Abstract
KAT-Coder is a 32B parameter model designed to transition from static code generation to autonomous agentic software engineering. By employing a hierarchical four-stage training curriculum—comprising Mid-Term Training, Supervised Fine-Tuning (SFT), Reinforcement Fine-Tuning (RFT), and Agentic Reinforcement Learning (RL)—KAT-Coder achieves state-of-the-art performance on complex benchmarks like SWE-Bench-Verified. This report details the architectural innovations, including Trie-Packed Training and relative reward mechanisms, that enable efficient and stable training for long-horizon programming tasks.
1. Introduction
Traditional code models often excel at isolated function completion but struggle within the dynamic environments of real-world Integrated Development Environments (IDEs). Agentic coding requires models to reason, plan, and execute across heterogeneous tools such as debuggers, linters, and compilers. KAT-Coder addresses three primary challenges in this domain: the distribution mismatch between linear training data and iterative coding, training instability in reinforcement learning for code, and the computational inefficiency of re-processing shared prefixes in agentic trajectories.
2. Methodology: The Four-Stage Training Pipeline
The development of KAT-Coder follows a structured curriculum designed to progressively build reasoning and execution capabilities.
2.1 Mid-Term Training
To activate reasoning, the model is first exposed to 20B tokens of real-world GitHub data (pull requests, commits) and synthetic Chain-of-Thought (CoT) trajectories. This stage focuses on teaching the model to plan and reflect before generating code.
2.2 Supervised Fine-Tuning (SFT)
A curated 1-million-sample dataset covers 20+ programming languages and 10 task archetypes. To mitigate the impact of noisy execution logs, the authors introduced Error-Masked SFT, which selectively masks gradients from failed tool calls, preventing the model from internalizing incorrect patterns.
2.3 Reinforcement Fine-Tuning (RFT)
KAT-Coder utilizes a relative evaluation framework. Instead of relying on absolute pass/fail rewards, the model is optimized based on the discrepancy between its generated output and a corrected ground-truth trajectory, providing a smoother gradient for learning.
2.4 Agentic Reinforcement Learning
The final stage employs Trie-Packed Training to optimize computational throughput. By organizing multiple trajectories into a prefix tree (Trie), the model avoids redundant computations for shared history.
3. Technical Innovations
3.1 Trie-Packed Training
In agentic workflows, the model frequently evaluates different trial-and-error branches from the same initial state. Trie-Packing treats training data as a tree rather than a list, allowing the model to compute shared prefixes only once during backpropagation. This approach significantly reduces memory overhead and increases training speed.
3.2 Relative Rewards and Entropy Scaling
To stabilize RL, KAT-Coder uses relative rewards compared against reference trajectories. Furthermore, Entropy-Aware Scaling is applied to boost the importance of high-difficulty, high-uncertainty samples, ensuring the model continues to explore diverse solutions for complex problems rather than over-optimizing on simple tasks.
4. Evaluation and Results
KAT-Coder (KAT-Dev 32B) demonstrates superior performance across several competitive benchmarks:
- SWE-Bench-Verified: Achieved a score of 73.4, outperforming larger models like Qwen3-Coder-480B (69.6) and rivaling Claude 3.5 Sonnet (72.7).
- Mathematical Reasoning: Scored 72.5 on AIME 2025, validating that its mid-term reasoning training generalizes beyond code to logic and mathematics.
- Base Coding Proficiency: Maintained a score of 96.3 on HumanEval, ensuring that agentic enhancements do not degrade fundamental coding skills.
5. Conclusion
KAT-Coder represents a significant step toward autonomous software engineering agents. By combining a rigorous four-stage curriculum with efficiency-focused innovations like Trie-Packed Training, the model achieves high-tier performance with a relatively modest 32B parameter count. Future work will focus on multi-modal capabilities for GUI-based debugging and extending memory for long-horizon project management.
Summary updated