arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.12157cs.CLcs.AI
收藏

什么使得上下文学习对数学推理有效:一个理论分析

What Makes In-context Learning Effective for Mathematical Reasoning: A Theoretical Analysis

University of Science and Technology of China(中国科学技术大学);State Key Laboratory of Cognitive Intelligence(认知智能国家重点实验室);Hong Kong University of Science and Technology(香港科技大学);University of Illinois at Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校)

Jiayu Liu, Zhenya Huang, Chaokun Wang, Xunpeng Huang, Chengxiang Zhai, Enhong Chen

AI总结:

本文通过理论分析证明上下文示例的语义相似性和推理稳定性影响LLMs数学推理性能,并提出LMS3方法,能自适应选择相关样本并拒绝不适合的示例,在多个基准上实现一致改进。

摘要:

由于上下文学习的能力,大型语言模型(LLMs)在各种数学推理基准测试中表现出令人印象深刻的性能。然而,我们发现少样本示例有时会带来负面性能,并且它们对LLMs推理能力的有效性仍然不可靠。为此,在本文中,我们旨在从理论上分析上下文示例对LLMs推理性能的影响。我们证明了推理效能(通过经验预测损失衡量)可以由面向LLM的语义相似性和示例的推理稳定性来界定,这适用于一次性和少样本场景。基于这一发现,我们提出了一种简单、可泛化且低复杂度的示例选择方法,名为LMS3。它可以自适应地促进为不同LLMs选择最相关的样本,并包含一种新颖的示例拒绝机制,以自动过滤不适合少样本学习的样本。通过在三个代表性基准测试、两个LLM骨干和多个少样本设置上的实验,我们验证了我们的LMS3具有优越性,并在所有数据集上实现了一致的改进,这是现有方法无法实现的。

英文摘要:

Owing to the capability of in-context learning, large language models (LLMs) have shown impressive performance across diverse mathematical reasoning benchmarks. However, we find that few-shot demonstrations can sometimes bring negative performance and their effectiveness on LLMs' reasoning abilities remains unreliable. To this end, in this paper, we aim to theoretically analyze the impact of in-context demonstrations on LLMs' reasoning performance. We prove that the reasoning efficacy (measured by empirical prediction loss) can be bounded by a LLM-oriented semantic similarity and an inference stability of demonstrations, which is general for both one-shot and few-shot scenarios. Based on this finding, we propose a straightforward, generalizable, and low-complexity demonstration selection method named LMS3. It can adaptively facilitate to select the most pertinent samples for different LLMs and includes a novel demonstration rejection mechanism to automatically filter out samples that are unsuitable for few-shot learning. Through experiments on three representative benchmarks, two LLM backbones, and multiple few-shot settings, we verify that our LMS3 has superiority and achieves consistent improvements on all datasets, which existing methods have been unable to accomplish.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