Abstract
Matrix is a decentralized, peer-to-peer (P2P) framework designed to scale multi-agent synthetic data generation to tens of thousands of concurrent workflows. By replacing centralized orchestrators with stateless agents that pass serialized "orchestrator" messages, Matrix achieves 2–15× higher throughput than existing specialized baselines without sacrificing data quality.
Introduction
Training state-of-the-art Large Language Models (LLMs) requires massive amounts of high-quality data. When real-world data is scarce or sensitive, researchers turn to agentic synthetic data generation, where multiple AI agents collaborate—for example, one agent writes code, another reviews it, and a third performs debugging.
However, current frameworks face two major hurdles:
- Centralized Bottlenecks: Most systems use a single "orchestrator" to manage task flow. As scaling reaches thousands of tasks, this central node becomes a massive performance bottleneck.
- Batch-Level Inefficiency: Traditional distributed engines process data in batches. If one task in a batch takes longer than others (a "straggler"), the entire pipeline stalls, leaving expensive GPUs idle.
Methods: Peer-to-Peer Architecture
The core innovation of Matrix is its Peer-to-Peer (P2P) architecture. Instead of a central brain telling every agent what to do, the "brain" (the task state, history, and routing logic) is serialized into a message called an Orchestrator object.
- Stateless Agents: Agents are implemented as lightweight Ray Actors. They do not store task state; they simply receive an Orchestrator message, perform their specific role (like calling an LLM), update the message, and forward it to the next agent.
- Row-Level Scheduling: Unlike batch processing, Matrix treats every row of data as an independent task. As soon as one task finishes a step, it moves to the next agent immediately, eliminating "bubble effects" where slow tasks hold up a batch.
- Distributed Service Decoupling: Matrix offloads heavy lifting—like LLM inference (via vLLM/SGLang) and tool execution (via Apptainer containers)—to dedicated distributed services. This keeps the agents themselves "thin" and highly responsive.
- Message Offloading: To prevent network congestion from large conversation histories, Matrix stores large data chunks in Ray’s distributed object store, passing only lightweight references between agents.
Evaluation and Datasets
The authors evaluated Matrix across three complex synthetic data generation scenarios:
- Collaborative Reasoner (Coral): A multi-agent dialogue setup where agents discuss and reach a consensus on MMLU-Pro reasoning questions.
- NaturalReasoning: A large-scale pipeline that filters 25 million web documents to extract and generate high-quality reasoning trajectories.
- Tau2-bench: A benchmark for customer service agents involving complex tool-use and multi-step trajectories in a simulated telecom domain.
Key Results
Matrix consistently outperformed specialized baseline systems across all tests. On the Coral Baseline, Matrix achieved 6.8× higher token throughput on 31 A100 nodes, generating 2 billion tokens in just 4 hours. While the centralized baseline plateaued due to overhead, Matrix scaled linearly.
In the NaturalReasoning task, Matrix delivered 2.1× higher throughput compared to a batch-level baseline built on Ray Data. For Tau2-bench, Matrix achieved a staggering 15.4× higher throughput than the official implementation by distributing agents and tool-containers across a cluster. In all cases, the massive speedup came with zero loss in data quality, as measured by agreement correctness and task rewards.
Discussion and Future Work
The success of Matrix demonstrates that decentralization is the key to scale. By moving the control plane into the data messages themselves, the system scales almost linearly with hardware, removing single points of failure or congestion.
While highly efficient, the framework currently depends on a specific stack (Ray, SLURM, vLLM). Future work will focus on extending Matrix to handle multi-modal data generation (images, video, audio) and exploring "on-policy" continuous data synthesis, where the generation process adapts in real-time based on the model's training progress.
Summary updated