AlignedCoT: Prompting Large Language Models via Native-Speaking Demonstrations

Zhicheng Yang,Yinya Huang,Jing Xiong,Liang Feng,Xiaodan Liang,Yiwei Wang,Jing Tang
2024-10-07
Abstract:Large Language Models prompting, such as using in-context demonstrations, is a mainstream technique for invoking LLMs to perform high-performance and solid complex reasoning (e.g., mathematical reasoning, commonsense reasoning), and has the potential for further human-machine collaborative scientific findings. However, current LLMs are delicate and elusive in prompt words and styles. And there is an unseen gap between LLM understanding and human-written prompts. This paper introduces Alignedcot, an LLM-acquainted prompting technique that includes proficient ``native-speaking'' in in-context learning for the LLMs. Specifically, it achieves consistent and correct step-wise prompts in zero-shot scenarios by progressively probing, refining, and formatting the LLM chain of thoughts so that free from handcrafted few-shot demonstrations while maintaining the prompt quality. We conduct experiments on mathematical reasoning and commonsense reasoning. We find that LLMs with Alignedcot perform significantly superior to them with human-crafted demonstrations. We further apply Alignedcot for rewriting the GSM8K training set, resulting in a GSM8K-Align dataset. We observe its benefits for retrieval augmented generation. The code and data can be found at <a class="link-external link-https" href="https://github.com/yangzhch6/AlignedCoT" rel="external noopener nofollow">this https URL</a>.
Artificial Intelligence,Machine Learning
What problem does this paper attempt to address?
The problem this paper attempts to address is the sensitivity and inconsistency of current large language models (LLMs) to prompts and styles, leading to unstable performance in complex reasoning tasks. Specifically, existing Chain of Thought (CoT) prompting methods often rely on manually written examples, which require LLMs to mimic the style of these examples rather than reasoning in their own natural way. This inconsistency can result in LLMs performing below expectations. To solve this problem, the paper proposes a new prompting technique—**AlignedCoT**, which aims to enable LLMs to reason in their "native style" through natural language generation in zero-shot scenarios. This method not only enhances the reasoning ability of LLMs but also reduces the reliance on manually written examples, thereby improving the model's generalization ability and performance. ### Main Contributions: 1. **Proposed a new prompting method**: **AlignedCoT**, which aligns the CoT text style in traditional few-shot examples with the natural style of LLMs to improve their reasoning ability. 2. **Validated effectiveness through extensive experiments**: Experimental results show that **AlignedCoT** significantly improves the performance of LLMs across multiple datasets and can be combined with other context learning methods to produce positive synergistic effects. 3. **Generated an improved dataset**: **GSM8K-Align**, by rewriting the GSM8K training set, further enhancing the performance of retrieval-augmented generation methods. ### Solution: 1. **Explore the natural style of LLMs**: In zero-shot scenarios, use each question to query the LLM, generating its natural style CoT. 2. **Correct the generated CoT**: Identify and correct errors in the generated CoT to ensure the accuracy of the reasoning steps. 3. **Unify the format of the generated CoT**: Format the generated CoT, including the format of the final answer and the solution steps, to make it consistent. Through these steps, **AlignedCoT** can generate high-quality CoT without relying on manually written examples, thereby improving the performance of LLMs in multi-step reasoning tasks.