GRAD:面向高效少样本推理的生成式检索对齐示例采样器
GRAD: Generative Retrieval-Aligned Demonstration Sampler for Efficient Few-Shot Reasoning
AI总结:
本研究提出GRAD动态示例生成方法,通过训练LLM生成输入定制的简洁示例,在资源受限下于数学及多STEM领域任务中优于传统RAG,且小模型生成的示例可引导大模型,为动态少样本学习提供新路径。
摘要:
大语言模型(LLM)在各类任务中表现出色,但其效果往往依赖于所提供上下文的质量。检索增强生成(RAG)通过外部信息丰富提示内容,但它对静态数据库的依赖限制了适应性,还可能产生不相关的示例。本研究提出生成式检索对齐示例器(GRAD),这是一种基于动态示例的方法,通过训练LLM模型生成针对特定输入的简洁示例。通过为每个输入定制示例,本方法比传统RAG方法能提供更好的上下文支持。我们在预算约束下验证了GRAD的优越性,即同时限制每个示例的token用量和最终输出的token用量。仅在数学数据集上训练的GRAD,在Qwen2.5-14B模型上的数学推理与高级STEM问题任务中始终优于强基线模型,凸显了GRAD对物理、化学、计算机科学等分布外(OOD)领域的强泛化能力。此外,我们发现经训练的小模型生成的示例能有效引导更大的目标模型,在保持具竞争力的准确率的同时降低了训练成本。总体而言,本研究提出了一种可扩展的示例生成器模型,为资源受限场景下的动态少样本学习范式迈出了第一步。我们已公开该项目所用代码。
英文摘要:
Large Language Models (LLMs) achieve strong performance across diverse tasks, but their effectiveness often depends on the quality of the provided context. Retrieval-Augmented Generation (RAG) enriches prompts with external information, but its reliance on static databases constrains adaptability and can result in irrelevant demonstrations. In this work, we propose a Generative Retrieval-Aligned Demonstrator (GRAD), a dynamic demonstration-based approach where an LLM model is trained to generate input-specific concise demonstrations. By tailoring demonstrations to each input, our method offers better contextual support than traditional RAG approaches. We demonstrate the superiority of GRAD under budget constraints, where we limit both the number of tokens used per demonstration and the number of tokens used for the final output. Trained solely on a math dataset, GRAD consistently outperforms strong baselines on Qwen2.5-14B across mathematical reasoning and advanced STEM questions, highlighting GRAD's robust generalization to out-of-distribution (OOD) domains such as physics, chemistry, and computer science. Furthermore, we show that demonstrations generated by trained smaller models can effectively guide larger target models, reducing training costs while maintaining competitive accuracy. Overall, this work introduces a scalable demonstration generator model presenting the first step toward a dynamic few-shot learning paradigm in resource-constrained settings. We release the code used for the project.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。