← Latest papers
🤖 machine learning

LOCKS: Page-Local Compact Key Summaries for Efficient Long-Context Decoding

LOCKS is a drop-in plugin for vLLM that accelerates long-context decoding by assigning each memory page a compact, low-rank spectral summary to efficiently estimate attention mass and select only the most relevant pages, thereby significantly reducing latency and memory usage while maintaining near-full-attention accuracy.

Original authors: Junsung Hwang

Published 2026-07-28
📖 4 min read☕ Coffee break read

Original authors: Junsung Hwang

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to read a massive library of books to answer a single question. In the world of artificial intelligence, Large Language Models (LLMs) are like brilliant students who have read the entire internet, but when they try to answer a question based on a very long document, they face a tricky problem. To think, they need to keep a "memory" of everything they've read so far. This memory is called the KV cache (Key-Value cache). Think of it as a giant whiteboard where the model writes down every single word it has processed.

The problem is that as the story gets longer, this whiteboard gets huge. Every time the model wants to write the next word, it has to scan the entire whiteboard to decide which past words are important. If the story is 100,000 words long, the model has to look at 100,000 words every single time it types one new letter. This is slow and uses up a massive amount of computer memory, like trying to find a specific needle in a haystack by moving the whole haystack every time you blink. Scientists have been trying to figure out how to make the model ignore the boring parts of the story and only look at the exciting parts, but they've struggled to do this without losing the ability to find the right answer.

This is where a new method called LOCKS comes in. The researchers behind this paper discovered a clever trick to speed things up without losing the plot. They realized that while the whole story is complex, small chunks of it (called "pages") have their own simple, unique patterns. Instead of trying to summarize the whole library with one giant, messy map, LOCKS gives every single page its own tiny, high-quality "spectral summary."

Think of it like this: Imagine you are a detective solving a mystery in a 1,000-page novel. Instead of reading every word of every page to find the killer, you create a tiny, 10% size "cheat sheet" for each page. This cheat sheet doesn't just list the words; it captures the vibe and the most important directions of that specific page's content. When the detective (the AI) needs to know where to look next, it doesn't read the full pages. It just glances at these tiny cheat sheets to see which pages have the most "clues" (attention mass).

The paper shows that this method is incredibly effective. By using these page-specific cheat sheets, the model can skip reading about 98% of the text in a 100,000-token context, yet it still finds the right answer almost as well as if it had read everything. In fact, on difficult math and reasoning tests, other methods that try to guess which pages are important often fail completely, but LOCKS keeps the "carrier" pages—the ones that actually hold the answer—safe and sound.

The researchers proved that trying to use one single map for the whole book (a "shared" summary) doesn't work because different pages have different secrets that get lost in the mix. They also showed that their method is "training-free," meaning it works with existing AI models without needing to re-teach them anything. When they tested it on real hardware, they found that it cut the time it takes to generate each word in half for very long documents. It's like turning a slow, plodding walk through a library into a high-speed teleportation system that only stops at the shelves that actually matter.

In short, LOCKS solves the "long-context" bottleneck by realizing that every page of a story has its own unique fingerprint. By creating a compact, page-specific summary for each one, the AI can instantly know which pages to read and which to ignore, making it possible to chat with models about books that are hundreds of thousands of words long without the computer getting overwhelmed.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →