arXivDaily arXiv每日学术速递 周一至周五更新
​通知:联邦节假日调休:哥伦布日 / 原住民日(Columbus Day / Indigenous Peoples' Day),今日(13日)无更新。
arXiv 2410.02167cs.LGcs.CL

训练非线性Transformer进行思维链推理:理论泛化分析

Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysis

Rensselaer Polytechnic Institute(罗切斯特理工学院);The Chinese University of Hong Kong(香港中文大学);IBM Research(IBM研究院)

Hongkang Li, Songtao Lu, Pin-Yu Chen, Xiaodong Cui, Meng Wang

AI总结:

本研究首次从理论上分析了训练非线性注意力Transformer以获得思维链推理能力所需的样本与迭代条件,证明了其在分布偏移的未见任务上的泛化性,并刻画了噪声示例下仍能准确推理的条件,实验验证了理论结果。

摘要:

思维链(Chain-of-Thought,CoT)是一种高效的提示方法,通过使用包含多个中间步骤的多个示例来增强查询,从而赋予大型语言模型推理能力。尽管经验上取得了成功,但关于如何训练Transformer以获得CoT能力的理论理解仍较少被探索。这主要是由于分析非线性注意力模型上的非凸优化所涉及的技术挑战。据我们所知,这项工作首次从理论上研究了训练具有非线性注意力的Transformer以获得CoT泛化能力,使得当输入通过新任务的示例增强时,所得模型能够在未见过的任务上进行推理。我们首先量化了训练Transformer模型以达到CoT能力所需的训练样本和迭代次数。然后,我们证明了其在具有分布偏移的测试数据上对未见任务的CoT泛化的成功性。此外,我们从理论上刻画了即使所提供的推理示例包含噪声且并非总是准确时,CoT仍能产生准确推理输出的条件。相比之下,上下文学习(In-Context Learning,ICL)可被视为没有中间步骤的单步CoT,在CoT能够提供准确输出时,ICL可能无法提供准确输出。这些理论发现通过实验得到了验证。

英文摘要:

Chain-of-Thought (CoT) is an efficient prompting method that enables the reasoning ability of large language models by augmenting the query using multiple examples with multiple intermediate steps. Despite the empirical success, the theoretical understanding of how to train a Transformer to achieve the CoT ability remains less explored. This is primarily due to the technical challenges involved in analyzing the nonconvex optimization on nonlinear attention models. To the best of our knowledge, this work provides the first theoretical study of training Transformers with nonlinear attention to obtain the CoT generalization capability so that the resulting model can inference on unseen tasks when the input is augmented by examples of the new task. We first quantify the required training samples and iterations to train a Transformer model towards CoT ability. We then prove the success of its CoT generalization on unseen tasks with distribution-shifted testing data. Moreover, we theoretically characterize the conditions for an accurate reasoning output by CoT even when the provided reasoning examples contain noises and are not always accurate. In contrast, in-context learning (ICL), which can be viewed as one-step CoT without intermediate steps, may fail to provide an accurate output when CoT does. These theoretical findings are justified through experiments.

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

↑