← Latest papers
💬 NLP

Long Context Pre-Training with Lighthouse Attention

This paper introduces Lighthouse Attention, a training-only, gradient-free hierarchical selection algorithm that wraps standard scaled dot-product attention to enable efficient subquadratic pre-training of causal transformers at extreme sequence lengths, which can be seamlessly removed via a short recovery phase to yield a full attention model with faster training and lower final loss.

Original authors: Bowen Peng, Subho Ghosh, Jeffrey Quesnelle

Published 2026-05-08
📖 5 min read🧠 Deep dive

Original authors: Bowen Peng, Subho Ghosh, Jeffrey Quesnelle

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 (a very long text) all at once to understand a story. In the world of AI, this is called "long-context training."

The problem is that standard AI models (Transformers) try to read every single word against every other word to find connections. If you have 100,000 words, the model has to do 10 billion comparisons. It's like trying to find a specific sentence in a library by shouting every word to every other word simultaneously. It takes forever, costs a fortune in electricity, and the computer runs out of memory.

This paper introduces a new method called Lighthouse Attention to solve this. Here is how it works, using simple analogies:

1. The Problem: The "All-Seeing Eye" is Too Heavy

Standard AI attention is like a security guard who insists on looking at every single person in a stadium at the same time to see who is talking to whom. As the stadium gets bigger, the guard gets overwhelmed.

2. The Solution: The "Lighthouse" Strategy

Instead of looking at everything at full resolution, Lighthouse Attention acts like a lighthouse scanning a dark ocean. It doesn't ignore the ocean; it just scans it in layers to find the most important parts quickly.

Here is the three-step process the paper describes:

Step A: The "Pyramid" (Summarizing the Crowd)

Imagine you have a huge crowd of people (the text). Instead of looking at every individual face, you group them into small clusters (like families or teams).

  • The Trick: The paper does something unique here. Most other methods only summarize the "people being talked about" (the keys and values) but leave the "people doing the talking" (the queries) in high detail.
  • Lighthouse's Move: It summarizes everyone equally. It creates a pyramid of summaries:
    • Level 0: Every single word.
    • Level 1: Groups of 4 words summarized into one.
    • Level 2: Groups of 16 words summarized into one.
    • And so on.
      This creates a multi-level map of the text, from "super detailed" to "big picture."

Step B: The "Spotlight" (Picking the Best Bits)

Now, the model needs to decide which parts of this pyramid are important enough to read in full detail.

  • The Selection: It uses a simple, free rule (no extra learning required) to score every group. It asks, "Which groups have the most 'energy' or importance?"
  • The Cut: It picks the top KK most important groups from all levels of the pyramid.
  • The Result: Instead of reading 100,000 words, the model now only needs to read a tiny, dense list of the most important "chunks" (maybe 5,000 words).

Step C: The "Flash" (Reading the Selected Bits)

Once the model has picked its top 5,000 words, it runs them through the standard, super-fast "FlashAttention" engine. Because the list is now short, this step is incredibly fast and fits easily in the computer's memory.

3. The "Magic" Recovery (The Two-Stage Training)

This is the most critical part of the paper. The authors were worried: "If we train the AI to only look at summaries, will it forget how to read full sentences later?"

To fix this, they use a Two-Stage Training Recipe:

  1. Stage 1 (The Lighthouse Phase): They train the model for most of the time using the Lighthouse method. The model learns to be efficient and pick the right highlights.
  2. Stage 2 (The Recovery Phase): For the last little bit of training, they turn off the "summarizing" and "picking" parts. They force the model to read the full text again using the standard method.

The Result: The model "wakes up" from its efficient training and remembers how to use full attention perfectly. The paper claims that after this short recovery, the model performs just as well (or better) than a model that was trained on the full text the entire time, but it got there much faster and cheaper.

Why is this a big deal?

  • Speed: The paper shows that for very long texts (like 100,000+ words), this method is 17 to 21 times faster than standard methods.
  • No "Junk" Code: Unlike other methods that require building custom, complicated computer chips (kernels) to handle the "picking" process, Lighthouse uses standard, off-the-shelf computer parts for the actual reading. It just rearranges the data before handing it over.
  • Symmetry: It treats the "question" and the "answer" parts of the sentence equally, which makes the math cleaner and more stable.

The Bottom Line

Lighthouse Attention is like hiring a smart research assistant. Instead of reading 1,000 pages of a report word-for-word, the assistant quickly scans the whole document, highlights the 50 most important paragraphs, and then reads only those 50 paragraphs in deep detail.

The paper proves that if you train an AI this way, and then give it a quick "refresher course" on reading the whole thing at the end, it becomes a super-fast reader that doesn't lose any of its intelligence.

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 →