Automatone
HomeAbout

Automatone

AI tools, dev workflows, and automation. No hype, just what works.

Pages

HomeBlogAboutPrivacyTerms

Connect

GitHubRSS Feed

ยฉ 2026 Automatone. All rights reserved.

Admin
  1. Home
  2. โ€บAI & ML
  3. โ€บMixtral and Mixture-of-Experts, Explained
๐Ÿ“„ Paper Review

Mixtral and Mixture-of-Experts, Explained

Sanchez Kim
Sanchez Kim
AI Engineer ยท August 3, 2026 ยท 8 min read

Mixtral 8x7B holds ~47B parameters but activates only ~13B per token, matching or beating Llama 2 70B and GPT-3.5 on most metrics at a fraction of the active compute. A walkthrough of how sparse mixture-of-experts works, what the benchmarks show, and the surprising finding that expert assignment appears to align more with syntax than with domain.

#Paper Review#Mixture of Experts#Mixtral#LLM#Mistral AI#Sparse Models#Machine Learning
Mixtral and Mixture-of-Experts, Explained

Mixtral 8x7B carries roughly 47 billion parameters but only fires about 13 billion of them for any given token, and it still matches or beats Llama 2 70B and GPT-3.5 on most benchmarks the authors test. That is the whole pitch of Mixtral of Experts: get the quality of a large model while paying the inference bill of a small one, by routing each token through only a fraction of the network.

TL;DR

Mistral AI took their Mistral 7B architecture and replaced each layer's single feed-forward block with eight expert feed-forward blocks plus a router that picks two of them per token. Total capacity goes up to ~47B parameters; active compute per token stays near ~13B. The result matches or surpasses Llama 2 70B and GPT-3.5 on most metrics โ€” clearly ahead on mathematics, code generation, and multilingual benchmarks, narrowly behind on a few commonsense and reading-comprehension ones โ€” and shipped openly under Apache 2.0, which is largely why sparse mixture-of-experts went from a research curiosity to a default tool in the open-weight community.

The problem

Dense transformers get better as you scale them, but the cost structure is unforgiving: at inference every parameter participates in processing every token. Double the parameters and you roughly double the per-token compute. There is no way to hold a lot of knowledge in the weights without paying for all of it on every forward pass.

The question Mixtral asks is whether total capacity and per-token compute can be decoupled. You want a big pool of parameters available โ€” the model should know a lot โ€” but you do not want to activate the entire pool to predict the next token, most of which has nothing to do with whatever specialized knowledge a given token needs. Sparse mixture-of-experts is the mechanism that breaks that coupling.

How it works

The backbone is close to Mistral 7B, but the paper names two exceptions, not one: Mixtral "supports a fully dense context length of 32k tokens," and the feed-forward blocks are replaced by MoE layers. Attention is still a single shared block per layer โ€” it is not replicated across experts โ€” which is what keeps the total parameter count well below 8ร—7B. Concretely, each layer holds eight expert FFNs and a small router (a gating network) that decides which experts handle each token.

Diagram of top-2 routing where a router scores eight experts, masks the six losers to negative infinity, and combines the two survivors with softmax weights

For each token at each layer, the router scores all eight experts, keeps the top two, and discards the rest. Concretely, the gate computes G(x) = Softmax(TopK(x ยท W_g)), where every expert outside the top-k has its logit set to โˆ’โˆž before the softmax, so it contributes exactly zero. The layer's output is the softmax-weighted sum over the selected experts:

y = ฮฃ_i G(x)_i ยท Expert_i(x)

Two details matter here. Routing is per token and per layer โ€” the choice of experts is made independently at every layer and every position, so the same token can take different experts as it moves up the stack, and adjacent tokens can diverge. And because only two of eight experts run, the active parameter count stays low even though all eight sets of weights exist.

