# Needle in a haystack

> Needle in a haystack: A long-context test: insert a piece of information at different positions in a long prompt and check whether the model can find and…

Canonical: https://llmdojo.dev/glossary/needle-in-a-haystack

Also called NIAH.

A long-context test: insert a piece of information at different positions in a long prompt and check whether the model can find and use it.

Learn it in the lesson: [Position matters: lost in the middle](https://llmdojo.dev/learn/prompt-context-engineering/context-selection/lost-in-the-middle) (Prompt and Context Engineering · Choosing Context: Selection, Ordering and Compression).

## Related
- [Lost in the middle](https://llmdojo.dev/glossary/lost-in-the-middle)
- [Reciprocal rank fusion](https://llmdojo.dev/glossary/reciprocal-rank-fusion)
- [BM25](https://llmdojo.dev/glossary/bm25)
- [Glossary of every term](https://llmdojo.dev/glossary)
