Non-myopic Generation of Language Models for Reasoning and Planning

Chang Ma, Haiteng Zhao, Junlei Zhang, Junxian He, Lingpeng Kong · DOI

Abstract

Large Language Models (LLMs) typically generate text autoregressively, selecting the most probable next token based on immediate history. This "myopic" approach often leads to planning failures where early, locally plausible choices result in irreversible errors. We introduce Predictive-Decoding, a training-free method that applies Model Predictive Control (MPC) to LLM generation. By sampling potential future trajectories and re-weighting current choices based on their long-term viability, Predictive-Decoding bridges the "Myopic Gap." Our results show significant improvements across math, coding, and robotic planning tasks, outperforming traditional search methods like MCTS with 50% fewer FLOPS.

1. Introduction

The fundamental limitation of current LLM generation is its greedy, autoregressive nature. While effective for local coherence, this mechanism struggles with complex reasoning where a single early mistake can derail an entire solution. This phenomenon, termed "myopia," is particularly prevalent in multi-step planning. For instance, in a task requiring an agent to retrieve a specific item, the model might greedily pick up a similar-looking object, only to realize several steps later that it cannot complete the goal. Research indicates that models like Llama-3-8B exhibit such myopic failures in over 60% of reasoning tasks.

2. The Myopic Gap and Delayed Clarity

A critical insight of this work is the "Myopic Gap"—the discrepancy between a model's local token preference and the globally optimal path. Analysis of the GSM8K dataset reveals that 76.5% of errors are rooted in this short-sightedness. Interestingly, the authors identify a property of "delayed clarity": while an LLM may not recognize a mistake the moment it is made, the error becomes obvious to the model's own internal evaluation logic after 3–4 additional steps of generation. Predictive-Decoding exploits this lag by looking into the future to inform the present.

3. Methodology: Predictive-Decoding

Predictive-Decoding transforms LLM generation from a simple greedy process into a trajectory optimization problem using two core components:

  1. Model Predictive Control (MPC): The model generates a set of "foresight trajectories" $T_0$ steps into the future. It evaluates these outcomes to determine which current action is most likely to lead to success.
  2. Sampling-Importance-Resampling (SIR): To implement this without retraining, the framework uses an energy-based approach. It samples $K$ parallel futures, calculates a "Global Correctness" score for each, and rescales the probability of the current step accordingly.
Comparison of Myopic Reasoning vs. Predictive Decoding. Predictive Decoding evaluates future trajectories to avoid early, irreversible errors.

To maintain computational efficiency, the authors introduce Recycling Trajectory Rollouts. By storing and reusing overlapping reasoning paths in a memory pool, the system significantly reduces the overhead of generating new tokens for every lookahead step.

4. Experimental Evaluation

The framework was tested across three primary domains:

  • Mathematics: GSM8K and MATH benchmarks.
  • Coding: HumanEval and MBPP.
  • Agents: AlfWorld (virtual household) and PDDL (robotic stacking).

4.1 Performance and Efficiency

Predictive-Decoding achieved a 7.2% accuracy boost on GSM8K and a 4.3% increase on MATH using Llama-3-8B. The most dramatic gains were seen in the AlfWorld agent task, where it outperformed the ReAct baseline by 25.3%.

Crucially, the method is more efficient than traditional search algorithms. On GSM8K, it outperformed Monte Carlo Tree Search (MCTS) by 2.4% while requiring 50% fewer FLOPS. This suggests an "inference scaling law" where Predictive-Decoding offers a superior Pareto trade-off between compute and performance compared to existing state-of-the-art baselines.

5. Discussion and Limitations

Beyond raw performance, Predictive-Decoding demonstrates high robustness to prompt engineering. Vanilla LLMs often suffer significant performance drops when instructions are brief; however, the lookahead mechanism allows Predictive-Decoding to maintain high accuracy even with minimal in-context examples.

Despite these strengths, the method relies on the LLM's ability to act as an accurate "world model." In complex agent environments, if the model hallucinates the state of the world during its foresight steps, the resulting evaluation will be flawed. Furthermore, while highly effective for discrete reasoning, its application to free-form creative writing remains a subject for future study.

6. Conclusion

Predictive-Decoding addresses the inherent myopia of autoregressive LLMs by shifting the focus from next-token prediction to trajectory optimization. By leveraging the model's own ability to critique its future paths, the method provides a scalable, training-free path toward more reliable and robust AI reasoning and planning.

Summary updated

BibTeX
@inproceedings{ma2025non,
  author = {Chang Ma and Haiteng Zhao and Junlei Zhang and Junxian He and Lingpeng Kong},
  title = {{Non-myopic Generation of Language Models for Reasoning and Planning}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=OoNazl6T7D},
}
Figure