ThreadWeaver: Adaptive Threading for Efficient Parallel Reasoning in Language Models
Long (Tony) Lian (Meta), Sida Wang, Felix Juefei-Xu, Tsu-Jui Fu, Xiuyu Li, Adam Yala, Trevor Darrell (Berkeley), Alane Suhr, Yuandong Tian, Xi Victoria Lin (Meta)
Overview
Recent advancements in Large Language Models (LLMs) have demonstrated remarkable capabilities in complex reasoning tasks, such as mathematical problem solving, through extended Chain-of-Thought (CoT) generation and reinforcement learning (RL). However, these serialized reasoning approaches force models to generate extremely long output sequences, severely stressing context windows, increasing computational complexity, and escalating inference latency. In this talk, the speakers present ThreadWeaver, an adaptive parallel reasoning framework developed collaboratively by researchers at Meta and UC Berkeley. ThreadWeaver addresses the fundamental bottleneck of serialized reasoning by enabling models to distribute their inference-time compute across both parallel and serial operations natively.

Key moments
- 0:00 Introduction to reasoning models and inference structures
- 2:00 Limitations of serializing reasoning trees and long chains
- 4:00 Introduction to ThreadWeaver and adaptive parallel reasoning
- 6:00 Comparison between sequential reasoning and ThreadWeaver
- 7:30 Supervised fine-tuning and data formatting with GPT-5
- 9:50 Reinforcement learning reward formulation and training
- 11:50 Results on accuracy, latency, and context utilization
- 13:00 Audience Q&A on latency, GPU utilization, and decomposition
ThreadWeaver: Adaptive Threading for Efficient Parallel Reasoning in Language Models
Speakers: Long (Tony) Lian (Meta); Sida Wang; Felix Juefei-Xu; Tsu-Jui Fu; Xiuyu Li; Adam Yala; Trevor Darrell (Berkeley); Alane Suhr; Yuandong Tian; Xi Victoria Lin (Meta)
Conference: ICML
YouTube: https://slideslive.com/39083718
Overview
Recent advancements in Large Language Models (LLMs) have demonstrated remarkable capabilities in complex reasoning tasks, such as mathematical problem solving, through extended Chain-of-Thought (CoT) generation and reinforcement learning (RL). However, these serialized reasoning approaches force models to generate extremely long output sequences, severely stressing context windows, increasing computational complexity, and escalating inference latency. In this talk, the speakers present ThreadWeaver, an adaptive parallel reasoning framework developed collaboratively by researchers at Meta and UC Berkeley. ThreadWeaver addresses the fundamental bottleneck of serialized reasoning by enabling models to distribute their inference-time compute across both parallel and serial operations natively.
The core premise of ThreadWeaver is that many hierarchical, tree-like reasoning problems—such as multi-step mathematical computations—do not need to be processed as a single, uninterrupted text string. Instead, the model can be trained to dynamically decompose tasks into independent subthreads, execute them concurrently across available hardware, and subsequently rejoin the main thread. This approach delivers three major advantages: drastically reduced real-time latency via parallelization, lower context window utilization per task thread, and empirically superior reasoning accuracy stemming from simplified learning objectives. Evaluated on challenging mathematical benchmarks like AIME 24, ThreadWeaver matches or exceeds the performance of traditional sequential reasoning models while achieving massive speedups in token latency.
The implications of this work extend far beyond math problem-solving, pointing toward a future where inference-time scaling is achieved through structural parallelism rather than mere sequence length expansion. By rethinking how models traverse reasoning trees, ThreadWeaver offers systems and ML engineers a practical blueprint for deploying efficient reasoning architectures that respect hardware constraints without sacrificing cognitive performance.
Background
▶ Watch: Introduction to reasoning models and inference structures (0:00)
In the machine learning and systems space, scaling inference-time compute has emerged as the dominant paradigm for improving LLM reasoning capabilities. Techniques ranging from zero-shot prompting to structured inference approaches—such as consensus sampling, Tree of Thoughts, debate frameworks, and inference with verifiers—all attempt to explore multiple reasoning paths. More recently, reinforcement learning approaches (exemplified by models like DeepSeek-R1 and various off-policy learning methods like S1) have taught models to search up and down an internal reasoning tree, exhibiting emergent behaviors like backtracking and self-correction.
Despite their power, these methods share a critical systems limitation: they serialize the reasoning tree into a single, massive string of tokens. As RL-trained models learn to reason more thoroughly, their reasoning chains grow increasingly lengthy. From a systems perspective, this creates severe memory and compute pressures. The auto-regressive nature of standard transformer inference means that generating long sequential chains prevents effective hardware utilization across multiple accelerators, heavily burdens the KV-cache, and causes latency to spike linearly with sequence length.
While alternative parallel approaches such as Multiverse Parallel R1 and standard Parallel R1 have attempted to introduce concurrency, they often struggle with coordination or fail to decompose tasks natively. The ML systems community has thus faced a tension between the need for deep, exploratory reasoning and the hardware inefficiencies of long, serialized context windows. ThreadWeaver resolves this tension by baking native hierarchical decomposition directly into the model's output space and training paradigm.
Key Findings
▶ Watch: Introduction to ThreadWeaver and adaptive parallel reasoning (4:00)
ThreadWeaver demonstrates that language models can be trained to perform adaptive parallel reasoning without sacrificing the accuracy gains typically associated with exhaustive serial compute. The main findings and performance highlights include:
- Accuracy Parity with Serial Baselines: ThreadWeaver achieves accuracy competitive with or exceeding traditional sequential reasoning models on complex math benchmarks, scoring 799 on AIME 24.
- Superiority Over Prior Parallel Methods: When compared directly against existing parallel inference baselines like Multiverse Parallel R1 and Parallel R1, ThreadWeaver yields significantly higher reasoning accuracy.
- Latency and Speedup Gains: By executing independent subtasks concurrently, ThreadWeaver dramatically reduces token latency, as measured by the mean critical path length (the longest path length in the execution trajectory).
- Reduced Context Pressure: Because tasks are decomposed into localized subthreads, individual threads only process a fraction of the total context, significantly lowering context utilization per task.
- Easier Learning Dynamics: Empirical observations suggest that task decomposition simplifies the reinforcement learning problem; instead of generating an uninterrupted, hyper-long chain of thought, models only need to manage smaller, bounded sub-problems.
Technical Deep Dive
▶ Watch: Supervised fine-tuning and data formatting with GPT-5 (7:30)
The technical architecture of ThreadWeaver relies on augmenting the model's output space and executing a two-stage training pipeline consisting of Supervised Fine-Tuning (SFT) and Reinforcement Learning (RL).
Output Space Augmentation
ThreadWeaver modifies the standard generation format by introducing parallelizable threading operations interleaved within the standard <think> block. The model learns to spawn new subthreads with isolated contexts that execute concurrently and eventually rejoin the main thread.
Training Pipeline: SFT
To bootstrap this capability, the authors construct a specialized dataset. Starting with Qwen-3-8B trajectories from the Polaris 53K dataset, they use GPT-5 to rewrite the reasoning traces into a structured parallel format containing explicit subthread outlines. This yields approximately 900 high-quality parallel demonstrations.
To train efficiently on these tree-structured trajectories, ThreadWeaver flattens the tree into a single training example and applies specialized masking and token ID resets:
- Decomposition Demonstration: Shows how the problem is broken down.
- Subtask Execution: Demonstrates how individual subthreads solve their respective components.
- Recombination: Shows how subthread results are synthesized into the final answer.
Masking ensures that dependent blocks are not improperly conditioned on unrelated parallel branches, while token ID resetting makes separate subthreads appear identical to the model during loss computation.
Training Pipeline: Reinforcement Learning
Following SFT, the model undergoes RL using approximately 17,000 trajectories sampled from the fine-tuned policy. The reward function combines two distinct terms:
$$\text{Reward} = \text{Correctness} + \text{Acceleration}$$
- Correctness Term: A binary or graded reward indicating whether the final answer is correct against evaluation datasets.
- Acceleration Term: Formulated as $\eta(\tau) = 1 - \frac{\text{Length of longest subthread in trajectory } \tau}{\text{Total length of trajectory } \tau}$, which explicitly incentivizes parallel speedup by penalizing bottlenecks (aligning with Amdahl's Law considerations).
Additionally, the authors introduce a variant of Group Relative Policy Optimization (GRPO) that broadcasts the reward and advantage of the entire trajectory across all subthread demonstrations.
Experimental Setup & Results
▶ Watch: Reinforcement learning reward formulation and training (9:50)
ThreadWeaver was evaluated across several challenging mathematical reasoning benchmarks using models derived from the Qwen architecture.
- Datasets: Evaluation relied on standard mathematical reasoning benchmarks, notably AIME 24. Training data was sourced from the Polaris 53K dataset, reformatted via GPT-5, and supplemented by 17,000 RL trajectories.
- Baselines: The framework was benchmarked against traditional serialized reinforcement learning models, as well as concurrent parallel methods including Multiverse Parallel R1 and Parallel R1.
- Headline Results: ThreadWeaver attained an AIME 24 score of 799, matching the accuracy of heavy sequential reasoning models while drastically shortening the mean critical path length.
- Ablations and Analysis: While formal ablations isolating the exact contribution of GPT-5's reformatting versus the RL algorithm remain an active area of study, empirical comparisons confirm that explicit task decomposition combined with parallel execution outperforms naive parallel baselines. The authors note that while stateful domains like coding introduce additional complexities (such as thread-to-thread state synchronization and communication), math reasoning serves as an ideal domain due to its natural decomposability.
Practical Implications
▶ Watch: Audience Q&A on latency, GPU utilization, and decomposition (13:00)
For infrastructure teams, model builders, and deployment engineers, ThreadWeaver represents a shift in how inference-time scaling should be engineered. Rather than accepting the memory bandwidth and latency penalties of ever-lengthening transformer context windows, engineering teams can look toward structured, parallel execution models.
- Hardware Utilization: By splitting reasoning tasks into subthreads, systems can better utilize multi-GPU or multi-accelerator setups, mitigating the idle-time penalties typically associated with waiting for single-threaded auto-regressive generation.
- KV-Cache Optimization: Shorter subthread context windows reduce the memory footprint of the KV-cache, allowing for higher concurrency and serving throughput in production environments.
- Limitations & Tradeoffs: As highlighted by Amdahl's Law, overall speedup is strictly bounded by the longest-running subthread. Furthermore, decomposition-based approaches risk error propagation if individual subthreads hallucinate or drift without intermediate cross-thread verification—a challenge that future systems must address by incorporating robust inter-thread communication protocols.
Key Takeaways
- Native Parallel Reasoning: ThreadWeaver trains LLMs to natively decompose tasks into parallel subthreads, bypassing the latency bottlenecks of long, serialized chains of thought.
- Accuracy Parity with Speedups: The method achieves competitive reasoning accuracy (e.g., 799 on AIME 24) while significantly reducing token latency and critical path length.
- Two-Stage Training: Combines supervised fine-tuning on GPT-5 reformatted trajectories (derived from Qwen-3-8B and Polaris 53K) with a specialized reinforcement learning loop using GRPO variant weighting.
- Dual-Term Reward Function: Optimizes both problem correctness and an acceleration metric that penalizes execution bottlenecks based on subthread length ratios.
- Reduced Context Stress: Task decomposition ensures that individual subthreads operate within smaller context windows, easing memory constraints during inference.
About the Speaker(s)
- Long (Tony) Lian (Meta): Conducted this work during an internship at Meta in collaboration with Berkeley.
- Trevor Darrell (Berkeley): Collaborated on this work conducted between Meta and Berkeley.
- Xi Victoria Lin (Meta): Co-author on this paper; the work was done in collaboration between Meta and Berkeley.
Co-authors: Sida Wang, Felix Juefei-Xu, Tsu-Jui Fu, Xiuyu Li, Adam Yala, Alane Suhr, Yuandong Tian.
Reviews
→ Top-rated talks at International Conference on Machine Learning 2026
All talks from International Conference on Machine Learning 2026