The arithmetic is the headline. The paper reports the total at about 47B parameters without deriving the figure; the arithmetic lands below 8ร—7B because attention and embeddings are shared rather than duplicated across experts. Only two experts run per token, keeping active parameters near 13B โ€” roughly 5ร— fewer active parameters than Llama 2 70B. That is why Mixtral carries the compute cost of a ~13B model while holding ~47B worth of capacity. It does not reach 13B-dense throughput in practice: the paper notes the SMoE layer "introduces additional overhead due to the routing mechanism and due to the increased memory loads when running more than one expert per device," and that such layers "are more suitable for batched workloads."

Three bars comparing the naive 56B figure, Mixtral's 47B total parameters, and its 13B active parameters per token

Beyond the routing, Mixtral is trained with a 32k-token context window and is multilingual across English, French, Italian, German, and Spanish. There is also Mixtral 8x7B โ€“ Instruct, a chat variant produced by supervised fine-tuning followed by Direct Preference Optimization (DPO).

Results

Against Llama 2 70B, Mixtral wins most of the table, with the paper noting one stated exception: Figure 3's caption says Mixtral outperforms Llama 2 70B on all benchmarks "except on reading comprehension benchmarks." On commonsense suites the two trade places โ€” Llama 2 70B is still ahead on HellaSwag (85.4 vs 84.4) and WinoGrande (80.4 vs 77.2), while Mixtral takes ARC-Challenge (59.7 vs 56.5). The gap opens decisively on math and code.

Benchmark Mixtral 8x7B Llama 2 70B
MMLU 70.6% 69.9%
GSM8K (maj@8) 74.4% 69.6%
MATH (4-shot, maj@4) 28.4% 13.8%
HumanEval (code) 40.2% 29.3%
MBPP (code) 60.7% 49.8%

All figures from Table 1 (GSM8K 8-shot maj@8). The paper's Table 2 reports GSM-8K at 5-shot: 58.4% vs 53.6%.

Against GPT-3.5, the paper reports Mixtral performing "similarly or above" on most metrics (MMLU 70.6 vs 70.0, MBPP 60.7 vs 52.2, GSM-8K 58.4 vs 57.1 at 5-shot), while GPT-3.5 stays narrowly ahead on WinoGrande (81.6 vs 81.2) and MT-Bench (8.32 vs 8.30).

Grouped bar chart comparing Mixtral 8x7B and Llama 2 70B across seven benchmarks, including the two where Llama 2 leads

The instruct model holds up against closed chat models of its era: Mixtral 8x7B โ€“ Instruct reaches MT-Bench โ‰ˆ 8.30, essentially level with GPT-3.5 Turbo (โ‰ˆ 8.32) and the strongest open-weight chat model at release. In human and Arena-style preference evaluation the paper reports it surpassing GPT-3.5 Turbo, Claude-2.1, Gemini Pro, and Llama 2 70B-chat. The authors also report less measured bias and a more positive sentiment profile than Llama 2 โ€” though the paper measures bias on the base model (ยง3.3, BBQ 56.0% vs Llama 2 70B 51.5%), while its introduction attributes the same property to the Instruct model.

What the experts actually learn

The most interesting section of the paper is not the leaderboard โ€” it is the routing analysis, because the result is counterintuitive. The paper's own framing is modest, calling this "a small analysis," but the finding is the one people remember: you might expect a "biology expert" and a "code expert" to emerge, and they do not.

Two panels showing expert assignment flat across domains except one outlier subset, and code indentation tokens routed consistently to one expert

When the authors inspect which experts handle text on biology (PubMed Abstracts), philosophy (PhilPapers), or LaTeX-heavy ArXiv papers, they find little evidence of topical specialization โ€” the paper reports that "the distribution of expert assignment is very similar" across these domains at every layer inspected. The one exception the paper flags is DM Mathematics, where it notes "a marginally different distribution of experts" โ€” which the authors attribute to that subset's synthetic nature and narrow coverage of natural language rather than to genuine domain expertise.

