RopeFreqScale
Contents
[
Hide
]
RopeFreqScale is a multiplicative scaling factor applied to RoPE frequencies. It implements simple linear scaling of positions — equivalent to Linear RopeScalingType at the value set here.
Quick reference
| Type | float? |
| Default | null (use model default) |
| Range | 0 – 1.0; < 1.0 stretches the context window |
| Category | Position encoding |
| Field on | ContextParameters.RopeFreqScale |
What it does
RoPE frequencies are scaled by RopeFreqScale. A scale of 1.0 is no scaling. Smaller values stretch the effective context:
RopeFreqScale = 1.0— no scaling.RopeFreqScale = 0.5— effective context doubled (2× training window). Moderate quality loss.RopeFreqScale = 0.25— 4× training window. More quality loss.
This is the simplest context-extension approach. More sophisticated algorithms (Yarn, LongRope) produce better quality at the same effective extension.
When to change it
| Scenario | Value |
|---|---|
| Default (use model metadata) | null |
| Simple 2× extension | 0.5 with RopeScalingType = Linear |
| Prefer better algorithms | Use RopeScalingType = Yarn instead |
Modern built-in presets target models that already ship with proper scaling metadata. Override only when adapting a model without adequate metadata.
Example
using Aspose.LLM.Abstractions.Models;
var preset = new Qwen25Preset();
preset.ContextParameters.RopeScalingType = RopeScalingType.Linear;
preset.ContextParameters.RopeFreqScale = 0.5f; // 2x linear extension
Interactions
RopeScalingType—Linearuses this scale;Yarn/LongRopehave their own knobs.RopeFreqBase— base frequency.ContextSize— the target extended context size.
What’s next
- RopeScalingType — algorithm selector.
- YarnOrigCtx — better long-context extension via YaRN.
- Long context tuning — practical recipes.