rl-finetune-speech-llm
Skill19k starsChanged 3 days agoApache-2.0View on GitHub
Adapt Nemotron Transcribe to customer audio with NeMo-RL GSPO. Use for reward-based speech fine-tuning, assessing rollout signal, selecting informative training recordings, choosing a bounded training run, or diagnosing RL that improves reward but not task quality. Covers train/dev/test inputs and prompts, transcript and task-specific rewards, stochastic mining, the native SpeechLM update surface, training, HF export, and matched evaluation. Use finetune-speech-llm for supervised fine-tuning instead.
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 11 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Use its full Hugging Face snapshot, including the tokenizer, speech encoder, projection and auxiliary heads.
- Distinctive: line 45
Ask for a retention dataset when preserving another capability matters.
- Very specific: line 49
Keep plan.md, progress.md and a compact experiment ledger in the customer work directory.
- Distinctive: line 56
If no prompt is established, compare a few plausible prompts on development data.
- Distinctive: line 70
Read Data and signal. Reuse compatible cached rollouts first.
- Distinctive: line 91
Keep development and evaluation examples out of that mix.
- Distinctive: line 95
If meaningful contrasts are scarce, inspect reward correctness, references and prompts, then sample a different training stratum.
- Distinctive: line 101
Read Tasks and presets. Start from the public native SpeechLM GSPO config and change data, task reward, prompt, LR/step budget and …
- Very specific: line 105
Default starting LR: 1e-6, five-update warmup, then constant.
- Distinctive: line 123
Follow Execution. Record the fully resolved config.
- Distinctive: line 126
Use the first updates to inspect the actual run while training proceeds:
- Distinctive: line 138
Do not substitute a different estimator, reward clipping or KL penalty while debugging data selection.
- Distinctive: line 140
If refills dominate, inspect which strata still have contrast and refresh the training-only selection.
- Distinctive: line 143
Do not silently extend the budget or change the metric to make a run look successful.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Reinforcement learning for Nemotron Transcribe
Turn the model's better sampled answers into a better model. Start with a small sample of customer audio, measure whether useful alternatives exist, then train on recordings that expose those alternatives. Success is a better held-out task score with acceptable retention—not a higher training reward.
The default seed is nvidia/Nemotron-3.5-Transcribe-30B-A4B.
Use its full Hugging Face snapshot, including the tokenizer, speech encoder, projection and auxiliary heads.
This skill uses NeMo-Speech, NeMo-RL and NeMo-Automodel.
References
Paths beginning with examples/ are relative to the Speech checkout. $RL means the separate NeMo-RL checkout.
| When | Read |
| Preparing rows, prompts and rollout selection | Data and signal |
| Choosing a reward or a small-task preset | Tasks and presets |
| Installing, launching, exporting and evaluating | Execution |
| Running a small Mandarin–English experiment | ASCEND end-to-end example |
| Understanding the underlying GSPO recipe | NeMo-RL SpeechLM guide |
| Reusing dataset preparation and task scoring | examples/speechlm2/finetuning/README.md, task_metrics.py in that directory |
| Choosing SFT when RL has no useful signal | ../finetune-speech-llm/SKILL.md |
1. Define the experiment
Collect what is missing; use information the customer already supplied. Write a short run plan and continue within the agreed compute budget. Do not require a separate approval round for every stage.
| Input | Record |
| Seed | HF repository, immutable revision and downloaded snapshot |
| Training data | Labeled audio, source/version, usable split and any language/domain balance |
| Development data | Data for prompt, hyperparameter and checkpoint decisions |
| Evaluation data | Held-out final measurement; never used for mining or checkpoint selection |
| Task and prompts | Desired output, user instruction(s), reference conventions and language information allowed at inference |
| Objective | Primary metric, target improvement, protected tasks/classes and acceptable degradation |
| Resources | GPU type/count, time/step limit, storage, scheduler and existing compatible image/environment |
Ask for a retention dataset when preserving another capability matters. If none is available, state that retention will remain unmeasured. If splits are missing, create them from training material before sampling; separate speakers or recordings where possible. Check audio identity and overlapping recording segments across splits, not just filenames.
Keep plan.md, progress.md and a compact experiment ledger in the customer work directory. Record source commits,
resolved configs, data membership, prompt text, metric code and output paths. Record failures as well as successes.
2. Establish a useful baseline
- Compare a few references with greedy seed outputs. Resolve wrong language, script, label vocabulary, number style or prompt/reference mismatch before interpreting the error rate.
- If no prompt is established, compare a few plausible prompts on development data. Keep the system message empty and put the user instruction before audio, as required by the native ASR processor. For a focused task, prefer one prompt; use prompt variation when robustness to several deployment instructions is itself a goal.
- Freeze the chosen prompt, scoring/normalization, decoding settings and selection criterion. Measure the seed on development and retention data. A seed test decode may be cached, but do not inspect it to tune the experiment.
- For label tasks, also establish a development-fitted no-training comparator when aliases, label priors or output parsing explain many errors. Apply the same allowed post-processing to compared models. Report strict and parsed results separately. An RL gain over a poorly prompted seed is not necessarily a gain over this comparator.
Report error-rate reduction as (seed_error - candidate_error) / seed_error; it is not a relative increase in
accuracy. For nearly perfect baselines, report error counts and uncertainty rather than an unstable percentage.
3. Find useful training signal
Read Data and signal. Reuse compatible cached rollouts first. Otherwise sample a small, shuffled, stratified subset of the training split and decode a greedy answer plus eight stochastic answers per recording. Use the intended training prompt and reward, temperature 0.8, and sufficient output/context limits.
Summarize by task/language/domain:
- valid completed responses, truncation/failure rate and cost;
- groups with different rewards, their spread, and groups containing an answer better than greedy;
- all-correct, all-wrong and mixed groups for binary tasks;
- representative actual errors: substitutions, omissions, repetitions, empty outputs, label confusions or code switches.
Extend uncertain, useful strata to 16 samples; use 32–64 only when the expected extra yield justifies it. Eight mining samples and 64 online training samples serve different purposes. An all-equal eight-sample group is weak evidence, not proof that all future responses will be identical.
Select useful contrast without demanding a perfect answer or a catastrophic alternative. Keep source/language and protected-task coverage; avoid filling the dataset solely with the largest reward gaps. Small differences created only by normalization quirks are not useful task signal. The oracle best-of-samples score is an opportunity estimate, not an expected trained-model score.
To improve task/domain X while preserving Y, include representative training data from both in the RL mix. Keep development and evaluation examples out of that mix. Mine useful reward variation in each domain and track their actual retained groups; merely evaluating Y, or adding Y examples whose rewards are all equal, supplies no retention learning signal. Adjust the mixture using development results for both X and Y.
If meaningful contrasts are scarce, inspect reward correctness, references and prompts, then sample a different training stratum. If the model still cannot produce useful answers, explain the evidence and recommend SFT or new data. Do not spend a long RL run trying to manufacture a capability absent from its samples.
4. Choose the smallest informative run
Read Tasks and presets. Start from the public native SpeechLM GSPO config and change data, task reward, prompt, LR/step budget and evaluation cadence deliberately. Preserve the tested optimizer, update surface, precision, synchronous rollout/refit, dropout behavior and exporter for the first comparison.
- Default starting LR:
1e-6, five-update warmup, then constant. Small tasks: 20 updates first; at most 100 in the initial comparison. Export/evaluate every 10–20 updates. These are starting settings, not a promised improvement. - Preserve 64 online responses per recording and 20 retained groups per update initially. The recipe offers 40 groups, then takes the first 20 with nonconstant rewards; it does not rank and take the “20 best” groups.
- At 20 retained groups, 100 updates mean 2,000 group presentations and 128,000 response presentations, with possible repeated audio. Decoding discarded/refill groups costs extra. A selected 500–1,000-recording pool can be sufficient for a small study; count actual distinct contributors rather than demanding a large dataset up front.
- Preserve the recipe's explicit 269 trainable tensors / 1,074,318,400 scalars for this model. CTC, MTP, routers, experts and the output head remain frozen. Keep trainable storage FP32; serving storage is a separate contract.
- Four eight-GPU nodes are the reference training layout. More nodes do not automatically change batch size. Changing the 20×64 batch is a separate experiment that also changes sample exposure and may require an LR comparison.
Size context/output limits from the actual audio and task. A short label may need only 16 output tokens; a transcript may need thousands. Never copy a classification cap into ASR or treat a tokenizer-only prompt length as audio-expanded context length. Keep the data loader's epoch allowance large enough to reach the step budget, and stop on the step limit.
5. Train and use early results
Follow Execution. Record the fully resolved config; the YAML inherits defaults. Start the bounded run in a fresh output directory. A restart from that directory is a resume, not a new seed comparison.
Use the first updates to inspect the actual run while training proceeds:
- Correct seed and update surface loaded; CTC is frozen; rewards, log probabilities, advantages and loss are finite.
- Correct audio/prompt grouping, nonzero loss masks and aligned retained rewards. Use
filtered_rewardswhere available: raw offered-batchrewardsmay not align with retained row IDs. - Retained groups and distinct contributing recordings by task/class, cumulative repeats, refill cost and throughput. Homogeneous “retention anchors” receive zero advantage; their presence in the manifest does not protect a capability.
- Checkpoint exports decode with the same prompt, scorer and serving settings as the seed. Retention/class recall can deteriorate while aggregate reward improves.
For retained group size G, the tested estimator subtracts the other G−1 rewards' mean, then divides by the full group's sample standard deviation plus epsilon. Sequence-level clipped importance ratios weight these advantages. Do not substitute a different estimator, reward clipping or KL penalty while debugging data selection.
If refills dominate, inspect which strata still have contrast and refresh the training-only selection. If reward improves but dev quality does not, inspect paired outputs and the scoring contract before adding steps. If protected classes or retention exceed the agreed tolerance, keep the earlier acceptable checkpoint and diagnose the change. Do not silently extend the budget or change the metric to make a run look successful.
6. Select, evaluate and hand over
Choose the checkpoint on the predeclared development metric subject to retention/class constraints; include the seed as a valid outcome. Export that checkpoint canonically, then evaluate it and the seed on the untouched evaluation split under the same conditions. If the evaluation set has already influenced development, label it a reused benchmark.
Report overall and relevant slice metrics, error counts and paired changes. ASR needs insertion/deletion/substitution, empty-output and repetition diagnostics; code switching needs monolingual and mixed slices; classification needs macro recall, per-class recall, confusion and invalid-output rates. Use paired uncertainty estimates when the gain is small. Frozen CTC weights do not establish timestamp retention when the speech encoder was updated.
Deliver a short result table plus exact commands, resolved config, selected data/rollout provenance, native checkpoint and HF export paths, prompt/metric definitions, compute consumed, and the next justified action. Clearly distinguish measured gains, unsuccessful trials and settings that have not been tested on the customer's stack.
Trending
Quiet since August.thin dataabout the whole repository
Who's talking about NVIDIA-NeMo/NeMo
- NVIDIA-NeMo/Speech“Potential Issue with Qwen2VisionModel RoPE”GitHub · Aug 29, 2025 · 6 reactions
- NVIDIA-NeMo/Megatron-Bridge“Support Megatron-Energon Integration”GitHub · Dec 2, 2025 · 5 reactions
- CaffeeLake/sagemaker-hyperpod-training-adapter-for-nemo“Bump the pip group across 1 directory with 3 updates”GitHub · Jun 24, 2026 · 2 reactions
- CaffeeLake/TensorRT-LLM“Bump the pip group across 9 directories with 5 updates”GitHub · Jun 24, 2026 · 2 reactions
- CaffeeLake/MagicPIG“Bump the pip group across 2 directories with 4 updates”GitHub · Jun 24, 2026 · 2 reactions
The biggest 5 of 9 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 9
Talked about on GitHub (9 times).
On GitHub · 9
- Aug 29, 2025Potential Issue with Qwen2VisionModel RoPE — NVIDIA-NeMo/Speech6 reactions · 16 comments
- Dec 2, 2025Support Megatron-Energon Integration — NVIDIA-NeMo/Megatron-Bridge5 reactions · 1 comment
- Jun 24, 2026Bump the pip group across 1 directory with 3 updates — CaffeeLake/sagemaker-hyperpod-training-adapter-for-nemo2 reactions
- Jun 24, 2026Bump the pip group across 9 directories with 5 updates — CaffeeLake/TensorRT-LLM2 reactions · 1 comment
- Jun 24, 2026Bump the pip group across 2 directories with 4 updates — CaffeeLake/MagicPIG2 reactions
4 more on GitHub
- Nov 22, 2025add diar_streaming_sortformer_4spk-v2 onnx — altunenes/parakeet-rs2 reactions
- Nov 17, 2025add streaming version for sortformer — altunenes/parakeet-rs2 reactions · 1 comment
- Oct 21, 2025Trainable Tokens Support — NVIDIA-NeMo/Megatron-Bridge2 reactions
- Aug 21, 2026build(deps): bump nemo-toolkit from 2.6.2 to 2.7.3 in /atlas_edge in the python-security-and-patches group across 1 directory — canfieldjuan/ATLAS1 reaction · 1 comment
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- debug-training-logsSkill
- finetune-speech-llmSkill
- fix-issueSkill
- migrate-to-resumable-dataloaderSkill
- nemo-speech-asr-finetuneSkill
- nemo-speech-pr-reviewSkill
- quantize-speech-llmSkill
- train-dflashSkill
- train-speech-llmSkill
- verifySkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

