Skip to content

Modality II (v0.52.0)

7 parts. New task families + BitNet + EBFT/GDPO + MoE quant. +237 tests (6968 → 7205).

Since v0.76.0: quantization: bitnet_1.58, ebft_variant and gdpo_variant are refused at config load, and data.format: audio is refused for the spark and oute families. tts_family: sesame_csm was refused through v0.76.x and trains through a native trainer since v0.77.0 (#1769). The sections below are kept as the record of what v0.52.0 shipped and now say what is true at v0.77.0.

TTS (task: tts)

Five tts_family values with per-family emotion vocabularies, all runnable at v0.77.0: orpheus and llasa on raw audio or pre-encoded data, spark and oute on pre-encoded data only (see below), and sesame_csm on raw audio through its own trainer (see Native Sesame CSM). Through v0.76.x sesame_csm was refused at config load.

yaml
task: tts
modality: audio_out
base: canopylabs/orpheus-3b-0.1-ft
data:
  format: audio
  train: ./data/tts.jsonl
training:
  tts_family: orpheus   # orpheus | llasa | spark | oute | sesame_csm (its own settings, below)
  tts_emotion: happy    # a single string, not a list

Cross-validator gates per family. canopylabs/orpheus requires tts_family: orpheus.

Only two families take an emotion tag, and each has its own list. Orpheus accepts neutral, happy, sad, angry, excited, calm, whisper and laugh; Oute accepts neutral, happy, sad, angry, calm and excited. Llasa, Spark and Sesame-CSM refuse tts_emotion outright (tts_family='llasa' does not support emotion conditioning), and a tag outside a family's list is refused when the config loads (laugh on oute, for instance). For the two families that take one, the trainer prepends a family-specific control string to the first user turn of every row: <|emotion|>happy<|/emotion|> for Orpheus and [emotion: happy] for Oute.

data.format: audio encodes raw audio at train time, and what it needs depends on the family.

  • Orpheus (pip install snac, 24 kHz) and Llasa (Soup's [audio] extra: torchaudio and soundfile; torchaudio must match the installed Torch; audio is resampled to 16 kHz and encoded with HKUSTAudio/xcodec2-hf, the ids rendered as <|s_ID|>) are live on this path.
  • Spark and Oute raw-audio configs are refused at config load, with the compatibility reason: Spark-TTS has no installable sparktts package and its official environment pins Torch and Transformers below Soup's stack, and the current outetts pins Transformers 4.52.3 (Oute also needs transcript or word alignment). Through v0.75.2 these were described as raising a runtime error naming a missing package.
  • sesame_csm takes raw audio only, through a native trainer rather than this codec-string path (since v0.77.0, see below). A pre-encoded chatml config is refused, because CSM trains text plus 32 Mimi codebooks as parallel frames, which is not a codec-token chat. Through v0.76.x it was refused whatever the data format. The sesame-csm-tts and spark-tts recipes removed in v0.76.0 have not come back.

The path that runs everywhere is the pre-encoded one: encode your audio to codec tokens yourself (in the upstream codec's own environment, for Spark and Oute), register them through data.new_special_tokens, and train with data.format: chatml (or auto) over the token text, as rows with a messages list. data.new_special_tokens is registered on backend: transformers only; backend: unsloth with it is refused at load (#1358). chat is not a value of data.format, even though Soup's own error message for a missing codec package says it is. Three TTS recipes ship: orpheus-tts-sft and llasa-tts (raw audio, data.format: audio) and oute-tts (pre-encoded, data.format: chatml).

Native Sesame CSM (v0.77.0)

tts_family: sesame_csm trains with Transformers' own CsmForConditionalGeneration and CsmProcessor (#1769, by @Amix29). Upstream describes the objective this way: the processor builds the text conditioning and the audio-frame labels, the model encodes each clip with its frozen Mimi codec, and the loss is the sum of the backbone's loss on the first codebook and the depth decoder's on the other 31. Install the audio extra beside training:

bash
pip install "soup-cli[train,audio]"

Each JSONL row is one local clip and its exact transcript, with role set to the speaker id, "0" or "1":

json
{"audio": "hello.wav", "messages": [{"role": "0", "content": "Hello, how are you?"}]}
yaml
base: sesame/csm-1b
backend: transformers
task: tts
modality: audio_out
data:
  train: ./data/speech.jsonl
  format: audio
  audio_dir: ./data/audio
  max_length: 2048
training:
  tts_family: sesame_csm
  quantization: none      # required: the schema default, 4bit, is refused
  epochs: 3
  batch_size: 1
  gradient_accumulation_steps: 4
  lr: 0.00002
  lora:
    r: 16
    alpha: 32

LoRA goes on the backbone and the depth decoder, never on Mimi; lora.r: 0 is full fine-tuning, with Mimi still frozen. What it refuses, at config load unless noted:

  • A data.format other than audio, a backend other than transformers, and any training.quantization but none. Leaving quantization out is refused too, because its default is 4bit: Sesame CSM requires training.quantization='none'.
  • Every training setting outside this list when it differs from its default: epochs, lr, batch_size, gradient_accumulation_steps, seed, data_seed, warmup_ratio, weight_decay, max_grad_norm, optimizer, scheduler, save_steps, logging_steps, eval_steps and a boolean gradient_checkpointing; under lora everything but r, alpha and dropout; under data everything but train, format, val_split, max_length and audio_dir. The message names the setting, for example Sesame CSM does not support training.packing. tts_emotion is one of them.
  • A row that is not one clip with exactly one transcript message, or whose role is not "0" or "1": checked after the data loads and before the model does, naming the split and the row. soup train --dry-run runs this check too.
  • More than one device, a distributed launch, DeepSpeed or FSDP, when the trainer is set up (on a multi-GPU box, select one card with CUDA_VISIBLE_DEVICES).
  • A sequence longer than data.max_length, when its batch is built: it is refused rather than truncated, because cutting the audio markers would break the codec alignment.

batch_size: auto uses 1. Validation loss, seeds, resume and saving the processor are supported. Audio is read through Soup's local-file checks and resampled to mono 24 kHz. sesame/csm-1b may need Hugging Face access; a local Transformers-format CSM checkpoint works too.

What was checked, and what was not. Upstream's offline tests build a tiny CSM model with all 32 Mimi codebooks and exercise forward and backward, training, evaluation, save and reload, and resume, and one LoRA step on a tiny random CSM model also ran on Apple Silicon (MPS). Upstream says that validates the integration and does not establish speech quality, and no full training run on the pretrained sesame/csm-1b checkpoint is recorded. No quality or speed figure is published here. Raw-audio Spark and Oute are unchanged: still pre-encoded only.

Distillation (task: distill)

yaml
task: distill
base: meta-llama/Llama-3.2-3B
training:
  teacher_model: meta-llama/Llama-3.1-70B-Instruct
  distill_divergence: kl         # kl | forward_kl | reverse_kl | js
  distill_temperature: 2.0       # [0.05, 100]

kl is an alias for forward_kl, which is also what an unset distill_divergence resolves to; an unset distill_temperature resolves to 2.0. Distillation runs on backend: transformers only (mlx and unsloth are refused at config load), and on modality: text only: since v0.77.0 vision and audio are refused at load, because the trainer loads a text-only student and teacher (#2014; through v0.76.1 they were accepted and ignored). It loads the student unquantized: an unset quantization resolves to none, and since v0.77.0 an explicit quantization: 4bit or 8bit (or load_in_8bit: true) stops the load with has no effect on task='distill' (see Keys a task ignores). training.gradient_checkpointing: true reaches the distill trainer since v0.77.0; it used to train with checkpointing off whatever the key said. Every train and validation row must keep at least one causal-loss target after truncation at data.max_length, or the run is refused at setup naming the split and row. distill_mode: sequence (the teacher generates a completion per prompt and the student trains with plain cross-entropy on it, instead of matching logits) cannot be combined with uld_strategy or minillm_enabled: the schema accepts the pair, and the distill trainer refuses it at setup, before any model loads. In sequence mode a row with no prompt turn is skipped, with the count and first positions printed.

Memory controls (v0.76.0)

Distillation with a large vocabulary and long sequences can run out of GPU memory on the logit and probability tensors the divergence builds. Two keys bound it:

yaml
task: distill
training:
  teacher_model: meta-llama/Llama-3.1-70B-Instruct
  distill_chunk_size: 256     # evaluate the divergence over chunks of response tokens
  distill_checkpoint: true    # recompute each chunk in backward instead of storing it

distill_chunk_size (an integer of at least 1) evaluates the divergence over chunks of response tokens, which bounds the transient peak. distill_checkpoint wraps each chunk in non-reentrant activation checkpointing, which cuts the bytes held for backward at the cost of recomputation. distill_checkpoint without distill_chunk_size treats all response tokens as one chunk: it reduces what is retained and leaves the transient peak unbounded. Both are refused outside task: distill, and with uld_strategy, minillm_enabled or distill_mode: sequence. One measurement exists since v0.78.0 (distill-chunked-h200-2026-11-10.md, issue #722, by @AubakirovArman): one H200 shared with another user's idle process, a Qwen2.5-0.5B student with a frozen Qwen2.5-1.5B teacher, batch 2 x 2,048 tokens, four interleaved matched pairs. A chunk size of 128 with distill_checkpoint: true lowered the allocated peak from 31.66 to 21.40 GiB (32.4% less) and made steps 32.8% longer by the ratio of medians (28.0 to 34.8% across the four pairs). The record calls it "a memory/time tradeoff, not a training speedup"; it is one model pair on a shared card, step time excludes data loading and setup, and it makes no quality claim.

Two numerics changes ride with it. The three divergences are now evaluated in FP32 and the loss scalar is FP32, so values differ slightly from the old low-precision numbers. Gradient accumulation weights by the number of shifted, non-masked targets across the whole optimizer window, so splitting the same rows into unequal-length microbatches keeps the full-batch token mean. Cross-tokenizer uld_strategy: wasserstein_aligned now leaves out a student token with no teacher counterpart (#1426); re-run a distillation whose tokenizers differ in byte-fallback or special tokens.

Classifier / Reranker / Cross-Encoder

yaml
task: classifier   # | reranker | cross_encoder
training:
  num_labels: 5
  label_names: ["very_bad", "bad", "neutral", "good", "very_good"]
  classifier_kind: single_label   # or multi_label (v0.52.0)
  classifier_lora: false          # true wraps the head with LoRA (v0.71.12)

Row shapes: classifier takes {"text": "...", "label": 1} or a label name, and for multi_label a list of active indices or names ({"text": "...", "label": [0, 2]}); reranker takes {"text": "query doc", "label": ...}; cross_encoder takes {"text_a": "query", "text_b": "doc", "label": 1} or {"question": "query", "answer": "doc", "label": 1} and, for task: cross_encoder, data.format: auto (the default) reads that pair shape; the explicit value data.format: cross_encoder (v0.76.0) is accepted only on that task and is refused on any other. These three tasks load the base unquantized, and since v0.77.0 an explicit quantization: 4bit or 8bit stops the load. training.gradient_checkpointing: true reaches them since v0.77.0 (their default stays off).

Master weights are fp32 for a full fine-tune (v0.78.0, #2941, #2949). A default classifier, reranker or cross_encoder run (no classifier_lora: true) loaded the base with no dtype, so transformers 5 kept the checkpoint's own, bf16 for most decoder bases. Upstream says AdamW then stepped 16-bit weights with 16-bit state, and 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). From v0.78.0 such a run over a 16-bit checkpoint holds fp32 weights, gradients and optimizer state, which is twice the memory (the pre-flight already budgeted it, but a run that fit the card on v0.77.x can now run out of memory), saves an fp32 model and trains to different losses. For the old footprint train an adapter with classifier_lora: true, or lower training.batch_size. With classifier_lora: true under bf16 or fp16 mixed precision the classification head the adapter trains is now upcast to fp32 too, and on a CUDA card without bf16 hardware the frozen base of a classifier_lora run loads in fp16, where v0.77.2 loaded the checkpoint's own dtype.

Warning:

Re-run this. A classifier, reranker or cross_encoder full fine-tune over a 16-bit checkpoint that finished on v0.77.2, the version checked. The scope is full fine-tunes only, not classifier_lora: true runs. See the runs to repeat.

query_id and ranking metrics for reranker and cross_encoder (v0.78.0, #2618, #2637, by @AlibekBerik). Add an optional "query_id" (a non-empty string of at most 512 characters, or an integer) to group the candidates of one query: {"query_id": "q17", "text": "query doc", "label": 1}. When the validation rows carry it, each evaluation also reports eval_mrr@10, eval_recall@1, eval_recall@5, eval_recall@10 and eval_ndcg@10, averaged over queries, beside eval_loss; they reach the Hugging Face log and trainer_state.json, and the run's recorded validation number stays val_loss. With num_labels: 2 candidates are ranked by logit[1] - logit[0], so label index 1 is the relevant class; with num_labels: 1 ranking needs classifier_kind: multi_label and uses the single logit; any other head prints one line saying why ranking is skipped. Ties break by row order, recall@k is the share of a query's relevant candidates in its top k, and nDCG uses binary gains. A query with no relevant candidate is left out and counted (eval_ranking_queries_no_positive); a query whose query_id also appears in the training rows is left out, counted (eval_ranking_queries_split) and named in one line at setup, because data.val_split cuts the file at a row index, so keep every row of a query on one side of the split; validation rows without a query_id are left out. Behaviour change: a query_id that is a boolean, a float, a list, an empty string or longer than 512 characters, or ids that mix integers and strings across the training and validation rows, loaded on v0.77.2 and is refused at load now, with the row that differs; give every query_id one type. Rows without query_id are unchanged.

Classification metrics (classifier, v0.78.0, #2638, #2789). With validation rows each evaluation reports eval_accuracy and eval_f1_macro for a single-label head, or eval_subset_accuracy (every label of a row correct), eval_f1_micro and eval_f1_macro for a multi-label head, beside eval_loss; the recorded validation number stays val_loss. A single-label prediction is the argmax of the logits (the first index on a tie); a multi-label label is predicted when its logit is above 0; a class with no true and no predicted row is left out of the macro average; num_labels: 1 with the default single-label kind accepts only label 0 and prints one line saying why the metrics are skipped. Upstream gives no metric values from a real run, and this page prints none; the trainer was not run for these paragraphs.

classifier_kind picks the head: single_label is the default for task: classifier, multi_label trains one independent decision per label rather than a choice between them. classifier_lora is opt-in: it wraps the sequence-classification head as a PEFT SEQ_CLS adapter instead of full fine-tuning, and the ordinary training.lora block still supplies r / alpha / dropout when you turn it on.

BitNet 1.58-bit (schema and export only)

training.quantization: bitnet_1.58 is refused at config load on every task and backend (v0.76.0): BitNet 1.58 training is not implemented yet; the export path soup export --format tq1_0 works on an existing BitNet checkpoint. Through v0.75.2 the schema accepted the value and the quantization loader then rejected it after the config had validated; the BitNetTrainerWrapper that was meant to take over had no caller in soup train. The falcon-e-bitnet-sft recipe set this key and was removed from the catalog in v0.76.0.

The export side is separate and is wired: soup export --format bitnet or tq1_0 runs llama.cpp's converter and then llama-quantize with the TQ1_0 type (it needs a built llama.cpp). is_bitnet_model is a name heuristic that matches a few prefixes (bitnet, falcon-e, falcone, 1bitllm, onebit), not a check of the weights.

EBFT + GDPO variants (refused since v0.76.0)

Both fields are refused at config load, in every value.

  • training.gdpo_variant (standard, length_normalized, margin) is refused (#1309): supported TRL versions (0.29 and later) no longer expose the DPO loss hook it depended on, so on those versions it was accepted and silently trained plain DPO. Remove it. Plain task: dpo is what standard ran; task: simpo is the nearest, not identical, length-normalised objective for length_normalized; margin has no equivalent.
  • training.ebft_variant (structured, strided) and training.ebft_temperature are refused (#1230): the term scored each position's logits against that position's own input token with no causal shift, so it rewarded copying the input; shifted onto the next token it duplicates the model's cross-entropy. ebft_temperature on its own is refused too.

No shipped recipe, template or example sets either field. The kernels this page described as live from v0.53.2 are not reachable from a config.

MoE expert quant

yaml
training:
  moe_lora: true                 # required: moe_expert_quant is refused without it
  moe_expert_quant: nf4          # nf4 | int8_rowwise
  train_router_only: true        # freeze experts, train router only

moe_expert_quant and train_router_only are read by task: sft and tts only and are refused at load on any other task. moe_expert_quant quantizes experts that are one nn.Linear each, and it needs CUDA and bitsandbytes. On a transformers 5 fused-expert MoE (Qwen3-30B-A3B is one) the experts are fused 3-D tensors with no nn.Linear to quantize, so the setup refuses with the architecture and the fused parameters named; through v0.75.2 it printed applied to 0 expert Linear block(s) and trained in full precision. moe_lora still adapts those experts, with lora.dropout: 0.0; see Backends.

Reasoning effort dispatch

yaml
training:
  reasoning_effort: medium       # low | medium | high  (gpt-oss family)
  train_on_eot: true             # also train on the end-of-turn token

Both keys are applied by the SFT formatter, so since v0.77.0 (#806, #1587) they load only on sft, tts (which trains through the SFT trainer) and distill: on any other task the config fails with training.reasoning_effort='high' requires task in ['distill', 'sft', 'tts']; got task='pretrain'. Through v0.76.1 they were refused on tts, where they apply, and accepted on pretrain, classifier, reranker and cross_encoder, which never read them; removing them from such a config changes nothing about what trains. On pretrain, train_on_eot changed only the soup data preprocess cache key, so a pretrain cache built with the flag has to be rebuilt without it. reasoning_effort prepends <|reasoning_effort|>medium<|/reasoning_effort|> to the first system message of every row, and inserts a system message at the top when the row has none. train_on_eot extends the assistant-only loss mask to include the end-of-turn token that follows each assistant reply, so the model is trained to emit the terminator; it acts through the assistant-only masking path, which is on by default (data.train_on_responses_only: true), and with that turned off it has nothing to extend.

Inside task: sft, only on the paths that read them (v0.77.2, #2278, by @abdulwaarith0). task: sft is several code paths, and these two keys are applied by the SFT formatter on the plain text path only. Through v0.77.1 the config loaded on the others and trained without them; since v0.77.2 reasoning_effort and train_on_eot are refused at load, with the field, the setting that selects the path and what to change, on modality: vision, modality: audio, backend: mlx and data.format: raft, and reasoning_effort alone on data.format: pre_tokenized (train_on_eot loads there, because the cache is keyed on it). On backend: unsloth both keys still load. Leave the key out. train_on_eot is a boolean, so train_on_eot: false also loads and null is refused; reasoning_effort loads when it is null, and false is refused (reasoning_effort must not be bool). stream_layers: true and the other tasks are unchanged. The message reads, for a vision run, training.reasoning_effort is not applied by task='sft' with modality='vision': the vision setup builds its own dataset and model, running neither the SFT formatter nor the resident kernel setup, so this run would ignore it. Use modality: text, or remove the key. soup train exits 1 and soup doctor --config exits 2. Nothing needs re-running: those runs finished without the setting, and removing the line changes nothing about what trained. The full table, with use_flash_attn and use_liger too, is on Settings Soup refuses at load.

v0.52.0 shipped the schema; v0.53.2 lit up the trainers — task: distill (DistillTrainerWrapper with KL/forward_kl/reverse_kl/js), task: classifier | reranker | cross_encoder (single-label / multi-label / cross-encoder heads), EBFT + GDPO loss kernels, and reasoning_effort dispatch. (Since closed in v0.76.0: the EBFT and GDPO fields are refused at config load, as above.) See v0.53.2 — Modality II live.

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.