Adapting Nemotron to a New Language#
This page maps the Nemotron step categories onto a single workflow: adapting an English-centric Nemotron base model to a target language, region, or domain, from tokenizer through evaluation. Each stage is documented in its own section; this page explains how the stages connect and which artifact each one hands to the next.
Workflow at a Glance#
flowchart LR
tok["tokenizer_extension/*<br/>checkpoint_hf"] --> cpt
cur["curate/nemo_curator<br/>filtered_jsonl"] --> prep["data_prep/pretrain_prep<br/>binidx"]
prep --> cpt["pretrain/megatron_bridge<br/>checkpoint_megatron"]
cpt --> sft_mb["sft/megatron_bridge<br/>checkpoint_megatron"]
sdg["sdg/persona_mcq<br/>training_jsonl"] --> pack["data_prep/sft_packing<br/>packed_parquet"]
pack --> sft_mb
sdg --> sft_auto["sft/automodel<br/>checkpoint_hf"]
sft_auto --> convert["convert/hf_to_megatron<br/>checkpoint_megatron"]
sft_mb --> ev["eval/model_eval<br/>eval_results"]
convert --> ev
Steps communicate through typed artifacts declared in each step.toml; the label under each node is the artifact the step produces.
A stage can be skipped when its input already exists: for example, start at pretrain/megatron_bridge when the base tokenizer already covers the target script, or start at sft/* when a continued-pretraining checkpoint is already available.
Stages#
Stage |
Step category |
Consumes |
Produces |
Documentation |
|---|---|---|---|---|
Extend the tokenizer |
|
Base tokenizer and Hugging Face checkpoint, target-language corpus |
Extended tokenizer, resized Hugging Face checkpoint, fertility and bits-per-byte reports |
|
Curate the corpus |
|
JSONL text or a Hugging Face dataset snapshot |
|
|
Prepare pretraining data |
|
|
|
|
Continue pretraining |
|
|
|
|
Generate SFT data |
|
Persona locales and teacher-model endpoints |
|
Generate Persona-Grounded MCQ Data for SFT, About Synthetic Data Generation |
Pack SFT data |
|
|
|
|
Fine-tune with Megatron Bridge |
|
|
|
|
Fine-tune with AutoModel |
|
|
|
|
Convert an AutoModel checkpoint |
|
|
|
|
Build benchmarks |
|
Source corpus or an existing benchmark |
|
|
Translate a corpus |
|
|
|
|
Evaluate |
|
|
|
How the Stages Connect#
Tokenizer extension precedes continued pretraining.
tokenizer_extension/extend adds target-script subwords to the base tokenizer and init_embeddings writes a resized Hugging Face checkpoint whose new embedding rows are initialized from existing subwords.
pretrain/megatron_bridge loads that checkpoint through hf_model_path and trains the new rows on the curated corpus.
tokenizer_extension/evaluate reports fertility (tokens per word) before any GPU is used, and eval_init reports bits per byte on the resized checkpoint, which is the metric that remains comparable across vocabularies.
Curation and data preparation feed continued pretraining.
curate/nemo_curator applies language identification, word-count, and domain filters to JSONL shards and writes filtered_jsonl.
data_prep/pretrain_prep tokenizes that output into Megatron binidx files with the extended tokenizer, so the pretraining corpus is tokenized with the same vocabulary the model will train on.
Synthetic data supplies the target-language SFT set.
sdg/persona_mcq authors multiple-choice questions grounded in regional personas, deduplicates them lexically and semantically, and keeps only questions on which a panel of three or more teacher models agrees.
Agreement is a consistency filter, not factual verification; validate a sample before training.
The step writes one aligned train.jsonl and blend.json per teacher, which sft/automodel reads directly and data_prep/sft_packing packs for sft/megatron_bridge.
sft/megatron_bridge produces checkpoint_megatron directly; convert the checkpoint_hf produced by sft/automodel with convert/hf_to_megatron before checkpoint-based evaluation.
Benchmarks are built independently of training.
byob/mcq generates multiple-choice benchmarks from a source corpus and can translate existing benchmarks; translate/nemo_curator translates JSONL or Parquet corpora with NeMo Curator backends.
Keep benchmark sources disjoint from the SFT data so that benchmark results measure generalization rather than memorization.
Choosing an Entry Point#
Situation |
Start at |
|---|---|
The base tokenizer produces high fertility on the target language |
|
The tokenizer is adequate but the model lacks target-language knowledge |
About Data Curation, then Model Training with Nemotron Steps |
A continued-pretraining checkpoint exists and needs instruction data |
|
A target-language benchmark needs to be generated |
|
A fine-tuned model needs target-language evaluation |
Limitations#
The workflow is assembled from independently documented steps; there is no single command that runs all stages.
sdg/persona_mcqdepends on managed Data Designer persona locales; languages without a managed locale reuse a related locale, as the shipped Malayalam configuration reusesen_IN.Cluster environment profiles (
env.toml) are per step; refer to each section’s cluster guide for the profile names.