Thinking Forward and Backward: Effective Backward Planning with Large Language Models

Allen Z. Ren, brian ichter, Anirudha Majumdar · Submission to ICLR 2025 · Rejected

TL;DR

Planning problems often feature asymmetric search spaces where searching backward from a goal is vastly simpler than searching forward from the start. However, because Large Language Models (LLMs) are autoregressive next-token predictors, directly asking them to plan backward causes a sharp drop in performance. This paper resolves this tension with Fwd-Flip: an approach that flips the problem definition (swapping initial and goal states), plans forward in the inverted space, flips the plan back, and uses self-verification to boost planning success rates by 4% to 24%.

What Problem Does This Paper Address?

In classical pathfinding and symbolic planning, backward search from the goal is often more efficient than forward search from the initial state—especially when structural bottlenecks exist near the goal. While humans and classical algorithms like bidirectional search regularly exploit this asymmetry, LLM planning research has almost exclusively relied on forward generation.

When researchers simply prompt an LLM to generate plans in reverse order (e.g., outputting actions from goal to initial state), LLMs perform noticeably worse. This stems from their forward autoregressive training and the rarity of reverse-ordered reasoning traces in web text. The authors investigate:

  1. Does directional difficulty (measured via search steps like Breadth-First Search) correlate with LLM planning performance?
  2. How can LLMs exploit backward-search advantages without triggering their inherent backward-generation bias?

Methods

The authors introduce a framework that enables effective backward reasoning while maintaining natural, forward LLM generation:

  1. Problem Flipping: Instead of prompting the model to generate steps in reverse, the authors invert the problem definition itself. The original goal state becomes the new initial state, and the initial state becomes the target goal.
  2. Action Space & Plan Inversion: For directed domains (such as directed graphs), edge relationships are inverted. The LLM generates a forward plan in this flipped space, which is then flipped back: the sequence order is reversed, and inverse actions are applied (e.g., swapping unstack with stack).
  3. Candidate Sampling & Self-Verification (Fwd-Flip): The model samples multiple candidate solutions across both the original forward formulation and the flipped formulation. The candidates are then verified by an LLM-based self-verification step before selecting the final valid or optimal plan.
  4. Zero-Shot Direction Reasoning (Fwd-Flip-Reason): In settings with explicit bottleneck structures, the authors evaluate whether an LLM can analyze the environment structure upfront to decide whether forward or flipped planning requires fewer steps.

Datasets

Experiments were conducted across three standard planning benchmarks:

  • Graph Planning: Finding optimal (shortest) paths on synthetic Erdős–Rényi random graphs (both directed and undirected) of varying node counts ($N \in \{10, 12\}$) and edge probabilities ($\rho \in \{0.2, 0.3\}$).
  • Array Transformation: A probabilistic context-free grammar domain where an integer array is manipulated via reversible operations (reverse, shift_left, shift_right, swap, repeat, and cut).
  • Blocksworld: Evaluated on the task_1_plan_generation split from the PlanBench benchmark (Valmeekam et al., 2024), where models arrange stacks of colored blocks.

Key Insights and Ideas

  • LLMs mirror classical search complexity: When a direction requires fewer Breadth-First Search (BFS) steps, the LLM’s success rate in that direction rises correspondingly. LLM planning difficulty correlates directly with underlying graph search complexity.
  • The backward penalty is real: Across all domains, naive backward prompting consistently underperformed forward planning (e.g., dropping from 82.5% to 74.5% on undirected graphs, and from 39.5% to 20.5% in Blocksworld).
  • Flipping restores parity and adds diversity: Planning forward on the flipped problem matches or exceeds standard forward performance. Combining original and flipped candidates (Fwd-Flip) breaks recurring error loops (such as trying to move blocked objects) by forcing the model to approach the state space from an entirely different angle.
  • LLMs can identify structural bottlenecks: When prompted on undirected graphs, GPT-4o identified the bottlenecked end and selected the easier planning direction 78.5% of the time in zero-shot.

Key Results

Using GPT-4o with up to $M=6$ sampling attempts and self-verification:

  • Directed Graph Planning: In directed graphs ($N=10, \rho=0.3$), forward-only planning achieved 69.5%, naive backward achieved 23.5%, and Fwd-Flip reached 86.5%—a 17% absolute improvement over forward planning.
  • Undirected Graph Planning: Across varying densities, Fwd-Flip reached up to 96.5% accuracy (compared to 89.5% for forward planning).
  • Blocksworld: Fwd-Flip achieved 48.5% accuracy compared to 39.5% for forward planning and 27.0% for naive forward-backward mixing (Fwd-Back).
  • Model Scaling: Evaluating GPT-3.5-Turbo, GPT-4-Turbo, and GPT-4o showed that while smaller models often fail during the self-verification stage, larger models execute both flipping and verification with minimal error.

Limitations and Future Work

  • Domain Invertibility: The flipping strategy assumes actions are readily invertible. In environments with irreversible transitions (e.g., breaking an object or non-deterministic dynamics), flipping the problem is non-trivial or impossible.
  • Goal Asymmetries: In problems with fully specified initial states but partially specified goals (common in Blocksworld), the model must first hallucinate a concrete initial state for the flipped problem, which occasionally introduces errors.
  • Action Reordering Overhead: For directed graphs, the LLM must invert and re-order edge descriptions, which can introduce syntactic parsing errors on weaker models.
  • Future Directions: The authors suggest fine-tuning LLMs directly on bidirectional reasoning traces and adapting bidirectional self-consistency mechanisms to general multi-step reasoning tasks such as mathematical proofs.

Summary updated

BibTeX
@misc{ren2024thinking,
  author = {Allen Z. Ren and brian ichter and Anirudha Majumdar},
  title = {{Thinking Forward and Backward: Effective Backward Planning with Large Language Models}},
  year = {2024},
  eprint = {2411.01790},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.01790},
}
Figure