Librarian Agents:用强化学习让 LLM 提前整理文档工作区
Librarian Agents: Training LLMs to Curate Long-Context Workspaces that Anticipate Future Queries
Meta 这篇论文把文档整理变成了 RL 训练任务,builder agent 提前建好文件系统,BrowseComp-Plus 上比检索基线高 33 个点,做长文档问答的可以看看。
Meta 的论文提出 Librarian Agents 框架:一个 builder agent 把原始文档整理成层次化的合成文件系统,供下游回答 agent 检索使用。研究者将工作区构建建模为马尔可夫决策过程,通过强化学习直接优化下游回答准确率。在 BrowseComp-Plus 基准上,该方法比最强检索和预计算基线高出 33 个百分点;在 BRIGHT 基准上零样本迁移到未见领域,平均准确率提升 31 点。核心思路是利用 Claude Code 类 agent 框架的不对称性:agent 擅长浏览现有文件系统,却很少被训练去构建可复用的工作区。
Librarian Agents: Training LLMs to Curate Long-Context Workspaces that Anticipate Future Queries
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.