Learning to Reason Efficiently with A* Post-Training

Andreas Opedal, Francesco Ignazio Re, Abulhair Saparov, Mrinmaya Sachan, Bernhard Schölkopf, Ryan CotterellarXiv 2026

TL;DR

This paper introduces a novel post-training framework that teaches Large Language Models (LLMs) to reason both correctly and efficiently by framing deductive reasoning as an A* search problem over a hypergraph. By training small models (Llama-3.2 1B and 3B) using supervised fine-tuning on A* execution traces and reinforcement learning with A*-informed process rewards, the authors enable these lightweight models to dramatically outperform much larger models like DeepSeek-V3.2 in logical deduction tasks.

What Problem Does This Paper Address?

While LLMs have shown remarkable success in autonomous reasoning tasks via chain-of-thought prompting and reinforcement learning, they remain deeply flawed reasoners. They frequently generate unfaithful reasoning chains, exhibit human-like biases, and suffer from "overthinking"—producing redundant or unnecessary inference steps.

The core issue is that standard post-training paradigms primarily reward final-answer correctness, providing no learning signal to optimize the efficiency or validity of intermediate steps. This inefficiency undermines human trust, reduces interpretability, and presents a severe scalability barrier as problems grow more complex. The authors address this gap by treating natural language deduction as a classical path-finding problem, using the A* search algorithm to guarantee optimally efficient reasoning paths.

Methods

The authors formalize deductive reasoning using logic programming (Datalog), mapping the task to finding a path in a hypergraph (necessary because logical rules often require multiple premises to reach a single conclusion).

To bridge symbolic search and natural language, they translate A* execution traces into "verbalized search traces." Unlike prior work, these traces include backpointers—explicitly stating which premises and rules led to each intermediate conclusion—allowing for full verification of the proof.

A\* search traces vs. Dijkstra's algorithm for deductive reasoning.

They evaluate two primary post-training strategies:

  1. Supervised Fine-Tuning (SFT): The model learns to imitate the exact execution traces (pushes and pops) generated by an algorithmic A* solver.
  2. Reinforcement Learning (RL): Using the Group Relative Policy Optimization (GRPO) algorithm, they guide the model using A*-informed Process Reward Models (PRMs). These rewards score intermediate steps based on the A* priority function $f(c') = w(c') + h(c')$, which balances the cost-so-far ($w$) and a heuristic estimate of the cost-to-go ($h$).

They experiment with two types of heuristics: the true cost-to-go (exact outside weight) and a simpler, imperfect dependency heuristic based on coarsened, unary rule dependencies.

Datasets

The framework was evaluated on two datasets:

  • ProofWriter: A benchmark based on logic programs with a relatively small search space. The authors filtered it to include only problems requiring a proof depth of at least 3.
  • DeepRD: A highly programmable synthetic dataset designed to generate arbitrarily complex logic problems by varying lookahead depth ($L$) and branching factors ($B$), resulting in significantly larger search spaces.

Key Insights and Ideas

  • The Imperfect Heuristic Advantage: On smaller search spaces (ProofWriter), training with the true cost-to-go yields the best results. However, on larger search spaces (DeepRD), models trained with the imperfect dependency heuristic achieved superior accuracy. This suggests that learning an exact optimal heuristic is too difficult in complex spaces, and learning to search with a generalized, imperfect heuristic scales better.
  • The Accuracy-Efficiency Pareto Front: The choice of reward model exposes a fundamental trade-off. Simple correctness rewards maximize final accuracy but lead to inefficient, bloated proofs. Step-count rewards maximize token efficiency but can degrade accuracy. A*-informed rewards strike a crucial balance, populating the Pareto-optimal front.
  • RL Needs a Solid Foundation: Reinforcement learning provided massive boosts on ProofWriter but failed to improve performance on DeepRD when the initial SFT reference policy was weak. This highlights that RL-guided search optimization is highly dependent on a baseline policy that can already find valid search trajectories.

Key Results

  • Small Models, Big Performance: Prior to post-training, Llama-3.2-1B and 3B models achieved ~0% accuracy on these formal logic tasks. After A* post-training, Llama-3.2-3B-Instruct achieved up to 93.5% accuracy and 97.5% efficiency on ProofWriter.
  • Beating the Giants: The post-trained 3B model comfortably outperformed DeepSeek-V3.2 evaluated via in-context learning (which achieved 79.6% accuracy and 94.3% efficiency).
Performance of SFT-finetuned models compared to DeepSeek-V3.2.

Limitations and Future Work

The primary limitation is the reliance on synthetic datasets where the underlying formal logic program and ground-truth search graph are fully known. Real-world natural language reasoning is rarely structured so cleanly.

As a next step, the authors suggest training a neural Process Reward Model directly on these algorithmic A* traces. A neural PRM could learn to approximate A* priority scores for arbitrary, unstructured natural language tasks where a symbolic prover cannot be easily implemented, opening the door to generalized, efficient system-2 reasoning in LLMs.

Summary updated

BibTeX
@misc{opedal2026learning,
  author = {Andreas Opedal and Francesco Ignazio Re and Abulhair Saparov and Mrinmaya Sachan and Bernhard Schölkopf and Ryan Cotterell},
  title = {{Learning to Reason Efficiently with A* Post-Training}},
  year = {2026},
  eprint = {2605.24597},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.24597},
}
Figure