Decentralized Multi-Agent Framework for Large-Scale Synthetic Data Generation
This article explains why centralized orchestration becomes a bottleneck when synthetic data generation scales from experiments to platform-level production, and how a decentralized message-based design addresses it. It covers the core abstraction of a mobile state machine that carries task context, routing logic, and observability metadata, the stateless agent loop, and key engineering practices including queue backpressure, idempotency, externalized state, and observability. A reference cloud build path and the boundaries where decentralized orchestration is or is not the right choice are also discussed.
1. Background: Synthetic Data Has Become the Main Supply for Training
The capability boundary of large language models increasingly depends on the quality of the data available during training and alignment. Real-world corpora have natural limits in coverage, annotation consistency, and privacy compliance, so synthetic data has become the primary way to fill long-tail scenarios: multi-turn dialogues are used to align interaction style, tool-call traces are used to train function orchestration, and reasoning chains are used to reinforce step-by-step solving and self-verification. What these data types share is that the generation process itself is a multi-step program, not a single text completion.
When generation needs move from experimental scripts to platform-level production, the engineering conflict appears immediately: the number of tasks jumps from a few hundred to hundreds of thousands, and each task internally involves multiple model calls, code execution, and result判定. At this point the bottleneck is often not single-card compute, but the scheduling structure and resource utilization.
2. Three Bottlenecks of Centralized Orchestration
A common industry approach is to set up a central orchestrator that holds workflow state and drives each step. This structure is clear and easy to debug at small and medium scale, but three typical problems emerge at scale.
The first is a single-point scaling bottleneck. The enqueueing, dequeueing, retries, and timeout判定 of all tasks converge on the same control plane, whose own network and serialization overhead grows linearly with concurrency and eventually saturates before compute does.
The second is idle spinning caused by batch-level barriers. Batch execution must wait for the slowest sample in the batch, and long-tail tasks leave the entire batch of GPUs waiting; since the length distribution of synthetic data tasks is highly uneven, the long tail is the norm and the waste is continuously amplified.
The third is an overly long coordination loop. Every handoff between agents passes through the central node, mixing control signaling and data payloads on the same path, which increases latency and converges the fault domain onto the central component.
| Dimension | Centralized Orchestration | Decentralized Message Orchestration |
|---|---|---|
| State ownership | Held in the control plane | Migrates with the task message |
| Scheduling granularity | Batch-level barrier | Independent per-row progress |
| Scaling method | Scale the control plane vertically | Add agent instances horizontally |
| Failure impact | Central failure halts everything | Local failure allows single-task replay |
3. Core Design: Turn Orchestration into a Migratable Message
The key abstraction of the decentralized approach is to serialize both the control flow and the data flow into a freely passable message object, which can be understood as a mobile state machine. It carries at least three kinds of information: task context (dialogue history, intermediate artifacts, completed tool results), routing logic (which role handles the next step, how to degrade on failure), and observability metadata (attempt count, elapsed time, identifier).
Agents are implemented as stateless execution units that store no task context during their lifecycle and only loop through four steps: pull a message from the queue, process it according to role logic, update the message state in place, and deliver the message to the next queue according to routing.
loop:msg = queue_in.pop()if msg.retry > LIMIT: return dead_letter.push(msg)result = role_logic(msg) # user simulation / code execution / quality evaluationmsg.update(result)next_q = msg.route() # routing is carried by the message itselfnext_q.push(msg)
This structure brings three direct benefits. First, with no central scheduler, control-plane pressure is spread across the queues and the agents. Second, the scheduling granularity is a single task, so long tasks no longer drag down short ones and GPU utilization is more stable. Third, routing rules are encapsulated in the message, so adding a role only requires extending the routing table and the corresponding queue, with no changes to the control plane.
4. Engineering Implementation Points
Queues and backpressure. The message queue is the backbone of the whole architecture; pay attention to partition parallelism, visibility timeout, and dead-letter handling. The visibility timeout should be greater than the longest single-step processing time, otherwise duplicate consumption occurs; when a certain role’s queue backs up, the upstream should slow down by weight to avoid turning memory pressure into an avalanche.
Idempotency and fault tolerance. Stateless execution units mean any step may be replayed, so tool calls and code execution must be designed with idempotency keys, and external storage writes should be deduplicated by task identifier. Failure handling should be tiered: retryable errors go back to the queue with an incremented count, while semantic errors go directly to the dead-letter queue for offline analysis.
Externalized state and cost. The message body keeps only necessary context, large intermediate artifacts are written to object storage with a reference carried in the message; this controls queue load and makes problem review easier. On the model-call side, unit token cost can be reduced through in-batch merging, prefix caching, and tiered compute allocation by role.
Observability. Use the task identifier throughout the full chain, collecting per-step latency, retry rate, queue depth, and role saturation; monitoring and alerting should focus on backlog duration rather than instantaneous length, because the health of a decentralized system is reflected in flow speed.
5. A Reference Path for Building on the Cloud
You do not need to build all the infrastructure yourself: a container platform hosts the stateless agents and provides elastic scaling, the message queue handles point-to-point relay and dead letters, object storage holds long text and trace artifacts, and logging and monitoring services handle tracing and alerting. Baidu AI Cloud offers corresponding capabilities in these general categories, and scaling policies can be configured based on the backlog metrics of role queues to let compute scale smoothly with load.
6. Benefits and Applicability Boundaries
Under real synthetic data workloads, replacing batch-level barriers with per-row progress typically brings a several-fold improvement in token throughput, with the exact multiple depending on task length variance, the share of tool calls, and the failure retry rate. It is worth noting that decentralization is not unconditionally better: for scenarios with very short task chains, strict global ordering, or strong consistency auditing, centralized orchestration is instead easier to maintain. A more robust engineering approach is layering—use a message-based state machine at the outer layer for large-scale parallel generation, and keep lightweight coordination at the inner layer for individual strongly constrained flows.
In summary, the real threshold for large-scale synthetic data is the scheduling architecture rather than model capability. Encapsulating orchestration state as a migratable message, letting stateless agents relay point to point, and holding reliability with queue backpressure, idempotent replay, and externalized state is a viable paradigm for building a high-throughput data production line.