What the router does key on is structure and syntax: certain experts are consistently favored for particular token types, such as indentation and keywords in code. There is also positional locality, but it is layer-dependent. The paper reports that "repetitions at the first layer are close to random, but are significantly higher at layers 15 and 31" โ€” first-choice repetition sits near the 12.5% random baseline at layer 0, rising to roughly 24โ€“28% at layers 15 and 31.

The takeaway is that "expert" is a misleading word. These are not human-meaningful, domain-aligned modules. Expert assignment appears to align more with syntax than with domain, especially at the first and last layers โ€” low-level structural regularity, not high-level semantics.

Limitations and context

The efficiency story has an asterisk worth saying plainly. Sparsity cuts the FLOPs per token, but it does nothing for memory: all 47B parameters must sit in VRAM, because the router might select any expert at any layer. So Mixtral is cheap to run but expensive to host โ€” it has the compute profile of a 13B model and the memory footprint of a 47B one, which the paper points out is still smaller than Llama 2 70B's. If you are GPU-memory-bound rather than compute-bound, the win shrinks.

Scatter plot of compute per token against total memory, with dense models on the diagonal and Mixtral far above it

Serving is also genuinely harder. Top-2 routing creates load-balancing and batching problems โ€” different tokens in a batch want different experts โ€” so efficient deployment needs expert-parallelism and carefully written kernels rather than a naive forward pass.

A few other caveats: the lack of semantic specialization means you cannot point at an expert and reason about or control it, which complicates interpretability. The paper is also light on pretraining-data details and the exact training recipe, so full reproduction is not on the table. And several reported scores depend on shot counts and maj@k decoding, so cross-paper comparisons should match settings before drawing conclusions.

Why it matters

Mixtral was a watershed open-weight release. It demonstrated that sparse MoE could deliver frontier-class quality at a fraction of the active compute, and it did so under a permissive Apache 2.0 license that let anyone build on it. That combination seeded a wave of open MoE models and a corresponding wave of serving optimizations, and it made "active parameters versus total parameters" a standard axis for reasoning about model efficiency. The routing analysis, meanwhile, opened a durable research thread on how โ€” and whether โ€” experts specialize at all, a question the field is still working through.

References

  • Jiang, A. Q., Sablayrolles, A., Roux, A., Mensch, A., et al. (Mistral AI). Mixtral of Experts. arXiv:2401.04088, 2024. https://arxiv.org/abs/2401.04088
  • HTML version: https://ar5iv.labs.arxiv.org/html/2401.04088
  • Mistral AI announcement: https://mistral.ai/news/mixtral-of-experts/

Related Posts

RLVR Explained: Verifiable Rewards and Where They Break Down
Aug 3, 2026ยท13 min read

RLVR Explained: Verifiable Rewards and Where They Break Down

Most RLVR explainers stop at "it works." This one adds the three published results that complicate it โ€” pass@k, spurious rewards, and what DeepSeek-R1 actually shipped.

AI & ML
FlashAttention Explained: Why Modern LLMs Run Faster
Jul 31, 2026ยท7 min read

FlashAttention Explained: Why Modern LLMs Run Faster

FlashAttention computes exact attention without ever materializing the Nร—N matrix in GPU memory, treating attention as a memory-movement problem instead of a FLOP-counting one. The payoff: up to 3ร— faster GPT-2 training, 15% off the BERT-large MLPerf record, and the long context windows modern LLMs rely on.

AI & ML
DPO Explained: Aligning LLMs Without RLHF Complexity
Jul 29, 2026ยท7 min read

DPO Explained: Aligning LLMs Without RLHF Complexity

Direct Preference Optimization (DPO) proves the RLHF objective has a closed-form solution, letting you express the reward in terms of the policy itself. The result: a single classification loss replaces the entire reward-model-plus-PPO pipeline, matching or beating RLHF on sentiment, summarization, and dialogue.

AI & ML

On this page

  • TL;DR
  • The problem
  • How it works
  • Results
  • What the experts actually learn
  • Limitations and context
  • Why it matters
  • References