📑 技术报告 | 📖 博客 | 🤗 Hugging Face | 🤖 ModelScope | 💻 GitHub | 🖥️ 演示
[!Note] 本仓库包含Qwen-AgentWorld-35B-A3B的模型权重和配置文件,这是一个为智能体环境仿真训练的原生语言世界模型。
这些模型文件兼容Hugging Face Transformers、vLLM、SGLang等框架。
Qwen-AgentWorld是首个在单一模型中覆盖七个智能体交互领域的语言世界模型。它通过长思维链推理来模拟智能体环境,根据智能体的动作和交互历史预测下一个环境状态。Qwen-AgentWorld通过三阶段 pipeline 进行训练——CPT 注入环境知识,SFT 激活下一状态预测推理,RL 提升仿真保真度——是一个原生世界模型:从 CPT 阶段开始,环境建模就是训练目标,而非事后附加功能。
各领域五维评分均值,归一化至0-100分制。
| 模型 | MCP | 搜索 | 终端 | SWE | 安卓 | 网页 | 操作系统 | 总体 |
|---|---|---|---|---|---|---|---|---|
| GPT-5.4 | 70.10 | 37.26 | 53.69 | 66.29 | 60.00 | 51.80 | 68.58 | 58.25 |
| Claude Opus 4.8 | 54.93 | 35.14 | 59.18 | 64.10 | 61.50 | 54.66 | 66.62 | 56.59 |
| Claude Opus 4.6 | 69.90 | 29.30 | 57.51 | 64.55 | 61.74 | 51.42 | 70.20 | 57.80 |
| Gemini 3.1 Pro | 59.07 | 30.21 | 52.47 | 59.07 | 61.40 | 52.83 | 66.92 | 54.57 |
| Claude Sonnet 4.6 | 70.00 | 28.79 | 56.98 | 64.52 | 58.03 | 50.78 | 63.17 | 56.04 |
| DeepSeek-V4-Pro | 63.27 | 27.61 | 51.26 | 59.44 | 55.17 | 50.32 | 63.70 | 52.97 |
| GLM-5.1 | 67.60 | 22.46 | 47.32 | 52.07 | 59.10 | 51.50 | 59.13 | 51.31 |
| Kimi K2.6 | 65.23 | 27.48 | 52.54 | 58.77 | 58.93 | 50.20 | 60.80 | 53.42 |
| MiniMax-M2.7 | 55.82 | 27.30 | 41.62 | 37.44 | 52.40 | 50.52 | 57.73 | 46.12 |
| Qwen3.5-35B-A3B | 57.87 | 25.98 | 46.13 | 47.58 | 53.18 | 47.10 | 56.27 | 47.73 |
| Qwen3.5-397B-A17B | 68.31 | 30.81 | 55.30 | 64.44 | 54.90 | 48.55 | 60.85 | 54.74 |
| Qwen3.6-Plus | 55.28 | 21.94 | 50.58 | 59.08 | 57.65 | 50.78 | 60.33 | 50.81 |
| Qwen-AgentWorld-35B-A3B | 64.79 | 36.69 | 53.96 | 65.63 | 58.17 | 49.55 | 65.92 | 56.39 |
| Qwen-AgentWorld-397B-A17B | 68.24 | 37.82 | 57.73 | 68.49 | 60.20 | 50.98 | 67.89 | 58.71 |
Qwen-AgentWorld-35B-A3B 可通过主流推理框架以 API 形式提供服务。以下展示启动兼容 OpenAI API 服务器的示例命令。
[!Important] 该模型默认上下文长度为 262,144 个 tokens。 若遇到内存不足(OOM)错误,可考虑减小上下文窗口。 但由于 Qwen-AgentWorld 利用扩展上下文进行多轮环境模拟,建议保持至少 128K tokens 的上下文长度。
SGLang 是一个用于大型语言模型的快速服务框架。
python -m sglang.launch_server \
--model-path Qwen/Qwen-AgentWorld-35B-A3B \
--port 8000 \
--tp-size 4 \
--context-length 262144 \
--reasoning-parser qwen3兼容 OpenAI 的 API 将在 http://localhost:8000/v1 提供。
vLLM 是一个用于大语言模型(LLMs)的高吞吐量且内存高效的推理引擎。
vllm serve Qwen/Qwen-AgentWorld-35B-A3B \
--port 8000 \
--tensor-parallel-size 4 \
--max-model-len 262144 \
--reasoning-parser qwen3 \
--language-model-only \
--trust-remote-code
--language-model-only标志是必需的,因为模型架构包含视觉组件定义,但检查点仅包含语言模型权重。如果没有此标志,vLLM 将尝试初始化视觉模块并失败。
兼容 OpenAI 的 API 将在 http://localhost:8000/v1 可用。
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Qwen/Qwen-AgentWorld-35B-A3B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto",
)
messages = [
{
"role": "system",
"content": "You are a language world model simulating a Linux terminal environment. "
"Given the user's command, predict the terminal output."
},
{
"role": "user",
"content": "Action: execute_bash\nCommand: ls -la /home/user/project/"
}
]
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, temperature=0.6)
response = tokenizer.decode(outputs[0][inputs.input_ids.shape[-1]:], skip_special_tokens=True)
print(response)from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8000/v1",
api_key="EMPTY",
)
# Terminal domain example
messages = [
{
"role": "system",
"content": "You are a language world model simulating a Linux terminal environment. "
"Given the user's command, predict the terminal output."
},
{
"role": "user",
"content": "Action: execute_bash\nCommand: ls -la /home/user/project/"
}
]
response = client.chat.completions.create(
model="Qwen/Qwen-AgentWorld-35B-A3B",
messages=messages,
max_tokens=32768,
temperature=0.6,
)
print(response.choices[0].message.content)[!Note] 我们在 GitHub 仓库的
prompts/目录下,为所有 7 个领域提供了特定领域的世界模型系统提示词模板。在将 Qwen-AgentWorld 用作环境模拟器时,这些模板可作为通用的系统提示词。每个领域文件夹中包含一个system_prompt.txt(世界模型系统提示词)和一个judge_system_prompt.txt(评估提示词)。
AgentWorldBench 通过从 5 个维度对每个预测的环境观测结果进行评分,来评估语言世界模型,这 5 个维度分别是:格式(Format)、事实性(Factuality)、一致性(Consistency)、真实性(Realism) 和 质量(Quality)。
# Clone the evaluation repository
git clone https://github.com/QwenLM/Qwen-AgentWorld.git
cd Qwen-AgentWorld
# Download the benchmark
huggingface-cli download Qwen/AgentWorldBench --repo-type dataset --local-dir ./AgentWorldBench
# Install dependencies
pip install openai评估遵循三步流程:
cd eval
# Step 1: Run world model inference
python eval.py infer \
--data-dir ../AgentWorldBench \
--model-base-url http://localhost:8000/v1 \
--model-name Qwen/Qwen-AgentWorld-35B-A3B \
--output-dir ./results
# Step 2: Run LLM judge scoring
export OPENAI_API_KEY="your-api-key"
python eval.py judge \
--predictions ./results/predictions.jsonl \
--judge-base-url https://api.openai.com/v1 \
--judge-model gpt-5.2-2025-12-11 \
--output-dir ./results
# Step 3: Aggregate and display scores
python eval.py score --predictions ./results/judged.jsonl采样参数:对于世界模型推理,我们建议使用 temperature=0.6、top_p=0.95、top_k=20。模型默认采用思考模式(</think>...</RichMediaReference>),在生成预测观察结果前对环境状态转换进行推理。
足够的输出长度:对于大多数查询,我们建议输出长度为 32,768 个 token。对于长的多步骤轨迹,您可以增加最大输出长度以容纳详细的环境观察结果。
特定领域系统提示词:为获得最佳的模拟保真度,请使用 GitHub 仓库的 prompts/ 目录中提供的特定领域系统提示词。
如果您发现我们的工作对您有所帮助,欢迎引用我们。
@article{zuo2026qwen,
title={Qwen-agentworld: language world models for general agents},
author={Zuo, Yuxin and Xiao, Zikai and Sheng, Li and Huang, Fei and Tu, Jianhong and Liu, Yuxuan and Tang, Tianyi and Hu, Xiaomeng and Su, Yang and Lan, Qingfeng and others},
journal={arXiv preprint arXiv:2606.24597},
year={2026}
}