语言服务器能否为编码代理节省令牌?测量方法与初步研究
原标题:Does a Language Server Save Tokens for Coding Agents? A Measurement Methodology and Preliminary Study
AI 摘要
该研究首次系统测量了编码代理中语言服务器协议(LSP)语义检索与词法检索(如grep)的令牌效率,提出“令牌到成功”指标并设计五臂消融实验。初步实验表明,在符号定位任务中LSP通常消耗更多令牌,仅在引用完整性任务中提高精度而非节省令牌,且对最弱模型Haiku有节省效果。研究建议采用自适应路由策略,根据任务类型和模型能力选择检索工具。
正文节选
Does a Language Server Save Tokens for Coding Agents? A Measurement Methodology and Preliminary Study Abstract Coding agents spend most of their context budget on retrieval: deciding which tokens of a repository must enter the model’s context so it can build a faithful internal model of the task. Two regimes dominate. Lexical retrieval (grep, ripgrep, find) is universal, instant, and zero-setup, but noisy: it cannot distinguish a definition from a call from a mention in a comment. Semantic retri