RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Eruo Fredoline
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
Glossary / Transformer & LLM components / YaRN (Yet another RoPE eNlargement)
Transformer & LLM components

YaRN (Yet another RoPE eNlargement)

YaRN is a context-extension method that modifies RoPE frequencies to let a model trained on, say, 8K context generalize to 32K or 128K with minimal fine-tuning. Used in Qwen 2.5, Mistral Nemo, and several Llama 3 long-context derivatives.

Compared to naive frequency scaling (linear or NTK-by-parts), YaRN preserves position discrimination at long range better, with measurable improvement on needle-in-haystack benchmarks past 32K.

Practical implication: when you see "extended to 128K with YaRN" on a model card, expect quality degradation past the original training context to be smaller than with vanilla RoPE scaling, but still real — long-context performance is rarely as good as short-context.

Practical example

A developer building a document-summarization pipeline picks Qwen 2.5 14B specifically because its model card advertises YaRN-extended context to 128K, needing to feed in 80-page PDFs converted to text. Running it in llama.cpp requires explicitly setting the YaRN scaling parameters (--rope-scaling yarn, plus the original and target context lengths) — forgetting this and just cranking --ctx-size to 128K without enabling YaRN produces degraded, sometimes incoherent output because the model was never trained to extrapolate RoPE frequencies that far without the scaling correction. Once configured correctly, retrieval accuracy on content near the end of a 100K-token document is noticeably better than naive linear RoPE scaling would give, though the developer still tests with needle-in-haystack-style probes rather than trusting the 128K claim blindly, since quality past the original 8K-32K training window is never quite as sharp as native short-context performance.

Related terms

Context WindowALiBi (Attention with Linear Biases)Rotary Position Embedding (RoPE)

Reviewed by Eruo Fredoline. See our editorial policy.

Buyer guides
  • Best GPU for local AI →
  • Best laptop for local AI →
  • Best Mac for local AI →
When it doesn't work
  • CUDA out of memory →
  • Ollama running slowly →
  • ROCm not detected →