TL;DR: LLMs can't read a whole long document for every question, so a retriever picks a few chunks for them, and it often picks the wrong ones. MAPLE (Memory-Aware Predictive Loading Engine) set out to fix that by distilling where a big LLM looks (its attention) into a small, fast model. The big model's attention really does point at better chunks. The small models never learned to reproduce it. Here is the full story: the idea, the experiments, the results, and what's next.
Picture this
You're relocating for a new job. Your apartment lease is 80 pages, so you upload it to an AI assistant and ask: "Can I end my lease early if I move for work?" It answers with the confidence of an uncle explaining crypto at a wedding: no such clause.
There is one. Page 47, under "Transfer of Employment", lets you leave with 60 days' notice. It never uses the words "end", "early" or "lease", so the assistant never saw it. It didn't misread the clause; it never got to read it.
That failure, picking the wrong pieces before the model even starts thinking, is what MAPLE tried to fix.
How it's done today, and where it breaks
The obvious fix is to send the whole document. That is expensive, often doesn't fit in the model's context window, and tends to make answers worse, because models get lost in long inputs. So most systems use retrieval-augmented generation (RAG): cut the document into chunks (MAPLE uses 500-character blocks), pick the few most relevant, and send only those. Everything then depends on the picker.
Why more context can mean worse answers: "Lost in the Middle". A 2023 study by Liu et al., Lost in the Middle, gave models a set of documents with the answer in just one of them, then moved that document around. Accuracy was highest when the answer sat at the very start or the very end of the input, and dropped sharply when it sat in the middle: a U-shaped curve. In some settings, a model with the answer buried mid-context did worse than the same model given no documents at all. Adding more documents made it worse. It's the night-before-the-exam effect: the first and last pages of the chapter stick, the middle blurs.
| Approach | How it picks | What's good | What goes wrong |
|---|---|---|---|
| Send everything (long context) | No picking: the whole document goes in | Nothing is left out | Costly and slow. On LongBench HotpotQA, 7,500 tokens of full context scored 46.8 F1, against 51.5 for 2,000 tokens picked by dense retrieval. |
| Keyword search (BM25) | Words shared by question and chunk | Very fast, no training | Misses paraphrases and synonyms |
| Dense retrieval (today's default) | Similarity between embedding vectors | Fast (a few milliseconds over a million chunks), handles paraphrases | Picks what resembles the question, not what answers it |
| Re-rankers (cross-encoders, LLM re-rankers) | A model reads the question and each chunk together | Judges relevance by reading, not by resemblance | Slow: a small cross-encoder took 237 ms for 100 candidates; LLM re-rankers run a multi-billion-parameter model on every query |
Dense retrieval is the default because it's the best cheap option. Think of it as an arranged-marriage matchmaking site: it pairs profiles that look alike and hopes the chemistry follows. Usually that works. It fails when the chunk you need doesn't look like the question, which is exactly what happens with questions that need two facts joined together. A real case from HotpotQA, a multi-hop QA benchmark:
Q: The director of the romantic comedy Big Stone Gap is based in what New York city?

Block B never mentions Big Stone Gap, so dense retrieval ranks it 6th of 12 and a top-5 selection drops it.
Why try something new? Today you choose between cheap pickers that judge by resemblance, and accurate ones that actually read but cost a model run per query. MAPLE was an attempt at a third option: a picker that judges like a model that has read the whole document, at the cost of dense retrieval.
Meet MAPLE: Memory-Aware Predictive Loading Engine
The hint came from the LLM itself. Given all 12 blocks, an 8B LLM puts more attention on Block B than on any other. It reads Block A, learns that Trigiani is the director, and its attention follows the name. The model knows where to look; dense retrieval doesn't.
That is the idea behind MAPLE, short for Memory-Aware Predictive Loading Engine. The name is the plan:
- Memory-aware: an LLM's context window is its working memory, and it is small and expensive. What goes into it matters.
- Predictive: instead of running the big model to see where it looks, predict where it would look.
- Loading engine: use those predictions to decide which chunks get loaded into that memory.
In practice it runs in two phases. The expensive teacher runs once, offline, to make training labels. At query time only the small student runs, at roughly the cost of an embedding lookup.

One cheap cosine pass narrows the field to 200 blocks, and the student orders them by where it predicts the teacher would have looked.
How this tackles "Lost in the Middle". If models lose track of the middle of long inputs, stop sending long inputs. MAPLE hands the reader a 2,000-token budget of selected blocks, in document order. A short context is only as good as the picker that fills it, though, and that turned out to be the hard part.
The idea has roots: Izacard & Grave (ICLR 2021) trained a retriever on a reader model's cross-attention over passages. MAPLE tested a cheaper, long-document version: a decoder-only LLM's attention over a whole document's blocks, distilled into students small enough to score a million blocks in milliseconds.
The experiments
- Record the teacher. Llama-3-8B-Instruct (4-bit) read 5,000 questions from HotpotQA and NarrativeQA. The attention its final token paid to each 500-character block became a soft relevance label: 4,000 questions for training, 1,000 held out.
- Train two kinds of student. Small scorers on top of frozen BGE-small embeddings (seven variants, including a control trained on human-marked evidence), and MAPLE-Embed, which fine-tunes BGE-small itself, either fully or only its top two layers.
- Test beyond the training data, with the rules set first. Held-out questions, larger candidate pools, four BEIR datasets, three multi-hop QA sets and end-to-end answers on LongBench, against BM25, dense, hybrid and a cross-encoder. Pass/fail bars were written before each run, every variant ran with 3 seeds, and every comparison has a significance test.
Full details are in the appendix.
All of this ran on a single laptop GPU, which spent most of the project sounding like a pressure cooker just before the third whistle.
The results: close, but not better

The chart shows evidence recall@5 on held-out HotpotQA questions: the share of the gold evidence blocks that make the top 5, averaged over questions.
- The label is good. The teacher's all-layer attention beats dense retrieval: 85.9% vs 82.8% (NarrativeQA: 77.3% vs 71.7%). Last-layer attention alone is worse than dense (74.7%), so the signal is real but spread across layers.
- Students trained on attention never caught up. The best attention-trained scorer reached 78.4%.
- The best versions only tie. The human-label scorer (83.7%, p = 0.17) and the regularised encoder (83.9%, p = 0.01–0.11 across seeds) sit about a point above dense. Not a reliable win.
Better at home, worse away. Retraining bought small gains on questions like the training data and paid for them on new kinds of questions:

Classic home-pitch specialist: dominant on familiar turf, out for a duck on tour. The careful retune is the best trade-off, and it still missed its pre-set BEIR bar (53.4) by 0.3 points.
End to end, the answers don't change. With the same reader (Llama-3-8B-Instruct, 2,000-token context) on LongBench, MAPLE's picks score F1 52.4–53.3 on HotpotQA against 51.5 for dense. No selection method differs significantly from dense (MAPLE p ≥ 0.17). A side note: on HotpotQA, every selection method beat feeding the model the full 7,500-token context (46.8 F1). Less really is more, as long as it's the right less. (Not everywhere: on NarrativeQA, long stories with the answer spread out, full context still won, 22.4 vs 17.6 F1.)
Fast, but not better. The re-rank search finds its top 5 among a million blocks in 4.55 ms on a laptop GPU, quicker than you'd find standing room on the Bangalore Metro at 4 p.m. But that is about 1.5 ms more than plain cosine similarity, which does the job just as well.
Why it didn't work
The teacher reads blocks together; the student scores them one at a time. Go back to the Big Stone Gap picture. The teacher ranks Block B first because it has just read Block A, which names the director. Attention to Block B is a reaction to Block A. A student that sees only (question, Block B) can't make that link: the MAPLE scorer ranked it 5th, one place above dense. It copied the teacher's outputs without the reasoning. Very Joey-learning-French: confident, close-sounding, and not actually French.
Three things made it worse:
- The label depends on context. Only about 10–12% of the final token's attention lands on the document at all, and how much a block gets depends on its neighbours, its position and recency. A student that scores blocks in isolation can only learn an average of that.
- A small encoder over-specialises fast. Fully fine-tuning BGE-small (33M parameters) on ~4,000 questions in one format gains in-domain and breaks elsewhere. The human-label control broke the same way, so the recipe is the culprit, not the attention labels. Regularising removed the loss and the gain together.
- The baseline is strong. BGE-small dense retrieval comes within 1.5 nDCG@10 of ICR (ICLR 2025), an 8B-LLM attention re-ranker, on the same four BEIR sets, and it beat the cross-encoder tested here.
Human labels beat attention labels wherever both existed. That leaves attention supervision a niche: settings with no labels at all.
Where it stands today
MAPLE v0.3.0 is published as a negative result: the code, every run and the pre-registered rules are public. I wouldn't recommend it over dense retrieval. It is slightly slower and no more accurate.
The takeaways:
- The signal is real. Full-context LLM attention finds better chunks than embedding similarity. The open question is how to get it cheaply.
- Pointwise students are the wrong shape. If the teacher's judgment comes from combining passages, the student has to see passages together.
- Test outside the training data early. In-domain gains were easy to get, and most came with a cost on new kinds of questions.
- Set the bar first. Missing by 0.3 points is easy to call a win if you define winning afterwards.
What happens next
Consider this the post-credits scene. The problem still deserves solving: better context than embedding similarity, at close to the same cost. The next attempt starts fresh, built around one lesson: read passages together. Candidates:
- Conditioned multi-hop retrieval: retrieve, then search again with the question plus what was found (MDR-style), and only then train a student on attention conditioned on the blocks already chosen.
- A small cross-encoder distilled from the teacher, reading question and block together, re-ranking the top 20–50.
- More data: 20,000+ questions instead of 4,000, mixed with general retrieval data such as MS MARCO.
- A pivot: use attention prediction where attention is the target, choosing which KV-cache blocks to keep during long-context generation, measured as speed at equal answer quality.
It may work, help a little, or not work at all. Either way it will be measured the same way and reported the same way.
Code, results and the full technical write-up: kmkrofficial/maplecore (v0.3.0).
