用推理图提升少样本学习中的示例检索质量
Reasoning Graph Enhanced Exemplars Retrieval for In-Context Learning
- 构建问题求解步骤的图结构,融合语义与逻辑关系
- 在数学和逻辑推理任务上显著优于现有方法
- 适合需要高质量示例检索的少样本学习场景
大型语言模型通过上下文学习(ICL)展现出强大的少样本学习能力。然而,示例的质量对模型表现影响显著。现有方法多关注查询与候选示例的语义相似性,而忽略推理步骤间的逻辑关联。本文提出推理图增强的示例检索方法(RGER):先让模型生成初步回答,将中间求解步骤转化为图结构,再利用图核度量语义与结构相似性,选择最优示例。大量实验表明,结构关系有助于提高查询与示例的对齐效果。RGER在数学与逻辑推理任务上的表现优于当前最先进的检索方法。代码已开源。
原文摘要 · Abstract (English)
Large language models (LLMs) have exhibited remarkable few-shot learning capabilities and unified the paradigm of NLP tasks through the in-context learning (ICL) technique. Despite the success of ICL, the quality of the exemplar demonstrations can significantly influence the LLM's performance. Existing exemplar selection methods mainly focus on the semantic similarity between queries and candidate exemplars. On the other hand, the logical connections between reasoning steps can be beneficial to depict the problem-solving process as well. In this paper, we proposes a novel method named Reasoning Graph-enhanced Exemplar Retrieval (RGER). RGER first quires LLM to generate an initial response, then expresses intermediate problem-solving steps to a graph structure. After that, it employs graph kernel to select exemplars with semantic and structural similarity. Extensive experiments demonstrate the structural relationship is helpful to the alignment of queries and candidate exemplars. The efficacy of RGER on math and logit reasoning tasks showcases its superiority over state-of-the-art retrieval-based approaches. Our code is released at https://github.com/Yukang-Lin/RGER.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。