atlas

Research map / Large language models / Language, safety and interpretability

Needle Threading: Can LLMs Follow Threads Through Near-Million-Scale Haystacks?

ICLR 2025 · Large language models › Language, safety and interpretability · approach: LLM unlearning and benchmarks · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Introduces needle-threading and multi-threading retrieval tasks on synthetic UUID key-value haystacks to evaluate 17 LLMs up to ~630k LLaMA-3.1 tokens, and proposes a tokenizer-independent effective context length metric.

Problem

Existing long-context benchmarks saturate on simple needle retrieval, are limited to sub-100k contexts, and give only coarse macro-trends, so it is unclear how effectively frontier LLMs use their advertised context windows, especially for multi-step threads.

Approach

Synthetic UUID key-value haystacks where values chain into keys form threads; single, multiple, conditional, threading, multi-threading and branched variants isolate granular factors (context length, thread direction, number of threads). A contour-based effective context length is computed in characters to avoid tokenizer differences.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Increase haystack context lengthLLMs on Single Needle retrieval · Single Needleretrieval accuracyHurt
Increase haystack context lengthLLMs on Multiple Needles retrieval · Multiple Needlesretrieval accuracyHurt
Cluster relevant key-value pairs rather than randomly place themConditional Needles retrieval · Conditional Needlesretrieval accuracyHelped
Cluster specified key-value pairs rather than randomly place themMultiple Needles retrieval · Multiple Needlesretrieval accuracyNo clear effect
Increase the number of concurrently retrieved needlesstronger models on Multiple Needles retrieval · Multiple Needlesretrieval accuracyNo clear effect
Increase the number of condition-matching needles in random positionsConditional Needles retrieval · Conditional Needlesretrieval accuracyHurt
Move thread links forward through the context rather than backwardLLMs on Threading · Threadingretrieval accuracyHelped
Increase thread lengthLLMs on Threading · Threadingretrieval accuracyHurt
Follow additional threads simultaneouslyLLMs on synthetic Multi-threading · Multi-threadingretrieval accuracyNo clear effect
Use natural-language text instead of synthetic UUID haystacksLLMs on Multi-threading · Natural-language Multi-threadingretrieval accuracyHurt
Increase branching factorLLMs on Branched Threading · Branched Threadingretrieval accuracyMixed

Surprising findings

Limitations

Experimental setup

Datasets: synthetic UUID key-value haystacks Gibbon's The History of the Decline and Fall of the Roman Empire (natural language ablation)

Benchmarks: Single Needle Multiple Needles Conditional Needles Threading Multi-threading Branched Threading natural language threading ablation

Metrics: exact match accuracy effective context length (contour at 75% threshold, in chara

Baselines: GPT-4o Gemini 1.5 Pro Gemini 1.5 Flash Claude 3.5 Sonnet LLaMA 3.1 405B

Builds on: needle in a haystack

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy