NoLiMa: Long-Context Evaluation Beyond Literal Matching
TL;DR. Standard needle tests let a model find the needle by matching words from the question. NoLiMa writes questions and needles with almost no word overlap, linked only by a fact the model knows (Dresden and the Semper Opera House). Models that solve these easily at 1K tokens degrade sharply with length; most have an effective length of 2K or less.
Key idea
Section titled “Key idea”Each needle names a character next to a keyword ; the question asks about a related keyword with no literal overlap. Effective length is relative to the model’s own short-context skill:
where is built per example: for each question-needle example, average accuracy over the five haystacks at each short length (250, 500 and 1K), take the maximum across those lengths, then average these maxima across examples. A toy case shows why this is optimistic: if example A scores 1.0, 0.6, 0.6 at the three lengths and example B scores 0.6, 0.6, 1.0, the mean over lengths gives 0.73 per example, but the mean of per-example maxima is 1.0. Variants add a second hop (via a third entity) and invert the order of name and keyword.
Results
Section titled “Results”Table 3 covers 13 models, all claiming at least 128K tokens. GPT-4o has the highest base score (99.3) and the longest effective length (8K), keeping 69.7 at 32K. Llama 3.3 70B (base 97.3) and Gemini 1.5 Pro (92.6) reach 2K, with 42.7 and 48.2 at 32K. Command R+ falls from a 90.9 base to 7.4. At 32K, 11 of 13 models score below half their base. In the needle-depth sweep, one-hop questions show a lost-in-the-middle dip at 32K, while two-hop questions degrade across all positions as length grows.
Connections
Section titled “Connections”- Before: RULER for the effective-length idea; Lost in the middle for position effects.
- Alongside: Context Rot varies question-needle similarity directly and reaches a similar conclusion.
- IR: the lexical versus semantic gap mirrors sparse versus dense retrieval; compare SPARSEUP and ColBERT.
- Reasoning: chain-of-thought prompting gives only partial recovery here.
Questions to think through
These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.
- Derive / compute
NoLiMa sets each model's threshold at 85% of its base score (for each question-needle example, average over five haystacks at each short length of 250, 500 and 1K, take the maximum across those lengths, then average these maxima across examples). Using Table 3, compute the thresholds and effective lengths for GPT-4o (base 99.3; 98.1, 98.0, 95.7, 89.2, 81.6, 69.7 at 1K to 32K) and Llama 3.3 70B (base 97.3; 94.2, 87.4, 81.5, 72.1, 59.5, 42.7), and the fraction of base each keeps at 32K.
What a strong answer covers
- GPT-4o: threshold 0.85 × 99.3 ≈ 84.4. 89.2 at 8K passes and 81.6 at 16K fails, so the effective length is 8K. At 32K it keeps 69.7 / 99.3 ≈ 70% of base.
- Llama 3.3 70B: threshold 0.85 × 97.3 ≈ 82.7. 87.4 at 2K passes and 81.5 at 4K fails, so 2K. At 32K it keeps 42.7 / 97.3 ≈ 44%.
- Both models claim 128K. A relative threshold judges each model against its own short-context skill, unlike RULER's fixed 85.6.
- The paper's headline follows from the same arithmetic: at 32K, 11 of 13 models keep less than half of their base score (only GPT-4o and Gemini 1.5 Pro stay above).
- Mechanism
Explain what makes a NoLiMa needle hard: the role of the question keyword and needle keyword, one-hop versus two-hop links, and inverted order. Then use the literal-match ablation and the distractor test to argue what attention is relying on in long contexts.
What a strong answer covers
- Example: the needle says a character lives next to the Semper Opera House; the question asks which character has been to Dresden. The link (the opera house is in Dresden) is world knowledge, not shared words. Two-hop needles add a step (Dresden is in Saxony).
- In the default order, the name precedes the needle keyword, so the keyword's causal representation can already contain information about the name. In the inverted order, the name follows the keyword; the keyword cannot attend forward to it, weakening the question → keyword → name path, which the authors argue is harder at long range.
- Literal-match ablation (Llama 3.3 70B): a direct question that names the keyword scores about 98.5 even at 32K; adding multiple-choice options with literal names lifts one-hop from 56.2 to 93.1 and two-hop from 25.9 to 87.2 at 32K.
- Distractors containing the question keyword but irrelevant to the answer hurt further. Together this suggests attention in long contexts leans on surface overlap to find relevant tokens.
- CoT helps but does not fix it: one-hop 56.2 → 60.6 and two-hop 25.9 → 34.3 at 32K for Llama 3.3 70B; on NoLiMa-Hard even o1 falls to 31.1 at 32K.
- Critique
From an IR perspective, NoLiMa is the long-context analogue of moving from lexical to semantic matching. Critique it as evidence that LLM readers cannot use semantically related passages in RAG, and design a follow-up that tests that claim with real retrieval output.
What a strong answer covers
- Strength: Table 1 shows NoLiMa has far lower question-context ROUGE overlap (precision 0.069) than vanilla NIAH (0.905) or RULER S-NIAH (0.571), isolating the literal-match shortcut.
- Limits: 58 question-needle pairs, a single answer type (a character name), and associations that depend on the model knowing a fact. Failures mix context use with missing world knowledge.
- Haystacks are filtered book text, not retrieved passages; a dense retriever would put semantically close but wrong passages in context, which is a different stressor.
- Follow-up: take queries whose relevant passage was found by a dense retriever but has low BM25 overlap, and compare reader accuracy against high-overlap relevant passages at the same position and length (e.g. 4K to 64K).