一个超强的推理增强大模型,开源了,本地部署

大家好,我是 Ai 学习的老章

前几天介绍了MOE 模型先驱 Mistral 开源的代码 Agent 大模型------mistralai/Devstral-Small-2505

今天一起看看 Mistral 最新开源的推理大模型------Magistral

Magistral 简介

Mistral 公司推出了首个推理模型 Magistral 及自研可扩展强化学习 (RL) 流程。团队采用自下而上的方法,完全基于自有模型和基础设施构建,不依赖现有实现或其他模型的 RL 轨迹。

Mistral 的技术栈探索了纯 RL 训练大语言模型的极限,开发出强制模型使用特定推理语言的方法,并证实仅用文本数据的强化学习能保持初始模型大部分能力。这种方法还能维持或提升多模态、指令遵循和函数调用能力。

设计理念是像人类一样缜密思考,同时具备跨专业领域的知识储备、可追踪验证的透明推理流程,以及深度的多语言适应能力。

Magistral 特性

  • 与通用模型不同,Magistral 针对多步逻辑进行了微调,提高了可解释性,并以用户语言提供可追溯的思维过程。
  • Magistral 基于 Mistral Small 3.1(2503)构建, 增强了推理能力
  • Magistral 提供两种版本:Magistral Small(240 亿参数开源版),Magistral Medium(企业版)
  • Magistral Small 融合了来自 Magistral Medium 的冷启动数据
  • Magistral Small 参数量 24B, 可本地部署,量化后能适配单张 RTX 4090 显卡或 32GB 内存的 MacBook
  • Magistral 上下文窗口 128k , 但超过 40k 后性能可能下降,官方建议将模型最大长度设置为 40k

Magistral 测评数据

Magistral Medium 只用 24B 参数秒杀 DeepSeek-V3,某些领域 (GPQA Diamond) 可以和 DeepSeek-R1 掰手腕,不过应该是旧版 R1,如果跟 R1-0528 比,那还是差这档次呢

Mistral 也鸡贼,拿去刷榜的是企业版 (Medium),开源版数据就没那么全了

注:GPQA Diamond 是 GPQA 数据集的子集。GPQA 数据集包含 448 道由生物学、物理学和化学领域专家编写的高质量选择题,而 Diamond 子集是其中质量最高的部分,包含 198 条结果,其选取的是两个专家均答对且至少 2/3 非专家答错的问题,这些问题具有很高的难度。

Model AIME24 pass@1 AIME25 pass@1 GPQA Diamond Livecodebench (v5)
Magistral Medium 模型 73.59% 64.95% 70.83% 59.36%
Magistral Small 模型 70.68% 62.76% 68.18% 55.84%

Medium 比 Small 强了 2 个百分点的样子

另:看论文中,Magistral 对中文相对没那么友好,毕竟法国公司。不过拿去写代码应该问题不大,Livecodebench (v5) 上强于 V3 一大截

Magistral Small 部署

截至发文 modelscope.com 尚未更新模型文件,网络不佳的同学可以坐等一下:https://www.modelscope.cn/models/mistralai/

网络畅通就去huggingface:https://huggingface.co/mistralai/Magistral-Small-2506

模型文件 50GB,感觉至少需要 4 张 4090 才能启动

启动模型:

BASH 复制代码
# 需要升级到最新版:
pip install -U vllm --extra-index-url [https://wheels.vllm.ai/0.9.1rc1](https://t.co/kuf2vI0hva "https://wheels.vllm.ai/0.9.1rc1") --torch-backend=auto
vllm serve mistralai/Magistral-Small-2506 --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice --tensor-parallel-size 2

量化版对显卡的要求至少可以打个对折起步

比如Ollama上量化后模型文件只有14GB

Magistral 量化版汇总:

Magistral 使用

官方有该模型的最佳参数:

  • top_p: 0.95
  • temperature: 0.7
  • max_tokens: 40960

我在论文中还看到了史上最简洁的系统提示词

markdown 复制代码
A user will ask you to solve a task. You should first draft your thinking process (inner
monologue) until you have derived the final answer. Afterwards, write a self-contained
summary of your thoughts (i.e. your summary should be succinct but contain all the critical
steps you needed to reach the conclusion). You should use Markdown and Latex to format
your response. Write both your thoughts and summary in the same language as the task
posed by the user.
Your thinking process must follow the template below:
<think>
Your thoughts or/and draft, like working through an exercise on scratch paper. Be as casual
and as long as you want until you are confident to generate a correct answer.
</think>
Here, provide a concise summary that reflects your reasoning and presents a clear final
answer to the user.
Problem:
{problem}

虽然简介,但是也包括了一个系统提示词的所有结构:

  1. 双阶段思考 :
    • 第一阶段:要求模型在Thought Process标签内进行详细的思考过程(内部独白)
    • 第二阶段:在标签外提供简洁但完整的总结和最终答案
  2. 思考可见化 :
    • 这种设计让用户能够看到模型的"思考过程",增加透明度
    • 类似于"思考链"(Chain-of-Thought) 提示技术,但更加结构化
  3. 格式要求 :
    • 要求使用 Markdown 和 LaTeX 进行格式化,适合数学和科学问题的展示
    • 强调结构化输出,使回答更加清晰易读
  4. 语言适应 :
    • 要求模型使用与用户提问相同的语言回答,增强用户体验
  5. 问题占位符:{problem}是一个占位符,将被实际问题替换

最后就是官方建议的聊天模板:

markdown 复制代码
<s>[SYSTEM_PROMPT]system_prompt

A user will ask you to solve a task. You should first draft your thinking process (inner monologue) until you have derived the final answer. Afterwards, write a self-contained summary of your thoughts (i.e. your summary should be succinct but contain all the critical steps you needed to reach the conclusion). You should use Markdown to format your response. Write both your thoughts and summary in the same language as the task posed by the user. NEVER use \boxed{} in your response.

Your thinking process must follow the template below:
<think>
Your thoughts or/and draft, like working through an exercise on scratch paper. Be as casual and as long as you want until you are confident to generate a correct answer.
</think>

Here, provide a concise summary that reflects your reasoning and presents a clear final answer to the user. Don't mention that this is a summary.

Problem:

[/SYSTEM_PROMPT][INST]user_message[/INST]<think>
reasoning_traces
</think>
assistant_response</s>[INST]user_message[/INST]

其他资源

试用:https://chat.mistral.ai/chat

论文:https://mistral.ai/static/research/magistral.pdf

API:http://console.mistral.ai/

制作不易,如果这篇文章觉得对你有用,可否点个关注。给我个三连击:点赞、转发和在看。若可以再给我加个🌟,谢谢你看我的文章,我们下篇再见!

搭建完美的写作环境:工具篇(12 章)
图解机器学习 - 中文版(72 张 PNG)
ChatGPT、大模型系列研究报告(50 个 PDF)
108 页 PDF 小册子:搭建机器学习开发环境及 Python 基础
116 页 PDF 小册子:机器学习中的概率论、统计学、线性代数
史上最全!371 张速查表,涵盖 AI、ChatGPT、Python、R、深度学习、机器学习等

相关推荐
JJJennie777几秒前
2026年大模型网关自建还是买?MAI Gateway等主流方案横评
人工智能·开源·gateway·ai网关
拆房老料1 小时前
【第四部分:Agentic 智能体设计模式】16. 一个 Prompt 搞不定复杂任务?试试 Prompt Chaining
java·前端·人工智能·设计模式·prompt
运维行者_2 小时前
应用性能监控怎么选?从调用链到用户体验的五个能力维度
运维·服务器·数据库·人工智能·mysql·性能优化·应用性能监控
张张123y2 小时前
后端第十四课:Agent 记忆系统(让 Agent 记住上下文和用户,跨会话不健忘)
java·大数据·人工智能·python·agent·记忆
国科安芯6 小时前
四重证据,一条逻辑链:商业航天级微控制器MCU抗辐射验证方法学综述——以国科安芯AS32S601为例
人工智能·单片机·嵌入式硬件·mcu·安全·抗辐射
dk_tjy7 小时前
AI驱动的自动化攻击背景下:企业端点安全体系的技术架构与建设路径
网络·人工智能·安全·自动化·终端安全管理·数据防泄漏
布吉岛的石头7 小时前
Java 程序员第 50 阶段2:预训练的目标函数:自回归语言建模本质
java·开发语言·人工智能·深度学习·回归·transformer
2601_965454237 小时前
用AI把开源项目功能清单做成MG动画介绍视频
人工智能·开源·音视频
风雅GW7 小时前
局域网访问为何少一半配置页:DSH 的安全边界设计复盘
人工智能
衡石科技7 小时前
同一句业务问题,怎样持续问对数?衡石 ChatBI 的语义准备与回归验证
人工智能·数据挖掘·回归·chatbi