Latest
Hugging Face shows how to train a four-agent swarm on a 0.6B model
Image: Hugging Face

Hugging Face shows how to train a four-agent swarm on a 0.6B model

Hugging Face has published the first part of a blog series on building, training and evaluating multi-agent swarms, with a reproducible example in which four copies of a small Qwen3-0.6B model learned to share information and solve a task. According to the company, training success rose from 6.6% to 82.3% over 75 updates.

The series, written by Ben Burtenshaw and Kashif Rasul, aims to show that swarms can be built with small, affordable models. Each post pairs background with an example that can be run on Hugging Face Jobs. The first takes about five hours on two H200 GPUs and costs roughly $50, Hugging Face said.

Illustration of a team of AI agents sharing messages in a multi-agent training setup
Image: Hugging Face

The task: pooling private numbers

The experiment reproduces an information-aggregation task from the paper “s³: Simple Scaling of Swarms via Cooperative Multi-agent RL”. Four agents share one policy but keep separate contexts. Each is given a private integer from 1 to 99 and must work out the full sorted list of all four numbers.

The team succeeds if at least one agent submits the correct list. Because no agent can infer the others’ numbers alone, communication is required. Agents use message, read_messages and check_notifications tools, and can send direct messages or broadcast to everyone.

How the training works

Successful teams get a reward that shrinks with the number of tokens used, while failed teams get zero. There is no separate reward for sending messages. For each problem, eight team attempts are collected and their rewards compared within the group. Every agent on a team receives that team’s advantage score, even if its own answer was wrong.

Illustration of a team of AI agents sharing messages in a multi-agent training setup
Image: Hugging Face

Results

Comparing the first and last five updates, success climbed from 6.6% to 82.3%, Hugging Face said. At checkpoint 75, the team solved 26 of 32 held-out problems (81.25%). The paper reports 93.2% four-agent success after 200 updates.

  • Generated tokens per team fell 37.4%, from about 12,800 to about 8,000.
  • Messages per team rose from 3.48 to 6.28.
  • Broadcasts rose from 2.38 to 5.73 per team.
  • Teams in which every agent sent exactly one broadcast went from 4.06% to 18.20%.

The authors also compared the trained team with simply retrying an untrained one. Using training data, the untrained team’s best of eight attempts solved 37.5% of problems at about 103,000 generated tokens per problem. A single attempt from the trained team solved 82.3% at about 8,000 tokens. Hugging Face described this as an estimate, since both rows use training problems.

Why it matters

The post opens by noting mixed evidence on large swarms. It cites OpenAI’s September claim that roughly 10,000 agents found a singularity in the 3D Navier-Stokes equations, and Noam Brown’s estimate that under 10% of that result came from cooperation. It also points to Anthropic’s vulnerability-finding experiment, where coordinated agents found more bugs but, restricted to the same directories, performed about the same per million tokens.

The series’ central question is whether communication helps or whether teams are just spending more compute. This first task cannot answer that directly, Hugging Face said, because a single agent cannot solve it. A later post will use a task one agent can solve alone, allowing comparisons at matched budgets.

Running it yourself

The original experiment used one H200 for training and seven running vLLM rollouts. The walkthrough uses TRL’s async GRPO example on two H200s, with one serving the policy and one training it, for 50 updates. TRL’s own run took about 4.8 hours on two H100s and reached 60.9% held-out success at checkpoint 50, according to the post.

Readers can approach the original setup by using 75 updates and 256 teams per update, which means three times as many rollouts and a 24-hour timeout. Hugging Face cautioned that the codebases differ in details such as the system prompt, so results will be similar rather than identical.

Later posts will step back from training to look at how swarms are evaluated and analysed.

Source: Hugging Face Blog