Skip to content
StackDecode
LLM Library
Dense decoderOpen weightsArchitecture animation

Mistral 7B

A small model that beat larger ones through efficient attention.

At a glance

Made by
Mistral AI
Released
2023
Type
Dense decoder
Access
Open weights
Parameters
7.3B
Context window
8,192 tokens (32k with window)
Attention
Grouped-query attention and sliding-window attention

How it works

Mistral 7B uses grouped-query attention for a small KV cache and sliding-window attention so each layer looks only at nearby tokens, while stacked layers still pass information over longer distances.

Architecture, step by step

A token travels from text in to prediction out. The boxed layers repeat many times.

× N layersText inTokenizerEmbedding + positionNormCausal self-attentionAdd (residual)NormFeed-forward (MLP)Add (residual)Final normLM head (vocabulary scores)Softmax, then sample next token

Raw text enters the system, for example "The cat sat on the".

stage:
1/12
part:
Text in
1/12

The green dot is one token travelling through the model. The boxed section repeats for every layer.

What stands out

  • GQA
  • Sliding-window attention
  • Apache 2.0 licence

Keep in mind

Sliding windows limit direct long-range lookup in a single layer.

Related models