In this paper, we present a novel approach for improving the quality and consistency of generated outputs from large-scale pre-trained language models (LLMs). Self-consistency has emerged as an effective approach for prompts with fixed answers, selecting the answer with the highest number of votes. In this paper, we introduce a generalized framework for self-consistency that extends its applicability beyond problems that have fixed-answer answers. Through extensive simulations, we demonstrate that our approach consistently recovers the optimal or near-optimal generation from a set of candidates. We also propose lightweight parameter-free similarity functions that show significant and consistent improvements across code generation, autoformalization, and summarization tasks, even without access to token log probabilities. Our method incurs minimal computational overhead, requiring no auxiliary reranker models or modifications to the existing model.
翻译:本文提出了一种新方法,用于提升大规模预训练语言模型(LLMs)生成输出的质量与一致性。自我一致性方法在固定答案提示词场景中已被证明有效,通过选择得票最高的答案来提升效果。本文则引入了一种广义的自我一致性框架,将其适用性扩展至无固定答案的问题。通过大量仿真实验,我们证明该方法能够从候选集合中稳定地恢复最优或近乎最优的生成结果。此外,我们提出了轻量级无参数相似度函数,在代码生成、自动形式化与摘要生成任务中展现了显著且一致的改进效果,且无需获取词元对数概率。该方法仅需极低的计算开销,无需额外的重排序模型或对现有模型进行修改。