ai, agents, deep dive,

Deep Dive: Training Swarms, Teaching Four Small Agents to Communicate (and Counting What It Costs)

Cui Cui Follow Dec 05, 2026 · 8 mins read
Deep Dive: Training Swarms, Teaching Four Small Agents to Communicate (and Counting What It Costs)
Share this

Hugging Face published Swarms, Flocks, Gangs: How to build, train, and evaluate multi-agent systems on Nov 26, 2026. It is Part 1 of a series on building swarms and training small, affordable models to work in them.

This is a reading of the article. I did not run the experiment, so every number below is the authors’ report. Where I add interpretation, I say so.

The workflow in motion

Animated workflow: private numbers, four agents sharing one policy, messaging tools, submitting a sorted list, team reward, policy update

My illustration of the article’s task and training loop, not a recorded episode or a diagram from the article.

The question behind the series

The article’s framing is that a big swarm is not, by itself, evidence that cooperation helped. It cites examples to make the point: Noam Brown’s estimate that less than 10% of a Navier-Stokes result came from multi-agent cooperation, and Anthropic’s vulnerability-finding experiment, where coordinated agents found more bugs but also searched more code and used more tokens, with per-token results about the same on matched directories.

So the series keeps asking one thing: when agents communicate, does it actually help, or are we just spending more compute? The fair test is an equal budget. Do four agents with a quarter of the tokens each beat one agent that spends all of them? The authors say that depends on the task, the model and how the work is divided.

Setup: a decentralized team

The article gives a short multi-agent RL primer. A team shares a reward but each agent sees part of the world, a decentralized partially observable MDP. That creates three problems the article lists: teammates keep changing while each agent learns, credit assignment, and the fact that a message changes what others observe, so communication is part of the policy being trained.

It contrasts two organizations:

  • Hierarchy: a lead assigns work to workers and collects results. The article cites Anthropic’s Research system, and Kimi K2.5’s PARL, which trains only the orchestrator and keeps subagents frozen.
  • Distributed team: peers message each other and decide when to read their inboxes, with no lead assigning actions. This is what the experiment uses, following the information-aggregation task in the s³ paper.

The task: four agents ordering numbers

Each agent gets one integer from 1 to 99, knows its teammates’ names, and does not know the others’ numbers. The team succeeds when at least one agent submits the complete, correctly sorted list, duplicates kept (for example [5, 5, 26, 78]).

Tools are message(to, text), read_messages() and check_notifications(). A notification says unread messages exist; reading the inbox reveals them. Agents can message directly or broadcast. All four agents are one shared Qwen3-0.6B policy with separate contexts and private inputs, not four different models.

The article is explicit about what this task does not test. Because each agent holds information the others need, a single agent or a team without messaging cannot succeed however many retries it gets. So it tests the precondition: can a small shared policy learn to communicate at all, and at what token cost? The matched-budget comparison is deferred to a later post with a task one agent can solve alone.

Reward design

A successful team gets a reward reduced by the tokens it uses; a failed team gets zero. The article gives the formula:

team allowance = 4 x (8,192 work tokens + 1,024 final-answer tokens) = 36,864
reward = success x (1 - 0.25 x min(1, generated team tokens / 36,864))

A correct team using half its allowance gets 0.875. There is no separate reward for messaging, so the incentive is to solve the task with fewer generated tokens.

For each problem, eight independent team attempts are collected and rewards are normalized within that group. Attempts above their group mean get a positive advantage, those below a negative one, and every agent in a team receives that team’s advantage, including an agent whose own final answer was wrong. In TRL each agent’s sampled tokens form a training row, and loss is averaged within each team and then across teams so longer conversations do not weigh more.

My note: giving all four agents the same advantage is the simplest answer to credit assignment, and it means there is no agent-specific penalty for free-riding, since credit is assigned at team level. The article does not discuss that trade-off.

Results

Reported over 75 updates:

  • Training success rose from 6.6% to 82.3% (first five vs last five updates).
  • At checkpoint 75 the team solved 26 of 32 held-out problems (81.25%). The article notes the paper reports 93.2% after 200 updates.
  • Generated tokens per team fell 37.4%, from about 13k to 8k, while broadcasts rose from 2.38 to 5.73 per team.

The article’s caution: fewer tokens did not mean fewer messages, and generated tokens include reasoning and tool calls, so message count alone does not show how much text the team produced. It also says the token-efficiency numbers are training measurements, because held-out token data was not retained.

Retries vs a trained team

Since no agent can solve the task alone, the closest “single agent with retries” is the untrained team with more retries. Counting a problem solved if any of its eight attempts succeeded early in training:

  • Untrained team, best of 8: 37.5% success at about 103,000 tokens per problem.
  • Trained team, one attempt: 82.3% at about 8,000 tokens.

The article reads this as an estimate: both rows use training problems, and updates 2 to 5 already sample from a slightly trained policy.

The infrastructure bill

The model is small but rollouts are not. Each update generates millions of tokens of conversation at up to 40k context. The original run used one H200 for the trainer and seven running vLLM rollout engines, with 32 problems per update, 8 attempts each, learning rate 5e-7 and temperature 1.0 over a pool of 1,024 generated problems.

The two-GPU walkthrough, simplified from the article’s script.

Reproducing it

The walkthrough runs TRL’s swarm example on Hugging Face Jobs with two H200s: create a bucket, run a script that clones TRL, serves the base model with vLLM, evaluates it, trains 50 updates, then evaluates the checkpoint. The article says TRL’s own run took about 4.8 hours on two H100s and reached 60.9% held-out success at checkpoint 50. The introduction estimates about five hours on two H200s and roughly $50 for the post’s example. To approach the original, the article suggests 75 updates with 256 teams per update and a 24h timeout, noting that the two codebases differ in details such as the system prompt, so expect similar rather than identical results.

Design ideas worth borrowing

These are my interpretation.

  1. Pick a task where communication is necessary. Information asymmetry isolates the skill of learning to communicate. A task one agent can solve alone is what later allows the matched-budget test of whether communication improves performance.
  2. Charge for tokens inside the reward, not as a separate message penalty. The team can then discover what to say and how much.
  3. Report success and cost together. The best-of-8 comparison shows 82% at 8k tokens vs 37.5% at 103k is a different claim than success alone.
  4. Group-relative scoring fits multi-agent rollouts. Eight attempts per problem give a baseline without a separate value model.

Where I would push back

  • The 0.6B model, a four-agent team and an easy-to-check sorting task are a long way from a production swarm. The article is open that this is an educational first step.
  • The 82.3% and 37.4% figures are training-batch measurements, and the retries comparison reuses training problems. The held-out result is 26 of 32, a small sample.
  • Experiment and walkthrough numbers differ (256 vs about 150 team attempts per update, 75 vs 50 updates), so the walkthrough will not exactly reproduce the headline figures.
  • Communication structure is only partly characterized: the article says the team had not converged to the cleanest pattern at 75 updates.

Takeaways

  • Treat agent count as a scaling dimension and always compare at matched budgets.
  • A small shared policy learned to pool private information, going from 6.6% to 82.3% training success, with fewer tokens per attempt.
  • Cooperation became cheaper per attempt than brute-force retries in this setup, which is the claim to carry into later, harder tasks.
  • The article says coming examples will step back from training to evaluate and analyze swarms.

Source: Hugging Face, Swarms, Flocks, Gangs.

Building or evaluating multi-agent systems? Get in touch.

Join Newsletter
Get the latest news right in your inbox. We never spam!
Cui
Written by Cui Follow
Hi, I am Z, the coder for cuizhanming.com!

Click to load Disqus comments