AI News AI资讯 13h ago Updated 12h ago 更新于 12小时前 49

KwaiKAT Team Releases KAT-Coder-V2.5: An Agentic Coding Model Trained on 100,000+ Verifiable Repository Environments KwaiKAT团队发布KAT-Coder-V2.5:在10万多个可验证仓库环境中训练的代理编码模型

KwaiKAT introduces KAT-Coder-V2.5, an agentic coding model trained on 100,000+ verifiable environments derived from real pull requests and commits, moving beyond single-turn code generation. The team developed "AutoBuilder," a system using build and verification agents to create isolated, executable repository environments with a >90% test success acceptance rule. A novel data scaling flywheel filters trajectories based on process quality rather than just final test success, using targeted hints KwaiKAT发布KAT-Coder-V2.5,一种在真实可执行仓库中训练的Agentic编码模型,而非仅生成单轮代码。 构建了包含10万+跨12种语言的可验证环境数据集,通过AutoBuilder实现自动化环境构建与测试验证。 提出“数据扩展飞轮”,利用过程级提示和基于规则的筛选机制,从失败轨迹中提取有价值的搜索与修复行为。 解决基础设施瓶颈,将沙箱反馈错误率从16%降至2%以下,并采用非对称PPO及三层奖励机制优化训练。 在PinchBench基准测试中以94.9分超越Opus 4.8,但在Terminal-Bench等特定场景下表现仍有差距。

72
Hot 热度
68
Quality 质量
70
Impact 影响力

Analysis 深度分析

TL;DR

  • KwaiKAT introduces KAT-Coder-V2.5, an agentic coding model trained on 100,000+ verifiable environments derived from real pull requests and commits, moving beyond single-turn code generation.
  • The team developed "AutoBuilder," a system using build and verification agents to create isolated, executable repository environments with a >90% test success acceptance rule.
  • A novel data scaling flywheel filters trajectories based on process quality rather than just final test success, using targeted hints for near-misses and rigorous scoring for passing runs to prevent harness overfitting.
  • Significant infrastructure improvements reduced sandbox feedback errors from ~16% to <2%, including fixing token drift and disk eviction policies, which stabilized the reinforcement learning training process.
  • KAT-Coder-V2.5 achieves state-of-the-art results on PinchBench (94.9) and competitive scores on SWE-Bench Pro, demonstrating strong performance in complex, multi-turn coding tasks.

Why It Matters

This research highlights the critical importance of high-quality, verifiable training data and robust infrastructure in developing effective agentic AI models for software engineering. By shifting focus from simple code completion to full repository-level problem solving with strict verification loops, it sets a new standard for how coding models should be trained and evaluated. The detailed analysis of infrastructure failures and reward shaping offers valuable lessons for practitioners attempting to scale reinforcement learning for complex, multi-step reasoning tasks.

Technical Details

  • Data Construction (AutoBuilder): Tasks are mined from real PRs, discarding raw issue text in favor of regenerated specifications based on golden patches and test patches. AutoBuilder uses a build agent to generate configuration scripts and a verification agent to ensure environments pass >90% of tests consistently, resulting in 100k+ environments across 12 languages.
  • Process-Level Filtering: Instead of filtering by final outcome, the team uses a "Data Scaling Flywheel." Near-miss trajectories receive targeted process hints to guide repair without leaking solutions, while passing trajectories are scored on exploration, localization, and patch minimality to remove exploitative or unstable samples.
  • Training Architecture: The model uses Asymmetric PPO with GAE. The Critic has access to privileged context (rewards, tests, coverage), while the Actor only sees rollout state. Rewards are three-tiered: Core Task Scores (test pass/fail), Standard Behavior Constraints (penalizing bad practices), and Failed Trajectory Incentives (partial credit for file retrieval).
  • Infrastructure Fixes: Key fixes included an early-release image eviction policy to reduce disk usage, correcting environment variables to prevent reward flipping, and bypassing mainstream chat endpoints to eliminate 40% token drift at scale.
  • Distillation: Five expert models are fused via Multi-Teacher On-Policy Distillation using reverse KL divergence and drift-aware truncation.

