Skip to main content
Browse Models

Mistral AI

Mistral 7B

Released

2023-09-27

Family

Mistral (2023)

Type

Foundation Model

Downloads

External Download

You are about to open a link to an external source. Verify the URL before continuing.

Download

Instruct model, 4-bit GGUF (Q4_K_M)

GGUF · mistral-7b-instruct-v0.2.Q4_K_M.gguf

Instruct model, 5-bit GGUF (Q5_K_M)

GGUF · mistral-7b-instruct-v0.2.Q5_K_M.gguf

Instruct model, 6-bit GGUF (Q6_K)

GGUF · mistral-7b-instruct-v0.2.Q6_K.gguf

Instruct model, 8-bit GGUF (Q8_0)

GGUF · mistral-7b-instruct-v0.2.Q8_0.gguf

4-bit GGUF (Q4_K_M)

GGUF · mistral-7b-v0.1.Q4_K_M.gguf

5-bit GGUF (Q5_K_M)

GGUF · mistral-7b-v0.1.Q5_K_M.gguf

6-bit GGUF (Q6_K)

GGUF · mistral-7b-v0.1.Q6_K.gguf

8-bit GGUF (Q8_0)

GGUF · mistral-7b-v0.1.Q8_0.gguf

Ollama Model (q4_K_M)

Ollama

Model Report

Overview

Mistral 7B is a generative large language model (LLM) developed by Mistral AI, comprising 7.3 billion parameters and released on September 27, 2023. Designed with a focus on efficiency and performance, Mistral 7B introduces a suite of architectural innovations to enhance language understanding, sequence handling, and inference speed. It demonstrates competitive performance against larger models in a range of academic and practical benchmarks, while maintaining a compact size and open licensing under Apache 2.0.

Side-by-side bar charts comparing Mistral 7B against LLaMA 2 7B, 13B, and LLaMA 1 34B on MMLU, Reasoning, Math, and Code benchmarks.

Figure 1. Bar charts comparing Mistral 7B's performance on multiple benchmarks to [LLaMA 2 7B](https://openlaboratory.ai/models/llama-2-7b), [LLaMA 2 13B](https://openlaboratory.ai/models/llama-2-13b), and [LLaMA 1 34B](https://openlaboratory.ai/models/llama-1-33b) models. Mistral 7B's benchmark results are presented across MMLU, AGI Eval, Reasoning, and Code accuracy metrics.

Architecture and Key Innovations

Mistral 7B builds on the transformer architecture, integrating several distinctive features to advance model efficiency and scalability. One of the core improvements is the implementation of Grouped-Query Attention (GQA), which improves decoding efficiency by reducing memory consumption and accelerating inference, thus enabling higher throughput.

The introduction of Sliding-Window Attention (SWA) allows the model to process longer sequences effectively by attending to up to 4,096 tokens at each layer. This optimization, combined with advancements to FlashAttention and xFormers, achieves approximately double the speed for long sequence processing. To handle memory more efficiently, Mistral 7B utilizes a rolling buffer cache, maintaining only the active sliding window, which leads to significant reductions in cache memory usage during inference without degrading output quality.

Additional technical details include a model dimension of 4,096, 32 layers, 32 attention heads, and a vocabulary size of 32,000 tokens, with support for context lengths of up to 8,192 tokens and theoretical attention spans exceeding 130,000 tokens in deeper layers. The model employs a byte-fallback BPE tokenizer to robustly handle diverse languages and scripts.

Training Data and Methodology

Mistral 7B is pretrained on a broad range of public data sources, chosen to ensure coverage across reasoning, mathematics, code, and general language tasks. For its fine-tuned variant, Mistral 7B Instruct, the developers leverage publicly available instruction datasets from HuggingFace, explicitly refraining from the use of proprietary datasets or undisclosed methods. This approach underpins the transparency and reproducibility of the model and its results. The model’s training pipeline is designed to preserve reliability and minimize artifacts, with no use of secret “training tricks” for the Instruct version.

Performance and Evaluation

Mistral 7B has been rigorously benchmarked against established models on a diverse battery of tasks. On major standardized leaderboards including MMLU, reasoning, knowledge benchmarks, and code generation, Mistral 7B consistently demonstrates capabilities rivaling or surpassing much larger models such as LLaMA 2 13B and, in several domains, even LLaMA 1 34B. For code-related tasks, the model approaches the specialized performance levels of models like CodeLlama 7B.

Table with benchmark comparisons between Mistral 7B and LLaMA variants.

