arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.07414cs.CLcs.AIcs.IR
收藏

干草堆工程:面向异构与智能体长上下文评估的上下文工程

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

Georgia Institute of Technology(佐治亚理工学院);Meta AI;University of Illinois Urbana–Champaign(伊利诺伊大学厄巴纳-香槟分校);National University of Singapore(新加坡国立大学)

Mufei Li, Dongqi Fu, Limei Wang, Si Zhang, Hanqing Zeng, Kaan Sancak, Ruizhong Qiu, Haoyu Wang, Xiaoxin He, Xavier Bresson, Yinglong Xia, Chonglin Sun, Pan Li

AI总结:

针对现有长上下文基准忽视噪声与智能体场景的问题,提出干草堆工程及HaystackCraft基准,通过异构检索和智能体操作测试15个模型,发现图重排序可减轻干扰,但先进模型仍面临级联失败。

摘要:

现代长上下文大语言模型(LLM)在合成的“大海捞针”(NIAH)基准测试中表现良好,但此类测试忽视了由有偏检索和智能体工作流产生的噪声上下文。我们认为,干草堆工程对于构建能忠实捕捉关键现实因素(异构有偏检索器的干扰以及智能体工作流中的级联错误)的噪声上下文、以测试模型的长上下文鲁棒性而言是必要的。我们通过HaystackCraft将其实例化,这是一个基于完整英文维基百科超链接网络并包含多跳问题的新NIAH基准。HaystackCraft评估了异构检索策略(如稀疏、稠密、混合和基于图的)如何影响干扰项组成、干草堆排序以及下游LLM性能。HaystackCraft进一步将NIAH扩展到动态、依赖LLM的设置,以模拟智能体操作,其中模型会优化查询、反思其过去的推理,并决定何时停止。使用15个长上下文模型进行的实验表明:(1)虽然更强的稠密检索器可能引入更具挑战性的干扰项,但基于图的重排序同时提高了检索有效性并减轻了更有害的干扰项;(2)在智能体测试中,即使是像Gemini 2.5 Pro和GPT-5这样的先进模型也会因自生成的干扰项而遭受级联失败,或难以执行早期停止。这些结果突显了智能体长上下文推理中持续存在的挑战,并将HaystackCraft确立为未来进展的宝贵测试平台。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