Industry Insight

  • Verification is Key to Agentic Reliability: The success of KAT-Coder-V2.5 underscores that agentic coding models require rigorous, automated verification loops within their training data construction. Simple code generation benchmarks are insufficient; models must be trained to operate within executable, testable environments.
  • Infrastructure Stability Dictates RL Success: The audit revealing that 16% of training failures were due to infrastructure issues (token drift, sandbox timeouts) rather than model policy suggests that scaling RL for agents requires significant investment in stable, deterministic execution environments. Neglecting these details can lead to misleading reward signals and training collapse.
  • Process Quality Over Outcome Metrics: Filtering training data based on the quality of the reasoning process (e.g., search behavior, localization accuracy) rather than just the final test result helps prevent models from learning shortcuts or exploiting test harnesses. This approach leads to more robust generalization and honest behavior in complex coding tasks.

TL;DR

  • KwaiKAT发布KAT-Coder-V2.5,一种在真实可执行仓库中训练的Agentic编码模型,而非仅生成单轮代码。
  • 构建了包含10万+跨12种语言的可验证环境数据集,通过AutoBuilder实现自动化环境构建与测试验证。
  • 提出“数据扩展飞轮”,利用过程级提示和基于规则的筛选机制,从失败轨迹中提取有价值的搜索与修复行为。
  • 解决基础设施瓶颈,将沙箱反馈错误率从16%降至2%以下,并采用非对称PPO及三层奖励机制优化训练。
  • 在PinchBench基准测试中以94.9分超越Opus 4.8,但在Terminal-Bench等特定场景下表现仍有差距。

为什么值得看

这篇文章展示了Agentic AI从“代码生成”向“完整工程任务执行”演进的关键技术路径,特别是如何处理复杂、动态的真实开发环境。其提出的环境构建自动化(AutoBuilder)和数据清洗飞轮机制,为解决AI编程助手在长周期、多步骤任务中的可靠性问题提供了极具参考价值的工程实践方案。

技术解析

  • 可验证任务框架与AutoBuilder:将任务定义为“描述-环境-测试”三元组。AutoBuilder由构建代理和分析代理组成,自动分析仓库依赖并生成配置脚本,在隔离沙箱中执行。验证逻辑不依赖退出码,而是解析结构化测试输出,要求90%以上预期测试通过且结果可复现,成功将环境构建成功率从16.5%提升至57.2%。
  • 数据筛选与飞轮机制:摒弃仅以最终测试成功为标准的过滤方式,保留包含有价值搜索行为的失败轨迹。对“接近成功”的轨迹提供无答案泄露的过程提示,提升通过率至20%;对成功轨迹则通过规则门控去除作弊或硬编码样本,并对工具调用、提示模板等进行随机化扰动以对抗Harness过拟合。
  • 训练架构与奖励设计:采用带GAE的非对称PPO算法,Critic使用特权信息(如覆盖率、补丁元数据),Actor仅观察 rollout 状态。奖励分为三层:核心任务得分(必须通过所有fail_to_pass和pass_to_pass测试)、标准行为约束(惩罚重复调用和调试残留)、失败轨迹激励(对文件检索和部分测试通过给予奖励)。
  • 基础设施稳定性优化:识别出约16%的训练失败源于沙箱基础设施而非模型策略。通过实施镜像早期释放策略降低磁盘占用、修正环境变量防止奖励翻转、以及绕过主流聊天端点直接调用/generate接口以避免Token漂移,将沙箱错误率降至2%以下。

行业启示

  • 环境真实性是Agentic AI的核心壁垒:单纯的代码补全能力已不足以支撑复杂工程任务,构建能够自动处理依赖、测试和隔离环境的标准化流水线(如AutoBuilder)是提升模型实际可用性的关键基础设施。
  • 过程质量优于结果标签:在RLHF或RLVR训练中,应深入挖掘“失败”或“接近成功”轨迹中的推理价值,通过过程级反馈而非简单的二元结果来引导模型学习更稳健的调试和定位能力。
  • 系统稳定性决定训练上限:在大规模强化学习训练中,基础设施的微小偏差(如Token漂移、环境变量冲突)可能导致严重的信号噪声,建立严格的基础设施监控和隔离机制是保障模型收敛的必要条件。

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Open Source 开源 Agent Agent Code Generation 代码生成 Programming 编程 Research 科学研究