用思维图谱提升复杂推理的示例检索效果
GraphIC: A Graph-Based In-Context Example Retrieval Model for Multi-Step Reasoning
- 构建思维图谱,显式建模推理步骤与依赖关系
- 在数学、代码生成等任务上超越10种基线方法
- 适合需要深度逻辑推理的AI应用开发者
上下文学习(ICL)通过引入示范示例提升大语言模型性能,但其效果高度依赖示例质量。现有方法多采用文本嵌入计算语义相似度,但在多步推理任务中易引入偏差,因文本嵌入包含无关语义信息且缺乏深层推理结构。为此,本文提出GraphIC,一种基于图的上下文示例检索模型,利用推理感知表示和专用相似度度量。GraphIC首先为候选示例和查询构建思维图——有向节点属性图,显式建模推理步骤及其依赖关系,过滤表面语义,保留核心推理过程。随后,采用针对此类图设计的新相似度度量,捕捉序列推理模式及示例间的不对称性。在数学推理、代码生成和逻辑推理任务上的全面评估表明,GraphIC优于10种基线方法。结果凸显了推理感知检索在ICL中的重要性,为提升大模型在多步推理场景下的表现提供了稳健方案。
原文摘要 · Abstract (English)
In-context learning (ICL) enhances large language models (LLMs) by incorporating demonstration examples, yet its effectiveness heavily depends on the quality of selected examples. Current methods typically use text embeddings to measure semantic similarity, which often introduces bias in multi-step reasoning tasks. This occurs because text embeddings contain irrelevant semantic information and lack deeper reasoning structures. To address this, we propose GraphIC, a graph-based retrieval model that leverages reasoning-aware representation and specialized similarity metric for in-context example retrieval. GraphIC first constructs thought graphs-directed, node-attributed graphs that explicitly model reasoning steps and their dependencies-for candidate examples and queries. This approach filters out superficial semantics while preserving essential reasoning processes. Next, GraphIC retrieves examples using a novel similarity metric tailored for these graphs, capturing sequential reasoning patterns and asymmetry between examples. Comprehensive evaluations across mathematical reasoning, code generation, and logical reasoning tasks demonstrate that GraphIC outperforms 10 baseline methods. Our results highlight the importance of reasoning-aware retrieval in ICL, offering a robust solution for enhancing LLM performance in multi-step reasoning scenarios.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。