Amortizing intractable inference in large language models

Edward J. Hu, Moksh Jain, Eric Elmoznino, Younesse Kaddar, Guillaume Lajoie +2 more
2/12/2026

No official code found. Best implementation: GFNOrg/gfn-lm-tuning (190 stars, MIT, last commit 2024-01-16).

Abstract

Autoregressive large language models (LLMs) compress knowledge from their training data through next-token conditional distributions. This limits tractable querying of this knowledge to start-to-end autoregressive sampling. However, many tasks of interest -- including sequence continuation, infilling, and other forms of constrained generation -- involve sampling from intractable posterior distributions. We address this limitation by using amortized Bayesian inference to sample from these intractable posteriors. Such amortization is algorithmically achieved by fine-tuning LLMs via diversity-seeking reinforcement learning algorithms: generative flow networks (GFlowNets). We empirically demonstrate that this distribution-matching paradigm of LLM fine-tuning can serve as an effective alternative to maximum-likelihood training and reward-maximizing policy optimization. As an important application, we interpret chain-of-thought reasoning as a latent variable modeling problem and demonstrate that our approach enables data-efficient adaptation of LLMs to tasks that require multi-step rationalization and tool use.

View on arXivView PDF

Code Implementations(1)

MIT
19022Python, Jupyter NotebookOct 5, 20232 years agoMIT

Cite this paper

@article{hu2026amortizing,
  title  = {Amortizing intractable inference in large language models},
  author = {Edward J. Hu and Moksh Jain and Eric Elmoznino and Younesse Kaddar and Guillaume Lajoie and Y. Bengio and Nikolay Malkin},
  year   = {2026},
  eprint = {2310.04363},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2310.04363},
  journal = {ICLR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2310.04363.svg)](https://codeofpaper.com/paper/2310.04363)

Discussion