Peng, Quesnelle, Fan and Shippole (2023), "YaRN: Efficient Context Window Extension of Large Language Models", arXiv:2309.00071 (ICLR 2024). Eq 17 rotation counts r(d) = L theta_d / (2 pi); Eq 18 ramp gamma; Eq 20 blend h(theta_d) = (1 - gamma) theta_d / s + gamma theta_d; Eq 22 temperature sqrt(1/t) = 0.1 ln(s) + 1.
Arguments
- base
RoPE base b (scalar > 1), or the d/2 frequencies directly (vector).
- s
Context extension scale factor (> 0).
- d
Head embedding width, positive even integer.
- L
Original context length (> 0).
- beta_fast, beta_slow
Rotation-count bounds (paper Eq 18 with alpha = beta_slow, beta = beta_fast; defaults 32 and 1).
Value
List with theta, theta_new, rotations,
gamma, temperature, logit_scale,
scale, estimate, n, method.
