Skip to main content
QUICK REVIEW

[论文解读] AutoMix: Automatically Mixing Language Models

Pranjal Aggarwal, Aman Madaan|arXiv (Cornell University)|Oct 19, 2023
Topic Modeling被引用 5
一句话总结

AutoMix 是一种基于 API 的黑盒方法,通过少样本自验证和元验证器,动态地在小型和大型语言模型之间路由查询,以优化成本-性能权衡。在使用 LLaMA2-13B 和 LLaMA2-70B 的五个上下文相关推理任务上,其单位成本的增量收益最高提升了 89%。

ABSTRACT

Large language models (LLMs) are now available from cloud API providers in various sizes and configurations. While this diversity offers a broad spectrum of choices, effectively leveraging the options to optimize computational cost and performance remains challenging. In this work, we present Automix, an approach that strategically routes queries to larger LMs, based on the approximate correctness of outputs from a smaller LM. Central to Automix are two key technical contributions. First, it has a few-shot self-verification mechanism, which estimates the reliability of its own outputs without requiring extensive training. Second, given that self-verification can be noisy, it employs a POMDP based router that can effectively select an appropriately sized model, based on answer confidence. Experiments across five language models and five challenging datasets show that Automix consistently surpasses strong baselines, reducing computational cost by over 50% for comparable performance.

研究动机与目标

  • 解决在无法访问模型权重、梯度或 logits 的情况下,高效利用多样化黑盒 LLM API 的挑战。
  • 通过识别并避免将无法解决的查询路由到更大模型,降低计算成本。
  • 通过元验证器机制提高自验证的可靠性,后者可能产生噪声。
  • 引入一种新指标——单位成本增量收益(ibc),以量化模型混合的效率。
  • 在数据量有限、难以训练专用验证器的情况下,实现有效的模型切换。

提出的方法

  • 使用少样本提示进行上下文相关蕴含判断,作为自验证机制,基于输入上下文评估答案正确性。
  • 采用基于 POMDP 的元验证器,评估初始自验证的可靠性,降低路由决策中的噪声。
  • 仅当自验证结果不确定或为负面时,才将查询路由至更大的语言模型,依据元验证器的输出。
  • 引入三类路由决策:接受答案(正确)、拒绝并路由(错误/不确定),或标记为无法解决。
  • 完全基于黑盒 API 运行,无需微调、模型权重或 logit 访问。
  • 利用上下文相关验证检测生成答案与输入上下文之间的不一致,无需人工标注数据。
Figure 1 : AutoMix : Given a context (like an article) and a question $q$ , an initial answer ( 1890 AD ) is generated with the smaller language model ( SLM ). The answer is self-verified by the SLM , yielding a noisy verification score. The Meta-Verifier subsequently assesses verifier’s results. Ba
Figure 1 : AutoMix : Given a context (like an article) and a question $q$ , an initial answer ( 1890 AD ) is generated with the smaller language model ( SLM ). The answer is self-verified by the SLM , yielding a noisy verification score. The Meta-Verifier subsequently assesses verifier’s results. Ba

实验结果

研究问题

  • RQ1在无法访问模型权重的情况下,使用上下文相关蕴含的少样本自验证能否可靠评估推理任务中的答案正确性?
  • RQ2在黑盒 LLM 环境中,元验证器在减少不可靠自验证输出噪声方面的有效性如何?
  • RQ3在低数据和高计算场景下,AutoMix 是否能相比基线方法实现更优的成本-性能权衡?
  • RQ4引入“无法解决”类别对计算效率和路由准确性有何影响?
  • RQ5当仅能获得有限数据(如 200 个样本)用于元验证器训练时,AutoMix 相较于训练过的验证器表现如何?

主要发现

  • 与现有基线相比,AutoMix 在五个上下文相关推理数据集上,单位成本的增量收益(ibc)最高提升了 89%。
  • 在训练数据有限(少于 2000 个样本)的情况下,AutoMix 显著优于 FrugalGPT,尽管 FrugalGPT 使用了领域特定训练且验证器成本为零。
  • 元验证器通过优化噪声较大的自验证输出,提升了路由准确性,即使初始验证器较弱也表现出鲁棒性。
  • 少样本自验证能有效检测答案与上下文之间的不一致,尤其在事实性不匹配的情况下(例如在“水生生物”上下文中出现“沙漠动物”)。
  • AutoMix 在低数据场景下保持了强劲性能,显示出在真实世界部署中(标签数据稀缺)的潜力。
  • 引入“无法解决”类别可防止不必要的大模型路由,减少对本质上难以解决查询的计算浪费。
Figure 4 : Left: Aggregated performance vs. cost for different methods on the small and large LLaMa2-13/70b . POMDP based meta-verifier is consistenly in the green region, signifying a higher Incremental Benefit per Cost ( ibc ). Right: The accuracy of the meta-verifier for both POMDP and Verifier-S
Figure 4 : Left: Aggregated performance vs. cost for different methods on the small and large LLaMa2-13/70b . POMDP based meta-verifier is consistenly in the green region, signifying a higher Incremental Benefit per Cost ( ibc ). Right: The accuracy of the meta-verifier for both POMDP and Verifier-S

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。