Instructions to use Alibaba-Apsara/DASD-30B-A3B-Thinking-Preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Alibaba-Apsara/DASD-30B-A3B-Thinking-Preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Alibaba-Apsara/DASD-30B-A3B-Thinking-Preview") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Alibaba-Apsara/DASD-30B-A3B-Thinking-Preview") model = AutoModelForCausalLM.from_pretrained("Alibaba-Apsara/DASD-30B-A3B-Thinking-Preview") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Alibaba-Apsara/DASD-30B-A3B-Thinking-Preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Alibaba-Apsara/DASD-30B-A3B-Thinking-Preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Alibaba-Apsara/DASD-30B-A3B-Thinking-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Alibaba-Apsara/DASD-30B-A3B-Thinking-Preview
- SGLang
How to use Alibaba-Apsara/DASD-30B-A3B-Thinking-Preview with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Alibaba-Apsara/DASD-30B-A3B-Thinking-Preview" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Alibaba-Apsara/DASD-30B-A3B-Thinking-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Alibaba-Apsara/DASD-30B-A3B-Thinking-Preview" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Alibaba-Apsara/DASD-30B-A3B-Thinking-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Alibaba-Apsara/DASD-30B-A3B-Thinking-Preview with Docker Model Runner:
docker model run hf.co/Alibaba-Apsara/DASD-30B-A3B-Thinking-Preview
Upload 7 files
Browse files- .gitattributes +4 -0
- README.md +147 -0
- assets/ali.webp +0 -0
- assets/pipeline.jpg +3 -0
- assets/size_30b_a3b-performance.png +3 -0
- assets/size_4b-performance-img.jpg +3 -0
- assets/size_4b-performance.jpg +3 -0
- assets/size_4b-performance.pdf +0 -0
.gitattributes
CHANGED
|
@@ -34,3 +34,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
assets/pipeline.jpg filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
assets/size_30b_a3b-performance.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
assets/size_4b-performance-img.jpg filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
assets/size_4b-performance.jpg filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,3 +1,150 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
pipeline_tag: text-generation
|
| 4 |
+
library_name: transformers
|
| 5 |
---
|
| 6 |
+
|
| 7 |
+
# <img src="assets/ali.webp" alt="Ali" style="height: 1.2em; vertical-align: middle; margin-right: 0.4em;"> Apsara-Reason: Distribution-Aligned Sequence Distillation Enabling Superior Long-CoT Reasoning
|
| 8 |
+
|
| 9 |
+
<!-- <p align="center">
|
| 10 |
+
<img src="assets/ali.webp" alt="Alibaba-Apsara" style="height: 1em; vertical-align: middle;"> <a href="https://huggingface.co/Alibaba-Apsara">Alibaba-Apsara</a>   |    📑 <a href="https://arxiv.org/abs/2506.xxxxx">Paper</a>    |    📂 <a href="https://apsara-reason.github.io">Data</a>   
|
| 11 |
+
</p> -->
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
[](https://github.com/D2I-ai/apsara-reason) 
|
| 15 |
+
<a href="https://arxiv.org/abs/2511.xx" target="_blank"><img src="https://img.shields.io/badge/Report-b5212f.svg?logo=arxiv" height="21px"></a>
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
[](https://huggingface.co/Alibaba-Apsara/Apsara-Reason-4B) 
|
| 20 |
+
[](https://www.modelscope.cn/models/Alibaba-Apsara/Apsara-Reason-4B) 
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
[](https://huggingface.co/Alibaba-Apsara/Alibaba-Apsara/Apsara-Reason-30B-A3B-Preview) 
|
| 24 |
+
[](https://www.modelscope.cn/models/Alibaba-Apsara/Apsara-Reason-30B-A3B-Preview) 
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
[](https://huggingface.co/datasets/Alibaba-Apsara/Apsara-Reason-v1-SFT) 
|
| 29 |
+
[](https://www.modelscope.cn/datasets/Alibaba-Apsara/Apsara-Reason-v1-SFT) 
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
## 🚀 Introduction
|
| 34 |
+
|
| 35 |
+
We release Apsara-Reason-30B-A3B-Preview, a highly capable 30B Mixture-of-Experts (MoE) language model specialized in long chain-of-thought (Long-CoT) reasoning across mathematics, code generation, and scientific reasoning. Apsara-Reason-30B-A3B-Preview is post-trained from **Qwen3-30B-A3B-Instruct-2507** (non-thinking student) and distilled from **gpt-oss-120b** (teacher) via our distribution-aligned sequence distillation pipeline.
|
| 36 |
+
|
| 37 |
+
> Note1: To demonstrate the scalability and efficiency of our data recipe, this preview model was trained only on the first-stage (Low-Temperature) dataset (~105K samples) derived from our 4B pipeline, without any re-curation or additional RL. Even with this lightweight recipe, it achieves excellent performance among open MoE models.
|
| 38 |
+
|
| 39 |
+
> Note2: This model (Apsara-Reason-30B-A3B-Preview) is a preliminary research artifact trained only on the first stage (Low-Temperature Sampling) of our pipeline to demonstrate the scalability of our data recipe. For the fully trained model and complete methodology, please refer to [Apsara-Reason-4B](https://huggingface.co/Alibaba-Apsara/Apsara-Reason-4B) and our Technical Report.
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
<div style="text-align: center;">
|
| 44 |
+
<img src="assets/size_30b_a3b-performance.png" alt="benchmark" style="width: 90%;">
|
| 45 |
+
</div>
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
---
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
## ⚡ Quick Start
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
```python
|
| 55 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 56 |
+
|
| 57 |
+
model_name = "Alibaba-Apsara/Apsara-Reason-30B-A3B-Preview"
|
| 58 |
+
|
| 59 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
| 60 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 61 |
+
model_name,
|
| 62 |
+
torch_dtype="auto",
|
| 63 |
+
device_map="auto",
|
| 64 |
+
trust_remote_code=True,
|
| 65 |
+
)
|
| 66 |
+
|
| 67 |
+
prompt = "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?"
|
| 68 |
+
messages = [
|
| 69 |
+
{"role": "system", "content": "You are a helpful assistant."},
|
| 70 |
+
{"role": "user", "content": prompt}
|
| 71 |
+
]
|
| 72 |
+
|
| 73 |
+
text = tokenizer.apply_chat_template(
|
| 74 |
+
messages,
|
| 75 |
+
tokenize=False,
|
| 76 |
+
add_generation_prompt=True,
|
| 77 |
+
)
|
| 78 |
+
|
| 79 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 80 |
+
|
| 81 |
+
generated_ids = model.generate(
|
| 82 |
+
**model_inputs,
|
| 83 |
+
max_new_tokens=81920,
|
| 84 |
+
)
|
| 85 |
+
|
| 86 |
+
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
|
| 87 |
+
content = tokenizer.decode(output_ids, skip_special_tokens=True)
|
| 88 |
+
print(content)
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
> Note: We include the system prompt, as it was used during all training stages. To ensure consistent output quality, we recommend including the same system prompt during actual usage; otherwise, the model's responses may be significantly affected.
|
| 93 |
+
|
| 94 |
+
For deployment, you can use sglang>=0.4.6.post1 or vllm>=0.8.5 or to create an OpenAI-compatible API endpoint:
|
| 95 |
+
|
| 96 |
+
- SGLang:
|
| 97 |
+
|
| 98 |
+
```
|
| 99 |
+
python -m sglang.launch_server --model-path Alibaba-Apsara/Apsara-Reason-30B-A3B-Preview --context-length 262144
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
- vLLM:
|
| 103 |
+
```
|
| 104 |
+
vllm serve Alibaba-Apsara/Apsara-Reason-30B-A3B-Preview --max-model-len 262144
|
| 105 |
+
```
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
## 💡Best Practices
|
| 113 |
+
|
| 114 |
+
To achieve optimal performance, we suggest using **Temperature=1.0, TopP=1.0, TopK=-1, and MinP=0**.
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
## 📜 Licence
|
| 118 |
+
|
| 119 |
+
The model weights are licensed under Apache 2.0 License.
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
## ⚠️ Limitation
|
| 123 |
+
|
| 124 |
+
While Apsara-Reason-30B-A3B-Preview demonstrates remarkable performance across mathematical, scientific, and coding benchmarks, **it is currently limited by the absence of tool integration and function calling capabilities.** Operating strictly within the text space, the model cannot interact with external interfaces such as code executors or APIs, which constrains its utility in agent-based workflows; however, future iterations aim to bridge this gap by integrating capabilities like knowledge retrieval and tool invocation to support more complex, interactive reasoning tasks.
|
| 125 |
+
|
| 126 |
+
## 📚 Citation
|
| 127 |
+
|
| 128 |
+
Apsara-Reason is developed by the **Apsara Lab** at Alibaba Cloud, as part of our mission to advance open, efficient, and trustworthy reasoning systems. If you find this work useful in your research or applications, please cite our technical report:
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
```bibtex
|
| 132 |
+
@misc{apsara2025reason,
|
| 133 |
+
title={Apsara-Reason: Distribution-Aligned Sequence Distillation Enabling Superior Long-CoT Reasoning},
|
| 134 |
+
author={Apsara Team},
|
| 135 |
+
year={2025},
|
| 136 |
+
eprint={2506.xxxxx},
|
| 137 |
+
archivePrefix={arXiv},
|
| 138 |
+
primaryClass={cs.CL},
|
| 139 |
+
url={https://arxiv.org/abs/2506.xxxxx}
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
@article{liu2025where,
|
| 143 |
+
title={Where Did This Sentence Come From? Tracing Provenance in LLM Reasoning Distillation},
|
| 144 |
+
author={Liu, Kaiyuan and Yan, Shaotian and Miao, Rui and Wang, Bing and Shen, Chen and Zhang, Jun and Ye, Jieping},
|
| 145 |
+
journal={arXiv preprint arXiv:2512.20908},
|
| 146 |
+
year={2025}
|
| 147 |
+
}
|
| 148 |
+
```
|
| 149 |
+
|
| 150 |
+
We welcome collaboration, feedback, and community contributions to push the boundaries of what small models can reason about—transparently and responsibly.
|
assets/ali.webp
ADDED
|
assets/pipeline.jpg
ADDED
|
Git LFS Details
|
assets/size_30b_a3b-performance.png
ADDED
|
Git LFS Details
|
assets/size_4b-performance-img.jpg
ADDED
|
Git LFS Details
|
assets/size_4b-performance.jpg
ADDED
|
Git LFS Details
|
assets/size_4b-performance.pdf
ADDED
|
Binary file (13.3 kB). View file
|
|
|