用推理时蒸馏让大模型代理更便宜,不需调参或微调。
Inference-Time Distillation: Cost-Efficient Agents Without Fine-Tuning or Manual Prompt Engineering
- 用教师模型生成示范,学生模型通过检索示例推理。
- 在ALFWorld上成本降2.5倍,准确率仍达教师水平。
- 无需人工调参或训练,适合快速迭代的开发场景。
大规模部署大模型代理通常面临质量与成本的权衡。现有降本方法均牺牲灵活性:提示工程易出错且迭代慢,微调需数天训练且设计固定,难以适应快速迭代和时效性任务。本文展示,利用动态上下文学习与自一致性级联等推理时技术,可在不损失灵活性的前提下,将成本-精度权衡曲线向更优方向移动。实践者只需在小规模任务集上运行教师模型收集示范,即可立即部署低成本学生模型处理剩余任务。每一步中,系统检索相关教师示范作为上下文示例;当多个学生采样结果一致则继续,分歧时回退至教师。该方法无需提示工程或训练。在ALFWorld上,成本从0.059降至0.024/回合(2.5倍降低),准确率保持不变;在AppWorld上,成本降低3.5倍,恢复教师准确率的79%。实证分析为教师数据库大小、示范集规模、检索策略及级联阈值等设计选择提供指导,揭示了无需牺牲开发速度即可调控成本性能的推理时杠杆。
原文摘要 · Abstract (English)
Deploying LLM agents at scale typically requires choosing between quality and cost. Existing cost-reduction approaches fail to preserve agility: the ability to iterate rapidly without human time bottlenecks. Prompt engineering is brittle and slows iteration, while fine-tuning requires multi-day training and commitment to fixed designs; both are impractical for iterative workflows and time-sensitive batch jobs. We demonstrate that established inference-time techniques--dynamic in-context learning and self-consistency cascades--can be leveraged to shift the cost-accuracy Pareto frontier while preserving agility. Practitioners run the teacher on a small task subset to collect demonstrations, then immediately deploy a cheaper student on the remainder. At each step, the system retrieves relevant teacher demonstrations as in-context examples. When multiple student samples agree, we proceed; when they diverge, we fall back to the teacher. This requires no prompt engineering or training. On ALFWorld, we match teacher accuracy at 2.5x lower cost (0.059 to 0.024 per episode). On AppWorld, we achieve 3.5x cost reduction while recovering 79% of teacher accuracy. Our empirical analyses provide guidance on key design choices: teacher database size, demonstration set size, retrieval strategy, and cascade thresholds. These analyses highlight inference-time levers for navigating cost-performance tradeoffs without sacrificing human development speed.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。