# Needle in a Haystack

> Needle in a haystack is a long-context evaluation that hides a specific fact at varying depths in a long distractor document and tests whether the model can retrieve it.

- Identifier: PTL-0099
- Category: Failure Modes & Evaluation
- Canonical URL: https://protologue.com/t/needle-in-a-haystack/
- Also known as: NIAH, passkey retrieval
- Introduced: 2023

## Description

It became a standard way to report effective context length, though passing it shows only simple retrieval, not reasoning over many dispersed facts.

## Related terms

- [Lost in the Middle](https://protologue.com/t/lost-in-the-middle/)
- [Context Window](https://protologue.com/t/context-window/)

## Sources

- Kamradt (2023). LLMTest_NeedleInAHaystack. https://github.com/gkamradt/LLMTest_NeedleInAHaystack

## Cite this entry

Protologue. (2026). Needle in a Haystack. In Protologue: A Taxonomy of Prompting and LLM Techniques (v1.0.0, PTL-0099). https://protologue.com/t/needle-in-a-haystack/

License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
