In-context learning (ICL) has been instrumental in adapting Large Language Models (LLMs) to downstream tasks using correct input-output examples. Recent advances have attempted to improve model performance through principles derived from mistakes, yet these approaches suffer from lack of customization and inadequate error coverage. To address these limitations, we propose Retrieved In-Context Principles (RICP), a novel teacher-student framework. In RICP, the teacher model analyzes mistakes from the student model to generate reasons and insights for preventing similar mistakes. These mistakes are clustered based on their underlying reasons for developing task-level principles, enhancing the error coverage of principles. During inference, the most relevant mistakes for each question are retrieved to create question-level principles, improving the customization of the provided guidance. RICP is orthogonal to existing prompting methods and does not require intervention from the teacher model during inference. Experimental results across seven reasoning benchmarks reveal that RICP effectively enhances performance when applied to various prompting strategies.
翻译:上下文学习(In-context Learning,ICL)通过使用正确的输入-输出示例,在使大语言模型(LLMs)适应下游任务方面发挥了关键作用。近期研究尝试通过从错误中推导出的原则来提升模型性能,但这些方法存在缺乏定制化以及错误覆盖不足的问题。为应对这些局限,我们提出了检索式上下文原则(Retrieved In-Context Principles,RICP),一种新颖的师生框架。在RICP中,教师模型分析学生模型的错误,生成用于预防类似错误的原因与洞见。这些错误根据其根本原因进行聚类,以开发任务级原则,从而提升原则的错误覆盖率。在推理过程中,为每个问题检索最相关的错误以创建问题级原则,从而提高所提供指导的定制化程度。RICP与现有提示方法正交,且在推理过程中无需教师模型的干预。在七个推理基准测试上的实验结果表明,RICP在应用于多种提示策略时能有效提升性能。