在过去几个月里,我们注意到一个日益清晰的趋势:为了追求更强大、更具智能体能力的人工智能(AI),模型的总参数量和上下文长度都在不断扩展。 我们很高兴分享我们在满足这些需求方面的最新进展——核心在于通过创新的模型架构提升扩展效率。 我们将这类新一代基础模型命名为Qwen3-Next。
Qwen3-Next-80B-A3B 作为 Qwen3-Next 系列的首款模型,具备以下关键增强特性:
Qwen3-Next-80B-A3B 在参数效率和推理速度方面均展现出优异性能:

更多详情,请参阅我们的博客文章 Qwen3-Next。
[!Note] Qwen3-Next-80B-A3B-Instruct 仅支持指令(非思考)模式,其输出不会生成
</think>superscript:块。
Qwen3-Next-80B-A3B-Instruct 具备以下特性:
| Qwen3-30B-A3B-Instruct-2507 | Qwen3-32B Non-Thinking | Qwen3-235B-A22B-Instruct-2507 | Qwen3-Next-80B-A3B-Instruct | |
|---|---|---|---|---|
| 知识能力 | ||||
| MMLU-Pro | 78.4 | 71.9 | 83.0 | 80.6 |
| MMLU-Redux | 89.3 | 85.7 | 93.1 | 90.9 |
| GPQA | 70.4 | 54.6 | 77.5 | 72.9 |
| SuperGPQA | 53.4 | 43.2 | 62.6 | 58.8 |
| 推理能力 | ||||
| AIME25 | 61.3 | 20.2 | 70.3 | 69.5 |
| HMMT25 | 43.0 | 9.8 | 55.4 | 54.1 |
| LiveBench 20241125 | 69.0 | 59.8 | 75.4 | 75.8 |
| 代码能力 | ||||
| LiveCodeBench v6 (25.02-25.05) | 43.2 | 29.1 | 51.8 | 56.6 |
| MultiPL-E | 83.8 | 76.9 | 87.9 | 87.8 |
| Aider-Polyglot | 35.6 | 40.0 | 57.3 | 49.8 |
| 对齐能力 | ||||
| IFEval | 84.7 | 83.2 | 88.7 | 87.6 |
| Arena-Hard v2* | 69.0 | 34.1 | 79.2 | 82.7 |
| Creative Writing v3 | 86.0 | 78.3 | 87.5 | 85.3 |
| WritingBench | 85.5 | 75.4 | 85.2 | 87.3 |
| 智能体能力 | ||||
| BFCL-v3 | 65.1 | 63.0 | 70.9 | 70.3 |
| TAU1-Retail | 59.1 | 40.1 | 71.3 | 60.9 |
| TAU1-Airline | 40.0 | 17.0 | 44.0 | 44.0 |
| TAU2-Retail | 57.0 | 48.8 | 74.6 | 57.3 |
| TAU2-Airline | 38.0 | 24.0 | 50.0 | 45.5 |
| TAU2-Telecom | 12.3 | 24.6 | 32.5 | 13.2 |
| 多语言能力 | ||||
| MultiIF | 67.9 | 70.7 | 77.5 | 75.8 |
| MMLU-ProX | 72.0 | 69.3 | 79.4 | 76.7 |
| INCLUDE | 71.9 | 70.9 | 79.5 | 78.9 |
| PolyMATH | 43.1 | 22.5 | 50.2 | 45.9 |
*:为确保可复现性,我们报告由 GPT-4.1 评估的胜率。
Qwen3-Next 的代码已合并至 Hugging Face transformers 的主分支。
pip install git+https://github.com/huggingface/transformers.git@main在早期版本中,您会遇到以下错误:
KeyError: 'qwen3_next'以下内容包含一段代码片段,展示了如何使用模型根据给定输入生成内容。
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Qwen/Qwen3-Next-80B-A3B-Instruct"
# load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
dtype="auto",
device_map="auto",
)
# prepare the model input
prompt = "Give me a short introduction to large language model."
messages = [
{"role": "user", "content": prompt},
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
# conduct text completion
generated_ids = model.generate(
**model_inputs,
max_new_tokens=16384,
)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
content = tokenizer.decode(output_ids, skip_special_tokens=True)
print("content:", content)[!Note] Hugging Face Transformers 中暂未普遍支持 Multi-Token Prediction (MTP)。
[!Note] 效率或吞吐量的提升在很大程度上取决于具体实现。 建议采用专用的推理框架(例如 SGLang 和 vLLM)来执行推理任务。
[!Tip] 根据不同的推理设置,使用
flash-linear-attention和causal-conv1d可能会获得更优的效率。 有关详细的使用说明和要求,请参见上述链接。
在部署方面,您可以使用最新版本的 sglang 或 vllm 来创建兼容 OpenAI 的 API 端点。
SGLang 是一个针对大型语言模型和视觉语言模型的快速服务框架。 SGLang 可用于启动具备 OpenAI 兼容 API 服务的服务器。
Qwen3-Next 需要 sglang>=0.5.2 版本,可通过以下方式安装:
pip install 'sglang[all]>=0.5.2'更多详情请参见其文档。
以下命令可用于在 4 块 GPU 上通过张量并行创建一个 API 端点,地址为 http://localhost:30000/v1,最大上下文长度为 256K tokens。
python -m sglang.launch_server --model-path Qwen/Qwen3-Next-80B-A3B-Instruct --port 30000 --tp-size 4 --context-length 262144 --mem-fraction-static 0.8以下是用于 MTP 的推荐命令,其余设置与上文相同:
python -m sglang.launch_server --model-path Qwen/Qwen3-Next-80B-A3B-Instruct --port 30000 --tp-size 4 --context-length 262144 --mem-fraction-static 0.8 --speculative-algo NEXTN --speculative-num-steps 3 --speculative-eagle-topk 1 --speculative-num-draft-tokens 4[!Note] 默认上下文长度为 256K。如果服务器启动失败,请考虑将上下文长度减小到更小的值,例如
32768。
另请参考 SGLang 关于 Qwen3-Next 的使用指南。
vLLM 是一个用于大语言模型的高吞吐量且内存高效的推理和服务引擎。 vLLM 可用于启动带有 OpenAI 兼容 API 服务的服务器。
Qwen3-Next 需要 vllm>=0.10.2,可通过以下方式安装:
pip install 'vllm>=0.10.2'有关更多详情,请参见其文档。
以下命令可用于在4块GPU上通过张量并行创建一个API端点,地址为http://localhost:8000/v1,最大上下文长度为256K tokens。
vllm serve Qwen/Qwen3-Next-80B-A3B-Instruct --port 8000 --tensor-parallel-size 4 --max-model-len 262144以下是用于 MTP 的推荐命令,其余设置与上文相同:
vllm serve Qwen/Qwen3-Next-80B-A3B-Instruct --port 8000 --tensor-parallel-size 4 --max-model-len 262144 --speculative-config '{"method":"qwen3_next_mtp","num_speculative_tokens":2}'[!Note] 默认上下文长度为 256K。如果服务器启动失败,请考虑将上下文长度减小到更小的值,例如
32768。
另请参阅 vLLM 关于 Qwen3-Next 的使用指南。
Qwen3 在工具调用能力方面表现出色。我们建议使用 Qwen-Agent 以充分发挥 Qwen3 的智能体能力。Qwen-Agent 在内部封装了工具调用模板和工具调用解析器,大幅降低了编码复杂度。
要定义可用工具,您可以使用 MCP 配置文件、使用 Qwen-Agent 的集成工具,或自行集成其他工具。
from qwen_agent.agents import Assistant
# Define LLM
llm_cfg = {
'model': 'Qwen3-Next-80B-A3B-Instruct',
# Use a custom endpoint compatible with OpenAI API:
'model_server': 'http://localhost:8000/v1', # api_base
'api_key': 'EMPTY',
}
# Define Tools
tools = [
{'mcpServers': { # You can specify the MCP configuration file
'time': {
'command': 'uvx',
'args': ['mcp-server-time', '--local-timezone=Asia/Shanghai']
},
"fetch": {
"command": "uvx",
"args": ["mcp-server-fetch"]
}
}
},
'code_interpreter', # Built-in tools
]
# Define Agent
bot = Assistant(llm=llm_cfg, function_list=tools)
# Streaming generation
messages = [{'role': 'user', 'content': 'https://qwenlm.github.io/blog/ Introduce the latest developments of Qwen'}]
for responses in bot.run(messages=messages):
pass
print(responses)Qwen3-Next 原生支持最长 262,144 tokens 的上下文长度。 当对话总长度(包含输入和输出)显著超过此限制时,建议使用 RoPE 缩放技术来有效处理长文本。 我们已通过 YaRN 方法验证了模型在最长 100 万 tokens 上下文长度下的性能。
目前已有多个推理框架支持 YaRN,例如 transformers、vllm 和 sglang。
通常,在支持的框架中启用 YaRN 有以下两种方法:
修改模型文件:
在 config.json 文件中,添加 rope_scaling 字段:
{
...,
"rope_scaling": {
"rope_type": "yarn",
"factor": 4.0,
"original_max_position_embeddings": 262144
}
}通过命令行参数:
对于 vllm,可以使用
VLLM_ALLOW_LONG_MAX_MODEL_LEN=1 vllm serve ... --rope-scaling '{"rope_type":"yarn","factor":4.0,"original_max_position_embeddings":262144}' --max-model-len 1010000 对于 sglang,可以使用
SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1 python -m sglang.launch_server ... --json-model-override-args '{"rope_scaling":{"rope_type":"yarn","factor":4.0,"original_max_position_embeddings":262144}}' --context-length 1010000[!NOTE] 所有主流开源框架均实现了静态 YaRN,这意味着缩放因子不随输入长度变化而改变,可能会影响短文本的性能。 建议仅在需要处理长上下文时才添加
rope_scaling配置。 还建议根据需要修改factor。例如,如果您的应用程序的典型上下文长度为 524,288 tokens,则最好将factor设置为 2.0。
我们在 RULER 基准测试的 100 万 tokens 版本上对模型进行了测试。
| 模型名称 | Acc avg | 4k | 8k | 16k | 32k | 64k | 96k | 128k | 192k | 256k | 384k | 512k | 640k | 768k | 896k | 1000k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Qwen3-30B-A3B-Instruct-2507 | 86.8 | 98.0 | 96.7 | 96.9 | 97.2 | 93.4 | 91.0 | 89.1 | 89.8 | 82.5 | 83.6 | 78.4 | 79.7 | 77.6 | 75.7 | 72.8 |
| Qwen3-235B-A22B-Instruct-2507 | 92.5 | 98.5 | 97.6 | 96.9 | 97.3 | 95.8 | 94.9 | 93.9 | 94.5 | 91.0 | 92.2 | 90.9 | 87.8 | 84.8 | 86.5 | 84.5 |
| Qwen3-Next-80B-A3B-Instruct | 91.8 | 98.5 | 99.0 | 98.0 | 98.7 | 97.6 | 95.0 | 96.0 | 94.0 | 93.5 | 91.7 | 86.9 | 85.5 | 81.7 | 80.3 | 80.3 |
为实现最佳性能,我们建议采用以下设置:
采样参数:
Temperature=0.7、TopP=0.8、TopK=20 和 MinP=0。presence_penalty 参数调整在 0 到 2 之间,以减少无意义的重复。但需注意,较高的参数值可能偶尔导致语言混杂,并略微降低模型性能。充足的输出长度:对于大多数查询,建议使用 16,384 tokens 的输出长度,这对于指令微调模型而言已足够。
标准化输出格式:在进行基准测试时,建议通过提示词标准化模型输出。
answer 字段中仅用选项字母展示您的选择,例如:"answer": "C"。”如果您觉得我们的工作有帮助,欢迎引用。
@misc{qwen3technicalreport,
title={Qwen3 Technical Report},
author={Qwen Team},
year={2025},
eprint={2505.09388},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2505.09388},
}
@article{qwen2.5-1m,
title={Qwen2.5-1M Technical Report},
author={An Yang and Bowen Yu and Chengyuan Li and Dayiheng Liu and Fei Huang and Haoyan Huang and Jiandong Jiang and Jianhong Tu and Jianwei Zhang and Jingren Zhou and Junyang Lin and Kai Dang and Kexin Yang and Le Yu and Mei Li and Minmin Sun and Qin Zhu and Rui Men and Tao He and Weijia Xu and Wenbiao Yin and Wenyuan Yu and Xiafei Qiu and Xingzhang Ren and Xinlong Yang and Yong Li and Zhiying Xu and Zipeng Zhang},
journal={arXiv preprint arXiv:2501.15383},
year={2025}
}