← Latest papers
🤖 machine learning

Jet-Long: Efficient Long-Context Extension with Dynamic Bifocal RoPE

Jet-Long is a tuning-free, zero-shot method that dynamically adapts RoPE rescaling factors to balance short-context fidelity and long-context extrapolation, achieving state-of-the-art performance on long-context benchmarks with minimal inference overhead through an efficient bifocal attention mechanism.

Original authors: Haozhan Tang, Zerui Wang, Yuxian Gu, Song Han, Han Cai

Published 2026-07-10
📖 5 min read🧠 Deep dive

Original authors: Haozhan Tang, Zerui Wang, Yuxian Gu, Song Han, Han Cai

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 have a super-smart robot brain (a Large Language Model) that was trained to read stories up to a certain length, say 32,000 words. Now, you want to ask it to read a whole novel or a massive code repository that is four times longer. If you just hand it the long text, the robot gets confused. It's like trying to read a book where the page numbers suddenly jump from 100 to 1,000,000; the robot's internal compass (called RoPE) spins wildly, and it starts hallucinating or forgetting the middle of the story.

For a while, scientists tried to fix this by picking one "magic number" to stretch the robot's vision. But this was a lose-lose game: if you stretched it too much to see the end of the book, the robot forgot the beginning. If you kept it tight to remember the start, it couldn't see the end.

Enter Jet-Long, a new method that acts like a dynamic bifocal lens for the robot's eyes.

The Bifocal Glasses Trick

Instead of forcing the robot to use one stretched view for the whole book, Jet-Long gives it two pairs of glasses at the same time:

  1. The Close-Up Lens: For the first chunk of text (the "local window"), the robot sees everything exactly as it was trained to see it. No stretching, no distortion. This keeps the robot's memory sharp for the recent past.
  2. The Zoom-Out Lens: For the rest of the text (the "remote window"), the robot uses a special trick. It doesn't just stretch the view; it dynamically groups the pages together. As the book gets longer, the robot automatically adjusts how many pages it groups into one "super-page."

The magic is that this grouping factor isn't fixed. It changes on the fly depending on how long the text is right now. If the text is short, the robot sees every word individually. If the text is huge, it groups words just enough so the robot's internal compass stays calm and doesn't spin out of control. This means the robot stays perfectly accurate for short tasks but can still read massive documents without getting lost.

The "Free Lunch" of Speed

Usually, doing two different calculations at once (looking close and looking far) would make the robot twice as slow. But the authors of this paper found a clever way to merge these calculations. They built a special engine (a "fused kernel") that does the math for both lenses in a single pass.

Think of it like a chef who usually has to chop vegetables, then boil them, then fry them in three separate pots. Jet-Long is like a magical pot that does all three steps at once without losing any flavor.

  • The Result: When the robot reads a massive 128,000-token context, Jet-Long is actually 1.39 times faster at the start (the "prefill" phase) than the standard method (FlashAttention-2) on an H100 chip.
  • The Catch: When the robot is generating new text one word at a time, it's only about 4% slower than the standard method. That's a tiny price to pay for being able to read a whole library instead of just a pamphlet.

What They Tested (And What They Didn't)

The team tested this on three different sizes of robot brains (1.7 billion, 4 billion, and 8 billion parameters) and found that Jet-Long consistently beat the previous best methods.

  • On a test called RULER (which checks if the robot can find hidden needles in a haystack of text), Jet-Long scored 4.79 points higher on the smallest model and 2.03 points higher on the largest model compared to the best competitor.
  • On a test called HELMET-RAG (which simulates real-world search tasks), it achieved the best overall accuracy.
  • On a test called PG-19 (reading old books), it kept the robot's confusion (perplexity) at the lowest levels, whereas other methods let the robot's confusion skyrocket as the text got longer.

Important Note on Limits: The paper explicitly rules out the idea that you need to retrain the robot from scratch to make it work. Jet-Long works on "zero-shot" models, meaning you can take a pre-trained robot and just plug in this lens. However, the paper also notes that while Jet-Long fixes the "spinning compass" problem, it doesn't fix a different problem called "attention diffusion" (where the robot gets overwhelmed by too many options). That problem is usually solved by changing the robot's architecture entirely, not just by adding a lens.

The Verdict

Jet-Long isn't a magic wand that makes robots infinitely smart, but it is a highly efficient, tuning-free tool that lets existing robots handle text lengths up to 128,000 tokens without losing their mind. It keeps the robot's short-term memory perfect while dynamically adjusting its long-term vision, all while running almost as fast as the standard methods. The authors measured this on real hardware (H100 GPUs) and found it works across different model sizes and even on hybrid robot brains that mix different types of attention. It's a solid, proven upgrade for anyone trying to make AI read longer.

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 →