AgentScaler 精读:环境扩展实现通用智能体能力
阿里通义团队提出 Environment Scaling 方法提升 Function Calling 泛化能力
AgentScaler: Towards General Agentic Intelligence via Environment Scaling
论文精读笔记 | arXiv: 2509.13311v1
作者: Runnan Fang, Shihao Cai, Baixuan Li, Jialong Wu, Guangyu Li 等 16 人
机构: 阿里巴巴(通义实验室)
发表时间: 2025年9月
关键词: Environment Scaling, Agentic Intelligence, Function Calling, Tool Learning, Agent Training
一、论文概览
1.1 核心问题
LLM Agent 的能力提升 根本性地受制于 agentic data 的稀缺——即 Agent 与环境交互产生的轨迹数据。现有环境构建方法要么不够真实、要么无法扩展,限制了 Agent 的 function-calling 能力泛化。
“Progress is fundamentally constrained by the scarcity of agentic data, i.e., trajectories generated by autonomous agents interacting with environments via explicit action executions, namely, tool calls.”
1.2 核心思路
通过环境扩展(Environment Scaling)推动通用代理智能。本文提出两个核心挑战及解决方案:
“This gives rise to two central challenges: (i) how to scale environments in a principled manner, and (ii) how to effectively train agentic capabilities from experiences derived through interactions with these environments.”
1.3 核心贡献
- 可扩展的自动化环境构建框架:从 30,000+ API 自动构建 1,000+ 个可执行仿真域
- 两阶段 Agent 微调策略:先建立通用能力基础,再领域专精化
- AgentScaler 模型系列(4B/8B/30B-A3B):在 τ-bench、τ²-Bench、ACEBench 上达到开源 <1T 参数模型的 SOTA
二、论文结构
1. Introduction
2. Environment Build and Scaling
2.1 Environment Automatic Build
2.2 Agentic Task Construction
3. Agent Experience Learning
3.1 Human-Agent Interplay for Experience Collection
3.2 Agentic Experience Learning
4. Experiments
4.1 Setup
4.2 Experimental Results
5. Analysis
6. Related Work
6.1 Tool-Use Environments
6.2 Tool Learning
7. Conclusion
8. Limitations
三、研究动机与背景
3.1 现有数据合成范式的不足
论文指出两种主流范式的缺陷:
| 范式 | 方法 | 问题 |
|---|---|---|
| 逆向范式(Reverse) | 先生成函数调用,再反推用户查询 | ”The resulting trajectories may exhibit limited realism” |
| 正向范式(Forward) | 模拟 Agent-Human 交互 | ”The environment is not scalable: the absence of automated environment construction hinders large-scale deployment” |
3.2 环境多样性决定能力边界
“The breadth of function-calling competence is closely tied to the diversity of environments in which agents are trained.”
这是本文的核心立论——环境的广度决定了 Agent 能力的广度,因此扩展环境是推进通用代理智能的关键路径。
3.3 现有环境构建的三种类型及局限
| 类型 | 优势 | 局限 |
|---|---|---|
| 真实世界环境 | 最真实的反馈 | 成本高、延迟大、难以维护稳定的 MCP 服务 |
| LLM 模拟环境 | 成本低 | ”Struggle with issues like hallucination and inconsistent response variability” |
| 基于状态配置的仿真环境 | 离线、低成本 | ”Constructing a reliable tool suite and a high-fidelity execution environment typically requires substantial manual effort” |
AgentScaler 的差异化:
“Our approach enables domain scalability through sampling from a tool graph, and eliminates the need for human intervention via a rigorous, rule-based validation pipeline.”
四、方法论:环境构建与扩展(Section 2)
4.1 设计原则:数据库中心化抽象
核心洞察:所有函数调用本质上都是对底层环境数据库的 读写操作。
- 每个函数
func被分配操作类型:op(func) ∈ {read, write} - Read 型函数:对数据库 𝒟 执行查询(检索、检查、监控)
- Write 型函数:引发数据库 𝒟 的状态转移(修改、生成、执行)
- 统一抽象:
API(func, α) ≡ op(func)(α; 𝒟),其中 α 为输入参数
同一领域的工具呈现 结构性相似的读写模式,共享通用数据库 schema 𝒮ₖ。
4.2 环境自动构建三阶段
阶段1:场景收集(Scenario Collection)
- 从 ToolBench、API-Gen 及内部仓库收集 30,000+ API
- 严格过滤低质量 API
- 重写 API 描述,加入显式输入输出规范
- 利用 API 间的输入输出关系构建工具组合
阶段2:工具依赖图建模(Tool Dependency Graph Modeling)
构建流程:
- 图构建:节点 = 工具,边 = 组合兼容性
- 相似度计算:
- 提取工具对的参数列表
- 转换为向量表示 φ
- 计算余弦相似度
- 公式:
E = {(i,j) | sim(φ(P_func_i), φ(P_func_j)) > τ, i ≠ j}
- 领域划分:使用 Louvain 社区检测算法 识别内聚的工具社区
- 每个社区构成一个领域(domain)
- 总计产生 1,000+ 领域
- 精炼:用 LLM 系统性检查域内工具对的依赖关系,提高边的准确性
阶段3:函数 Schema 程序化物化(Programmatic Materialization)
- 数据库 Schema 生成:利用域内所有工具的参数,生成领域专属数据库结构
- 代码形式化:将每个工具以 Python 代码形式化,实现对数据库 schema 的读写操作
“When generating database structures and formalizing code within specific domains of τ-bench, we observe through manual inspection that our outputs exhibit a high degree of consistency with the official implementations provided by τ-bench.”
4.3 代理任务构建(Agentic Task Construction)
采用正向模拟方法:
环境初始化 → 工具序列采样 → 参数生成与执行 → 验证
- 环境初始化:基于域数据库 schema 初始化环境状态,鼓励多样性
- 工具序列采样:从域工具图中采样逻辑一致的工具序列
“Starting from a randomly selected initial node, we conduct a directed walk until either the maximum execution steps are reached or a node with no outgoing edges is encountered.”
- 参数生成与执行:为每步生成参数,执行实际工具调用,直接在数据库上操作,持续跟踪数据库状态演化
- 双粒度验证:
- (i) 数据库级:状态一致性验证
- (ii) 工具序列级:精确匹配验证
五、方法论:Agent 经验学习(Section 3)
5.1 Human-Agent Interplay 经验收集
交互流程:
- 实例化一个 模拟用户(simulated user),负责表达给定的总体意图
- Agent 利用领域工具响应用户需求
- 交互持续至模拟用户认为任务完成
“Since we possess both the gold tool sequences and arguments for the overall intent and the final environment state, we can apply these as supervision signals for experience filtering.”
5.2 三阶段过滤框架(核心质量保障)
| 阶段 | 过滤粒度 | 作用 |
|---|---|---|
| ① Validity Control | 轨迹级 | 移除无效轨迹,确保交替的 user-assistant 交互格式,n-gram 过滤重复推理 |
| ② Environment State Alignment | 数据库/环境级 | 仅保留最终数据库状态与 golden state 匹配的轨迹,验证 write 操作有效性 |
| ③ Function Calling Exact Match | 工具序列级 | 最严格过滤——仅保留工具调用序列和参数与总体意图精确匹配的轨迹 |
关键设计:
“We do not filter out trajectories in which tool calls return errors. Thanks to the aforementioned filtering framework, such trajectories may still accomplish the intended goal despite intermediate failures. Retaining them in the training data helps improve the robustness of the model.”
保留包含工具调用错误的轨迹,只要最终目标达成——这有助于提升模型的鲁棒性。
5.3 训练目标与损失函数
给定 Agent-Human 交互轨迹 ℋ = (h₀, a₁, …, aₙ₋₁, hₙ, a₀),其中:
- hₜ = 第 t 轮人类指令
- aₜ = (τₜ, ρₜ, yₜ):
- τₜ = 函数调用 token
- ρₜ = 工具响应 token
- yₜ = 助手响应 token
损失函数(仅优化工具调用和助手响应):
ℒ(θ) = -1/∑ 𝕀[k ∈ 𝒯] · ∑ 𝕀[xₖ ∈ 𝒯] · log πθ(xₖ | x<k)
“All tokens in ρᵢ and hᵢ are masked out from supervision but remain visible in the context x<k. This ensures that the model conditions on tool responses and human instructions, while gradients are only propagated through assistant-generated tool calls and natural-language responses.”
关键:人类指令 hᵢ 和工具响应 ρᵢ 从监督中屏蔽(不计算梯度),但保留在上下文中供模型条件化。
5.4 两阶段经验学习框架
Stage 1: General Foundation Learning(通用基础学习)
- 在广泛的通用领域上训练
- 目标:建立工具使用和用户交互的基础技能
“Emphasis on breadth and generality, ensuring that the agent builds a versatile foundation of agentic behaviors before domain-specific specialization.”
Stage 2: Domain-Specific Specialization(领域专精化)
- 在垂直领域上进行细粒度训练
- 任务、工具、用户意图呈现领域特定特征
“By grounding the learning process in realistic scenarios within a target domain, the agent refines its ability to select tools, parameterize calls, and produce responses that are accurate, contextually appropriate, and aligned with domain-specific goals.”
六、实验结果(Section 4)
6.1 实验配置
| 配置项 | 详情 |
|---|---|
| 模型 | AgentScaler-4B / 8B / 30B-A3B |
| 基础模型 | Qwen3-Thinking-4B, Qwen3-8B, Qwen3-Thinking-30B-A3B |
| 基准 | τ-bench, τ²-Bench, ACEBench-en |
| 指标 | pass@1(τ/τ²-bench),Accuracy(ACEBench) |
| 对比模型 | 5 个闭源 + 15+ 个开源模型 |
6.2 主实验结果
τ-Bench(Retail & Airline)
| 模型 | Retail | Airline |
|---|---|---|
| 闭源最佳 | ||
| GPT-5 (think) | 78.3 | 44.0 |
| GPT-o3 | 70.4 | 52.0 |
| 开源大模型 | ||
| Kimi-K2-1T-A32B | 73.9 | 51.2 |
| Qwen3-Thinking-235B-A22B | 67.8 | 46.0 |
| Deepseek-V3.1-671B-A37B | 66.1 | 40.0 |
| AgentScaler 系列 | ||
| AgentScaler-4B | 64.3 | 54.0 |
| AgentScaler-8B | 50.4 | 42.0 |
| AgentScaler-30B-A3B | 70.4 | 54.0 |
亮点:AgentScaler-30B-A3B 在 Airline 上以 54.0 超越所有闭源模型(GPT-o3: 52.0, GPT-5: 44.0)。
τ²-Bench(Retail, Airline, Telecom)
| 模型 | Retail | Airline | Telecom |
|---|---|---|---|
| GPT-5 (think) | 81.1 | 62.6 | 96.7 |
| GPT-o3 | 80.2 | 64.8 | 58.2 |
| Kimi-K2-1T-A32B | 70.6 | 56.5 | 65.8 |
| Qwen3-Thinking-235B-A22B | 71.9 | 58.0 | 45.6 |
| AgentScaler-30B-A3B | 70.2 | 60.0 | 55.3 |
| AgentScaler-4B | 62.3 | 56.0 | 48.2 |
亮点:AgentScaler-4B(仅4B参数)在 Airline 上达 56.0,与 Kimi-K2-1T(万亿参数)持平。
ACEBench-en
| 模型 | Normal | Special | Agent | Overall |
|---|---|---|---|---|
| Gemini-2.5-pro | 76.7 | 90.0 | 63.4 | 78.2 |
| GPT-o3 | 78.3 | 86.7 | 63.3 | 78.2 |
| Kimi-K2-1T-A32B | 78.9 | 81.3 | 65.0 | 77.4 |
| Seed-OSS-36B | 79.1 | 82.0 | 58.4 | 76.7 |
| AgentScaler-30B-A3B | 76.7 | 82.7 | 60.0 | 75.7 |
| AgentScaler-8B | 69.2 | 76.7 | 44.2 | 67.4 |
| xLAM-2-70B-fc-r | 57.1 | 5.3 | 38.4 | 36.5 |
6.3 核心发现
发现1:小模型的代理潜力
“Notably, AgentScaler-4B achieves performance on par with 30B-parameter models despite using the fewest parameters, highlighting the agentic potential of compact LLMs.”
发现2:接近闭源水平
“AgentScaler-30B-A3B delivers results that are comparable to trillion-parameter open-source models and, in several domains, approach those of closed-source counterparts.”
发现3:高效部署友好
“These findings highlight the efficiency of our approach: agentic capabilities can be effectively learned and deployed even in relatively compact models, enabling competitive performance without relying on massive parameter counts.”
七、深度分析(Section 5)
7.1 OOD 泛化:ACEBench-zh 结果
在中文基准(非训练分布)上的表现:
| 模型 | Normal | Special | Agent | Overall |
|---|---|---|---|---|
| Qwen3-Thinking-4B(base) | 34.7 | 85.3 | 6.7 | 43.9 |
| AgentScaler-4B | 70.8 (+36.1) | 70.0 | 38.4 (+31.7) | 65.6 (+21.7) |
| Qwen3-8B(base) | 80.3 | 72.7 | 35.0 | 71.3 |
| AgentScaler-8B | 75.2 | 79.3 (+6.6) | 58.4 (+23.4) | 73.7 (+2.4) |
| Qwen3-Thinking-30B-A3B(base) | 73.4 | 86.7 | 55.8 | 74.2 |
| AgentScaler-30B-A3B | 85.3 (+11.9) | 83.3 | 64.1 (+8.3) | 81.5 (+7.3) |
最惊艳的结果:AgentScaler-4B 在 Agent 子集上从 6.7 飙升至 38.4(+31.7),Overall 从 43.9 到 65.6(+21.7)。
“Notably, the small Qwen3-4B model demonstrated a remarkable improvement in agentic capabilities after the two-stage training, with its score surging from 6.7 to 38.4 and substantial gain of 21.7 points in the overall score.”
结论:
“OUR SYNTHETIC DATA APPROACH ENABLES EFFICIENT KNOWLEDGE TRANSFER AND STRONG ROBUSTNESS AND GENERALIZATION.”
7.2 稳定性与一致性分析(Pass@k)
在 τ²-Bench 上评估 pass@k 指标(同一问题 k 次独立试验全部正确):
“The weighted overall score of AgentScaler-30B-A3B consistently surpasses that of Qwen3-Thinking-30B-A3B across all evaluated pass@k settings.”
关键观察:
“A clear downward trend in scores is observed as k increases, suggesting that the stability of existing LLMs remains a considerable challenge.”
随着 k 增加,所有模型得分下降——LLM Agent 的稳定性仍是核心挑战。
7.3 长视野工具调用分析
在 τ-Bench 上分析工具调用次数与准确率的关系:
“There exists a clear negative correlation between the number of tool calls and task accuracy. Our AgentScaler models exhibit this trend as well, underscoring that handling extended tool-use chains is still an open problem.”
工具调用次数越多,准确率越低——这是一个影响所有模型(包括 AgentScaler)的 根本性挑战。
7.4 两阶段训练消融
在 ACEBench-en 上对 Qwen3-Thinking-30B-A3B 进行消融:
“Both Stage 1 and Stage 2 training substantially improve performance over the base model across all subsets.”
- Stage 1:建立工具使用基础能力(通用领域广泛训练)
- Stage 2:进一步提升 Agent 子集得分(领域专精化)
“These results validate the design of the two-phase training pipeline: general foundation learning is critical for establishing tool-usage capabilities, and subsequent domain-specialization further consolidates and contextualizes these capabilities.”
八、图表总览
| 图/表 | 内容 | 关键信息 |
|---|---|---|
| Figure 1 | 环境自动构建与任务构造流程 | 三阶段管线:场景收集→工具依赖图→程序化物化 |
| Figure 2 | Agent-环境交互框架 | 模拟用户-Agent 交互循环,通过函数调用改变环境状态 |
| Figure 3 | 两阶段训练消融(ACEBench-en) | Stage 1 和 Stage 2 均显著提升性能 |
| Figure 4 | Pass@k 指标(τ²-Bench) | AgentScaler 一致优于基线;所有模型随 k 增加得分下降 |
| Figure 5 | 工具调用次数 vs 准确率(τ-Bench) | 负相关——长视野工具调用仍是开放问题 |
| Table 1 | 主实验全量结果 | 4 模型 × 3 基准 × 多领域完整数据 |
| Table 2 | OOD 泛化(ACEBench-zh) | AgentScaler-4B Agent 子集 +31.7 提升 |
九、局限性
局限1:缺乏强化学习
“While our approach leverages two-stage supervised fine-tuning (SFT), the simulated environment we construct provides stable and low-latency feedback, which is inherently well-suited for RL optimization.”
当前仅使用 SFT,未利用仿真环境的 RL 潜力。
局限2:模型规模受限
“Our method has so far only been validated on a 30B-scale architecture, without extension to larger models exceeding 200B or even trillion-parameter scales.”
但作者认为这与 “small language models are the future of agentic AI” 的趋势一致。
十、实践启示与个人思考
10.1 “环境扩展”范式的深远意义
本文提出的核心论点——环境多样性决定 Agent 能力边界——为 Agent 训练提供了一个新的 scaling 维度。传统的 scaling 关注模型参数量和训练数据量,而本文首次系统性地将 环境数量和多样性 作为 scaling 对象。
这与 “Experience Era” 的概念一致:
- 数据时代:更多文本 → 更好的语言能力
- 经验时代:更多(多样化的)环境交互 → 更好的代理能力
10.2 数据库中心化抽象的巧妙之处
将所有 API 统一为数据库的读写操作,实现了:
- 环境可验证性:通过对比数据库最终状态来验证轨迹质量
- 环境可扩展性:新领域只需定义新的数据库 schema
- 自动化构建:程序化物化消除了人工干预
这种抽象的精妙之处在于——它既足够通用以覆盖各种 API 类型,又足够具体以支持精确验证。
10.3 小模型的代理潜力
AgentScaler-4B 的表现令人印象深刻(Airline 54.0 超过 GPT-5 的 44.0),表明:
- 代理能力可以被高效注入小模型
- 训练数据质量和多样性比模型大小更重要
- 对边缘部署和资源受限场景意义重大
10.4 与 Don’t Break the Cache 的交叉联系
结合前一篇论文的发现,可以得出更完整的 Agent 系统设计图景:
- AgentScaler 回答了”如何训练更好的 Agent”
- Don’t Break the Cache 回答了”如何更高效地部署 Agent”
- 两者都关注了 长视野工具调用 这一核心挑战
10.5 未解决的问题与未来方向
- RL 结合仿真环境:论文已铺好地基,RL 训练是自然的下一步
- 长链工具调用的衰退:所有模型都面临的根本挑战,可能需要架构级创新
- 稳定性问题:pass@k 随 k 增加下降,Agent 的确定性和可靠性仍待提升
- 跨模态扩展:当前仅覆盖文本 API,多模态环境是开放方向
附:关键术语表
| 术语 | 定义 |
|---|---|
| Environment Scaling | 系统性扩展训练环境的数量和多样性以提升 Agent 能力 |
| Database-Centric Abstraction | 将所有函数调用统一为对底层数据库的读写操作 |
| Tool Dependency Graph | 工具间组合兼容性的有向图,节点为工具,边为依赖关系 |
| Louvain Community Detection | 用于将工具图划分为内聚领域的社区检测算法 |
| Programmatic Materialization | 将工具 schema 程序化为可执行的 Python 代码 |
| Two-Phase Training | 先通用基础学习,再领域专精化的训练策略 |
| Pass@k | 同一问题 k 次独立试验全部正确的概率指标 |
| AgentScaler | 本文提出的 Agent 模型系列(4B/8B/30B-A3B) |
| τ-Bench / τ²-Bench | 评估 Agent function-calling 能力的多轮交互基准 |
| ACEBench | 评估函数调用能力的基准(含 Normal/Special/Agent 子类) |
| Forward Paradigm | 正向模拟用户-Agent 交互来生成训练数据的方法 |
| Experience Era | 从原始语料和人工数据向 Agent 自主交互经验的范式转变 |
精读完成于 2026-03-08