CSMOptions

Options & Configuration · AiDotNet.TextToSpeech.CodecBased

Options for CSM.

Inheritance: ModelOptions → TtsModelOptions → CSMOptions

For Beginners

These settings size CSM’s two Transformers and its audio codec, control how it samples each frame of sound, and set how it trains; the defaults reproduce the released 1B model.

How It Works

The defaults are CSM 1B (Sesame 2025, “Crossing the uncanny valley of conversational voice”; SesameAILabs/csm models.py, generator.py; sesame/csm-1b): a Llama 3.2 1B backbone (width 2048, 16 layers, 32 heads over 8 key-value heads, SwiGLU 8192) and a Llama 100M audio decoder (width 1024, 4 layers, 8 heads over 2, SwiGLU 8192), both with rotary θ 500000 and Llama 3 scaling ×32, over Llama 3’s 128,256 text tokens and Mimi’s 32 codebooks of 2048 codes (2051 per codebook in the model’s tables) at 12.5 Hz and 24 kHz.

Generation follows generator.py: top-k 50 at temperature 0.9 for every codebook, up to 90 seconds, a frame of zeros ending the speech, and the output watermarked with SilentCipher under the release’s public key at 36 dB. Training follows the blog where it is explicit — codebook 0 learned on every frame, the audio decoder on a random sixteenth of them — and Hugging Face’s CSM port, written with Sesame, otherwise: the backbone’s next-frame loss on codebook 0 plus the decoder’s loss on codebooks 1–31, under the Trainer’s default AdamW (no recipe was released).

Constructors

Constructor Summary
CSMOptions() Creates the CSM 1B configuration.
CSMOptions(CSMOptions other) Copies another instance.

Properties

Property Summary
bool ConstrainToCodebook { get; set; } Whether sampling is restricted to codes Mimi can decode (below MimiCodebookSize; false).
bool Watermark { get; set; } Whether synthesis watermarks its output with SilentCipher, as the release does (true).
double Beta1 { get; set; } AdamW’s β₁ (0.9, Hugging Face’s default).
double Beta2 { get; set; } AdamW’s β₂ (0.999, Hugging Face’s default).
double DecoderFrameFraction { get; set; } The share of a sample’s audio frames the audio decoder learns from (1/16, the blog’s compute amortization); codebook 0 learns from all of them.
double Epsilon { get; set; } AdamW’s ε (1e-8, Hugging Face’s default).
double MaxAudioLengthMs { get; set; } The longest speech generated, in milliseconds (90000: 1125 frames of 80 ms).
double MaxGradNorm { get; set; } The gradient-norm clip (1.0, Hugging Face’s default; 0 for none).
double RmsEpsilon { get; set; } RMSNorm epsilon (1e-5).
double RopeHighFrequencyFactor { get; set; } Llama 3 rotary scaling’s high-frequency factor (4).
double RopeLowFrequencyFactor { get; set; } Llama 3 rotary scaling’s low-frequency factor (1).
double RopeScalingFactor { get; set; } Llama 3 rotary scaling factor (32; 0 for none).
double RopeTheta { get; set; } Rotary base θ (500000).
double Temperature { get; set; } Sampling temperature (0.9).
double WatermarkSdr { get; set; } The watermark’s level below the audio in dB (36).
int AudioCodebooks { get; set; } Codebooks per frame (32).
int AudioVocabSize { get; set; } Entries per codebook in the model’s audio tables and heads (2051: Mimi’s 2048 and three more).
int BackboneHeads { get; set; } The backbone’s attention heads (32).
int BackboneIntermediate { get; set; } The backbone’s SwiGLU width (8192).
int BackboneKeyValueHeads { get; set; } The backbone’s key-value heads (8).
int BackboneLayers { get; set; } The backbone’s layers (16).
int DecoderHeads { get; set; } The audio decoder’s attention heads (8).
int DecoderHidden { get; set; } The audio decoder’s width (1024).
int DecoderIntermediate { get; set; } The audio decoder’s SwiGLU width (8192).
int DecoderKeyValueHeads { get; set; } The audio decoder’s key-value heads (2).
int DecoderLayers { get; set; } The audio decoder’s layers (4).
int MaxSequenceLength { get; set; } The backbone’s longest sequence of frames, context and generation together (2048).
int MimiCodebookDim { get; set; } Mimi’s quantizer width (256).
int MimiCodebookSize { get; set; } Entries in each of Mimi’s codebooks (2048).
int MimiContext { get; set; } Mimi’s attention window in 25 Hz frames (250).
int MimiDimension { get; set; } Mimi’s latent width (512).
int MimiFeedForward { get; set; } Mimi’s feed-forward width (2048).
int MimiFilters { get; set; } Mimi’s SEANet base width (64).
int MimiHeads { get; set; } Mimi’s attention heads (8).
int MimiTransformerLayers { get; set; } Mimi’s Transformer layers on each side (8).
int RopeOriginalMaxPositions { get; set; } Llama 3 rotary scaling’s original context (8192).
int SamplingSeed { get; set; } The seed of generation’s sampling, of the decoder’s training frames, and of the native model’s initialization when the architecture has no seed (0).
int TopK { get; set; } Top-k sampling’s k (50).
int TrainingSteps { get; set; } The total optimizer steps the linear decay to 0 spans (0: a constant learning rate).
int[] MimiRatios { get; set; } Mimi’s SEANet ratios (8, 6, 5, 4): 960 samples per 25 Hz frame, two of those per code frame.
int[] WatermarkKey { get; set; } The watermark’s five bytes (the release’s public key, [212, 211, 146, 56, 201], which marks audio as made by CSM 1B; the release asks other applications to use a private key of their own).
string WatermarkModelPath { get; set; } The SilentCipher model directory the watermark is read from (sony/silentcipher’s 44_1_khz/73999_iteration: enc_c.ckpt, dec_c.ckpt, dec_m_0.ckpt), loaded on first use.