FireRedASRLLMOptions

Options & Configuration · AiDotNet.SpeechRecognition.LLMIntegrated

Options for FireRedASR-LLM: the FireRedASR-AED encoder, an adapter and the Qwen2-7B-Instruct decoder.

Inheritance: ModelOptions → FireRedASRLLMOptions

For Beginners

Defaults are the released FireRedASR-LLM-L: FireRedASR-AED-L’s Conformer encoder (16 blocks of width 1,280, 20 heads, kernel 33) over 80-band filterbanks, an adapter that splices two encoder frames into one, and Qwen2-7B-Instruct (28 layers of width 3,584, 28 query and 4 key-value heads, SwiGLU 18,944, a 152,064-row untied vocabulary) with LoRA of rank 64 on every projection.

Constructors

Constructor Summary
FireRedASRLLMOptions() Initializes a new instance with default values.
FireRedASRLLMOptions(FireRedASRLLMOptions other) Initializes a new instance by copying from another instance.

Properties

Property Summary
OnnxModelOptions OnnxOptions { get; set; } Gets or sets the ONNX Runtime settings used when the model is loaded from an ONNX file.
SpeechLlmTrainingScope TrainingScope { get; set; } The parameters training updates: every one by default; the paper’s recipe trains the encoder, the adapter and the LoRA adapters only.
double LlmRmsEpsilon { get; set; } Gets or sets the RMS-normalization stability constant for the language-model.
double LlmRopeTheta { get; set; } Gets or sets the rotary positional-embedding frequency base for the language-model.
double LoraAlpha { get; set; } Gets or sets the LoRA adapter scaling factor.
double LoraDropout { get; set; } Gets or sets the dropout probability of the LoRA adapter.
double RopeTheta { get; set; } The rotary base standing in for the encoder’s relative positional encoding, as in FireRedASR-AED.
int AdapterFrameSplicingFactor { get; set; } Encoder frames the adapter concatenates into one (2).
int ConvKernel { get; set; } The encoder’s depthwise convolution kernel (33).
int EncoderDim { get; set; } The FireRedASR-AED-L encoder’s width (1,280).
int EncoderFeedForwardDim { get; set; } The encoder’s feed-forward width (5,120, four times the width; must be a multiple of it).
int LlmDim { get; set; } Qwen2-7B’s width (3,584), which the adapter projects to.
int LlmFeedForwardDim { get; set; } Qwen2-7B’s SwiGLU width (18,944).
int LoraRank { get; set; } The LoRA rank on every attention and feed-forward projection (64, the release’s LoraConfig).
int MaxAudioLengthSeconds { get; set; } The longest recording transcribed (30 seconds).
int MaxTextLength { get; set; } The longest transcript generated, in tokens; the release also stops at the adapter’s output length.
int NumAttentionHeads { get; set; } The encoder’s attention heads (20).
int NumEncoderLayers { get; set; } The encoder’s Conformer blocks (16).
int NumLlmAttentionHeads { get; set; } Qwen2-7B’s query heads (28).
int NumLlmKvHeads { get; set; } Qwen2-7B’s key-value heads (4).
int NumLlmLayers { get; set; } Qwen2-7B’s layers (28).
int NumMels { get; set; } Filterbank bands (80).
int SampleRate { get; set; } Gets or sets the sample rate, in Hz, that input audio is expected at.
int VocabSize { get; set; } Qwen2-7B’s vocabulary rows (152,064).
string Instruction { get; set; } The instruction after the speech (“请转写音频为文字”, transcribe the audio as text).
string Language { get; set; } Gets or sets the language code used for speech processing.
string ModelPath { get; set; } Gets or sets the path to the model weights.
string[] Vocabulary { get; set; } Optional vocabulary mapping token ids to text when the vocabulary is not Qwen’s.