Figure 2. Benchmark results showing Mistral 7B outperforming or matching [LLaMA 2 13B](https://openlaboratory.ai/models/llama-2-13b) and [CodeLlama 7B](https://openlaboratory.ai/models/CodeLlama-7B) across reasoning, QA, and code metrics.

The model’s design enables “equivalent model size” performance, demonstrating performance comparable to or exceeding models with more than three times its parameter count, as shown across reading comprehension, STEM reasoning, and code generation. Evaluation on efficiency metrics reveals that for sequence lengths of 32,000 tokens, cache memory savings can reach up to eightfold compared to traditional transformer caches. On knowledge-intensive tasks, Mistral 7B achieves an estimated 1.9x compression ratio relative to reference models, which correlates with its more compact architecture.

Line charts showing Mistral 7B's effective size compared to LLaMA models on multiple metrics.

Figure 3. Line charts depicting how Mistral 7B's performance matches much larger LLaMA 2 models on MMLU, Reasoning, Knowledge, and Comprehension tasks.

Use Cases and Applications

Thanks to its compact size and competitive performance, Mistral 7B is suited for a wide array of natural language processing applications. The base model can be fine-tuned for instruction following, chat, content moderation, and enforcing safety guardrails. The Mistral 7B Instruct variant, specifically optimized for conversational alignment, achieves strong results on MT-Bench, rivaling chat models with far larger parameter counts.

Table comparing chat models by MT Bench score, with Mistral 7B Instruct highlighted.

Figure 4. MT-Bench leaderboard showing Mistral 7B Instruct's strong chat alignment compared to LLaMA and larger models.

For content moderation and guardrail enforcement, fine-tuned Mistral 7B models have demonstrated high precision and recall in self-reflection tasks, and system prompting can guide the model to refuse unsafe or problematic content. These flexible use cases make Mistral 7B a strong base for research and further customization.

Limitations and Responsible Use

As with all pretrained language models, the base Mistral 7B does not include intrinsic moderation mechanisms. While the Instruct variant offers improved safety through system prompting, full safety and ethical compliance require further integration of explicit guardrails and ongoing human oversight. On knowledge-focused benchmarks, the model performs comparably to much larger alternatives, but its relatively small size limits knowledge retention and factual recall compared to state-of-the-art giant models.

The developers of Mistral AI encourage responsible use and community engagement for continually improving guardrail systems and moderation.

Availability and Licensing

Mistral 7B is distributed under the Apache 2.0 License, supporting open use, modification, and distribution. Technical documentation, reference source code, and both base and Instruct model weights are available through Mistral AI’s official site, GitHub repository, and HuggingFace profile.

Helpful Links

More from Mistral AI

Mistral AI /

Mistral Large 2

123 billion parameter model from Paris-based Mistral AI, significantly more capable than its predecessor in code generation, mathematics, reasoning, multilingual support, and function calling.
Mistral AI /

Mistral Small (2409)

A 22B parameter enterprise-grade small model, a convenient mid-point between Mistral NeMo 12B and Mistral Large 2. This version delivers significant improvements in human alignment, reasoning capabilities, and code over the previous version.
Mistral AI /

Mistral Small 3.2 (2506)

A 24-billion parameter multimodal model featuring improved instruction following, function calling, and reduced repetition over its predecessor.
Mistral AI /

Mistral Small 3.1 (2503)

A 24-billion parameter multimodal transformer supporting text and vision tasks with 128K token context length under Apache 2.0 license.
Mistral AI /

Devstral Small 1.0

A 23.6B parameter coding assistant finetuned for agentic software engineering tasks with 128K context window and 46.8% SWE-Bench performance.
Mistral AI /

Mistral Small 3 (2501)

A 24-billion parameter instruction-tuned language model with multilingual capabilities, 32K context window, and optimized low-latency inference performance.
Mistral AI /

Mistral NeMo 12B

A 12B parameter multi-lingual model that supports function calling built in collaboration with NVIDIA and trained using the new Tekken tokenizer. By some metrics, it is state-of-the-art in its size category. NeMo was trained with quantisation awareness, enabling FP8 inference without any performance loss.
Mistral AI /

Codestral 22B v0.1

A 22.2 billion parameter causal language model trained on over 80 programming languages with support for code generation and fill-in-the-middle completion.
Mistral AI /

Mixtral 8x7B

Spare sparse mixture of experts (MoE) model consisting of 8 "experts" with 7b parameters each, outperforming all Llama 2 models (including 70b) on most benchmarks.
Mistral AI /

Mixtral 8x22B

A sparse mixture-of-experts architecture with 141 billion total parameters, activating 39 billion per token, supporting multilingual tasks and 64,000-token contexts.