图书馆员智能体:训练大语言模型策划能预判未来查询的长上下文工作空间

·

研究论文 · 2026/10/20

大型语言模型(LLM)在长文档上下文推理方面仍面临挑战。标准检索方法本质上是反应式的,在推理时使智能体在复杂的跨文档推理中成为瓶颈,而知识图谱等预计算结构往往因依赖僵化启发式而效果不佳。为此,我们提出让智能体执行预期性定向整理:学习在推理前主动重组非结构化语料库,以高效服务未来多样化的查询。基于现代智能体框架(如Claude Code)中的一个关键不对称性——LLM智能体擅长导航现有文件系统以解决即时任务,但很少被训练构建可复用的工作空间以供未来使用——我们引入了Librarian Agents框架。在该框架中,构建者智能体将原始文档转换为由合成文件和引用链接组成的分层文件系统,形成面向下游回答智能体的定制工作空间。我们将工作空间构建建模为马尔可夫决策过程,并通过强化学习优化构建者策略,以直接最大化下游回答准确率。实验表明,Librarian Agents在BrowseComp-Plus上比最强的检索和预计算基线高出33个百分点,在重复查询中摊销前期构建成本,并在BRIGHT上零样本泛化到未见领域,平均准确率提升31点。

该论文提出了一种新颖的预期性整理方法,通过强化学习训练LLM构建可复用工作空间,显著提升长上下文推理性能,并展示了跨领域泛化能力,对智能体系统和长文档处理有重要启示。

Reasoning over long document contexts remains a challenge for large language models (LLMs). Standard retrieval methods are inherently reactive, bottlenecking agents with complex, cross-document reasoning at inference time, while precomputed structures like knowledge graphs often fall short because they rely on rigid heuristics. Instead, can we allow agents to perform anticipatory directed curation: learning to proactively reorganize unstructured corpora prior to inference to efficiently serve diverse future queries. We build on a key asymmetry in modern agentic harnesses (e.g., Claude Code): while LLM agents are adept at navigating existing filesystems to solve an immediate task, they are rarely trained to construct reusable workspaces for future use. To instantiate this capability, we introduce Librarian Agents, a framework in which a builder agent transforms raw documents into a hierarchical filesystem of synthetic files and reference links, which forms a workspace tailored for a downstream answering agent. We formulate workspace construction as a Markov decision process and optimize the builder policy via reinforcement learning to directly maximize downstream answering accuracy. Empirically, Librarian Agents outperforms the strongest retrieval and precomputation baselines by 33 percentage points on BrowseComp-Plus, amortizes upfront construction costs across repeated queries, and generalizes zero-shot to unseen domains on BRIGHT with a 31-point average accuracy improvement.

阅读原文

参与讨论