Matrix: Peer-to-Peer Multi-Agent Synthetic Data Generation Framework

Dong Wang, Yang Li, Ansong Ni, Ching-Feng Yeh, Youssef Emad, Xinjie Lei, Liam Robbins, Karthik Padthe, Hu Xu, Xian Li, Asli Celikyilmaz, Ramya Raghavendra, Lifei Huang, Carole-Jean Wu, Shang-Wen LiarXiv 2025 · DOI

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:

  1. 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.
  2. 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.

The Matrix P2P Agent Environment architecture, where orchestrator state is passed between Ray nodes.
  • 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:

  1. Collaborative Reasoner (Coral): A multi-agent dialogue setup where agents discuss and reach a consensus on MMLU-Pro reasoning questions.
  2. NaturalReasoning: A large-scale pipeline that filters 25 million web documents to extract and generate high-quality reasoning trajectories.
  3. 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.

Comparison of performance metrics between the Coral Baseline and the P2P-Agent framework.

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

BibTeX
@misc{wang2025matrix,
  author = {Dong Wang and Yang Li and Ansong Ni and Ching-Feng Yeh and Youssef Emad and Xinjie Lei and Liam Robbins and Karthik Padthe and Hu Xu and Xian Li and Asli Celikyilmaz and Ramya Raghavendra and Lifei Huang and Carole-Jean Wu and Shang-Wen Li},
  title = {{Matrix: Peer-to-Peer Multi-Agent Synthetic Data Generation Framework}},
  year = {2025},
  eprint = {2511.21686},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.21686},
}
Figure