RopeFreqBase

RopeFreqBase is the base frequency (often denoted θ, theta) used in RoPE’s positional encoding. Overriding it changes how position indices map to rotation angles. Most users leave this at the model default.

Quick reference

Type float?
Default null (use model metadata; equivalent to the value from the GGUF file)
Range Typical 10000.010000000.0
Category Position encoding
Field on ContextParameters.RopeFreqBase

What it does

In RoPE, each attention head’s frequency vector is built from freq_base^(-k/d) for k across dimensions. The default freq_base = 10000.0 works for contexts in the tens of thousands of tokens. Very long contexts sometimes use much larger bases — for example, RopeFreqBase = 1_000_000 for 128K-trained models.

  • null (default) — use the model’s trained value from GGUF metadata.
  • A positive float — override. Use only when you know the correct value for your target context.

Built-in presets leave this as null — the metadata is usually correct.

When to change it

Scenario Value
Default (recommended) null
Running a model in a non-standard context regime Set per upstream model card
Extending a short-context model with hand-tuned RoPE Non-trivial — refer to papers

Changing RopeFreqBase without understanding the effect usually degrades quality. Prefer RopeScalingType approaches for context extension.

Example

var preset = new Qwen25Preset();
preset.ContextParameters.RopeFreqBase = 1_000_000f;  // only if the model documents this

Interactions

What’s next