欢迎勒康克:Mistral 4 在Hugging Face
Mistral Large 4 (aka Le Chonk)是来自Mistral的多模式多语言,多语种,多功能的混合型(MoE)型。 它以文本和图像作为输入并生成文本。 它拥有大约1T总计,49B活性参数,以及1M令牌上下文窗口。
该型号为发布,分两种正式变体:1.
还有由Unsloth和llama.cpp团队创建的GGUF. 在Mistral生态系统开放-重量许可(MIT衍生物
Mistral大4对网络安全,编码agents,和多式特别强。 在本文中,我们审视模型是如何运作的,其能力,架构等等!
目录
Mistral 大四号有什么新鲜事
Mistral Large 4结合了一大群专家,注意力稀少,并配有皮克斯视觉编码器。 语言模型为每个符号选择一个小专家组,而它的注意力索引器则选择了之前要处理的符号位置。 这些是两种不同的垃圾邮件形式,一种选择向导网络,另一种选择上下文位置。
您可以在 Mistral 4 大收藏中找到所有检查站。
网络安全能力
Mistral大调4在人工分析网络指数测试中得分为82%,该测试要求一个模型在开源软件中复制出一个真正的脆弱性,然后补上软件。 Mistral报告说,几个封闭前沿模型在同一测试中得分接近零,因为他们拒绝尝试工作。 这对维权者来说是极为重要的,因为解决脆弱性通常需要再现脆弱性。 在Mistral的内部测试中,Mistral Large 4对恶意软件分析,脆弱性优先化和写出检测规则也有用,而模型并没有对此进行明确的训练。
Mistral主要定位防御性安全工作的模型。 脆弱性研究和事件反应常常在模型输入中出现像攻击一样,因此闭合源过滤器可以阻挡。 依赖于API的团队也可能在事发中失去访问权限。 关键是,开放式重量模型将使用政策和部署都置于用户的控制之下。 称,该模型仍然拒绝有害的请求:在来自Jailbreak Bench,StrongREJECT和Agent Harm的网络提示上,其平均拒绝率高于其他开放重量模型。
对于社区建设者来说,Mistral大4等开放式重量模型会解锁下游一负荷的使用案例。 你可以建立自己的网络系统围绕你的代码基础崩溃日志和恶意软件样本。 例如,在TRL中,您可以从Mistral大4的痕迹中取出微调更小的模型来修补您的代码基础。 事实上,再现-当时-patch任务使用可核查的奖励,因此它适合RL环境,可用于进一步使用RL更小的安全模型。 开放权重也让研究人员直接衡量模型的拒绝行为,而不是依赖提供者的描述。
简而言之,像ML4在公开场合的网络能力对社区来说是一个巨大的推动。
我们已经采访了Pierre Stock 关于模型的网络能力你可以在这里观看
建筑
Mistral 时速大4的文本解码器有72层,隐藏的维度为6,144,有64个注意力头。 它的注意力区块将多头Latet Note(MLA)和DeepSeek Sparse Content(DSA)索引器(GLM 5.3等其它模型中的一个方向)结合。 MLA保留了压缩的KV代表,DSA为每个查询选择最多2,048个关键位置。
对于每个解码器块,有一个3:1的ROPE到NoPE模式,即3个解码器层使用ROPE,而每4个层使用NoPE. 该模型还分层共享了KV状态。
第一个解码层使用密集的向导线网。 其他71个地层使用MOE块,其中软max路由器在每个符上选择128位专家中的4位。 共有一名专家总是与选定的专家一起工作,每名专家共5名。
关于ROPE,Mistral使用由YARN缩放的ROPE,每频率有1个学习到的乘数。
视觉编码器
Mistral Lige 4使用1.6B Pixtral编码器。 Pixtral有30层,隐藏维度为2,048,并有16个关注头。 它使用14×14个补丁和一个有空间合并尺寸2的补丁-并发投影仪。 你可以看到下面的编码器管道。
基准测试结果
Mistral大4能提供强大的基准测试性能,跨越编码,网络安全,多模式理解,以及代理工作流程,将其定位为开放量级生态系统的竞争性附加。 截至2026年10月29日,该模型是人工分析智能指数上第5个最佳的开放权重模型。
在编码方面,ML4在DeepSWE v1.1上实现了61.7%,在SWE-Atlas-QnA上实现了59.4%,在终端-奔驰4上实现了28.3%. 其综合编码Agent指数得分49.8%,将其排在DeepSeek V4 Pro 0813和Qwen3.8 Max前。
ML4的编码能力扩展到了知识工作,自动化奔驰的编码率为59.9%,AA-Briefcase的编码率为1,393 Elo,它们评价业务工作流程和长视专业任务。
网络安全是Mistral Large 4的站立能力之一,在现实世界的脆弱性评估和安全竞争任务中取得了显著成果。 三个基准测试突出该模型的网络性能:
- 人工分析网络指数:在对模型发现和修复软件脆弱性的能力进行独立评价时,ML4在全球排名前五名。
- 脆弱性复制和补丁:它取得了82%的成绩,是指数范围内这一测试报告得分最高的成绩。 这项任务需要在开源软件中复制出真正的脆弱性并再进行补丁,测试调查和补救。
- Cybench:ML4从安全竞赛中抽取的40个挑战中解决了93%,显示出在实际操作安全问题上的强能。
Mistral Large 4也表现出93.3%的对Lakera的B3 基准测试的攻击阻力,并增加了强力对抗即时注射攻击的证据。 除基准测试外,内部测试在恶意软件分析、脆弱性优先化和检测规则生成方面都显示有希望的结果。
推论支持
Mistral大调4被运出,为变压器提供日-0支持,vLLM和llama.cpp. GGUF的四分数来自GGUF和llama.cpp团队。 我们提供各种选择,以便远程部署推论终点,并通过推论提供者使用无服务器推论。
变形器
"变形器"执行提供AutoModelFor MultimemoduleLM,由AutoProcessor来准备对讲和图像输入。 Mistral 时速大4可以采取低,中,高的推理努力。 默认值很高,并且注意推理不能被禁用,因此使用推理 effort:无将仍然使用高。
要运行模型,升级变压器包
pip 安装 -- -- 升级变压器
导入 Os
从变压器导入自动处理器,自动模版多式LM,分布式配置
分布式配置 = 分布式配置 ()
tp_size=int(os.environ["WORLD_SIZE"]),
ep_size=int(os.environ["WORLD_SIZE"]),
)
型号 id = “Mistralai/Mistral-Large-4-1T-A52B”
处理器 = 自动处理器。 from pretrained(model id)
型号 = AutoModel For Multimodule LM. from pretrained () 自动模版
模式( D)
分布式配置=分布式配置
)
{\fn方正粗倩简体\fs12\an8\1cHFFFF00\b0}只有文字
文本消息= [
{
"作用":"用户"
"内容":"你是谁?
}
]
# 文本+图像
多式联运消息=[
{
"作用":"用户"
"内容":[
{
"类型":"图像"
"图像":"https://huggingface.co/datasets/huggingface/cats-image/resolve/main/cats image.jpeg" (中文(简体) ).
},
{
"类型":"文本"
""文字":"形象上有多少猫?
},
],
},
]
[文本消息,多式消息]中的信息:
输入 = 处理器。 apply chat template()
信件
添加生成即时= True
符号化=真
返回( d)
返回( T)
推理努力=“ 中等”
.to (model.device).to (model.dtype) (英语).
输入 len = 输入 ["输入 ids"]. sshape [-1].
输出 = model.generate(**输入,最大 new tokens=100)
if int(os.environ["RANK"]) == 0:
print( 处理器。 decode (输出 [0][ input len:],跳过 special tokens=False))
您可以将上面的脚本保存在 python 文件脚本中,然后运行
火炬跑 -- nproc-per-node 8 脚本.py
vLLM 数据
vLLM支持高品质的NVFP4 Mistral大4检查站,其内存足迹较小并需要NVIDIA Blackwell GPU. 该型号还搭载了DSpark起草器来进行与vLLM的附加快取。 像这样的服务器发布:
vllm serve mistralai/Mistral-Large-4-1T-A52B-NVFP4 \
-- 配置格式 mistral \
-- 装入格式 mistral \
高度平行大小 8\
--decode-context-并行大小 8\
- 专家 - 平行?
--dtype bfloat16 \
131072\fn方正黑体简体\fs18\b1\bord1\shad1\3cH2F2F2F}麦斯·莫德兰 131072\b0}
十六号。..
- 2048年) - 马克斯- 纳姆- 击打- 键
--gpu-memory- 用途 0.85 °
- enable- prefix- caching \ \ - 绝对可以
强壮地
--mm 处理器 cache gb 0.0
一旦服务器启动并运行,您就可以运行以下功能。
卷曲 - http://127. 0.0.1: 8000/v1/chat/ completes - H 'Content-Type: application/json'\
-d"{"消息": [{"作用":"用户","内容":"什么是17*23"],"max tokens"::512}"
Llama.cpp (英语).
Llama.cpp和Llama App已经支持了Mistral大4.
您可以用以下命令安装 Llama App:
卷曲 - LsSf https://llama.app/install.sh QQ sh
然后可以启动服务器如下,在模型 ID 后表示等号后缀:
llama服务-hf ggml-org/Mistral-Large-4-1T-A52B-GGUF:Q2 K
这是由FP8检查站衍生出来的量子库,这是NVFP4
服务器启动后,可以前往localhost:9931使用内置的WebUI进行聊天。 从网络UI中您可以添加图像进行推断并调整推理杠杆。
您也可以通过以下方式查询服务器。 请随意查阅关于多式联运的API参考文献,工具调用等。
校对:Soup
-H"Content-Type:应用程序/json"\?
-d '{
"灵枢": [
{"作用":"系统","内容":"你是一个有帮助的助手".
{"作用":"使用者","内容":"为蟒蛇的例外写出石灰"}
]
}'
您可以运行图像文本推断如下。
卷起- http://127. 0.0.1:8080/v1/chat/ completes-\
-H"Content-Type:应用程序/json"\?
-H"授权:熊熊" "你的钥匙"\?
-d '{
"模型":"缪斯-沙克-开"
"灵枢": [
{
"作用":"用户"
"内容":[
{
"类型":"文本"
"文"曰:"此相中何为?
},
{
"类型":"图像 url"
"图像 url":{
"url":"数据:image/png;base64,".
}
}
]
}
],
"温度":0
}'
llama.cpp分舰队出动了以下等分舰队:IQ2 XXS,Q2 K,Q4 K M,NVFP4,Q8 0和BF16以进行进一步的转换。 2位四相机运行在单台Apple硅极地计算机上,并有512GB的统一RAM. 其他的则需要分布推论。 也可以在多张NVIDIA或AMD卡上运行。
运行于一单M3 Ultra上的Q2 K,预填吞吐量约为每秒90个令牌,一代速度为15克/秒。 在4 x RTX6000 Pro上,我们观察到以下结果:
- NVFP4:32K上下文大小,预装130-590吨/秒,等能速度~10吨/秒
- IQ2QQS:800K上下文大小。 在短上下文大小时,预填为500tok/s,生成运行为30tok/s. 然而,使用长上下文的性能下降到129克/秒(预填)和3克/秒(生成).
带TRL的微调
我们还利用TRL运送0日支持微调Mistral大4. 你只需要升级到最新版本的变压器,trl和peft.
pip 安装 -- -- 升级变压器 trl peft
在下面的例子中,我们培训该模型以进行多语种思维。 精细的调制模型能够用系统要求的语言解释!
剧本在8xB300s的节点上运行于FP8变体上。
# 火炬跑 -- nproc-per-node 8 sft.py
导入 Os
从数据集导入负载数据集
从 peft 导入 Loraconfig
从变压器导入自动模式FormageTextText,分布式配置
从 trl 导入 SFTConfig, SFTtrainer
世界大小 = int(os.environ ["WORLD SIZE"])
型号 id = “Mistralai/Mistral-Large-4-1T-A52B”
本文由 AI宝库自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
Welcome Le Chonk: Mistral Large 4 on Hugging Face
Mistral Large 4 (aka Le Chonk) is a multimodal, multilingual, Mixture-of-Experts (MoE) model from Mistral. It takes text and images as input and generates text. It has about 1T total, 49B active parameter, and a context window of 1M tokens.
The model is released in two official variants:
There are also GGUFs created by Unsloth and the llama.cpp team. It’s distributed under the Mistral Ecosystem Open-Weight License (an MIT derivative that establishes limitations for model-as-a-service offerings).
Mistral Large 4 is particularly strong for cybersecurity, coding agents, and multimodality. In this post, we look at how the model works, its capabilities, architecture and more!
Table of Contents
What is new with Mistral Large 4
Mistral Large 4 combines a large pool of experts with sparse attention and a Pixtral vision encoder. The language model selects a small group of experts for each token, while its attention indexer selects which earlier token positions to attend to. These are two different forms of sparsity, where one selects feed-forward networks, the other selects context positions.
You can find all the checkpoints in the Mistral Large 4 collection.
Cybersecurity Capabilities
Mistral Large 4 scores 82% on the Artificial Analysis Cyber Index test that asks a model to reproduce a real vulnerability in open-source software and then patch the software. Mistral reports that several closed frontier models score near zero on the same test because they refuse to attempt the work. This is super important for defenders, because fixing a vulnerability usually requires reproducing the vulnerability. In Mistral’s internal testing, Mistral Large 4 was also useful for malware analysis, vulnerability prioritisation and writing detection rules, which the model was not explicitly trained for.
Mistral mainly positions the model for defensive security work. Vulnerability research and incident response often appear like attacks in model input, so closed source filters can block them. A team that depends on an API can also lose access in the middle of an incident. Crucially, open weight models put both the usage policy and the deployment under the user’s control. That said, the model still declines harmful requests: on cyber prompts from JailbreakBench, StrongREJECT and AgentHarm, its average refusal rate is higher than any other open weight model.
For community builders, an open weight model like Mistral Large 4 unlocks a load of downstream use cases. You could build your own cyber system around your code base, crash logs, and malware samples. For example, with TRL you could fine-tune smaller models from Mistral Large 4 traces patching your code base. In fact, reproduce-then-patch tasks use a verifiable reward, so it fits with RL environments that could be used to further RL smaller security models. Open weights also let researchers measure the model’s refusal behaviour directly instead of relying on the provider’s description.
In short, cyber capabilities like ML4’s in the open are a huge boost for the community.
We have interviewed Pierre Stock about the cyber capabilities of the model, you can watch it here.
Architecture
Mistral Large 4’s text decoder has 72 layers, a hidden dimension of 6,144, and 64 attention heads. Its attention blocks combine Multi-head Latent Attention (MLA) with a DeepSeek Sparse Attention (DSA) indexer (a direction in other models such as GLM 5.3). MLA keeps a compressed KV representation, and DSA selects up to 2,048 key positions for each query.
For each decoder block, there’s a 3:1 RoPE to NoPE pattern, i.e. 3 decoder layers employ RoPE and every fourth layer uses NoPE. The model also shares KV state across layers.
The first decoder layer uses a dense feed-forward network. The other 71 layers use MoE blocks, in which a softmax router selects four of the 128 experts for each token. One shared expert always runs alongside the selected experts, for a total of 5 active experts per token.
Regarding RoPE, Mistral uses LeRope, a YaRN-scaled RoPE with one learned multiplier per frequency.
Vision encoder
Mistral Large 4 employs a 1.6B Pixtral encoder. Pixtral has 30 layers, a hidden dimension of 2,048, and 16 attention heads. It uses 14 × 14 patches and a patch-merge projector with spatial merge size 2. You can see the encoder pipeline below.
Benchmark Results
Mistral Large 4 delivers strong benchmark performance across coding, cybersecurity, multimodal understanding, and agentic workflows, positioning it as a competitive addition to the open-weight ecosystem. As of October 29, 2026, the model is the fifth best open weights model on Artificial Analysis Intelligence index.
On coding, ML4 achieves 61.7% on DeepSWE v1.1, 59.4% on SWE-Atlas-QnA, and 28.3% on Terminal-Bench 4. Its combined Coding Agent Index score of 49.8% places it ahead of DeepSeek V4 Pro 0813 and Qwen3.8 Max.
Coding capabilities of ML4 extend to knowledge work, with 59.9% on AutomationBench and 1,393 Elo on AA-Briefcase, which evaluate business workflows and long-horizon professional tasks.
Cybersecurity is one of Mistral Large 4’s standout capabilities, with strong results across real-world vulnerability assessment and security competition tasks. Three benchmarks highlight the model’s cyber performance:
- Artificial Analysis Cyber Index: ML4 ranks among the top five models globally on this independent evaluation of models’ ability to find and fix software vulnerabilities.
- Vulnerability reproduction and patching: It achieves 82%, the highest reported score on this test within the index. The task requires reproducing a real vulnerability in open-source software and then patching it, testing both investigation and remediation.
- Cybench: ML4 solves 93% of a suite of 40 challenges drawn from security competitions, demonstrating strong performance on hands-on security problems.
Mistral Large 4 also demonstrates 93.3% attack resistance on Lakera’s B3 benchmark, adding evidence of robustness against prompt-injection attacks. Beyond benchmarks, internal testing showed promising results in malware analysis, vulnerability prioritization, and detection-rule generation.
Inference Support
Mistral Large 4 is shipped with day-0 support for transformers, vLLM and llama.cpp. GGUF quants are available from GGUF and the llama.cpp team. We provide options to deploy remotely with Inference Endpoints, and use serverless inference through Inference Providers.
Transformers
The Transformers implementation provides AutoModelForMultimodalLM, with AutoProcessor preparing the conversation and image inputs. Mistral Large 4 can take low, medium, high as reasoning effort. The default is high, and note that reasoning cannot be disabled, so using reasoning_effort: none would still use high.
To run the model, upgrade the transformers package
pip install --upgrade transformers
import os
from transformers import AutoProcessor, AutoModelForMultimodalLM, DistributedConfig
distributed_config = DistributedConfig(
tp_size=int(os.environ["WORLD_SIZE"]),
ep_size=int(os.environ["WORLD_SIZE"]),
)
model_id = "mistralai/Mistral-Large-4-1T-A52B"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForMultimodalLM.from_pretrained(
model_id,
distributed_config=distributed_config,
)
# only text
text_messages = [
{
"role": "user",
"content": "Who are you?"
}
]
# text + image
multimodal_messages = [
{
"role": "user",
"content": [
{
"type": "image",
"image": "https://huggingface.co/datasets/huggingface/cats-image/resolve/main/cats_image.jpeg",
},
{
"type": "text",
"text": "How many cats are in the image?",
},
],
},
]
for messages in [text_messages, multimodal_messages]:
inputs = processor.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
reasoning_effort="medium",
).to(model.device).to(model.dtype)
input_len = inputs["input_ids"].shape[-1]
outputs = model.generate(**inputs, max_new_tokens=100)
if int(os.environ["RANK"]) == 0:
print(processor.decode(outputs[0][input_len:], skip_special_tokens=False))
You can run the script above by saving it in a python file script.py and then run
torchrun --nproc-per-node 8 script.py
vLLM
vLLM supports the high-quality NVFP4 Mistral Large 4 checkpoint, which has a smaller memory footprint and requires NVIDIA Blackwell GPUs. The model also ships with a DSpark drafter for additional speed-ups with vLLM. Launch the server like this:
vllm serve mistralai/Mistral-Large-4-1T-A52B-NVFP4 \
--config-format mistral \
--load-format mistral \
--tensor-parallel-size 8 \
--decode-context-parallel-size 8 \
--enable-expert-parallel \
--dtype bfloat16 \
--max-model-len 131072 \
--max-num-seqs 16 \
--max-num-batched-tokens 2048 \
--gpu-memory-utilization 0.85 \
--enable-prefix-caching \
--enforce-eager \
--mm_processor_cache_gb 0.0
Once the server is up and running, you can run the following.
curl -s http://127.0.0.1:8000/v1/chat/completions -H 'Content-Type: application/json' \
-d '{"messages":[{"role":"user","content":"What is 17*23?"}],"max_tokens":512}'
Llama.cpp
Llama.cpp and Llama App already support Mistral Large 4.
You can install Llama App with the following command:
curl -LsSf https://llama.app/install.sh | sh
Then you can start the server as follows, indicating the quant suffix after the model ID:
llama serve -hf ggml-org/Mistral-Large-4-1T-A52B-GGUF:Q2_K
Here’s the repository with the quants derived from the FP8 checkpoint, and this is the NVFP4 one, converted from the official NVFP4 repo.
Once the server has started, you can head to localhost:9931 to chat using the built-in WebUI. From the web UI you can add images for inference and adjust the reasoning lever.
You can also query the server as follows. Feel free to check out the API reference for multimodality, tool calls and more.
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Write a limerick about python exceptions"}
]
}'
You can run image-text inference as follows.
curl -s http://127.0.0.1:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-key>" \
-d '{
"model": "muse-spark-open",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is in this image?"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,..."
}
}
]
}
],
"temperature": 0
}'
The llama.cpp team ships the following quants: IQ2_XXS, Q2_K, Q4_K_M, NVFP4, Q8_0, and BF16 for further conversions. The 2-bit quants run on a single Apple Silicon Ultra computer with 512 GB of unified RAM. The others require distributed inference. You can also run on multiple NVIDIA or AMD cards.
Running Q2_K on a single M3 Ultra, we got a prefill throughput of about 90 tokens per second, and a generation speed of 15 tok/s. On 4 x RTX6000 Pro, we observed the following results:
- NVFP4: 32K context size, prefill 130-590 t/s, gen speed ~10 t/s
- IQ2_XXS: 800K context size. At short context sizes, prefill is 500 tok/s and generation runs at 30 tok/s. However, using long contexts performance drops to 129 tok/s (prefill) and 3 tok/s (generation).
Fine-tuning with TRL
We also ship day 0 support of fine tuning Mistral Large 4 using TRL. All you have to do is upgrade to the latest version of transformers, trl and peft.
pip install --upgrade transformers trl peft
In the following example we train the model to perform multilingual thinking. The fine tuned model would be able to reason in the language the system prompt asks for!
The script runs on the FP8 variant on a node of 8xB300s.
# torchrun --nproc-per-node 8 sft.py
import os
from datasets import load_dataset
from peft import LoraConfig
from transformers import AutoModelForImageTextToText, DistributedConfig
from trl import SFTConfig, SFTTrainer
world_size = int(os.environ["WORLD_SIZE"])
model_id = "mistralai/Mistral-Large-4-1T-A52B"
Auto-fetched and translated by AI Gem Box. All rights belong to the original author.