Instructions to use shunxing1234/test_2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shunxing1234/test_2 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("shunxing1234/test_2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
---
|
| 3 |
+
language:
|
| 4 |
+
- multilingual
|
| 5 |
+
license: other
|
| 6 |
+
license_name: kwaipilot-license
|
| 7 |
+
license_link: LICENSE
|
| 8 |
+
library_name: transformers
|
| 9 |
+
---
|
| 10 |
+
<div align="center">
|
| 11 |
+
<img src="https://raw.githubusercontent.com/Anditty/OASIS/refs/heads/main/Group.svg" width="60%" alt="Kwaipilot" />
|
| 12 |
+
</div>
|
| 13 |
+
|
| 14 |
+
<hr>
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
# Highlights
|
| 18 |
+
**KAT-Dev-32B** is an open-source 32B-parameter model for software engineering tasks.
|
| 19 |
+
|
| 20 |
+
On SWE-Bench Verified, **KAT-Dev-32B** achieves comparable performance with **62.4%** resolved and ranks **5th** among all open-source models with different scales.
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
|
| 24 |
+
# Introduction
|
| 25 |
+
|
| 26 |
+
KAT-Dev is optimized via several stages of training, including a mid-training stage, supervised fine-tuning (SFT) & reinforcement fine-tuning (RFT) stage and an large-scale agentic reinforcement learning (RL) stage. In summary, our contributions include:
|
| 27 |
+
|
| 28 |
+
<table>
|
| 29 |
+
<thead>
|
| 30 |
+
<tr>
|
| 31 |
+
<th style="text-align:left; width:18%;">Stage</th>
|
| 32 |
+
<th style="text-align:left;">Key Techniques</th>
|
| 33 |
+
</tr>
|
| 34 |
+
</thead>
|
| 35 |
+
<tbody>
|
| 36 |
+
<tr>
|
| 37 |
+
<td><strong>1. Mid-Training</strong></td>
|
| 38 |
+
<td>We observe that adding extensive training for tool-use capability, multi-turn interaction, and instruction-following at this stage may not yield large performance gains in the current results (e.g., on leaderboards like SWE-bench), but it will have a significant impact on the subsequent SFT and RL stages. This suggests that improving these foundational capabilities can have a profound effect on the model’s ability to perform complex tasks.
|
| 39 |
+
</td>
|
| 40 |
+
</tr>
|
| 41 |
+
<tr>
|
| 42 |
+
<td><strong>2. SFT & RFT</strong></td>
|
| 43 |
+
<td>We meticulously curated eight task types and eight programming scenarios during the SFT stage to ensure the model’s generalization and comprehensive capabilities. Moreover, before RL, we innovatively introduced an RFT stage. Compared with traditional RL, we incorporate “teacher trajectories” annotated by human engineers as guidance during training—much like a learner driver being assisted by an experienced co-driver before officially driving after getting a license. This step not only boosts model performance but also further stabilizes the subsequent RL training.
|
| 44 |
+
</td>
|
| 45 |
+
</tr>
|
| 46 |
+
<tr>
|
| 47 |
+
<td><strong>2. Agentic RL Scaling</strong></td>
|
| 48 |
+
<td>Scaling agentic RL hinges on three challenges: efficient learning over nonlinear trajectory histories, leveraging intrinsic model signals, and building scalable high-throughput infrastructure. We address these with a multi-level prefix caching mechanism in the RL training engine, an entropy-based trajectory pruning technique, and an inner implementation of SeamlessFlow[1] architecture that cleanly decouples agents from training while exploiting heterogeneous compute. These innovations together cut scaling costs and enable efficient large-scale RL.
|
| 49 |
+
</td>
|
| 50 |
+
</tr>
|
| 51 |
+
</tbody>
|
| 52 |
+
</table>
|
| 53 |
+
|
| 54 |
+
For more details, including benchmark evaluation, hardware requirements, and inference performance, please refer to our [blog](https://kwaipilot.github.io/KAT-Coder/).
|
| 55 |
+
|
| 56 |
+
# Quickstart
|
| 57 |
+
|
| 58 |
+
```python
|
| 59 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 60 |
+
|
| 61 |
+
model_name = "Kwaipilot/KAT-Dev"
|
| 62 |
+
|
| 63 |
+
# load the tokenizer and the model
|
| 64 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 65 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 66 |
+
model_name,
|
| 67 |
+
torch_dtype="auto",
|
| 68 |
+
device_map="auto"
|
| 69 |
+
)
|
| 70 |
+
|
| 71 |
+
# prepare the model input
|
| 72 |
+
prompt = "Give me a short introduction to large language model."
|
| 73 |
+
messages = [
|
| 74 |
+
{"role": "user", "content": prompt}
|
| 75 |
+
]
|
| 76 |
+
text = tokenizer.apply_chat_template(
|
| 77 |
+
messages,
|
| 78 |
+
tokenize=False,
|
| 79 |
+
add_generation_prompt=True,
|
| 80 |
+
)
|
| 81 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 82 |
+
|
| 83 |
+
# conduct text completion
|
| 84 |
+
generated_ids = model.generate(
|
| 85 |
+
**model_inputs,
|
| 86 |
+
max_new_tokens=65536
|
| 87 |
+
)
|
| 88 |
+
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
|
| 89 |
+
|
| 90 |
+
content = tokenizer.decode(output_ids, skip_special_tokens=True)
|
| 91 |
+
|
| 92 |
+
print("content:", content)
|
| 93 |
+
```
|
| 94 |
+
|