In-context learning (ICL) with large language models (LLMs) has become the modern tools of choice for many natural language processing tasks. However, how the text style of in-context examples influences the performance of LLMs still remains under-explored. This paper presents a novel and effective approach, named \textbf{AlignedCoT}, to improve the reasoning capability of LLMs by aligning the in-context examples with the native style of LLMs.''Native'' refers to the inherent characteristic of LLMs which can be probed by zero-shot scenarios.AlignedCoT is widely applicable to ICL methods, making it easy to combine with state-of-the-art techniques to further improve the LLMs' performance. We conduct extensive and comprehensive experiments on several benchmarks on mathematical question-answering, common-sense reasoning, and text understanding. The empirical results demonstrate that our AlignedCoT significantly improves performance over the carefully handcrafted demonstrations. Specifically, with AlignedCoT, we observe an average +3.2\% improvement for \texttt{gpt-3.5-turbo} compared to the carefully handcrafted CoT on multi-step reasoning benchmarks.Furthermore, we use AlignedCoT to rewrite the CoT text style in the training set, which improves the performance of Retrieval Augmented Generation by 3.6\%.The source code and dataset is available at https://github.com/yangzhch6/AlignedCoT
翻译:上下文学习(In-context learning, ICL)与大型语言模型(LLMs)已成为处理许多自然语言处理任务的现代首选工具。然而,上下文示例的文本风格如何影响LLMs的性能仍鲜有探索。本文提出一种新颖且有效的方法,名为**AlignedCoT**,通过将上下文示例与LLMs的原生风格对齐来提升其推理能力。“原生”指可通过零样本场景探测的LLMs固有特性。AlignedCoT广泛适用于ICL方法,易于与最先进技术结合以进一步提升LLMs性能。我们在数学问答、常识推理和文本理解等多个基准上进行了广泛而全面的实验。实证结果表明,AlignedCoT相较于精心设计的人工示例显著提升了性能。具体而言,在多步推理基准上,使用AlignedCoT后,`gpt-3.5-turbo`的平均性能较精心设计的CoT提升了+3.2%。此外,我们利用AlignedCoT重写训练集中的CoT文本风格,使检索增强生成(Retrieval Augmented Generation)的性能提升了3.6%。源代码和数据集可从https://github.com/yangzhch6/AlignedCoT获取。