结构化上下文工程用于文件原生代理系统:评估模式准确性、格式有效性及大规模多文件导航
Structured Context Engineering for File-Native Agentic Systems: Evaluating Schema Accuracy, Format Effectiveness, and Multi-File Navigation at Scale
AI总结:
本研究评估了文件原生代理系统中结构化上下文工程的准确性、格式有效性及多文件导航,发现模型能力是影响性能的关键因素,架构选择需根据模型能力调整。
摘要:
大型语言模型代理越来越多地通过编程接口操作外部系统,但从业者缺乏关于如何结构化这些代理所消费的上下文的实证指导。使用SQL生成作为程序代理操作的代理,我们对结构化数据的上下文工程进行了系统研究,包括9,649次实验,涵盖11个模型、4种格式(YAML、Markdown、JSON、基于令牌的对象记法[TOON])以及从10到10,000张表的模式。我们的发现挑战了常见的假设。首先,架构选择是模型依赖的:基于文件的上下文检索在前沿级模型(Claude、GPT、Gemini)中提高准确性(+2.7%,p=0.029),但在开源模型中效果混杂(汇总-7.7%,p<0.001),且不同模型的表现差异显著。其次,格式对汇总准确性无显著影响(卡方=2.45,p=0.484),但个别模型,尤其是开源模型,表现出格式特定的敏感性。第三,模型能力是主导因素,前沿级与开源级之间有21个百分点的准确性差距,远超任何格式或架构的影响。第四,通过领域划分的模式,文件原生代理可扩展到10,000张表,同时保持高导航准确性。第五,文件大小不影响运行效率:紧凑或新颖的格式可能因grep输出密度和模式不熟悉而产生令牌开销,其幅度取决于模型能力。这些发现为从业者在结构化系统上部署LLM代理提供了实证指导,证明架构决策应根据模型能力定制,而非假设通用最佳实践。
英文摘要:
Large Language Model agents increasingly operate external systems through programmatic interfaces, yet practitioners lack empirical guidance on how to structure the context these agents consume. Using SQL generation as a proxy for programmatic agent operations, we present a systematic study of context engineering for structured data, comprising 9,649 experiments across 11 models, 4 formats (YAML, Markdown, JSON, Token-Oriented Object Notation [TOON]), and schemas ranging from 10 to 10,000 tables. Our findings challenge common assumptions. First, architecture choice is model-dependent: file-based context retrieval improves accuracy for frontier-tier models (Claude, GPT, Gemini; +2.7%, p=0.029) but shows mixed results for open source models (aggregate -7.7%, p<0.001), with deficits varying substantially by model. Second, format does not significantly affect aggregate accuracy (chi-squared=2.45, p=0.484), though individual models, particularly open source, exhibit format-specific sensitivities. Third, model capability is the dominant factor, with a 21 percentage point accuracy gap between frontier and open source tiers that dwarfs any format or architecture effect. Fourth, file-native agents scale to 10,000 tables through domain-partitioned schemas while maintaining high navigation accuracy. Fifth, file size does not predict runtime efficiency: compact or novel formats can incur a token overhead driven by grep output density and pattern unfamiliarity, with the magnitude depending on model capability. These findings provide practitioners with evidence-based guidance for deploying LLM agents on structured systems, demonstrating that architectural decisions should be tailored to model capability rather than assuming universal best practices.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。