【大模型】 炸裂!!阿里开源大模型 Qwen/QwQ-32B 性能追平 DeepSeek-R1、o1-mini

【大模型】 炸裂!!阿里开源大模型 Qwen/QwQ-32B 性能追平 DeepSeek-R1、o1-mini

Qwen/QwQ-32B 模型介绍

QwQ是Qwen系列的推理模型。与传统的指令调优模型相比,QwQ具有思考和推理能力,可以在下游任务,特别是难题中实现显著提高的性能。QwQ-32B是中等规模的推理模型,能够与最先进的推理模型(如DeepSeek-R1、o1-mini)实现竞争性能。

模型特性

Type: Causal Language Models
Training Stage: Pretraining & Post-training (Supervised Finetuning and Reinforcement Learning)
Architecture: transformers with RoPE, SwiGLU, RMSNorm, and Attention QKV bias
Number of Parameters: 32.5B
Number of Paramaters (Non-Embedding): 31.0B
Number of Layers: 64
Number of Attention Heads (GQA): 40 for Q and 8 for KV
Context Length: Full 131,072 tokens

发布时间

2025年3月5日

模型性能

在这里插入图片描述

运行环境安装

pip install transformers==4.47 -i https://mirrors.aliyun.com/pypi/simple/

运行模型

from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "Qwen/QwQ-32B"

model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

prompt = "How many r's are in the word \"strawberry\""
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)

generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=32768
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)

下载

model_id: Qwen/Qwen2.5-1.5B-Instruct
下载地址:https://hf-mirror.com/Qwen/QwQ-32B 不需要翻墙

gguf量化后的模型

  • 16显存跑32B 模型

下载模型 https://hf-mirror.com/bartowski/Qwen_QwQ-32B-GGUF/tree/main,选择:Qwen_QwQ-32B-IQ2_S.gguf 10.4 GB

使用llama.cpp测试

  • 24GB 显存跑32B 模型

下载模型 https://hf-mirror.com/bartowski/Qwen_QwQ-32B-GGUF/tree/main,选择:Qwen_QwQ-32B-Q4_0.gguf 18.7 GB

使用llama.cpp测试

开源协议

License: apache-2.0

参考

### DeepSeek-R1-Distill-Qwen-32B 模型介绍 DeepSeek-R1-Distill-Qwen-32B 是基于 Qwen2.5-32B 进行蒸馏得到的小规模密集模型之一。该模型通过从大型预训练模型 DeepSeek-R1 中提取知识,显著提升了推理能力和性能表现[^1]。 在开发过程中,研究人员选择了 Qwen2.5-32B 作为基础模型,并直接从 DeepSeek-R1 进行了知识蒸馏。实验结果显示,在多个基准测试中,这种直接蒸馏的方法比使用强化学习优化后的效果更好,表明大模型所发现的推理模式对于提升小模型的能力非常重要[^2]。 ### 性能比较:DeepSeek-R1-Distill-Qwen-32B vs. 14B 版本 研究表明,经过精心设计的知识蒸馏过程后,即使是参数量较少的模型也能达到甚至超过更大规模模型的表现: - **14B 模型**:蒸馏后的 14B 模型大幅超越了当时最先进水开源 QwQ-32B-Preview (Qwen, 2024a),显示出强大的竞争力。 - **32B 和 70B 模型**:这些更大的蒸馏版模型不仅保持住了原有优势,还在密集模型中的推理基准上创下了新纪录。特别是 DeepSeek-R1-Distill-Qwen-32B,在某些特定任务上的成绩尤为突出,例如 AIME 2024 数学竞赛方面超过了 GPT-4o 和 Claude 3.5 的表现[^3]。 综上所述,虽然 32B 版本拥有更多的参数数量,但在实际应用场景下两者之间的差距可能取决于具体任务需求;而就整体而言,32B 版本确实展现出了更强的整体实力和更广泛的应用潜力。 ```python # 示例代码展示如何加载并评估两个不同大小的模型 import torch from transformers import AutoModelForCausalLM, AutoTokenizer def evaluate_model(model_name): tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModelForCausalLM.from_pretrained(model_name) input_text = "Evaluate this math problem:" inputs = tokenizer(input_text, return_tensors="pt") with torch.no_grad(): outputs = model.generate(**inputs, max_length=50) result = tokenizer.decode(outputs[0], skip_special_tokens=True) print(f"Result from {model_name}: ", result) evaluate_model('DeepSeek-R1-Distill-Qwen-14B') evaluate_model('DeepSeek-R1-Distill-Qwen-32B') ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

szZack

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值