NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Flow of Reasoning: Training LLMs for Divergent Reasoning with Minimal Examples

Fangxu Yu, Lai Jiang, Haoqiang Kang, Shibo Hao, Lianhui Qin

TL;DR

Flow of Reasoning (FOR) is a novel, data-efficient fine-tuning method that trains Large Language Models (LLMs) to generate diverse, creative, and high-quality multi-step reasoning paths using minimal training data (e.g., just 15 examples). By framing multi-step reasoning as a Markovian flow on a Directed Acyclic Graph (DAG), FOR adapts Generative Flow Network (GFlowNet) objectives to sample valid solutions with probabilities proportional to their rewards, preventing the typical "mode collapse" seen in standard reinforcement learning.

What Problem Does This Paper Address?

When humans solve complex problems, we don't just rely on a single rigid line of thought; we exhibit divergent thinking, uncovering multiple creative ways to reach a solution. This capability is crucial for machine robustness, scientific discovery, and interactive human assistance.

However, current LLM reasoning paradigms fall short:

  • Supervised Fine-Tuning (SFT) can improve reasoning quality but requires massive, expensive datasets to capture a wide variety of solutions.
  • Reinforcement Learning (RL) methods like Proximal Policy Optimization (PPO) focus strictly on reward maximization, causing the model to converge onto a single optimal path while neglecting solution diversity.
  • Advanced Prompting/Search Methods (like Tree of Thoughts or Reasoning-via-Planning) can find diverse paths but are computationally expensive and slow at inference time because they require extensive searching on the fly.

FOR bridges this gap by amortizing the search process directly into training, allowing LLMs to generate diverse, accurate reasoning paths efficiently at inference time with very little training data.

Methods

The authors introduce Flow of Reasoning (FOR), which treats multi-step reasoning as a fluid flow through a network of states (intermediate reasoning steps) and actions (the next reasoning step generated by the LLM).

Figure 1: Multi-step LLM reasoning as a Markovian flow on six tasks, forming DAG-structured reasoning graphs. In the example of Game24 (left), we sample 20 reasoning paths from each method, respectively. Baseline methods such as SFT and CoT generate only one valid solution (leftmost path) repetitively (e.g., SFT generates this solution twice out of the 20 attempts), while our method FOR discovers three additional unique solutions.

Key methodological components include:

  1. Markovian Flow Formulation: Reasoning is modeled on a DAG where the flow traveling through a terminal state equals its objective reward. This ensures the model learns to sample paths proportional to their correctness and uniqueness, rather than just maximizing the top reward.
  2. Trajectory Balance Objective: FOR optimizes the LLM using a log-variance approximation of the trajectory balance constraint from GFlowNet literature. This objective bypasses the need to calculate an intractable partition function $Z$ (the total flow).
  3. Modified Local Search: To make exploration efficient and prevent the LLM from getting lost in massive search spaces, the authors introduce a "destroy-and-reconstruct" mechanism. It takes the highest-reward trajectory in a batch, backtracks a few steps (destroys it), and uses a random policy to rebuild it (reconstructs it), discovering alternative high-reward paths with minimal computational overhead.
The forward/backward policy training loop and the modified local search mechanism.

Datasets

The framework was rigorously evaluated across six diverse and challenging reasoning benchmarks, utilizing extremely small training sets (ranging from 15 to 50 examples):

  • BlocksWorld: Embodied planning and reasoning task (15 training examples).
  • Game of 24: Mathematical puzzle solving (20 training examples).
  • Rubik’s Cube: Multi-step spatial reasoning (15 training examples).
  • 1D-ARC: One-dimensional abstraction and reasoning corpus (15 training examples).
  • GSM8K: Grade-school math word problems (50 training examples).
  • PrOntoQA: Rule-based logical reasoning (50 training examples).

Key Insights and Ideas

  • Amortizing Search into Training: Instead of executing heavy tree searches (like ToT or RAP) during inference, FOR bakes the exploratory distribution directly into the LLM weights. This shifts the computational burden from inference to training.
  • Diversity as a First-Class Objective: Traditional RL forces models to exploit a single peak reward. By framing the problem as a flow network, FOR forces the model to distribute its probability mass across all valid paths, leading to exceptional robustness and creativity.
  • Data Efficiency via Exploration: FOR proves that you don't need thousands of examples to fine-tune an LLM effectively. By combining on-policy, off-policy (replay buffers), and local search strategies, the model can synthesize its own diverse training trajectories from a tiny seed dataset.

Key Results

FOR consistently outperformed SFT, PPO, and advanced prompting baselines across all tasks in both accuracy (finding at least one correct solution) and diversity (the number of unique valid solutions found).

  • Speedup: FOR matches the inference speed of simple Chain-of-Thought (CoT) prompting while being 30× faster than search-based inference methods like ToT (BFS) and RAP.
  • Out-of-Distribution (OOD) Generalization: When trained on shorter reasoning steps (e.g., 2-step BlocksWorld) and tested on longer ones (e.g., 4-step or 6-step), FOR maintained high accuracy (71.43%), vastly outperforming SFT and CoT baselines, which dropped to between 9.52% and 14.28%.
  • Scalability: The benefits of FOR became even more pronounced as the base model size scaled up (tested up to Llama-3-70B and Qwen2.5-72B).
Comparison of accuracy and diversity between SFT and FOR across varying training data sizes.

Limitations and Future Work

The authors highlight two primary limitations:

  1. Inference Overhead During Training: While inference is fast after training, the training phase requires significant online sampling from the LLM to explore the DAG, which remains computationally expensive.
  2. Long-Horizon Reasoning: LLMs naturally struggle with very long-range planning. For tasks requiring dozens of steps, FOR might still need to be paired with explicit planning algorithms like Monte Carlo Tree Search (MCTS).

Future directions include extending FOR to structured data reasoning, social reasoning, and multimodal tasks.

Summary updated

BibTeX
@inproceedings{yu2025flow,
  author = {Fangxu Yu and Lai Jiang and Haoqiang Kang and Shibo Hao and Lianhui Qin},
  title = {{Flow of Reasoning: Training LLMs for Divergent Reasoning with Minimal Examples}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=qyMxunrR2j},
}
Figure