TL;DR
This paper introduces ThreadWeaver, a novel framework that enables Large Language Models (LLMs) to perform complex reasoning tasks much faster by intelligently parallelizing their internal thought processes. ThreadWeaver achieves this by training LLMs to adaptively decide when to split their reasoning into parallel threads and when to rejoin them, matching the accuracy of sequential models while significantly reducing inference latency.
What Problem Does This Paper Address?
Large Language Models (LLMs) have become incredibly powerful at complex reasoning tasks, but their inherent sequential nature means that generating longer, more detailed "chain-of-thought" reasoning can take an extremely long time, sometimes hours for a single problem. While parallelizing reasoning has been explored, existing methods often lead to a drop in accuracy or require specialized inference engines. The core challenge is to achieve both high accuracy and significantly reduced inference latency by parallelizing the reasoning process within a single generation, without needing custom hardware or complex inference setups.
Methods
ThreadWeaver tackles this challenge with three key innovations:
- Two-Stage Parallel Trajectory Generator: This system first generates high-quality, structured "parallel chain-of-thought" data. This data is crucial for supervised fine-tuning (SFT) and helps the model learn how to break down problems into parallelizable parts.
- Trie-Based Rollout Design: This is a clever way to enable parallel reasoning on any standard autoregressive LLM inference engine (like vLLM or SGLang). It uses a trie (prefix tree) structure to manage and merge parallel threads, allowing them to run concurrently and then be combined without modifying the underlying LLM architecture.
- Parallelization-Aware Reinforcement Learning (P-GRPO): This framework trains the LLM to balance reasoning accuracy with efficient parallelization. It uses a novel reward function that encourages correct answers while also rewarding faster inference by considering the "critical path" (longest thread) of the parallel reasoning.
Datasets
The paper uses the Polaris 53k dataset, a collection of high-quality math reasoning problems, for training. They also leverage existing math reasoning benchmarks for evaluation, including:
- AIME24 and AIME25
- Minerva Math
- AMC23
- OlympiadBench
- MATH500
Key Insights and Ideas
- Adaptive Parallelism is Key: Simply running multiple independent reasoning threads (like self-consistency) doesn't fully leverage compute for speed. ThreadWeaver's innovation is in adaptive parallelism, where the model learns when and how to parallelize within a single reasoning process.
- Data Quality Matters: The success of ThreadWeaver hinges on high-quality training data that reflects natural parallel reasoning. The two-stage generation process (LLM rewriting + self-training) is crucial for bridging the gap between human-curated data and the model's own generative patterns.
- Off-the-Shelf Compatibility is a Game-Changer: The trie-based design allows ThreadWeaver to work with existing, widely-used LLM inference engines, making it much easier to deploy and integrate.
- Speed-Accuracy Pareto Frontier: The paper emphasizes a "speed-accuracy Pareto view," aiming to improve both metrics simultaneously, rather than just boosting accuracy at the cost of speed.
Key Results
- Accuracy on Par: ThreadWeaver, trained on Qwen3-8B, achieves accuracy comparable to state-of-the-art sequential models. For example, 79.9% on AIME24 (vs. 78.3% for sequential) and 71.9% on average across six benchmarks (vs. 72.2% for sequential).
- Significant Speedup: ThreadWeaver delivers substantial reductions in token latency, achieving up to 1.53x speedup on Minerva Math and 1.23x speedup on MATH500. The average speedup across benchmarks is 1.22x.
- New Pareto Frontier: These results establish a new frontier for accuracy and efficiency in LLM reasoning.
- Robustness: The framework shows strong performance across various math reasoning benchmarks, demonstrating its generalizability.
Limitations and Future Work
- Topology-Agnostic Policy: The current policy for deciding how many threads to spawn is topology-agnostic, meaning it doesn't consider hardware specifics like GPU availability or network bandwidth. This limits scalability and efficiency on large clusters. Future work could involve making the policy topology-aware.
- Generalizing Beyond Reasoning: The framework's ability to decompose tasks and coordinate concurrent threads could be extended beyond internal reasoning to interactive decision-making in shared environments, enabling multi-agent systems for complex applications.
- Reward Hacking: While not observed in experiments, the authors acknowledge the potential for reward hacking (generating redundant branches to inflate acceleration). They suggest future work could explore more sophisticated reward mechanisms, though their current approach is designed to be conservative.
Summary updated