English | 简体中文
Phai-A1-35B-1M is a model built upon Qwen3.6-35B-A3B, extensively post-trained and optimized for Coding & Agent workloads. The entire post-training pipeline, including Supervised Fine-Tuning (SFT) and Reinforcement Learning (RL), was conducted on Huawei Ascend NPUs.
The model delivers substantial improvements in code generation, tool calling, long-horizon task planning, and execution across agentic workflows. It also natively supports a context window of up to 1 million (1M) tokens.
| Stage | Description |
|---|---|
| Base Model | Qwen3.6-35B-A3B (Mixture-of-Experts) |
| SFT | High-quality Coding & Agent instruction data*, covering multi-turn conversations, tool calling, long-chain reasoning, and related scenarios |
| RL | Primarily based on GRPO, leveraging 4,000 sandbox environments to provide real-world feedback through code execution, unit testing, and tool interactions |
* Training data covers sequence lengths ranging from 16K to 1M tokens. YaRN with a scaling factor of 4 is enabled throughout post-training to extend the context window to 1M tokens while maintaining training stability.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_path = "<your ModelScope model path>"
tokenizer = AutoTokenizer.from_pretrained(
model_path,
trust_remote_code=True
)
model = AutoModelForCausalLM.from_pretrained(
model_path,
torch_dtype="bfloat16",
device_map="auto",
trust_remote_code=True,
)
messages = [
{"role": "system", "content": "You are a helpful coding assistant."},
{
"role": "user",
"content": "Implement an asynchronous task queue with concurrency limits."
},
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=2048
)
print(
tokenizer.decode(
outputs[0][inputs.input_ids.shape[1]:],
skip_special_tokens=True
)
)
config.json by default, supporting context windows of up to 1M tokens without requiring additional configuration.We evaluate Phai-A1-35B-1M on a comprehensive suite of Coding & Agent benchmarks, including SWE-Bench (Verified / Pro / Multilingual), TAU3-Bench, IFBench, and AA-LCR.
The results demonstrate consistent improvements over the base model of comparable size, with performance approaching or surpassing that of significantly larger models on several benchmarks.
Note: "—" indicates that benchmark results were not reported for the corresponding model.
Phai-A1-35B-1M is post-trained from Qwen3.6-35B-A3B. Users must comply with the license terms and conditions of the underlying base model when using or distributing the model weights.
model-00006-of-00016.safetensors 5.0 GBmodel-00009-of-00016.safetensors 5.0 GBmodel-00012-of-00016.safetensors 5.0 GBmodel-00015-of-00016.safetensors 5.0 GBmodel-00003-of-00016.safetensors 5.0 GBmodel-00001-of-00016.safetensors 4.7 GBmodel-00007-of-00016.safetensors 4.5 GBmodel-00010-of-00016.safetensors 4.5 GBmodel-00013-of-00016.safetensors 4.5 GBmodel-00004-of-00016.safetensors 4.5 GBmodel-00008-of-00016.safetensors 4.0 GBmodel-00011-of-00016.safetensors 4.0 GBmodel-00014-of-00016.safetensors 4.0 GBmodel-00002-of-00016.safetensors 4.0 GBmodel-00005-of-00016.safetensors 4.0 GBmodel-00016-of-00016.safetensors 2.7 GB