# Retrofitting Unbounded Context onto Stock Language Models

DevFeed: [Retrofitting Unbounded Context onto Stock Language Models](<https://devfeed.tech/articles/retrofitting-unbounded-context-onto-stock-language-models-125136.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2611.10141>)

Author: Mark Oskin

Published: 2026-11-10T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Machine Learning](<https://devfeed.tech/sources/arxiv-machine-learning.md>)

Topics: [long-context](<https://devfeed.tech/topics/long-context.md>), [context window](<https://devfeed.tech/topics/context-window.md>), [llama](<https://devfeed.tech/topics/llama.md>), [llama.cpp](<https://devfeed.tech/topics/llama-cpp.md>), [AI Chat](<https://devfeed.tech/topics/ai-chat.md>)

Tags: [3](<https://devfeed.tech/tags/3.md>), [8k](<https://devfeed.tech/tags/8k.md>), [attention](<https://devfeed.tech/tags/attention.md>), [competition](<https://devfeed.tech/tags/competition.md>), [context](<https://devfeed.tech/tags/context.md>), [cs-cl](<https://devfeed.tech/tags/cs-cl.md>), [cs-lg](<https://devfeed.tech/tags/cs-lg.md>), [design](<https://devfeed.tech/tags/design.md>), [dimensions](<https://devfeed.tech/tags/dimensions.md>), [discrimination](<https://devfeed.tech/tags/discrimination.md>), [fast](<https://devfeed.tech/tags/fast.md>), [generation](<https://devfeed.tech/tags/generation.md>), [handle](<https://devfeed.tech/tags/handle.md>), [history](<https://devfeed.tech/tags/history.md>), [index](<https://devfeed.tech/tags/index.md>), [language-models](<https://devfeed.tech/tags/language-models.md>), [models](<https://devfeed.tech/tags/models.md>), [order](<https://devfeed.tech/tags/order.md>), [paper](<https://devfeed.tech/tags/paper.md>), [planes](<https://devfeed.tech/tags/planes.md>), [position](<https://devfeed.tech/tags/position.md>), [stock](<https://devfeed.tech/tags/stock.md>)

## AI overview

The paper describes a way to extend context on unmodified Mistral-7B and Llama-3.1-8B weights by keeping an 8K-token near window and selectively installing distant key-value units into trained-range slots. A word index locates units named by rare words in the request; generated rare words can trigger an exact re-encode during generation. The method relies on distant attention behaving more like a bag of words than an ordered sequence, and the abstract reports that retrieval through descriptions fails at distance in every model measured, including a 70B model. In reported tests, it retrieves single needles at 99-100/100 and achieves 88-100/100 on three-key discrimination from 32K to one million tokens. RULER results vary by model: 70.8 versus 69.9 for dense attention on Llama-3.1-8B at 128K, and 67.8 versus 75.5 on Mistral-7B at 32K. At 128K, reported prefill speed is 1.85x and decode speed 1.65-1.68x stock.

## Source excerpt

arXiv:2611.10141v1 Announce Type: cross Abstract: A language model that never had to forget would keep every document it has read and every turn it has spoken, and answer from any of it. This paper shows that two stock models can do that on unmodified weights by manipulating their geometry. Rotary attention turns each pair of key dimensions, a plane, at its own rate. The slow planes turn once in thousands of tokens and carry the address a query matches when it reads a far key; the fast planes turn once in a few tokens, and the order of the tokens inside a span is already written into its keys and values by the time the span leaves the near window. At distance the position blurs, and what attention reads is a bag rather than a sequence. A far span is read by its words: under competition it is read only if it is visible at the query of the question's own handle word, and a read through a description rather than a word fails at distance in every model measured, a 70B included. These facts allow a trick. What sits in the far part of attention does not have to be the history as it was; it can be installed ahead of the prediction. The design keeps a near window of 8K tokens at their true positions and changes what lies beyond it with the prompt: every far key and value goes to the host exact, a word index finds the units the request's rare words name, a far window of slots inside the trained range holds them while the request is encoded, and a rare word the model generates fetches its units mid-generation with one exact re-encode. Implemented in llama.cpp on Mistral-7B and Llama-3.1-8B, the design reads planted single needles at 99 to 100 of 100 and three-key discrimination at 88 to 100 of 100 from 32K to one million tokens, scores 70.8 on RULER against 69.9 for dense attention on Llama-3.1-8B at 128K and 67.8 against 75.5 on Mistral-7B at 32K, and at 128K prefills at 1.85 times and decodes at 1.65 to 1.68 times stock speed.