The test places a specific sentence or passkey at various positions in long, unrelated text and asks the model to retrieve it. Accuracy is measured by context length and hiding position, and the method is used to check how well a large language model actually uses its context window.
Needle-in-a-Haystack
Needle-in-a-Haystack is a long-context evaluation that checks whether a language model can find a short piece of information hidden in a long document.
2 articlesLast mentioned
This entry is based on AIPOST articles and widely known facts. If something is wrong, please send us a correction request.
Articles covering this entry
ShapeLearn Qwen3.8-27B on a 16GB GPU: Agent Tests Pass 4 of 5 at 128k ContextAI Performance ·
The Needle-in-a-Haystack test hides a six-digit passkey inside a large block of text at depths of 0%, 25%, 50%, 75% and 100% of the context, then asks the model…
Read article2-bit Qwen 27B on a 16GB GPU: Strong at Apps and Games, Weaker in 3DAI Performance ·
The memory test used a Needle-in-a-Haystack setup.
Read article