LEDOM: Reverse Language Model

Xunjian Yin, Sitao Cheng, Yuxi Xie, Xinyu Hu, Li Lin, Xinyi Wang, Liangming Pan, William Yang Wang, Xiaojun Wan

TL;DR

While standard large language models are trained exclusively to predict text from left to right, this paper introduces LEDOM, a purely reverse-trained (right-to-left) autoregressive language model scaled up to 7B parameters. By conditioning on the future to predict the past, LEDOM excels at abductive reasoning and naturally bypasses the notorious "reversal curse." Furthermore, by pairing LEDOM with standard forward models via a "Reverse Reward" noisy-channel framework, the authors achieve massive performance boosts on complex mathematical reasoning tasks.

What Problem Does This Paper Address?

Modern autoregressive language models (like GPT-4 or Llama) universally factorize the joint probability of text from left to right. While intuitive, this is only one of two mathematically valid ways to decompose text using the chain rule.

By ignoring the right-to-left factorization, standard Forward Language Models (FLMs) suffer from distinct cognitive blind spots. A prominent example is the reversal curse: a model trained on "A is B" (e.g., "Oppenheimer was the director of the Manhattan Project") routinely fails to infer "B is A" ("The director of the Manhattan Project was Oppenheimer"). Additionally, forward models struggle to verify their own outputs, frequently generating plausible-sounding but logically broken "hallucinated" reasoning chains.

Methods

The authors train LEDOM (Reverse Language Model, or RLM) by simply reversing the token order of the pre-training corpus ($x^R = (x_T, \dots, x_1)$) and training a standard causal, decoder-only Transformer architecture.

Figure 1: Forward vs. Reverse Language Modeling. FLMs decompose P(x) left-to-right; our RLM decom- poses P(x) right-to-left. Both use identical decoder- only Transformer architectures; only the factorization direction differs.

To leverage LEDOM's unique strengths, the authors propose Reverse Reward, an elegant application of Bayesian noisy channel duality. Instead of relying solely on a forward model's likelihood $P(y \mid x)$ to generate a response $y$ given prompt $x$, they use LEDOM to evaluate the posterior probability $P(x \mid y)$—essentially asking: "How well can we reconstruct the original prompt given this generated response?"

The final bidirectional score is calculated as: $$R(x, y) = P_{\text{FLM}}(y \mid x)^{(1-\lambda)} \cdot R_{\text{RLM}}(x, y)^{\lambda}$$

The authors operationalize this bidirectional scoring at two granularities:

  1. Response-Level Reranking (Best-of-N): Sampling $N$ candidates from an FLM and selecting the one that maximizes the bidirectional score.
  2. Step-wise Decoding via Beam Search: Pruning hallucinated derivation paths early at each intermediate reasoning step.
Figure 2: Verification by Inversion. The FLM generates candidate reasoning paths. LEDOM scores each by computing PRLM(query | response). Darker shading = higher posterior score. The final output combines forward likelihood with reverse posterior evaluation.

Datasets

  • Pre-training (435B tokens total):
  • D_General: 284B tokens from the DCLM-Baseline dataset for general linguistic balance.
  • D_Math: 102B tokens from MAP-Neo to boost numerical and formal logic.
  • D_Code: 48B tokens from MAP-Neo for structural reasoning.
  • Fine-tuning: 100,000 examples from the OpenMathInstruct-2 dataset, adapted for reverse token prediction.
  • Evaluation: Standard NLP benchmarks via OpenCompass (BoolQ, HellaSwag, WinoGrande, OpenBookQA, HumanEval, NQ-Open, TriviaQA, GSM8K) alongside advanced math benchmarks (MATH-500, AIME 2024, AMC 2023).

Key Insights and Ideas

  • Directional Entropy Asymmetry: In reasoning tasks, responses are typically longer and more variable than prompts. Mathematically, this means the conditional entropy of the reverse direction is lower than the forward direction ($H(X \mid Y) < H(Y \mid X)$). Consequently, reverse reconstruction is less uncertain, making LEDOM's posterior score a significantly tighter and more discriminative evaluation signal for catching hallucinations.
  • The "Aha!" of Abductive Reasoning: Because LEDOM generates text backward, it naturally excels at abductive inference—generating plausible premises or backstories to explain a given conclusion. It also naturally flips answers back into well-formed questions.
  • Training Dynamics Asymmetry: LEDOM converges more slowly and hits a higher final training loss than an identical forward model. This happens because natural language possesses a forward-causal structure (syntax and discourse flow left-to-right), making right-to-left prediction inherently more uncertain during training.

Key Results

Evaluated standalone, LEDOM matches or beats forward models on semantic understanding tasks (like BoolQ) but predictably struggles on forward-causal tasks like code generation.

However, when deployed as a Reverse Reward verifier for strong math models (DeepSeekMath, QwenMath, OpenMath2), the results are striking:

  • AIME 2024: Best-of-N reranking boosted QwenMath from 16.7% to 23.3% accuracy, and OpenMath2 from 10.0% to 16.7%.
  • AMC 2023: DeepSeekMath's performance skyrocketed from 12.5% to 27.5%.
  • Scaling Effects: As the number of sampled candidates ($N$) increases, the accuracy improves monotonically, proving that the reverse posterior signal remains highly effective even across large search spaces.
Figure 3: Accuracy of FLM with Reverse Reward beam search as sampling size N varies from 1 to 64 on MATH- 500 and GSM8K. Performance improves monotonically with N.

Limitations and Future Work

  • Directional Task Asymmetry: Pure reverse models are structurally ill-suited for tasks with strict left-to-right dependencies, such as incremental code generation or sequential decision-making.
  • Safety Alignment Vulnerabilities: The authors discovered a "safety asymmetry": prompts that trigger safety filters in forward models can sometimes bypass them in reverse models, indicating that standard alignment techniques do not automatically transfer right-to-left.
  • Scale Constraints: The current study only scales up to 7B parameters. Whether the posterior verification signal saturates or grows stronger at larger scales remains an open question.

Summary updated

Abstract

Autoregressive language models are trained exclusively left-to-right. We explore the complementary factorization, training right-to-left at scale, and ask what reasoning patterns emerge when a model conditions on future context to predict the past. We train LEDOM, an open-source purely reverse autoregressive language model (2B/7B parameters, 435B tokens), and find it develops capabilities distinct from forward models, including abductive inference, question synthesis, and natural resolution of the reversal curse. We then explore one application of the reverse model: combining forward likelihood $P(y \mid x)$ with reverse posterior $P(x \mid y)$ through noisy channel duality. We propose Reverse Reward, which reranks forward outputs using reverse posterior estimates, and prove that bidirectional scoring penalizes hallucinated reasoning chains whose backward reconstruction degrades. Reverse Reward yields gains of up to 6.6\% on AIME 2024 and 15\% on AMC 2023 across multiple strong baselines. We release all models, code, and data here: https://github.com/Arvid-pku/LEDOM.
BibTeX
@inproceedings{yin2026ledom,
  author = {Xunjian Yin and Sitao Cheng and Yuxi Xie and Xinyu Hu and Li Lin and Xinyi Wang and Liangming Pan and William Yang Wang and Xiaojun Wan},
  title = {{LEDOM: Reverse Language Model}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.acl-long.975},
}
Figure