RAG-Targeted SFT Improves RAG-Enhanced Math Reasoning
摘要
Mathematical reasoning is a crucial capability of large language models (LLMs). Retrieval-augmented generation (RAG) can assist LLMs in extracting contextual information to enhance their mathematical reasoning skills. However, employing RAG in mathematical tasks is non-trivial, since noisy context and misleading irrelevant examples brought by RAG may negatively impact math performance. In this work, we propose a RAG-targeted Supervised Fine-Tuning (SFT) method that enhances LLMs’ ability to adapt to the RAG reasoning strategies, outperforming standard SFT in downstream mathematical reasoning tasks. Additionally, we observed that the math questions addressed by zero-shot and RAG reasoning strategies vary, prompting us to propose the RAG Inference Trigger that leverages reward models to combine both strengths and decrease inference cost. Experimental results demonstrate that our simple method achieves impressive improvement (10.6% on MATH adopted with LLaMA3.1-8B-Instruct), with reduced RAG-related inference cost.