mlsanityData to 14 Oct 2026

Haystack Engineering: Context Engineering for Heterogeneous and Agentic Long-Context Evaluation

arXiv 2510.07414 ↗First posted 8 Oct 2025cs.CL cs.AI cs.IRcited by 4

On the map: LLM agents and tool use → Web, search, and research agents

Abstract (arXiv)

Modern long-context large language models (LLMs) perform well on synthetic "needle-in-a-haystack" (NIAH) benchmarks, but such tests overlook how noisy contexts arise from biased retrieval and agentic workflows. We argue that haystack engineering is necessary to construct noisy long contexts that faithfully capture key real-world factors -- distraction from heterogeneous biased retrievers and cascading errors in agentic workflows -- to test models' long-context robustness. We instantiate it through HaystackCraft, a new NIAH benchmark built on the full English Wikipedia hyperlink network with multi-hop questions. HaystackCraft evaluates how heterogeneous retrieval strategies (e.g., sparse, dense, hybrid, and graph-based) affect distractor composition, haystack ordering, and downstream LLM performance. HaystackCraft further extends NIAH to dynamic, LLM-dependent settings that simulate agentic operations, where models refine queries, reflect on their past reasonings, and decide when to stop. Experiments with 15 long-context models show that (1) while stronger dense retrievers can introduce more challenging distractors, graph-based reranking simultaneously improves retrieval effectiveness and mitigates more harmful distractors; (2) in agentic tests, even advanced models like Gemini 2.5 Pro and GPT-5 suffer cascading failures from self-generated distractors or struggle to perform early stops. These results highlight persistent challenges in agentic long-context reasoning and establish HaystackCraft as a valuable testbed for future progress.

Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Placed in Web, search, and research agents, one of 16 directions in LLM agents and tool use. Builds on 57 of its 71 references that are in the map. First posted on arXiv 8 Oct 2025.

Builds on

57 of 71 references.

References · 57

  1. 2024The Llama 3 Herd of Modelscited by 14,715
  2. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
  3. 2025Qwen3 Technical Reportcited by 8,820
  4. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
  5. 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,626
  6. 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
  7. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
  8. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  9. 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
  10. 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,824
  11. 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,754
  12. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
38 more
  1. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
  2. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
  3. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
  4. 2023Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflectioncited by 1,839
  5. 2025Gemma 3 Technical Reportcited by 1,824
  6. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
  7. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
  8. 2020Constructing A Multi-hop QA Dataset for Comprehensive Evaluation of Reasoning Stepscited by 1,282
  9. 2023AgentBench: Evaluating LLMs as Agentscited by 1,267
  10. 2025Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation Modelscited by 1,261
  11. 2021BEIR: A Heterogenous Benchmark for Zero-shot Evaluation of Information Retrieval Modelscited by 1,252
  12. 2023Large Language Models Cannot Self-Correct Reasoning Yetcited by 1,017
  13. 2022Interleaving Retrieval with Chain-of-Thought Reasoning for Knowledge-Intensive Multi-Step Questionscited by 923
  14. 2021MuSiQue: Multihop Questions via Single-hop Question Compositioncited by 916
  15. 2017Reading Wikipedia to Answer Open-Domain Questionscited by 777
  16. 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 601
  17. 2023Active Retrieval Augmented Generationcited by 516
  18. 2023Ring Attention with Blockwise Transformers for Near-Infinite Contextcited by 457
  19. 2025LLMs Get Lost In Multi-Turn Conversationcited by 429
  20. 2025Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attentioncited by 407
  21. 2024LongBench v2: Towards Deeper Understanding and Reasoning on Realistic Long-context Multitaskscited by 379
  22. 2024∞Bench: Extending Long Context Evaluation Beyond 100K Tokenscited by 367
  23. 2023NLP Evaluation in trouble: On the Need to Measure LLM Data Contamination for each Benchmarkcited by 348
  24. 2023MINT: Evaluating LLMs in Multi-turn Interaction with Tools and Language Feedbackcited by 297
  25. 2024MT-Bench-101: A Fine-Grained Benchmark for Evaluating Large Language Models in Multi-Turn Dialoguescited by 250
  26. 2023L-Eval: Instituting Standardized Evaluation for Long Context Language Modelscited by 233
  27. 2024BABILong: Testing the Limits of LLMs with Long Context Reasoning-in-a-Haystackcited by 215
  28. 2023Query Rewriting for Retrieval-Augmented Large Language Modelscited by 213
  29. 2025MultiChallenge: A Realistic Multi-Turn Conversation Evaluation Benchmark Challenging to Frontier LLMscited by 180
  30. 2023ZeroSCROLLS: A Zero-Shot Benchmark for Long Text Understandingcited by 176
  31. 2022SCROLLS: Standardized CompaRison Over Long Language Sequencescited by 170
  32. 2025Qwen2.5-1M Technical Reportcited by 164
  33. 2023Query2doc: Query Expansion with Large Language Modelscited by 149
  34. 2025A Survey of Context Engineering for Large Language Modelscited by 126
  35. 2025MMTEB: Massive Multilingual Text Embedding Benchmarkcited by 125
  36. 2024Long-Context LLMs Meet RAG: Overcoming Challenges for Long Inputs in RAGcited by 123
  37. 2024Leave No Document Behind: Benchmarking Long-Context LLMs with Extended Multi-Doc QAcited by 122
  38. 2023Retrieval meets Long Context Large Language Modelscited by 115

50 most cited of 57 All 57 (JSON)

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 4.

4 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Hidden in the Haystack: Smaller Needles are More Difficult for LLMs to Find
  2. 2025Graph of Agents: Principled Long Context Modeling by Emergent Multi-Agent Collaboration
  3. 2024Michelangelo: Long Context Evaluations Beyond Haystacks via Latent Structure Queries
  4. 2026Understanding Axes of Difficulty For Long Context Tasks Via PredicateLongBench
  5. 2026TS-Haystack: A Multi-Task Retrieval Benchmark for Long-Context Time-Series Reasoning
  6. 2025Can LLMs reason over extended multilingual contexts? Towards long-context evaluation beyond retrieval and haystacks
  7. 2024NeedleBench: Evaluating LLM Retrieval and Reasoning Across Varying Information Densities
  8. 2024Chain of Agents: Large Language Models Collaborating on Long-Context Tasks