Abstract
Remarkable progress has been made on automated reasoning with natural text, by using Language Models (LMs) and methods such as Chain-of-Thought and Selection-Inference. These techniques search for proofs in the forward direction from axioms to the conclusion, which suffers from a combinatorial explosion of the search space, and thus high failure rates for problems requiring longer chains of reasoning. The classical automated reasoning literature has shown that reasoning in the backward direction (i.e. from the intended conclusion to supporting axioms) is significantly more efficient at proof-finding. Importing this intuition into the LM setting, we develop a Backward Chaining algorithm, called LAMBADA, that decomposes reasoning into four sub-modules. These sub-modules are simply implemented by few-shot prompted LM inference. We show that LAMBADA achieves sizable accuracy boosts over state-of-the-art forward reasoning methods on challenging logical reasoning datasets, particularly when deep and accurate proof chains are required.
Introduction
While Large Language Models (LLMs) have demonstrated impressive capabilities, they frequently falter when tasks require long, precise logical reasoning chains. Current state-of-the-art techniques, such as Chain-of-Thought (CoT) and Selection-Inference, primarily rely on "forward chaining." These methods start from a set of known facts and rules to generate new inferences, hoping to eventually reach the target conclusion.
However, forward chaining faces three critical challenges:
- Combinatorial Explosion: The number of possible inferences grows exponentially with the number of facts and rules, often leading the model into irrelevant search paths.
- Hallucinations: In extended reasoning chains, models tend to invent "shortcuts"—hallucinating non-existent facts or rules to force a conclusion.
- Spurious Correlations: Models may rely on superficial patterns (e.g., lexical cues like "not") rather than genuine logical derivation.
The LAMBADA Framework
To address these issues, we introduce LAMBADA (Language Model augmented BAckwarD chAining). LAMBADA implements a classical backward chaining algorithm, utilizing an LLM (specifically PaLM 540B) to execute individual reasoning steps.
The process begins with a specific Goal (e.g., "Is Eric nice?") and recursively decomposes it using four specialized sub-modules, each implemented via few-shot prompting:
- Fact Check: Verifies if the goal is directly supported or contradicted by the provided facts.
- Rule Selection: Identifies rules whose "consequent" (the then part) matches the current goal.
- Goal Decomposition: Breaks down a selected rule into its "antecedents" (the if parts), which become new sub-goals.
- Sign Agreement: A bookkeeping module that manages logical negations to ensure consistency.
By employing a search tree and a cache to prevent redundant computations, LAMBADA systematically explores only the paths relevant to proving the goal.
Experimental Results
We evaluated LAMBADA on several challenging benchmarks, including ProofWriter (requiring up to 5 reasoning hops), PrOntoQA (complex proof planning), and ParaRules (linguistically diverse natural language rules).
Key Findings
- Superior Accuracy at Depth: On the most challenging Depth-5 tasks in ProofWriter-PUD, LAMBADA achieved a 44% relative improvement over CoT. As shown in the results, LAMBADA's performance is significantly more robust to increasing reasoning depth compared to forward-chaining baselines.
- Efficiency and Reliability: LAMBADA is notably faster for deep proofs, requiring 11.8x fewer LLM calls than Selection-Inference at depth 5. Furthermore, while CoT often produces incorrect proofs even when the final label is correct, LAMBADA's structured approach ensures high proof fidelity.
- Robustness: The model's performance remained stable even when using "novel" nonsense words for names and verbs, indicating a reliance on logical structure rather than pre-trained associations. It also succeeded on ParaRules, demonstrating that backward chaining generalizes well to naturalistic human writing.
Conclusion and Future Work
LAMBADA demonstrates that goal-directed search is a powerful paradigm for LLM reasoning, effectively mitigating the noise and hallucinations inherent in forward-chaining. While currently limited to modus ponens and constrained by context window sizes for rules, future iterations could incorporate retrieval systems for massive knowledge bases and expand the logical scope to include disjunctions and proofs by contradiction.
Summary updated