> ## Content Index
> Fetch the complete content index at: https://globalfeed.ai/llms.txt
> Use this file to discover other available public pages before exploring further.

# 四个小智能体如何学会一起思考？Hugging Face 多智能体训练指南
- URL: https://globalfeed.ai/zh/si-ge-xiao-zhi-neng-ti-ru-he-xue-hui-yi-qi-si-kao-hugging-face-duo-zhi-neng-ti-xun-lian-zhi-nan/
- Published: 2026-11-29T18:40:02.000Z
- Updated: 2026-11-29T18:40:02.000Z
- Description: Hugging Face 指南用强化学习教同一小模型的四个副本通过交流合作：实验设置、奖励设计与复现方法。
- Author: GlobalFeed Editor
- Tags: Hugging Face, 多智能体, dil-zh, elle

给四个人各悄悄说一个数字，谁也不知道别人的数字，任务是把四个数从小到大说出来。一个人做不到，必须交流。Hugging Face 的 Ben Burtenshaw 和 Kashif Rasul 于 11 月 26 日发布的[指南](https://huggingface.co/blog/training-swarms?ref=globalfeed.ai)让 AI 智能体玩这个游戏，并一步步展示如何用强化学习教会它们合作。同一个小模型的四个副本在 75 次更新后，成功率从 6.6% 升至 82.3%，而且消耗的 token 更少。

## 实验与训练

任务来自 [s3 论文](https://huggingface.co/papers/2611.08615?ref=globalfeed.ai)：每个智能体持有 1 到 99 之间的一个私有整数，通过 `message`、`read_messages` 等工具交流，至少一人提交完整排序列表即算成功。四个智能体共享同一个 Qwen3-0.6B 策略。团队预算为 36,864 个 token，奖励为“成功 ×（1 − 0.25 × 使用比例）”，发消息本身不得分。训练在 TRL 中以 GRPO 方式进行：每题 8 次团队尝试，团队中每个智能体都获得团队优势。

## 结果与复现

每队 token 从约 12,800 降到 8,000，消息数从 3.48 增至 6.28：智能体学会了说得更多但更简短。作者也指出，该任务单个智能体无法完成，因此尚未与同预算的单智能体比较，后续文章会补上。指南建议在 Hugging Face Jobs 上用 2 张 H200 约 5 小时、约 50 美元复现，代码位于 [TRL 示例](https://github.com/huggingface/trl/tree/main/examples/async%5Fgrpo%5Fs3%5Faggregation?ref=globalfeed.ai)。

来源： [Hugging Face 指南](https://huggingface.co/blog/training-swarms?ref=globalfeed.ai), [s3 论文](https://huggingface.co/papers/2611.08615?ref=globalfeed.ai), [TRL 示例代码](https://github.com/huggingface/trl/tree/main/examples/async%5Fgrpo%5Fs3%5Faggregation?ref=globalfeed.ai)