Amortizing intractable inference in large language models
This paper proposes using GFlowNets to amortize intractable inference in large language models, enabling them to sample from complex posterior distributions for tasks like constrained generation and chain-of-thought reasoning as a data-efficient alternative to traditional maximum-likelihood or reward-maximizing training.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Large language models are vast libraries of human knowledge, compressed into digital networks that predict the next word in a sentence based on what came before. They are trained to be excellent at continuing a story or answering a question when given a starting point, a process that flows naturally from left to right. However, many of the most interesting tasks we want these models to perform require thinking in reverse or filling in the middle of a story. Imagine being given the beginning and the end of a tale and asked to invent the middle, or being asked to explain the reasoning behind a specific answer. In these scenarios, the model cannot simply guess the next word; it must search through a massive, complex landscape of possibilities to find the specific path that connects the start to the finish. This is a difficult mathematical problem because the number of possible paths is so enormous that checking them one by one is impossible, and the standard methods for navigating this landscape often get stuck on just one or two common routes, missing the rich variety of valid solutions that exist.
Researchers at the Mila – Quebec AI Institute and the University of Oxford have developed a new way to teach these models how to navigate that complex landscape. Instead of training the model to simply maximize a score for the "best" answer, which often leads to repetitive and narrow thinking, they used a method called amortized inference. This approach treats the problem as a search for a diverse set of correct paths rather than a single perfect one. To do this, they employed a technique known as a generative flow network, which acts like a guide that learns to sample from the entire range of possible solutions, ensuring that the model explores different valid reasoning chains rather than collapsing into a single, overused pattern.
The team demonstrated this by fine-tuning large language models to solve problems that require multi-step reasoning, such as arithmetic calculations or classifying whether a movie review expresses an opinion or a fact. In one experiment, they asked the model to fill in the missing middle sentence of a short story, given the beginning and the end. Standard methods often produced sentences that were grammatically correct but did not fit the narrative flow. The new method, however, successfully generated middle sentences that linked the start and end coherently, showing a much higher ability to understand the full context. In another test involving simple math problems, the model was equipped with a calculator tool and asked to break down the calculation into steps. While other training methods caused the model to repeat numbers or fail to use the tool correctly, the new approach taught the model to plan its steps carefully, leading to a dramatic improvement in accuracy, especially on problems it had never seen before.
The results suggest that this method is particularly powerful when data is scarce. In a test with only ten examples of movie reviews to learn from, the new method achieved significantly higher accuracy than standard training techniques, and it continued to outperform them even with fifty examples. The researchers found that by encouraging the model to sample a wide variety of reasoning paths and then combining their conclusions, the system became more robust and reliable. This is a crucial distinction because it means the model is not just memorizing a single way to solve a problem but is learning the underlying structure of how to think through it. The study indicates that by shifting the goal from finding the single most likely answer to exploring the full diversity of correct answers, we can make these powerful tools more flexible and better suited for complex reasoning tasks.
The work also highlights a limitation in how current models are often trained. When models are pushed to maximize a reward, they tend to find shortcuts, such as repeating the same phrase or ignoring the actual logic of a problem, just to get a high score. The researchers showed that their method avoids this trap by matching the entire distribution of possible solutions, ensuring that the model does not collapse into a single, flawed mode of thinking. This approach allows the model to generalize better to new situations, such as solving arithmetic problems with more numbers than it was trained on, where other methods failed. The findings offer a promising path forward for making artificial intelligence more capable of genuine reasoning, moving beyond simple pattern matching to a more nuanced understanding of how to construct arguments and solve problems step by step.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.