mlsanityData to 7 Oct 2026

Retrieval is Cheap, Show Me the Code: Executable Multi-Hop Reasoning for Retrieval-Augmented Generation

arXiv 2605.12975 ↗First posted 13 May 2026cs.AIcited by 3

On the map: LLM reasoning → Knowledge- and tool-augmented reasoning

also in 1 more
Abstract (arXiv)

Retrieval-Augmented Generation (RAG) has become a standard approach for knowledge-intensive question answering, but existing systems remain brittle on multi-hop questions, where solving the task requires chaining multiple retrieval and reasoning steps. Key challenges are that current methods represent reasoning through free-form natural language, where intermediate states are implicit, retrieval queries can drift from intended entities, and errors are detected by the same model that produces them making self-reflection an unreliable, ungrounded signal. We observe that multi-hop question answering is a typical form of step-by-step computation, and that this structured process aligns closely with how code-specialized language models are trained to operate. Motivated by this, we introduce pyrag, a framework that reformulates multi-hop RAG as program synthesis and execution. Instead of free-form reasoning trajectories, pyrag represents the reasoning process as an executable Python program over retrieval and QA tools, exposing intermediate states as variables, producing deterministic feedback through execution, and yielding an inspectable trace of the entire reasoning process. This formulation further enables compiler-grounded self-repair and execution-driven adaptive retrieval without any additional training. Experiments on five QA benchmarks (PopQA, HotpotQA, 2WikiMultihopQA, MuSiQue, and Bamboogle) show that pyrag consistently outperforms strong baselines under both training-free and RL-trained settings, with especially large gains on compositional multi-hop datasets. Our code, data and models are publicly available at https://github.com/GasolSun36/PyRAG.

Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Placed in Knowledge- and tool-augmented reasoning, one of 17 directions in LLM reasoning. Builds on 21 of its 50 references that are in the map. First posted on arXiv 13 May 2026.

Builds on

21 of 50 references.

Closest ancestors · 7

Same direction, newest first

  1. 2026TaSR-RAG: Taxonomy-guided Structured Reasoning for Retrieval-Augmented Generation10 Mar
  2. 2025Structure-R1: Dynamically Leveraging Structural Knowledge in LLM Reasoning through Reinforcement Learning16 Oct
  3. 2025Structure-Augmented Reasoning Generation10 Jun
  4. 2025ReSearch: Learning to Reason with Search for LLMs via Reinforcement Learning25 Mar
  5. 2025Search-R1: Training LLMs to Reason and Leverage Search Engines with Reinforcement Learning12 Mar
  6. 2025R1-Searcher: Incentivizing the Search Capability in LLMs via Reinforcement Learning7 Mar
  7. 2023Retrieval-Augmented Generation for Large Language Models: A Survey18 Dec

Other references · 14

  1. 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 8,851
  2. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
  3. 2020Measuring Massive Multitask Language Understandingcited by 7,768
  4. 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,146
  5. 2024Qwen2.5 Technical Reportcited by 4,713
  6. 2024From Local to Global: A Graph RAG Approach to Query-Focused Summarizationcited by 1,411
  7. 2024Qwen2.5-Coder Technical Reportcited by 1,151
  8. 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,057
  9. 2022Demonstrate-Search-Predict: Composing retrieval and language models for knowledge-intensive NLPcited by 316
  10. 2022Binding Language Models in Symbolic Languagescited by 224
  11. 2025ZeroSearch: Incentivize the Search Capability of LLMs without Searchingcited by 203
  12. 2025Hypercube-Based Retrieval-Augmented Generation for Scientific Question-Answeringcited by 3
2 more
  1. 2026Rethinking the Reranker: Boundary-Aware Evidence Selection for Robust Retrieval-Augmented Generationcited by 3
  2. 2026MultiCube-RAG for Multi-hop Question Answeringcited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 3.

3 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Reasoning in Trees: Improving Retrieval-Augmented Generation for Multi-Hop Question Answering
  2. 2025π-CoT: Prolog-Initialized Chain-of-Thought Prompting for Multi-Hop Question-Answering
  3. 2024Plan*RAG: Efficient Test-Time Planning for Retrieval Augmented Generation
  4. 2025ComposeRAG: A Modular and Composable RAG for Corpus-Grounded Multi-Hop Question Answering
  5. 2025Think Straight, Stop Smart: Structured Reasoning for Efficient Multi-Hop RAG
  6. 2025REAP: Enhancing RAG with Recursive Evaluation and Adaptive Planning for Multi-Hop Question Answering
  7. 2026Retrieval--Reasoning Processes for Multi-hop Question Answering: A Four-Axis Design Framework and Empirical Trends
  8. 2026D2F-ReAG: Dynamic Decomposition and Filtering for Multi-Hop Reasoning-Augmented Generation