Skip to content

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

🕒 Published (v1): 2025-11-26 18:59 UTC · Source: Arxiv · link

Ask a follow-up

Open an assistant pre-loaded with this paper's context.

💬 Ask ChatGPT✦ Ask Claude

TL;DR

Matrix is a decentralized, peer-to-peer runtime for large-scale multi-agent synthetic data generation, replacing centralized orchestrators with stateless Ray actors that exchange serialized "orchestrator" messages through distributed queues. Built on SLURM + Ray + vLLM/SGLang + Apptainer and configured via Hydra, it scales to tens of thousands of concurrent agentic workflows. Across three case studies it achieves 2–15× higher data generation throughput under identical hardware with comparable output quality.

Problem

Existing multi-agent synthesis frameworks either (a) rely on a centralized orchestrator that becomes a scalability bottleneck at high concurrency, or (b) are domain-specific (e.g., AgentInstruct for instruction tuning, SWE-Agent for code) requiring non-trivial re-engineering to adapt. General-purpose agent authoring frameworks (AutoGen, LangGraph, CrewAI) provide workflow abstractions but lack the production scaffolding—backpressure, retries, distributed inference services, concurrency control—needed for throughput-regime synthetic data generation at scale.

Method

Core design — P2P message-passing runtime: - Each input datum is wrapped in an Orchestrator object that carries task state (conversation history, control-flow index, completion flag). The orchestrator is serialized and forwarded between agents; agents themselves are stateless. - Agents run as persistent Ray Actors (AgentActor) with an async _event_loop: dequeue orchestrator → call process() → call orchestrator.update() → dispatch to team[next_agent] via random load-balancing within the role group. - A _sink terminal actor collects completed orchestrators for persistence and metric aggregation.

Scheduling — row-level vs. batch-level: Each task progresses independently through the agent graph without waiting for a batch barrier, eliminating GPU idle bubbles caused by slow stragglers in fixed-size batches.

Distributed services: LLM inference is offloaded to vLLM/SGLang/FastGen via gRPC with local URL caching for direct worker-to-worker traffic (bypassing the Ray head node). Stateful containerized tools (Apptainer) are managed through a resource pool and ID-based registry so multi-step tool calls hit the same container instance.

Message offloading: Large conversation histories are stored in Ray's distributed object store (immutable objects); the orchestrator carries only object IDs. This avoids the double-bandwidth cost of external cache (Redis) patterns where each agent reads and writes the full history per turn.

Fault tolerance: Per-role message brokers maintain an assignment_map of in-flight orchestrators. On actor crash, the broker marks affected orchestrators as failed and routes them to the sink. At-most-once semantics; failed trajectories can be re-run offline.

Configuration: Hydra YAML drives agent roles, resource allocations, LLM engine selection, and orchestrator class. A LangGraphOrchestrator shim lets users specify control flow as a standard LangGraph state graph while Matrix handles decentralized execution.

Key Contributions

  • P2P agent runtime: serialized orchestrator messages replace a centralized controller; eliminates orchestrator bottleneck and batch-level synchronization idle time.
  • Row-level scheduling: each task advances asynchronously and independently, maximizing GPU utilization for heterogeneous multi-agent workloads.
  • Modular, fully configurable design: Hydra-driven config separates agent roles, distributed services (LLM inference, containerized execution), and orchestration logic; LangGraph compatibility for familiar workflow authoring.
  • 2–15Ă— throughput gains over domain-specific baselines on three representative synthesis tasks (Collaborative Reasoner / Coral, NaturalReasoning, Tau2-bench) at equal hardware.
  • Open-source on SLURM + Ray + vLLM + SGLang + Apptainer stack; supports open-weight models and commercial LLM API proxies.

Results

  • Collaborative Reasoner (Coral): Matrix (P2P-agent) achieves ~1,400+ data items generated per minute vs. significantly lower rates for the baseline (exact baseline numbers in Figure 3, text truncated before full table).
  • NaturalReasoning and Tau2-bench: headline 2–15Ă— higher token throughput vs. specialized baseline systems with comparable output quality (exact per-benchmark numbers in sections 5.2–5.3, text truncated).
  • Message offloading via Ray object store quantitatively reduces network bandwidth vs. Redis-based history caching (Section 5.3.1, numbers truncated).

Limitations

  • At-most-once semantics: in-flight orchestrators held by a crashed agent are lost; recovery requires offline re-runs of failed trajectories.
  • Broker/sink as single points of failure: if a broker or the sink fails, the entire generation job terminates; only per-role agents are auto-restarted by Ray.
  • No built-in checkpointing or exactly-once delivery: large jobs interrupted mid-run require manual triage of output vs. failed trajectory files.
  • Control flow expressed imperatively: non-sequential workflows require hand-writing if/else orchestration logic (LangGraph shim partially alleviates this but adds a dependency).
  • Experimental section is truncated; full quantitative comparisons against baselines are not shown in the provided text.

Relevance to Harnesses / Meta-Harnesses

Matrix is a production-grade meta-harness: it sits above workflow-authoring frameworks (LangGraph, AutoGen) and provides the infrastructure layer—scheduling, fault tolerance, backpressure, monitoring, distributed service integration—that those frameworks omit. The Hydra-driven configuration and pluggable Orchestrator base class make it a template for building domain-specific data-generation harnesses without reimplementing distributed systems primitives each time. For researchers building or studying harnesses that orchestrate multi-agent pipelines over large datasets, Matrix demonstrates the key design pattern of separating workflow definition from execution infrastructure and quantifies the throughput gains from doing so. The LangGraph compatibility layer is particularly noteworthy: it shows how a meta-harness can reuse existing workflow specs as a frontend while substituting a more scalable backend runtime.