YarnExtFactor

YarnExtFactor is the YaRN extrapolation mix factor. It blends between base RoPE and NTK-aware scaling in the YaRN algorithm. Relevant only when RopeScalingType is Yarn.

Quick reference

Type float?
Default null (negative / model default)
Range 0.01.0; negative means “from model”
Category YaRN position encoding
Field on ContextParameters.YarnExtFactor

What it does

YaRN combines position interpolation and extrapolation. YarnExtFactor controls the mix between the two. The model’s GGUF metadata usually sets this correctly for the intended scaling factor; overriding is rarely useful.

  • null or negative — use the model’s value.
  • 0.0 — pure interpolation.
  • 1.0 — pure extrapolation.
  • Intermediate — blend.

When to change it

Scenario Value
Default (recommended) null
Experimental YaRN tuning Per upstream YaRN paper recipe

Example

var preset = new Llama32Preset();
preset.ContextParameters.RopeScalingType = RopeScalingType.Yarn;
// preset.ContextParameters.YarnExtFactor = null; // default — use model's value

Interactions

What’s next