Swarm patterns & emergent coordination — Agentic Systems Engineer (Free Preview) — Claude Cert Academy

Swarms accelerate embarrassingly parallel tasks — and degrade sequential reasoning by 39–70%, making task type the most important architectural choice.

The swarm pattern promises a compelling scaling story: replace a single coordinator with dozens of homogeneous agents working in parallel. For the right class of tasks, this delivers real gains. Bulk document summarization, web crawling, and independent data extraction complete significantly faster with swarm coordination than with sequential execution. The problem emerges when teams apply swarms to the wrong class of tasks.

In 2025, Google DeepMind published 'Towards a Science of Scaling Agent Systems,' an empirical analysis of multi-agent performance across task types. The key finding — now called the Parallelism Cliff — quantifies what practitioners had suspected: adding more agents to sequential reasoning pipelines degrades performance by 39–70%. Coordination overhead, context fragmentation, and inter-agent communication cost overwhelm any parallelism benefit when each step must build on the previous one.

This lesson covers the two primary swarm topologies (leaderless and thin-orchestrator), the Mixture of Agents pattern that sits adjacent to both, and the task-type test that must precede every architecture decision.

Subtopic 1.1. Questions present a task type and ask whether a swarm is appropriate. The Parallelism Cliff statistic (39–70% degradation on sequential tasks, DeepMind 2025) is a high-frequency exam fact. Trap: 'swarm = no coordinator' — many production swarms use a thin orchestration layer for routing and aggregation.

Leaderless vs. thin-orchestrator swarms

A leaderless swarm has no coordinator. Agents self-organize, broadcast their state, and claim available tasks from a shared queue. This maximises fault tolerance (no single point of failure) but requires consensus mechanisms and produces unpredictable task assignment under load. A thin-orchestrator swarm adds a minimal routing layer — just enough to assign tasks and collect results — without owning business logic. This is the production default for most swarm deployments because it preserves parallelism while adding deterministic routing.

import anthropic
import asyncio
from asyncio import Queue

client = anthropic.Anthropic()

async def swarm_worker(worker_id: int, task_queue: Queue, results: list) -> None:
    while not task_queue.empty():
        try:
            task = task_queue.get_nowait()
        except Exception:
            break
        response = await asyncio.to_thread(
            client.messages.create,
            model="claude-opus-4-7",
            max_tokens=512,
            system="You are a document summarization worker. Return a concise one-paragraph summary.",
            messages=[{"role": "user", "content": f"Summarize: {task}"}],
        )
        results.append({"worker_id": worker_id, "summary": response.content[0].text})
        task_queue.task_done()

async def run_thin_orchestrator_swarm(documents: list[str], n_workers: int = 5) -> list[dict]:
    queue: Queue = Queue()
    for doc in documents:
        await queue.put(doc)
    results: list = []
    workers = [asyncio.create_task(swarm_worker(i, queue, results)) for i in range(n_workers)]
    await queue.join()
    for w in workers:
        w.cancel()
    return sorted(results, key=lambda x: x["worker_id"])

Mixture of Agents (MoA): parallel proposals, unified synthesis

MoA differs from both swarms and hub-and-spoke: multiple proposer agents generate independent candidate responses in parallel, then one or more aggregator agents synthesize the proposals into a final output. The aggregator sees all proposals simultaneously, allowing it to select, combine, and refine across the full proposal space. MoA consistently outperforms single models on benchmarks requiring diverse perspectives — reasoning tasks where different framings reveal different insights.

import anthropic
import asyncio

client = anthropic.Anthropic()

async def proposer(prompt: str, perspective: str) -> str:
    response = await asyncio.to_thread(
        client.messages.create,
        model="claude-opus-4-7",
        max_tokens=512,
        system=f"You are analyzing from the perspective of {perspective}. Provide your independent analysis.",
        messages=[{"role": "user", "content": prompt}],
    )
    return response.content[0].text

async def aggregator(prompt: str, proposals: list[str]) -> str:
    combined = "\n\n".join(f"Perspective {i+1}:\n{p}" for i, p in enumerate(proposals))
    response = await asyncio.to_thread(
        client.messages.create,
        model="claude-opus-4-7",
        max_tokens=1024,
        system="You are a synthesis agent. Combine the strongest elements of these independent analyses into a single authoritative response.",
        messages=[{"role": "user", "content": f"Question: {prompt}\n\nAnalyses:\n{combined}"}],
    )
    return response.content[0].text

async def mixture_of_agents(prompt: str) -> str:
    perspectives = ["a security engineer", "a product manager", "a systems architect"]
    proposals = await asyncio.gather(*[proposer(prompt, p) for p in perspectives])
    return await aggregator(prompt, list(proposals))

'Adding more agents always improves system performance' — false for sequential reasoning tasks. The Parallelism Cliff (Google DeepMind, 2025) shows 39–70% performance degradation when multi-agent coordination is applied to tasks that require sequential reasoning. Always classify the task type before choosing a topology.

The Parallelism Cliff is most dangerous precisely because swarms work well on the tasks teams try first. A team that succeeds at document summarization with a swarm builds an incorrect mental model: 'swarms are better.' When they apply the same approach to chain-of-thought reasoning, multi-step planning, or iterative debugging, the degradation is unexpected and hard to diagnose.

Swarms accelerate embarrassingly parallel, homogeneous tasks. They degrade sequential reasoning by 39–70% (DeepMind, 2025). Classify task type first — parallel or sequential — then choose the topology.

Continue to Claude Cert Academy