SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.05673 · ICML · 2025

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

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

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 15 functions out of this paper's own repositories and ran 11 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
Yu-Fangxu/FoR canonical 11 of 15
FunctionStatusWhere it lives
add_time Ran Yu-Fangxu/FoR/BlocksWorld/lightning_module_selection.py
code served (permissive licence) · get_code("afcd0eb6a3a4c39a")
color1_2_1 Ran Yu-Fangxu/FoR/1D-ARC/Models.py
code served (permissive licence) · get_code("815d8e8d214865ea")
convert_tensors_to_numbers Ran Yu-Fangxu/FoR/1D-ARC/lightning_module_selection.py
code served (permissive licence) · get_code("7226941042e90d9b")
detectFrontiers Ran Yu-Fangxu/FoR/1D-ARC/Task.py
code served (permissive licence) · get_code("e4b13d74df59c1aa")
extract_last_state Ran Yu-Fangxu/FoR/prontoqa/lightning_module.py
code served (permissive licence) · get_code("2d983246aa9b1200")
extract_prompt Ran Yu-Fangxu/FoR/GSM8K/lightning_module_selection.py
code served (permissive licence) · get_code("8398b51b37d44019")
get_class Ran Yu-Fangxu/FoR/1D-ARC/Utils.py
code served (permissive licence) · get_code("012c0ca7e3ccba0e")
is_equal Ran Yu-Fangxu/FoR/GSM8K/lightning_module_selection.py
code served (permissive licence) · get_code("327e54ca69883f06")
load_json_data Ran Yu-Fangxu/FoR/1D-ARC/lightning_data.py
code served (permissive licence) · get_code("8f6dea1ad179b459")
pixelCorrespondence Ran Yu-Fangxu/FoR/1D-ARC/Models.py
code served (permissive licence) · get_code("df242a324791e4b9")
transform_to_function Ran Yu-Fangxu/FoR/1D-ARC/Utils.py
code served (permissive licence) · get_code("085c428237ab0869")
detectShapes Not yet run Yu-Fangxu/FoR/1D-ARC/Task.py
code served (permissive licence) · get_code("d22f365bc478b1f9")
detectShapesByColor Not yet run Yu-Fangxu/FoR/1D-ARC/Task.py
code served (permissive licence) · get_code("958485939c0541e6")
extract_last_state Not yet run Yu-Fangxu/FoR/Game24/lightning_module.py
code served (permissive licence) · get_code("daabe65145c7218d")
get_tokenizer Not yet run Yu-Fangxu/FoR/1D-ARC/Utils.py
code served (permissive licence) · get_code("115cf95e952e04f2")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

The ability to generate diverse solutions to a given problem is a hallmark of human creativity. This divergent reasoning is also crucial for machines, enhancing their robustness and enabling them to assist humans in many applications such as scientific discovery. However, existing approaches to multi-step reasoning with large language models (LLMs) have mostly focused only on reasoning accuracy, without further discovering more diverse valid solutions. For example, supervised fine-tuning improves reasoning quality but requires vast labeled data, while reward-maximizing reinforcement learning finds top-reward solutions while neglecting the solution diversity. To fill this gap, we propose Flow of Reasoning (FOR), an efficient diversity-seeking LLM finetuning method aimed at improving reasoning quality and diversity with minimal data. FOR formulates multi-step LLM reasoning as a Markovian flow on a DAG-structured reasoning graph. This formulation allows us to incorporate and adapt principled GFlowNet approaches, for finetuning LLMs to sample divergent paths with probabilities proportional to the (unnormalized) reward of target problems. Extensive experiments show that, with limited training examples (e.g., 15 examples), FOR enables the discovery of diverse, creative, high-quality solutions, greatly outperforming a wide range of existing inference and training methods across six challenging reasoning tasks, including BlocksWorld (embodied reasoning), Game24 (math puzzle solving), Rubik's Cube (spatial reasoning), 1D-ARC (abstraction reasoning), GSM8k (math reasoning), and Pron-toQA (logical reasoning). Code is available at https://github.com/Yu-Fangxu/FoR.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2406.05673")
get_code_for_paper("2406.05673")
have("2406.05673")

Connect an agent — have() is free.