Skip to main content
QUICK REVIEW

[论文解读] Let's Sample Step by Step: Adaptive-Consistency for Efficient Reasoning and Coding with LLMs

Pranjal Aggarwal, Aman Madaan|arXiv (Cornell University)|May 19, 2023
Topic ModelingComputer Science被引用 3
一句话总结

本文提出 \ours,一种适用于大型语言模型(LLMs)的模型无关、成本高效的采样技术,通过基于狄利克雷分布的多数输出置信度,动态调整推理和代码生成的采样数量。该方法在17个数据集和三种LLM上,将采样预算减少高达7.9倍,且准确率下降不足0.1%,在效率与准确率的权衡上优于固定预算的Self-Consistency方法。

ABSTRACT

A popular approach for improving the correctness of output from large language models (LLMs) is Self-Consistency - poll the LLM multiple times and output the most frequent solution. Existing Self-Consistency techniques always generate a constant number of samples per question, where a better approach will be to non-uniformly distribute the available budget based on the amount of agreement in the samples generated so far. In response, we introduce Adaptive-Consistency, a cost-efficient, model-agnostic technique that dynamically adjusts the number of samples per question using a lightweight stopping criterion. Our experiments over 17 reasoning and code generation datasets and three LLMs demonstrate that Adaptive-Consistency reduces sample budget by up to 7.9 times with an average accuracy drop of less than 0.1%. Our code and data are available at https://www.sample-step-by-step.info

研究动机与目标

  • 解决固定预算Self-Consistency在LLM推理与代码生成中计算成本过高的问题。
  • 开发一种无需微调的、模型无关的推理时技术,以降低采样成本。
  • 根据对正在出现的多数答案的置信度,动态调整每个输入的采样数量。
  • 在显著减少所需LLM生成次数的同时,保持或提升准确率。
  • 为多样化任务提供一种实用、即插即用的高效且可靠的LLM推理解决方案。

提出的方法

  • 该方法使用轻量级停止准则,通过观察到的答案频率上的狄利克雷分布,评估对多数输出的置信度。
  • 基于当前计数,建模当前多数答案在未来采样中仍保持主导地位的概率。
  • 当多数答案保持主导地位的概率超过置信度阈值时触发停止条件,该阈值通过狄利克雷后验的概率积分计算得出。
  • 为提高计算效率,通过聚焦于前两名答案的计数,使用贝塔分布近似,从而简化高维积分。
  • 该算法迭代采样答案,更新计数,并在每次采样后检查停止条件,若置信度足够高则提前停止。
  • 该方法具有模型无关性,无需微调,可适用于任何预训练LLM。
Figure 1: An overview of \ours : Self-Consistency samples a predetermined number of answers, whereas \ours iteratively samples until a lightweight Stopping Criteria, decides to report the majority answer. The figure demonstrates an example where \ours reduces sampling costs by 4x, requiring only ten
Figure 1: An overview of \ours : Self-Consistency samples a predetermined number of answers, whereas \ours iteratively samples until a lightweight Stopping Criteria, decides to report the majority answer. The figure demonstrates an example where \ours reduces sampling costs by 4x, requiring only ten

实验结果

研究问题

  • RQ1动态采样策略是否能在不牺牲准确率的前提下,降低LLM推理与代码生成中的推理成本?
  • RQ2在采样过程中,对多数答案的置信度如何演变?是否可量化以指导提前停止?
  • RQ3在Self-Consistency类方法中,采样成本与准确率之间的最优权衡是什么?
  • RQ4在多样化推理与代码生成任务中,所提方法与固定预算Self-Consistency相比表现如何?
  • RQ5轻量级、模型无关的停止准则是否能实现显著的成本降低,同时保持高可靠性?

主要发现

  • 在 code-davinci-002 上,\ours 相较于 Self-Consistency 将平均采样预算减少3.4倍,且准确率无下降。
  • 在 Vicuna-13B 上,\ours 所需采样次数减少1.9倍,且准确率下降不足0.1%。
  • 在 GPT-3.5-turbo 上,\ours 将采样量减少4.4倍,且准确率下降不足0.2%。
  • 在全部17个数据集和三种模型上,\ours 平均采样预算减少3.3倍,且平均准确率下降不足0.1%。
  • 在固定采样成本下,\ours 在所有任务中均一致实现比 Self-Consistency 更高的准确率,部分任务准确率提升高达5个百分点。
  • 该方法在多样化任务中表现出强鲁棒性,包括数学、常识推理、符号推理和代码生成等。
Figure 3: Impact of Confidence Threshold ( $C_{thresh}$ ) on \ours for GSM-8K : As $C_{thresh}$ varies, the accuracy of \ours increases gradually, eventually plateauing. Initially, the average number of generations also increases gradually but then sharply climbs, reflecting the accuracy-confidence
Figure 3: Impact of Confidence Threshold ( $C_{thresh}$ ) on \ours for GSM-8K : As $C_{thresh}$ varies, the accuracy of \ours increases gradually, eventually plateauing. Initially, the average number of generations also increases gradually but then sharply climbs, reflecting the accuracy-confidence

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。