Self-correction has achieved impressive results in enhancing the style and security of the generated output from large language models (LLMs). However, recent studies suggest that self-correction might be limited or even counterproductive in reasoning tasks due to LLMs' difficulties in identifying logical mistakes. In this paper, we aim to enhance the self-checking capabilities of LLMs by constructing training data for checking tasks. Specifically, we apply the Chain of Thought (CoT) methodology to self-checking tasks, utilizing fine-grained step-level analyses and explanations to assess the correctness of reasoning paths. We propose a specialized checking format called "Step CoT Check". Following this format, we construct a checking-correction dataset that includes detailed step-by-step analysis and checking. Then we fine-tune LLMs to enhance their error detection and correction abilities. Our experiments demonstrate that fine-tuning with the "Step CoT Check" format significantly improves the self-checking and self-correction abilities of LLMs across multiple benchmarks. This approach outperforms other formats, especially in locating the incorrect position, with greater benefits observed in larger models. For reproducibility, all the datasets and code are provided in https://github.com/bammt/Learn-to-check.
翻译:自我校正在提升大语言模型生成内容的风格与安全性方面已取得显著成果。然而,近期研究表明,由于大语言模型在识别逻辑错误方面存在困难,自我校正在推理任务中可能效果有限甚至适得其反。本文旨在通过构建检查任务的训练数据来增强大语言模型的自我检查能力。具体而言,我们将思维链方法应用于自我检查任务,利用细粒度的步骤级分析与解释来评估推理路径的正确性。我们提出了一种称为“步骤思维链检查”的专用检查格式。遵循此格式,我们构建了包含详细逐步分析与检查的校正数据集,并通过微调大语言模型来提升其错误检测与校正能力。实验表明,采用“步骤思维链检查”格式进行微调,能显著提升大语言模型在多个基准测试中的自我检查与自我校正能力。该方法优于其他格式,尤其在定位错误位置方面表现突出,且模型规模越大收益越显著。为保障可复现性,所有数据集与代码均已发布于 https://github.com/bammt/Learn-to-check。