ASR fine-tuning (v0.71.32)
soup train with task: asr fine-tunes OpenAI Whisper speech-recognition models on your own audio, locally. Data is plain JSONL rows of {"audio": "clip.wav", "text": "the transcript"}: clips decode to 16 kHz mono log-mel input features, transcripts become the decoder labels, and the trainer wraps Hugging Face Seq2SeqTrainer + WhisperProcessor. whisper-tiny (39M) and whisper-base (74M) train on a 4 GB GPU.
Config
base: openai/whisper-tiny
task: asr
data:
train: ./data/train.jsonl
format: asr # rows: {"audio": "clip.wav", "text": "hello world"}
audio_dir: ./data/audio # audio paths resolve here (containment-checked)
training:
epochs: 3
lr: 1e-4
batch_size: 2
asr_language: en # optional; pins + persists the decoder prefix
asr_task: transcribe # transcribe | translate
asr_lora: true # LoRA on q/v projections; default is full fine-tune
lora: { r: 16, alpha: 32, target_modules: [q_proj, v_proj] }
output: ./outpip install "soup-cli[train,audio]"
soup recipes use whisper-tiny-asr # or whisper-base-asr / whisper-large-v3-asr
soup trainConfig fields
| Field | Default | Meaning |
|---|---|---|
asr_language | (none) | Decoder language prefix (e.g. en). Persists to an asr_generation.json sidecar next to the weights, so inference restores it automatically. |
asr_task | transcribe | transcribe or translate. Also persisted to the sidecar. |
asr_lora | false | true trains LoRA on the q/v projections instead of full fine-tuning. |
The cross-validator requires backend: transformers (so mlx / unsloth are rejected) and footgun-rejects asr_* fields when the task is not asr; a separate trainer-side gate rejects a non-Whisper base before any weight download.
Master weights are fp32 for a full fine-tune (v0.78.0)
A default task: asr run (no asr_lora: true) now holds fp32 weights, gradients and optimizer state, as every other full fine-tune does (#2941, #2949). On v0.77.2, the version checked, the trainer loaded the base with no dtype, so transformers 5 kept the checkpoint's own, which is fp16 for whisper-large-v3 and whisper-large-v3-turbo; AdamW then stepped 16-bit weights with 16-bit state. Upstream says that at the default learning rate every norm and most other weights stayed where they started: after 8 steps on one RTX PRO 5000 Blackwell, 100% of the norms and 69.7% of the attention and MLP weights were bit-identical (one run, one card; upstream's figures, and upstream does not say the smaller Whisper checkpoints were or were not affected). The consequence is twice the memory over a 16-bit checkpoint: the pre-flight already budgeted asr without asr_lora as a full fine-tune, but a run that fit the card on v0.77.x can now run out of memory, it saves an fp32 model and it trains to different losses. For the old footprint, train an adapter with asr_lora: true, or lower training.batch_size.
Warning:Re-run this. A
task: asrfull fine-tune over a 16-bit checkpoint that finished on v0.77.2, the version checked (#2941, #2949); the code of earlier releases was not read. The scope is full fine-tunes only:asr_lora: trueruns were not part of this, although on a CUDA card without bf16 hardware their frozen base now loads in fp16, where v0.77.2 loaded the checkpoint's own dtype. The three bundled recipes all setasr_lora: true. See the runs to repeat.
Keys this trainer does not read (v0.76.0, v0.77.0)
task: asr loads Whisper and trains it as a full fine-tune, or as LoRA on q/v with asr_lora: true. Since v0.76.0 the config loader says so for the settings it never applies, instead of accepting them:
training.quantization. The trainer never quantises the base. An unset value now resolves tonone. An explicit4bit,8bitorload_in_8bit: trueis refused at load since v0.77.0, naming the task (training.quantization: 8bit has no effect on task='asr': its trainer never quantises the base, so no run can honour it. Delete the line or set quantization: none. Refused as of Soup v0.77.); v0.76 loaded it with a warning and treated it asnone. A Quant Menu value (gptq,awq,hqq:*, ...) or a 4-bit-only setting such asbnb_4bit_quant_storageis refused at load (#795). The VRAM pre-flight budgetsasrwithoutasr_loraas a full fine-tune.training.moe_lorais refused, because Whisper has no expert layers (training.moe_lora is not applied by task='asr': that trainer loads Whisper, which has no expert layers. Remove moe_lora (or set it to false).) (#1151).data.chat_template,training.freeze_layersandfreeze_ratio,data.add_new_tokensandnew_special_tokens, andtraining.loraplus_lr_ratiowithoutasr_lora: trueandlora.r > 0are refused at load, each naming the task.backend: unslothis refused with the other backends:task='asr' requires backend='transformers'.
training.gradient_checkpointing is honoured since v0.77.0 (#797, #2140). The ASR trainer now passes it to its Hugging Face training arguments; through v0.76.1 it ignored the key and always trained with checkpointing off. The default false is unchanged, so only a config that sets true behaves differently, and any enabled tier is full checkpointing on this task.
soup doctor --config <file> runs these checks without loading a model. soup recipes verify --config <file> (which needs the training stack, the [train] extra) reports task: asr without asr_lora as having no adapter, since that trainer full-fine-tunes.
Audio paths in the rows resolve against data.audio_dir when it is set, and otherwise against the directory of the local data file the row came from. Since v0.76.0 this holds on every load path. A remote URI or a Hugging Face Hub dataset has no data-file directory, so it needs data.audio_dir; without it the load stops and names the setting. Local files in a streaming data.interleave resolve against their own folders. Rows whose file lies outside the directory are skipped with the usual "rows skipped" warning, and a value naming a network share, a device or an extended-length path is skipped without being looked up (#1599). Through v0.75.2 those paths kept the value as written, so a relative path was opened against the working directory and data.audio_dir had no effect. Before an audio file is read, the ASR and TTS loaders check that it is a regular file and stop with an error on a directory, FIFO or device, as they do for a symlink; the check runs before the file is opened, so a file swapped in between the check and the read is not caught.
Inference + WER/CER
soup infer --task asr --model ./out --input eval.jsonl --output preds.jsonl \
--audio-dir ./data/audio [--asr-language en] [--asr-task transcribe]--model loads a full Whisper model or a PEFT/LoRA adapter dir. Input rows are {"audio": path} with an optional "text" reference; when references are present, each output row carries transcription, wer and cer, plus a corpus WER summary (sum of edits over sum of reference words, not a mean of per-row rates). The metrics are pure-Python word- and char-level Levenshtein with no new dependency, and word accuracy (1 - WER) plugs into soup ship as a higher-is-better task metric, so the SHIP / DON'T-SHIP verdict works for speech models too.
WER/CER use a light normalizer (casefold, strip surrounding punctuation, collapse whitespace), deliberately not the full Whisper normalizer: good for before/after deltas, not leaderboard-comparable absolutes.
Recipes
| Recipe | Base | Size | Status |
|---|---|---|---|
whisper-tiny-asr | openai/whisper-tiny | 39M | Live, validated on a 4 GB RTX 3050 |
whisper-base-asr | openai/whisper-base | 74M | Live, fits a 4 GB GPU |
whisper-large-v3-asr | openai/whisper-large-v3 | 1.5B | Parse-tested; needs a 16 GB+ GPU (an adapter run, as the recipe sets asr_lora: true; a full fine-tune of this checkpoint holds fp32 state since v0.78.0, and no memory figure was measured for it) |
A smolvlm-256m-sft tiny-VLM recipe ships alongside (parse-tested, target_modules pinned to q/v). v0.72.0 fixed the setup and tokenization half of issue #302 (the vision processor now mirrors pad_token from its nested tokenizer), but a full training step still needed Idefics3-aware collation, so that recipe stayed parse-only until v0.74.0, which keeps messages and images together until collation, converts legacy <image> markers to structured multimodal content, and lets the processor produce image-token expansion and architecture-specific pixel tensors.
Honesty
Proof-of-mechanism only. The live validation is a memorization run on a single RTX 3050: WER 1.000 to 0.000 and loss 7.2 to 0.0005 at 0.4 of 4 GB VRAM. That proves the loop trains end to end; real accent or domain gains need real audio. The release also fixed the hardware-fit gate mis-sizing Whisper checkpoints as 7B models, which would have wrongly blocked ASR training on consumer GPUs.
Security
Audio decodes only through the hardened loader (a soundfile pre-probe before read, symlink rejection, O_NOFOLLOW, byte caps), never through datasets auto-decode. data.audio_dir is containment-checked (realpath + commonpath); UNC paths and traversal are rejected. A missing [audio] extra, a bad audio path, or a non-Whisper base all fail with a friendly error before a GPU hour.
See also
- Vision & Audio — the audio-understanding (Qwen2-Audio) and vision paths.
- Modality II — TTS, the audio-out counterpart to ASR's audio-in.
- soup ship — gate a speech model on word accuracy plus no forgetting.
- Recipes — all 181 ready-made configs.
Soup is free and Apache-2.0. If it saved you a training run, starring the repo costs nothing and helps most. You can also fund the GPU time behind the work a 4 GB laptop cannot reach.