Lune

AAAI2026Top-tier venue

GraphIC: A Graph-Based In-Context Example Retrieval Model for Multi-Step Reasoning

Jiale Fu, Yaqing Wang, Simeng Han, Jiaming Fan, Xu Yang

Abstract

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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

2 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Tree of Thoughts: Deliberate Problem Solving with Large Language Models cites Language Models are Few-Shot Learners
  • Automatic Chain of Thought Prompting in Large Language Models cites Language Models are Few-Shot Learners
  • Automatic Chain of Thought Prompting in Large Language Models cites Calibrate Before Use: Improving Few-shot Performance of Language Models
  • Graph of Thoughts: Solving Elaborate Problems with Large Language Models cites Tree of Thoughts: Deliberate Problem Solving with Large Language Models
  • Graph of Thoughts: Solving Elaborate Problems with Large Language Models cites Language Models are Few-Shot Learners
  • Calibrate Before Use: Improving Few-shot Performance of Language Models cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. MVI-Bench: A Comprehensive Benchmark for Evaluating Robustness to Misleading Visual Inputs in LVLMsHuiyi Chen, Jiawei Peng, Dehai Min, Changchang Sun et al.ICML 2026 · 18 citations
  2. Aurelia: Test-Time Reasoning Distillation in Audio-Visual LLMsSanjoy Chowdhury, Hanan Gani, Nishit Anand, Sayan Nag et al.ICCV 2025

Builds on31

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Tree of Thoughts: Deliberate Problem Solving with Large Language ModelsShunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran et al.NeurIPS 2023 · 5,068 citations
  3. Calibrate Before Use: Improving Few-shot Performance of Language ModelsZihao Zhao, Eric Wallace, Shi Feng, Dan Klein et al.ICML 2021 · 1,843 citations
  4. Graph of Thoughts: Solving Elaborate Problems with Large Language ModelsMaciej Besta, Nils Blach, Ales Kubicek, Robert Gerstenberger et al.AAAI 2024 · 1,292 citations
  5. Automatic Chain of Thought Prompting in Large Language ModelsZhuosheng Zhang, Aston Zhang, Mu Li, Alex SmolaICLR 2023 · 234 citations

Related papers

  1. Reasoning with Graphs: Structuring Implicit Knowledge to Enhance LLMs ReasoningHaoyu Han, Yaochen Xie, Hui Liu, Xianfeng Tang et al.ACL Findings 2025 · 7 citations
  2. Let's Ask GNN: Empowering Large Language Model for Graph In-Context LearningZhengyu Hu, Yichuan Li, Zhengyu Chen, Jingang Wang et al.EMNLP Findings 2024 · 7 citations
  3. Learning to Select In-Context Demonstration Preferred by Large Language ModelZheng Zhang, Shaocheng Lan, Lei Song, Jiang Bian et al.ACL Findings 2025 · 5 citations
  4. Beyond Examples: Towards Automated Thought-level In-Context Reasoning for Large Language ModelsJinyang Wu, Mingkuan Feng, Shuai Zhang, Feihu Che et al.ACL 2026
  5. Find Tailored Step Example for Next Step: a Targeted Step-wise Retrieval Framework for Guiding LLM ReasoningCheng Yang, Zhenya Huang, Liyang He, Weibo Gao et al.KDD 2026
Dusk over the sea between two cliffs drawn in fine vertical lines