NIAH (Needle in a Haystack)
https://github.com/gkamradt/LLMTest_NeedleInAHaystack
Places a known sentence ("needle") at varying positions inside a long irrelevant document ("haystack") and prompts the model to retrieve it. Tests context lengths from 2K to model max. Greg Kamradt, 2023, no formal venue.
Active · Verified 2026-05-14 · fresh as of 2026-05-14 · 26 cited facts, 1 with a third-party source · Suggest a correction
At a glance
- Tier
- T4
- Section
- Memory benchmarks & evaluation
- Latest release
- no releases fix
- GitHub
- 2.3k★ Jupyter Notebook repo fix
- Pricing
- not applicable — open source; free to use repo fix
- Funding
- not applicable — not commercial fix
- Freshness
- 2026-05-14 fix
- Layer
- agent-infra repo fix
- Licensing
- open-source repo fix
- Developer activity
- OpenRank 0.67 (12-mo avg 1.8) · 1 participants — 2025-10 third-party fix
Memory taxonomy
- storage
- n/a
- retrieval
- n/a
- persistence
- n/a
- update
- read-only
- unit
- n/a
- governance
- n/a
- conflict
- n/a
When to use
Optimised for: not applicable - eval dataset, not a system
Anti-fit: not applicable - eval dataset, not a system
Pros & cons
Pros
Original needle-in-a-haystack benchmark — defined the long-context recall test paradigm.
Cons
Single-pattern test; commercial models now ace it; less informative for modern memory architectures.
Claims & capabilities
De facto first-pass filter for long-context LLM releases. Now considered necessary-but-insufficient — most frontier models score near-perfect.
Technical surface
- API surface
- not applicable — eval dataset, not a system
- Backend storage
- not applicable — eval dataset, not a system
- Deployment
- not applicable — run locally
- Embedding model
- not applicable — eval dataset, not a system
- Multi-tenancy
- not applicable — eval dataset, not a system
- MCP
- not applicable — benchmark / evaluation harness
- A2A
- not applicable — benchmark / evaluation harness
- OpenTelemetry
- not applicable — benchmark / evaluation harness
Similar systems
Other memory benchmarks & evaluation in the catalog, ranked by inbound references.
- LoCoMo T3
Conversations spanning up to 35 sessions / 300 turns / ~9K tokens, built from LLM-agent personas grounded on temporal event graphs and verified by human annotators. Tests QA (single-hop, multi-hop, temporal, commonsense, adversarial), event-graph summarisation, multimodal dialogue.
- GAIA T3
Benchmark for general AI assistants made of real-world questions that require reasoning, multimodality, web browsing and tool use, with a public leaderboard on Hugging Face. Traction: ~917 likes on the Hugging Face dataset
- LongBench T3
Tsinghua THUDM. 21 datasets across 6 categories (single-doc QA, multi-doc QA, summarisation, few-shot ICL, synthetic, code completion) in English + Chinese. ~6.7K words English / 13.4K chars Chinese average. v2 at ACL 2025 with harder, longer instances.
- LongMemEval T3
5 core memory abilities — info extraction, multi-session reasoning, temporal reasoning, knowledge updates, abstention — via 500 curated questions in synthetic chat histories. Two scales: LongMemEval-S (115K tokens), LongMemEval-M (up to 1.5M).
- RULER T3
NVIDIA. Extends NIAH with multi-needle retrieval, multi-hop entity tracing, aggregation, QA — configurable for arbitrary length / difficulty. Evaluated 17 long-context models on 13 tasks.
- InfiniteBench (∞Bench) T3
Tsinghua / OpenBMB. First benchmark with average input >100K tokens. 12 tasks across English + Chinese: long novel QA, code debugging, math in long context, summarisation, retrieval. Realistic documents (novels, code) rather than synthetic filler.
Sources (25 cited facts, 1 third-party)
Each fact links to the page it came from; the badge says who published it (how to read sources).
- What it is Single-fact verbatim retrieval from long context repo
- What it does & what's distinct Places a known sentence ("needle") at varying positions inside a long irrelevant documen… repo
- Claims / benefits De facto first-pass filter for long-context LLM releases. Now considered necessary-but-i… repo
- Modalities text repo
- Created 2023-11 repo
- License MIT repo
- GitHub 2.3k★ Jupyter Notebook repo
- Mindshare no academic citations (informal GitHub project); de-facto first-pass filter for all fron… repo
- Pricing not applicable — open source; free to use repo
- Deployment not applicable — run locally repo
- Founders / pedigree Greg Kamradt (independent AI researcher); open-source 2023 repo
- Versioning none repo
- Schema evolution not applicable — fixed evaluation dataset repo
- Pros Original needle-in-a-haystack benchmark — defined the long-context recall test paradigm. repo
- Cons Single-pattern test; commercial models now ace it; less informative for modern memory ar… repo
- Project & sources GitHub gkamradt repo
- commit-trajectory [{"ym":"2023-11","cum":9},{"ym":"2023-12","cum":15},{"ym":"2024-02","cum":16},{"ym":"202… repo
- cost-input-usd-per-mtok 0 repo
- cost-output-usd-per-mtok 0 repo
- cost-tier free repo
- cost-pricing-model free-tier repo
- cost-last-verified 2026-06-29 repo
- licensing-bucket open-source repo
- taxonomy-three-layer-rollup agent-infra repo
- developer-activity-opendigger {"activity":1.49,"as_of":"2025-10","openrank_12mo":1.8,"openrank_current":0.67,"particip… third-party
Related systems
Referenced by (1)
- RULER extends — Extends NIAH with multi-needle retrieval, multi-hop entity tracing, aggregation, QA — configurable for arbitrary length / difficulty.