# Simple Scaling of Swarms viaCooperative Multi-agent RL

## Executive summary

The discussion details S3, a novel extension to GRPO designed for training collaborative multi-agent systems (swarms). S3 enables asynchronous communication between agents using a `send message` tool. The system is tested on two toy environments—Information Aggregation and Decentralized Exploration—and focuses heavily on the complexity of scaling, resource contention (KV cache), and designing a token-efficient reward function that balances correctness and computational cost.

## Key takeaways

- S3 Swarm Architecture and Communication: S3 allows agents to communicate asynchronously using a `send message` tool, which takes a recipient (one or multiple agents) and a text payload. This contrasts with setups where agents are isolated or rely on a single orchestrator.
- Task Environments and Scaling Laws: Two tasks were used: Information Aggregation (sorting a list of integers) and Decentralized Exploration (finding a path through a maze). The results showed that the Information Aggregation task suffered from a collapse in success rate as agent count increased, while Decentralized Exploration showed stable scaling up to 8 agents.
- Token-Weighted Reward Function: The reward is calculated as a binary success factor multiplied by a weighted factor (involving $\lambda=0.25$). This design incentivizes both correctness (success) and token efficiency (total token consumption $N \times L$).
- Resource Contention and Optimization: To prevent agents from monopolizing VLM resources (KV cache), the system splits generations into requests of at most 1,024 new tokens. This allows a request to end early (at a tool call or response end), enabling other agents to progress and reducing blocking.

## Technical details

- Agent Training Framework: The system uses a modified GRPO framework. Rollouts are independent team rollouts, where $G$ teams run in parallel, and each team has $N$ agents (e.g., $8 \times 4$ agents). The advantage is a normalized JPO advantage calculated over the averages of all other teams running in parallel.
- Asynchronous Execution: Agents operate asynchronously. An episode is considered over when any one agent from the team submits an answer, allowing the training process to avoid waiting for slower workers within a team.
- VLM Resource Management: The implementation handles VLM server contention by limiting requests to 1,024 new tokens. This mechanism ensures that a single agent's long trajectory does not block the entire slot pool, allowing other agents to make progress.

## Practical implications

- Demonstrates a method for scaling multi-agent systems beyond simple leader-follower models, allowing for decentralized coordination.
- Provides a mechanism (token-weighted reward) to incentivize not just task completion, but also computational efficiency in LLM-driven agents.
- Offers a technical solution (early request termination) to mitigate resource contention issues when deploying large swarms against a shared VLM server.

## Topics

Reinforcement Learning, Multi-Agent Systems, AI Scaling, LLM Optimization, Distributed Computing, Simple Scaling of Swarms via Cooperative Multi-agent RL

Source: https://www.youtube.com/watch?v=SUP5rlVHI0Y
