arXiv:2604.07494cs.SEcs.AI2026-04被引 2

用代码健康度自动分配任务到合适模型,省钱又不降质。

Triage: Routing Software Engineering Tasks to Cost-Effective LLM Tiers via Code Quality Signals

  • 根据代码健康度和任务信息,动态选择最便宜的模型执行任务。
  • 在SWE-bench Lite上实现最高节省60%推理成本,质量不下降。
  • 适合想优化AI编程工具成本的研发团队和工程管理者。

背景:当前AI编程代理将所有任务都交给昂贵的前沿大模型,即使许多任务很常规。目标:提出Triage框架,利用代码健康度(软件可维护性指标)作为路由信号,将每个任务分配给能通过相同验证门限的最廉价模型层级。方法:定义轻量、标准、重型三类模型层级(如Haiku、Sonnet、Opus),基于预计算的代码健康子因子与任务元数据进行路由。设计评估实验,在SWE-bench Lite(300个任务,覆盖三类模型层级)上对比三种策略:启发式阈值、训练好的机器学习分类器、完美后见之明的基准。结果:理论推导出两个可验证条件:轻量级模型在健康代码上的通过率需超过跨层级成本比,且代码健康度对所需层级的判别力至少达到小效应量($ ilde{p} \≥ 0.56$)。结论:Triage将代码健康度转化为可操作的模型选择信号,提供严谨的评估协议,识别驱动路由决策的关键子因子。

原文摘要 · Abstract (English)

Context: AI coding agents route every task to a single frontier large language model (LLM), paying premium inference cost even when many tasks are routine. Objectives: We propose Triage, a framework that uses code health metrics -- indicators of software maintainability -- as a routing signal to assign each task to the cheapest model tier whose output passes the same verification gate as the expensive model. Methods: Triage defines three capability tiers (light, standard, heavy -- mirroring, e.g., Haiku, Sonnet, Opus) and routes tasks based on pre-computed code health sub-factors and task metadata. We design an evaluation comparing three routing policies on SWE-bench Lite (300 tasks across three model tiers): heuristic thresholds, a trained ML classifier, and a perfect-hindsight oracle. Results: We analytically derived two falsifiable conditions under which the tier-dependent asymmetry (medium LLMs benefit from clean code while frontier models do not) yields cost-effective routing: the light-tier pass rate on healthy code must exceed the inter-tier cost ratio, and code health must discriminate the required model tier with at least a small effect size ($\hat{p} \geq 0.56$). Conclusion: Triage transforms a diagnostic code quality metric into an actionable model-selection signal. We present a rigorous evaluation protocol to test the cost--quality trade-off and identify which code health sub-factors drive routing decisions.

代码生成成本优化模型路由

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。