offmonreal commited on
Commit
0c5548d
·
verified ·
1 Parent(s): 5ed522b

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +534 -0
README.md ADDED
@@ -0,0 +1,534 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: Kwaipilot/KAT-Coder-V2.5-Dev
4
+ tags:
5
+ - gguf
6
+ - llama.cpp
7
+ - turboquant
8
+ - qwen35moe
9
+ - quantized
10
+ - imatrix
11
+ - coding
12
+ - agent
13
+ - consumer-gpu
14
+ - offmoreal
15
+ ---
16
+
17
+ # KAT-Coder-V2.5-Dev MaxQuality iMatrix GGUF
18
+
19
+ Quality-first GGUF quants for running a 35B MoE agentic-coding model on consumer hardware. This release aims for the best practical balance of output quality, generation speed, and memory use — not merely the smallest possible file.
20
+
21
+ The upstream checkpoint declares a vision-capable architecture class (`Qwen3_5MoeForConditionalGeneration`) in its config, but the released weights already contain zero vision tensors — there was nothing to strip. The config was restructured to the plain text-only causal-LM form (`Qwen3_5MoeForCausalLM`) required for GGUF conversion; the weights themselves are untouched.
22
+
23
+ ## Files
24
+
25
+ | File | Size | BPW | Intended use |
26
+ |---|---:|---:|---|
27
+ | `KAT-Coder-V2.5-Dev_Q4_K_M_imatrix.gguf` | 19.70 GiB | 4.88 | Higher quality with a balanced MoE CPU/GPU split |
28
+ | `KAT-Coder-V2.5-Dev_Q3_K_M_imatrix.gguf` | *coming shortly* | — | Quality-focused smaller option for consumer GPUs |
29
+
30
+ Both files are calibrated with an iMatrix built from `calibration_datav5.txt` (802 chunks, full expert coverage — 0 tensors with partial data at the final checkpoint).
31
+
32
+ ## Quantization profiles
33
+
34
+ ### Q4_K_M iMatrix
35
+
36
+ Plain `Q4_K_M` quantization with imatrix guidance — no manual per-tensor overrides. llama.cpp's own K-quant preset applies a position-dependent mix within several tensor roles (it protects tensors in the earliest/latest layers with higher precision); the table below reflects the actual observed split, not a simplification.
37
+
38
+ - Embedding (`token_embd`): Q4_K; Output (`lm_head`): Q6_K
39
+ - MoE router (`ffn_gate_inp`): F32
40
+ - Linear-attention (SSM) QKV/gate: mixed Q4_K / Q6_K (16 / 14 of 30 layers)
41
+ - Full-attention Q/K/output: Q4_K (all layers); V: mixed Q4_K / Q6_K (4 / 6 of 10 layers)
42
+ - Routed MoE experts gate/up: Q4_K (all layers); down: mixed Q4_K / Q6_K (20 / 20 of 40 layers)
43
+ - Shared MoE experts gate/up/down: Q4_K
44
+ - Normalization, SSM scalars, biases: F32
45
+
46
+ ### Q3 iMatrix
47
+
48
+ - Embedding / output: Q6_K
49
+ - MoE router (`ffn_gate_inp`): F32
50
+ - Linear-attention QKV/gate, SSM output: Q5_K (explicit override)
51
+ - Full-attention Q/K/V/output: Q5_K (explicit override)
52
+ - Shared MoE experts: Q5_K (explicit override)
53
+ - Routed MoE experts: `Q3_K_M` default (no override) — gate/up Q3_K, down mixed Q3_K/Q5_K by layer position
54
+
55
+ ## Tested hardware and software
56
+
57
+ - Linux
58
+ - NVIDIA GeForce RTX 5060 Ti, 16 GB VRAM
59
+ - AMD Ryzen 9 5950X, 16 cores / 32 threads
60
+ - 64 GB system RAM
61
+ - [TheTom/llama-cpp-turboquant](https://github.com/TheTom/llama-cpp-turboquant), commit `c26cbdffc`
62
+
63
+ Observed generation speed on this machine:
64
+
65
+ | Variant | Context | Generation speed |
66
+ |---|---:|---:|
67
+ | Q4 iMatrix | ~10K | ~60 tok/s |
68
+ | Q3 iMatrix | — | *to be measured* |
69
+
70
+ Actual speed varies with context length, prompt size, CPU memory bandwidth, and the selected MoE offload split.
71
+
72
+ ## Recommended 256K launch command (Q4)
73
+
74
+ This profile keeps the KV cache in VRAM and moves only late routed-expert tensors to CPU RAM. Attention, routers, embeddings, and output remain on the GPU. `turbo3` KV enables the TurboQuant path; K is automatically upgraded to q8_0 for this model's 8:1 GQA ratio.
75
+
76
+ ```bash
77
+ llama-server \
78
+ --jinja --host 0.0.0.0 --port 8080 \
79
+ -m KAT-Coder-V2.5-Dev_Q4_K_M_imatrix.gguf \
80
+ --n-gpu-layers 99 --n-cpu-moe 0 \
81
+ -ot "blk\.(2[4-9]|3[0-9])\.ffn_.*_exps\.weight=CPU" \
82
+ --ctx-size 262144 --parallel 1 \
83
+ --flash-attn on \
84
+ --cache-type-k turbo3 --cache-type-v turbo3 \
85
+ --batch-size 262144 --ubatch-size 1024 --cache-reuse 256
86
+ ```
87
+
88
+ The Q3 launch command and its tested VRAM/CPU-offload split will be added once that file is published.
89
+
90
+ ### Extending context beyond 262,144 tokens
91
+
92
+ The upstream model natively supports 262,144 tokens. The original authors document YaRN RoPE scaling (factor 4.0) to extend usable context to roughly 1,010,000 tokens on frameworks that support runtime RoPE overrides (vLLM, SGLang, KTransformers). See the "Processing Ultra-Long Texts" section in the reproduced upstream card below for the exact parameters; applying the same scaling to a GGUF/llama.cpp deployment has not been tested for this release.
93
+
94
+ ## Upstream model card
95
+
96
+ This release is based on the original KAT-Coder-V2.5-Dev model card reproduced in full below. Its original license declaration and complete model card are preserved unchanged.
97
+
98
+ ---
99
+ license: apache-2.0
100
+ language:
101
+ - en
102
+ - zh
103
+ library_name: transformers
104
+ pipeline_tag: text-generation
105
+ tags:
106
+ - code
107
+ - agent
108
+ - agentic-coding
109
+ - moe
110
+ - coding
111
+ base_model:
112
+ - Qwen3.6-35B-A3B
113
+ ---
114
+
115
+ <div style="background-color:#ffffff;border:none;border-radius:12px;padding:14px 22px;display:inline-block;">
116
+ <div style="display:flex;align-items:center;gap:20px;">
117
+ <img src="assets/kat_logo_hd.png" alt="KAT-Coder logo" width="120">
118
+ <h1 style="margin:0;border:none;padding:0;font-size:52px;color:#1a4a25;">KAT-Coder-V2.5-Dev</h1>
119
+ </div>
120
+ </div>
121
+
122
+ <a href="https://huggingface.co/papers/2607.05471"><img src="https://img.shields.io/badge/Technical%20Report-1a4a25?style=for-the-badge&logo=arxiv&logoColor=white" alt="KAT-Coder Technical Report"></a>
123
+
124
+ <table style="border-collapse:collapse;width:100%;margin:0 auto;">
125
+ <tr>
126
+ <td style="background-color:#e6f0e4;padding:14px 20px;border-left:4px solid #1a4a25;">
127
+ <span style="color:#1a4a25;">This repository contains the model weights and configuration files for the post-trained <strong>KAT-Coder-V2.5-Dev</strong> in the Hugging Face Transformers format. The artifacts are compatible with Hugging Face Transformers, vLLM, SGLang, KTransformers, etc. <strong>Note:</strong> this open-weight release ships only the language-model weights and operates as a <strong>text-only</strong> model; the vision/multimodal components are not included and are unavailable.</span>
128
+ </td>
129
+ </tr>
130
+ </table>
131
+
132
+ Following the release of KAT-Coder-V2.5 in July, we are pleased to release the open-weight version **KAT-Coder-V2.5-Dev**, an MOE model with a total parameter count of 35B and 3B activated parameters, to strengthen communication with the community and showcase our research achievements.
133
+
134
+ ## KAT-Coder-V2.5-Dev Highlights
135
+
136
+ - **Performance improvement.** Through SFT/RL training, KAT-Coder-V2.5-Dev achieves SOTA results in the field of Agentic Coding among models with similar parameter scales.
137
+ - **Optimization of abnormal behaviors.** Through RL training, certain abnormal behaviors have been significantly optimized, such as: abnormal tool labels -9pp (9.34% -> 0.28%), single-turn continuous repetition -0.34pp (0.34% -> 0%).
138
+
139
+ ## Benchmark performance
140
+
141
+ <p align="center">
142
+ <a href="https://huggingface.co/Kwaipilot/KAT-Coder-V2.5-Dev/resolve/main/KAT-Coder-V2.5-Dev-Benchmarks.png?download=true">
143
+ <img src="assets/KAT-Coder-V2.5-Dev-Benchmarks.png" alt="KAT-Coder-V2.5-Dev benchmark performance" width="100%">
144
+ </a>
145
+ </p>
146
+
147
+ <div style="background-color:#ffffff;border:none;border-radius:12px;padding:16px;overflow-x:auto;">
148
+ <table style="border-collapse:collapse;width:100%;margin:0 auto;font-size:12.5px;line-height:1.4;white-space:nowrap;">
149
+ <tr>
150
+ <td style="padding:11px 8px;text-align:center;border-bottom:2px solid #1a4a25;"><span style="color:#1a4a25;font-weight:700;">Benchmark</span></td>
151
+ <td style="padding:11px 8px;text-align:center;background-color:#e2eede;border-bottom:2px solid #1a4a25;"><span style="color:#1a4a25;font-weight:700;">KAT-Coder-V2.5-Dev</span></td>
152
+ <td style="padding:11px 8px;text-align:center;border-bottom:2px solid #1a4a25;"><span style="color:#1a4a25;font-weight:600;">Qwen3.5-27B</span></td>
153
+ <td style="padding:11px 8px;text-align:center;border-bottom:2px solid #1a4a25;"><span style="color:#1a4a25;font-weight:600;">Qwen3.6-35BA3B</span></td>
154
+ <td style="padding:11px 8px;text-align:center;border-bottom:2px solid #1a4a25;"><span style="color:#1a4a25;font-weight:600;">Gemma4-31B</span></td>
155
+ <td style="padding:11px 8px;text-align:center;border-bottom:2px solid #1a4a25;"><span style="color:#1a4a25;font-weight:600;">Qwen3.5-35BA3B</span></td>
156
+ <td style="padding:11px 8px;text-align:center;border-bottom:2px solid #1a4a25;"><span style="color:#1a4a25;font-weight:600;">Ornith-1.0-35B</span></td>
157
+ <td style="padding:11px 8px;text-align:center;border-bottom:2px solid #1a4a25;"><span style="color:#1a4a25;font-weight:600;">Gemma4-26BA4B</span></td>
158
+ <td style="padding:11px 8px;text-align:center;border-bottom:2px solid #1a4a25;"><span style="color:#1a4a25;font-weight:600;">Qwen3-Coder-30B</span></td>
159
+ </tr>
160
+ <tr>
161
+ <td colspan="9" style="padding:8px 12px;background-color:#eef4ea;color:#1a4a25;font-weight:700;letter-spacing:0.03em;">Coding Agent</td>
162
+ </tr>
163
+ <tr>
164
+ <td style="padding:9px 8px;text-align:left;font-weight:600;color:#333333;border-bottom:1px solid #ececec;">SWE-bench Verified</td>
165
+ <td style="padding:9px 8px;text-align:center;background-color:#e2eede;border-bottom:1px solid #d7e4d2;"><strong style="color:#1a4a25;">69.40</strong></td>
166
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">68.60</td>
167
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">64.40</td>
168
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">60.60</td>
169
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">58.60</td>
170
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">55.80</td>
171
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">35.80</td>
172
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">31.80</td>
173
+ </tr>
174
+ <tr>
175
+ <td style="padding:9px 8px;text-align:left;font-weight:600;color:#333333;border-bottom:1px solid #ececec;">SWE-bench Multilingual</td>
176
+ <td style="padding:9px 8px;text-align:center;background-color:#e2eede;border-bottom:1px solid #d7e4d2;"><strong style="color:#1a4a25;">63.00</strong></td>
177
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">57.67</td>
178
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">57.00</td>
179
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">49.33</td>
180
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">47.67</td>
181
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">51.67</td>
182
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">27.33</td>
183
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">20.67</td>
184
+ </tr>
185
+ <tr>
186
+ <td style="padding:9px 8px;text-align:left;font-weight:600;color:#333333;border-bottom:1px solid #ececec;">SWE-bench Pro</td>
187
+ <td style="padding:9px 8px;text-align:center;background-color:#e2eede;border-bottom:1px solid #d7e4d2;"><strong style="color:#1a4a25;">45.96</strong></td>
188
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">42.13</td>
189
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">40.63</td>
190
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">32.97</td>
191
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">38.03</td>
192
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">34.47</td>
193
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">9.58</td>
194
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">19.84</td>
195
+ </tr>
196
+ <tr>
197
+ <td style="padding:9px 8px;text-align:left;font-weight:600;color:#333333;border-bottom:1px solid #ececec;vertical-align:middle;">Terminal-Bench 2.1</td>
198
+ <td style="padding:9px 8px;text-align:center;background-color:#e2eede;border-bottom:1px solid #d7e4d2;"><strong style="color:#1a4a25;">41.02</strong><br><span style="font-size:11px;color:#7c8a78;">32.60 / 49.44</span></td>
199
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">34.84<br><span style="font-size:11px;color:#9aa596;">41.57 / 28.10</span></td>
200
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">32.02<br><span style="font-size:11px;color:#9aa596;">34.83 / 29.20</span></td>
201
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">32.59<br><span style="font-size:11px;color:#9aa596;">30.34 / 34.83</span></td>
202
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">26.12<br><span style="font-size:11px;color:#9aa596;">26.44 / 25.80</span></td>
203
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">35.98<br><span style="font-size:11px;color:#9aa596;">35.96 / 36.00</span></td>
204
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">20.94<br><span style="font-size:11px;color:#9aa596;">27.27 / 14.60</span></td>
205
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">13.50<br><span style="font-size:11px;color:#9aa596;">10.11 / 16.90</span></td>
206
+ </tr>
207
+ <tr>
208
+ <td style="padding:9px 8px;text-align:left;font-weight:600;color:#333333;border-bottom:1px solid #ececec;">PinchBench</td>
209
+ <td style="padding:9px 8px;text-align:center;background-color:#e2eede;border-bottom:1px solid #d7e4d2;"><strong style="color:#1a4a25;">93.43</strong></td>
210
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">90.71</td>
211
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">92.21</td>
212
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">85.53</td>
213
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">88.75</td>
214
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">91.62</td>
215
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">82.01</td>
216
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">72.3</td>
217
+ </tr>
218
+ <tr>
219
+ <td style="padding:9px 8px;text-align:left;font-weight:600;color:#333333;border-bottom:1px solid #ececec;">Scicode</td>
220
+ <td style="padding:9px 8px;text-align:center;background-color:#e2eede;border-bottom:1px solid #d7e4d2;"><strong style="color:#1a4a25;">44.20</strong></td>
221
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">25.58</td>
222
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">37.53</td>
223
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">33.19</td>
224
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">27.73</td>
225
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">30.34</td>
226
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">30.84</td>
227
+ <td style="padding:9px 8px;text-align:center;color:#444444;border-bottom:1px solid #ececec;">18.27</td>
228
+ </tr>
229
+ <tr>
230
+ <td style="padding:9px 8px;text-align:left;font-weight:600;color:#333333;">KAT-Code-Bench</td>
231
+ <td style="padding:9px 8px;text-align:center;background-color:#e2eede;"><strong style="color:#1a4a25;">46.21</strong></td>
232
+ <td style="padding:9px 8px;text-align:center;color:#444444;">44.83</td>
233
+ <td style="padding:9px 8px;text-align:center;color:#444444;">42.76</td>
234
+ <td style="padding:9px 8px;text-align:center;color:#444444;">37.93</td>
235
+ <td style="padding:9px 8px;text-align:center;color:#444444;">35.86</td>
236
+ <td style="padding:9px 8px;text-align:center;color:#444444;">33.10</td>
237
+ <td style="padding:9px 8px;text-align:center;color:#444444;">22.06</td>
238
+ <td style="padding:9px 8px;text-align:center;color:#444444;">15.17</td>
239
+ </tr>
240
+ </table>
241
+ </div>
242
+
243
+ <sub>For **Terminal-Bench 2.1**, the bold number is the average across two agent harnesses; the small numbers below are the per-harness scores (Terminus-2 / Claude Code).</sub>
244
+
245
+ <div style="background-color:#ffffff;border:none;border-radius:12px;padding:14px 18px;margin-top:6px;">
246
+ <div style="font-size:11.5px;line-height:1.5;color:#8a8a8a;">
247
+
248
+ <p style="margin:0 0 3px;"><strong style="color:#555;">1. Evaluation method.</strong> All metrics presented in the table are reproduced in-house: we download the public model checkpoints, deploy them via vLLM or SGLang, and evaluate under a unified standardized pipeline. No officially reported results of the respective models are directly adopted in this table. Each model is tested only once on each evaluation set; retests are conducted only if obvious errors are found.</p>
249
+
250
+ <p style="margin:6px 0 2px;"><strong style="color:#555;">2. Evaluation configuration.</strong></p>
251
+ <p style="margin:0 0 2px;">* SWE-bench Verified / Multilingual / Pro, KAT-Code-Bench: agent=claude_code@2.1.195, pass@k=1, temperature=1.0, top_p=0.95, 256k ctx.</p>
252
+ <p style="margin:0 0 2px;">* Terminal-Bench 2.1: agent=terminus-2 / claude_code, pass@k=1, temperature=0.7, top_p=1.0, 256k ctx.</p>
253
+ <p style="margin:0 0 2px;">* PinchBench: agent=openclaw@2026.3.13, pass@k=1, temperature=0.7, top_p=1.0, 256k ctx.</p>
254
+ <p style="margin:0 0 2px;">* Scicode: pass@k=1, temperature=0.6, top_p=1.0, 256k ctx.</p>
255
+
256
+ <p style="margin:6px 0 2px;"><strong style="color:#555;">3. Anomaly description.</strong></p>
257
+ <p style="margin:0 0 2px;">* Qwen3.6-35BA3B: We found that on the SWE-bench Verified, SWE-bench Multilingual, and SWE-bench Pro test sets, our test results this time have an approximate 10 pp gap compared with the official results. We believe this is mainly caused by the harness version and some optimizations made to the test sets by the Qwen team, and it should not be an issue with the model itself.</p>
258
+ <p style="margin:0 0 2px;">* Qwen3.5-35BA3B: We observed frequent hallucinations during evaluation, including attempts to invoke the unavailable MultiEdit tool under the current agent environment, which negatively impacts the final metric.</p>
259
+ <p style="margin:0 0 2px;">* Gemma4-26B-A4B-it: Two main factors degrade evaluation performance: context overflow (exceeding the 256k context limit) and hallucinated calls to the unsupported MultiEdit tool in this evaluation setup.</p>
260
+ <p style="margin:0;">The above deviations arise from mismatches between model tool preference and the allowed toolset in the evaluation harness, rather than inherent capability limitations of the models.</p>
261
+
262
+ </div>
263
+ </div>
264
+
265
+ ## Post-training
266
+
267
+ To provide a systematic overview of our team's work on data and algorithms, we adopt the widely recognized Qwen3.6-35B-A3B as the base model for post-training and build KAT-Coder-V2.5-Dev on top of it. Overall, KAT-Coder-V2.5-Dev largely follows the post-training recipe of KAT-V2.5, with most settings—including data construction, training pipeline, and optimization strategy—remaining unchanged. The full pipeline consists of two stages: supervised fine-tuning (SFT) and reinforcement learning (RL). We first fine-tune Qwen3.6-35B-A3B on a dataset of 127K examples and then perform RL training on the resulting SFT model.
268
+
269
+ During the RL stage, we retain the training infrastructure and key technical designs validated in KAT-V2.5, including the following four components:
270
+
271
+ 1. **Token-in-Token-out (TITO) consistency.** We use TITO to ensure that the token sequences in the rollout and training stages are strictly identical, preventing training discrepancies caused by differences in chat templates, serialization, or tokenizer behavior.
272
+ 2. **Truncated Importance Sampling (TIS).** To mitigate policy staleness and off-policy issues introduced by asynchronous rollouts, we apply TIS to truncate importance-sampling weights, reducing the variance and instability caused by excessively large weights.
273
+ 3. **Reliable sandboxes and verifiers.** We systematically inspect and validate the stability and correctness of the sandboxes and verifiers. This helps prevent infrastructure failures—such as execution timeouts, environment errors, or verifier misjudgments—from being incorrectly treated as model failures and contaminating the reward signal.
274
+ 4. **Hierarchical rewards based on harness execution feedback.** We construct hierarchical rewards from fine-grained execution feedback provided by the harness. This allows the model to optimize toward the final task objective while also receiving credit for meaningful progress in unsuccessful trajectories, thereby increasing the training value of failed attempts and providing denser reward signals.
275
+
276
+ However, Qwen3.6 exhibits trajectory patterns that differ from those observed in KAT-V2.5, requiring additional reward adaptations tailored to its behavior. In our initial experiments, a simple binary 0–1 reward caused model collapse as early as the second epoch. An analysis of the training trajectories revealed that, as training progressed, the model increasingly tended to issue a large number of parallel tool calls within a single turn—occasionally exceeding 70 calls. This behavior caused the context length to grow rapidly, generated a substantial number of invalid trajectories and execution errors, and ultimately destabilized RL training.
277
+
278
+ To address this issue, we augmented the original hierarchical reward with several Qwen3.6-specific penalties targeting (including but not limited to the following):
279
+
280
+ - Excessive parallel tool calls within a single turn;
281
+ - Failed tool calls;
282
+ - Empty tool-call blocks; and
283
+ - Large amounts of repeated content.
284
+
285
+ These targeted reward adjustments effectively suppressed pathological tool-use and repetitive-generation behaviors, enabling stable RL training for 10 epochs. Our experiments validate the effectiveness and feasibility of both the overall training pipeline and the Qwen3.6-specific reward design.
286
+
287
+ <p align="center">
288
+ <a href="https://huggingface.co/Kwaipilot/KAT-Coder-V2.5-Dev/resolve/main/KAT-Coder-V2.5-Dev-RL-Reward-Curve.png?download=true">
289
+ <img src="assets/KAT-Coder-V2.5-Dev-RL-Reward-Curve.png" alt="RL training reward curve" width="100%">
290
+ </a>
291
+ </p>
292
+
293
+ <p align="center"><sub><em>The proportion of samples that pass the unit test (1 for pass, 0 for fail) within a batch of samples during RL training.</em></sub></p>
294
+
295
+ ## Quickstart
296
+
297
+ For streamlined integration, we recommend using KAT-Coder-V2.5-Dev via APIs. Below is a guide to use KAT-Coder-V2.5-Dev via OpenAI-compatible API.
298
+
299
+ ### Serving KAT-Coder-V2.5-Dev
300
+
301
+ KAT-Coder-V2.5-Dev can be served via APIs with popular inference frameworks. In the following, we show example commands to launch OpenAI-Compatible API servers for KAT-Coder-V2.5-Dev model.
302
+
303
+ #### SGLang
304
+
305
+ SGLang is a fast serving framework for large language models and vision language models. sglang>=0.5.10 is recommended for KAT-Coder-V2.5-Dev, which can be installed using the following command in a fresh environment:
306
+
307
+ ```shell
308
+ uv pip install sglang[all]
309
+ ```
310
+
311
+ The following will create API endpoints at `http://localhost:8000/v1`:
312
+
313
+ > **Note:** This open-weight release ships only the language-model weights (no vision tower). If your SGLang version attempts to build the multimodal/vision components at load time, startup may fail on missing vision weights; in that case, run with the version's text/language-model-only option (see `python -m sglang.launch_server --help`).
314
+
315
+ - Standard Version: The following command can be used to create an API endpoint with maximum context length 262,144 tokens using tensor parallel on 8 GPUs.
316
+ ```shell
317
+ python -m sglang.launch_server \
318
+ --model-path Kwaipilot/KAT-Coder-V2.5-Dev \
319
+ --port 8000 \
320
+ --tp-size 8 \
321
+ --mem-fraction-static 0.8 \
322
+ --context-length 262144 \
323
+ --reasoning-parser qwen3
324
+ ```
325
+ - Tool Use: To support tool use, you can use the following command.
326
+ ```shell
327
+ python -m sglang.launch_server \
328
+ --model-path Kwaipilot/KAT-Coder-V2.5-Dev \
329
+ --port 8000 \
330
+ --tp-size 8 \
331
+ --mem-fraction-static 0.8 \
332
+ --context-length 262144 \
333
+ --reasoning-parser qwen3 \
334
+ --tool-call-parser qwen3_coder
335
+ ```
336
+
337
+ #### vLLM
338
+
339
+ vLLM is a high-throughput and memory-efficient inference and serving engine for LLMs. vllm>=0.19.0 is recommended for KAT-Coder-V2.5-Dev, which can be installed using the following command in a fresh environment:
340
+
341
+ ```shell
342
+ uv pip install vllm --torch-backend=auto
343
+ ```
344
+
345
+ The following will create API endpoints at `http://localhost:8000/v1`:
346
+
347
+ > **Note:** This open-weight release ships only the language-model weights, so the `--language-model-only` flag is **required**. It tells vLLM to skip the vision encoder and multimodal profiling; without it, vLLM attempts to initialize vision-tower weights that are not present in the checkpoint and startup fails.
348
+
349
+ - Standard Version: The following command can be used to create an API endpoint with maximum context length 262,144 tokens using tensor parallel on 8 GPUs.
350
+ ```shell
351
+ vllm serve Kwaipilot/KAT-Coder-V2.5-Dev \
352
+ --port 8000 \
353
+ --tensor-parallel-size 8 \
354
+ --max-model-len 262144 \
355
+ --reasoning-parser qwen3 \
356
+ --language-model-only
357
+ ```
358
+ - Tool Call: To support tool use, you can use the following command.
359
+ ```shell
360
+ vllm serve Kwaipilot/KAT-Coder-V2.5-Dev \
361
+ --port 8000 \
362
+ --tensor-parallel-size 8 \
363
+ --max-model-len 262144 \
364
+ --reasoning-parser qwen3 \
365
+ --enable-auto-tool-choice \
366
+ --tool-call-parser qwen3_coder \
367
+ --language-model-only
368
+ ```
369
+
370
+ #### KTransformers
371
+
372
+ KTransformers is a flexible framework for experiencing cutting-edge LLM inference optimizations with CPU-GPU heterogeneous computing. For running KAT-Coder-V2.5-Dev with KTransformers, see the KTransformers Deployment Guide.
373
+
374
+ #### Hugging Face Transformers
375
+
376
+ Hugging Face Transformers contains a lightweight server which can be used for quick testing and moderate load deployment. The latest transformers is required for KAT-Coder-V2.5-Dev. Installing `accelerate` is also required for multi-GPU (sharded) loading:
377
+
378
+ ```shell
379
+ pip install "transformers[serving]" accelerate
380
+ ```
381
+
382
+ Then, run transformers serve to launch a server with API endpoints at `http://localhost:8000/v1`; it will place the model on accelerators if available:
383
+
384
+ ```shell
385
+ transformers serve Kwaipilot/KAT-Coder-V2.5-Dev --port 8000
386
+ ```
387
+
388
+ ## Using KAT-Coder-V2.5-Dev via the Chat Completions API
389
+
390
+ The chat completions API is accessible via standard HTTP requests or OpenAI SDKs. Here, we show examples using the OpenAI Python SDK.
391
+
392
+ Before starting, make sure it is installed and the API key and the API base URL is configured, e.g.:
393
+
394
+ ```shell
395
+ pip install -U openai
396
+
397
+ # Set the following accordingly
398
+ export OPENAI_BASE_URL="http://localhost:8000/v1"
399
+ export OPENAI_API_KEY="EMPTY"
400
+ ```
401
+
402
+ ### Text-Only Input
403
+
404
+ ```python
405
+ from openai import OpenAI
406
+ # Configured by environment variables
407
+ client = OpenAI()
408
+
409
+ messages = [
410
+ {"role": "user", "content": "Type \"I love KAT-Coder-V2.5-Dev\" backwards"},
411
+ ]
412
+
413
+ chat_response = client.chat.completions.create(
414
+ model="Kwaipilot/KAT-Coder-V2.5-Dev",
415
+ messages=messages,
416
+ max_tokens=81920,
417
+ temperature=1.0,
418
+ top_p=0.95,
419
+ presence_penalty=1.5,
420
+ extra_body={
421
+ "top_k": 20,
422
+ },
423
+ )
424
+ print("Chat response:", chat_response)
425
+ ```
426
+
427
+ ## Instruct (or Non-Thinking) Mode
428
+
429
+ KAT-Coder-V2.5-Dev will think by default before response. You can obtain direct response from the model without thinking by configuring the API parameters. For example,
430
+
431
+ ```python
432
+ from openai import OpenAI
433
+ # Configured by environment variables
434
+ client = OpenAI()
435
+
436
+ messages = [
437
+ {"role": "user", "content": "Write a Python function that returns the n-th Fibonacci number."},
438
+ ]
439
+
440
+ chat_response = client.chat.completions.create(
441
+ model="Kwaipilot/KAT-Coder-V2.5-Dev",
442
+ messages=messages,
443
+ max_tokens=32768,
444
+ temperature=0.7,
445
+ top_p=0.8,
446
+ presence_penalty=1.5,
447
+ extra_body={
448
+ "top_k": 20,
449
+ "chat_template_kwargs": {"enable_thinking": False},
450
+ },
451
+ )
452
+ print("Chat response:", chat_response)
453
+ ```
454
+
455
+ ## Preserve Thinking
456
+
457
+ By default, only the thinking blocks generated in handling the latest user message is retained, resulting in a pattern commonly as interleaved thinking. KAT-Coder-V2.5-Dev has been additionally trained to preserve and leverage thinking traces from historical messages. You can enable this behavior by setting the preserve_thinking option:
458
+
459
+ ```python
460
+ from openai import OpenAI
461
+ # Configured by environment variables
462
+ client = OpenAI()
463
+
464
+ messages = [...]
465
+
466
+ chat_response = client.chat.completions.create(
467
+ model="Kwaipilot/KAT-Coder-V2.5-Dev",
468
+ messages=messages,
469
+ max_tokens=32768,
470
+ temperature=0.7,
471
+ top_p=0.8,
472
+ presence_penalty=1.5,
473
+ extra_body={
474
+ "top_k": 20,
475
+ "chat_template_kwargs": {"preserve_thinking": True},
476
+ },
477
+ )
478
+ print("Chat response:", chat_response)
479
+ ```
480
+
481
+ This capability is particularly beneficial for agent scenarios, where maintaining full reasoning context can enhance decision consistency and, in many cases, reduce overall token consumption by minimizing redundant reasoning. Additionally, it can improve KV cache utilization, optimizing inference efficiency in both thinking and non-thinking modes.
482
+
483
+ ## Processing Ultra-Long Texts
484
+
485
+ KAT-Coder-V2.5-Dev natively supports context lengths of up to 262,144 tokens. For long-horizon tasks where the total length (including both input and output) exceeds this limit, we recommend using RoPE scaling techniques to handle long texts effectively, e.g., YaRN.
486
+
487
+ YaRN is currently supported by several inference frameworks, e.g., transformers, vllm, ktransformers and sglang. In general, there are two approaches to enabling YaRN for supported frameworks:
488
+
489
+ - Modifying the model configuration file: In the config.json file, change the rope_parameters fields in text_config to:
490
+ ```json
491
+ {
492
+ "mrope_interleaved": true,
493
+ "mrope_section": [
494
+ 11,
495
+ 11,
496
+ 10
497
+ ],
498
+ "rope_type": "yarn",
499
+ "rope_theta": 10000000,
500
+ "partial_rotary_factor": 0.25,
501
+ "factor": 4.0,
502
+ "original_max_position_embeddings": 262144
503
+ }
504
+ ```
505
+ - Passing command line arguments:
506
+
507
+ For vllm, you can use
508
+
509
+ ```shell
510
+ VLLM_ALLOW_LONG_MAX_MODEL_LEN=1 vllm serve ... --hf-overrides '{"text_config": {"rope_parameters": {"mrope_interleaved": true, "mrope_section": [11, 11, 10], "rope_type": "yarn", "rope_theta": 10000000, "partial_rotary_factor": 0.25, "factor": 4.0, "original_max_position_embeddings": 262144}}}' --max-model-len 1010000
511
+ ```
512
+
513
+ For sglang and ktransformers, you can use
514
+
515
+ ```shell
516
+ SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1 python -m sglang.launch_server ... --json-model-override-args '{"text_config": {"rope_parameters": {"mrope_interleaved": true, "mrope_section": [11, 11, 10], "rope_type": "yarn", "rope_theta": 10000000, "partial_rotary_factor": 0.25, "factor": 4.0, "original_max_position_embeddings": 262144}}}' --context-length 1010000
517
+ ```
518
+
519
+ ## Citation
520
+
521
+ If you find our work helpful, feel free to give us a cite.
522
+
523
+ ```bibtex
524
+ @misc{katcoder_v25_2026,
525
+ title={{KAT-Coder-V2.5 Technical Report}},
526
+ author={{KwaiKAT Team}},
527
+ year={2026},
528
+ month={July},
529
+ eprint={2607.05471},
530
+ archivePrefix={arXiv},
531
+ primaryClass={cs.AI},
532
+ url={https://arxiv.org/pdf/2607.05471}
533
+ }
534
+ ```