Chain-of-thought (CoT) prompting can guide language models to engage in complex multi-step reasoning. The quality of provided demonstrations significantly impacts the success of downstream inference tasks. While existing automated methods prioritize accuracy and semantics in these demonstrations, we show that the underlying reasoning patterns play a more crucial role in such tasks. In this paper, we propose Pattern-Aware CoT, a prompting method that considers the diversity of demonstration patterns. By incorporating patterns such as step length and reasoning process within intermediate steps, PA-CoT effectively mitigates the issue of bias induced by demonstrations and enables better generalization to diverse scenarios. We conduct experiments on nine reasoning benchmark tasks using two open-source LLMs. The results show that our method substantially enhances reasoning performance and exhibits robustness to errors. The code will be made publicly available.
翻译:链式思考(CoT)提示可以引导语言模型进行复杂的多步推理。所提供的示例质量显著影响下游推理任务的成功率。虽然现有自动化方法优先考虑这些示例的准确性和语义,但我们表明,其中的底层推理模式在此类任务中起着更为关键的作用。本文提出了一种考虑示例模式多样性的提示方法——模式感知CoT(Pattern-Aware CoT)。通过融入诸如中间步骤中的步长和推理过程等模式,PA-CoT有效缓解了示例引起的偏差问题,并实现了对多样场景的更好泛化。我们使用两个开源大语言模型在九个推理基准任务上进行了实验。结果表明,我们的方法显著提升了推理性能,并展现出对错误的鲁棒性。相关代码将公开发布。