Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 11 min read Announcement mediumAdept

Welcome Mixtral - a SOTA Mixture of Experts on Hugging Face

Mixtral 8x7B is Mistral's sparse Mixture-of-Experts LLM. It replaces feed-forward layers with MoE layers that route each token to 2 of 8 experts, so it has about 45B total parameters but decodes at roughly the speed of a 12B dense model. On release it beat Llama 2 70B on the Open LLM Leaderboard and matched GPT-3.5 on MT-Bench (8.30), under an Apache 2.0 license. Hugging Face shipped integrations for running it with Transformers and Text Generation Inference, plus QLoRA fine-tuning with TRL on one A100 (attention projections only, since sparse MLP layers interact poorly with PEFT). For quantization, VRAM needs are about 90 GB in fp16 and about 23 GB in 4-bit, and GPTQ performs better when the expert gating layers are left unquantized (perplexity 4.40 vs 4.25 in fp16).

Assumes: transformer architecture basicsHugging Face TransformersLLM quantization

Related posts

  • Mixture of Experts Explained

    Hugging Face hardMaster

    Mixture of Experts (MoE) transformers replace dense feed-forward layers with sparse expert layers and a learned router that sends each token to only a few experts. Pretraining is much faster than for dense models, and inference is faster than a dense model with the same parameter count, but all experts must sit in memory: Mixtral 8x7B needs VRAM for about 47B parameters while computing like a 12B model. The history runs from the 1991 origins through Shazeer's noisy top-k gating, GShard's expert capacity and random routing, and Switch Transformers' single-expert routing and selective bfloat16 precision. It also covers load-balancing auxiliary losses, router z-loss, fine-tuning difficulties, expert parallelism and serving tradeoffs.

  • Welcome Le Chonk: Mistral Large 4 on Hugging Face

    Hugging Face mediumAdept

    Mistral Large 4 is a multimodal, multilingual Mixture-of-Experts model with about 1T total and 49B active parameters and a 1M-token context window. It combines two kinds of sparsity: Multi-head Latent Attention with a DeepSeek Sparse Attention indexer that selects up to 2,048 key positions per query, and 71 MoE layers that route each token to 4 of 128 experts plus a shared expert. A 1.6B Pixtral encoder handles images. It scores 82% on a vulnerability reproduce-and-patch test and 93% on Cybench, ships in FP8 and NVFP4 with day-0 Transformers, vLLM, llama.cpp and TRL support, and reaches about 65 tok/s single-request on 8×H200, or 15 tok/s with a 2-bit quant on an M3 Ultra.

  • Mixtral 8x7B: What you need to know about Mistral AI’s latest model

    Neon easyNovice

    Mixtral 8x7B, Mistral AI's new open model, supports 32k-token context, improves code generation and matches or beats Llama 2 70B and GPT-3.5 on benchmarks such as MMLU, MBPP and GSM-8K. Self-hosting it needs about 64GB RAM and 2 GPUs, roughly 3x the cost of Mistral 7B, but Mistral's beta API offers an OpenAI-like Python/JavaScript client with mistral-tiny, mistral-small (Mixtral) and mistral-medium models, priced below gpt-3.5-turbo for the smaller tiers. The 1024-dimension mistral-embed model costs slightly more than ada v2, and switching from 1536-dimension ada embeddings stored in pgvector means regenerating them.

  • Mixture of Experts (MoEs) in Transformers

    Hugging Face hardMaster

    Hugging Face transformers v5 reworks its internals to treat Mixture of Experts models as first-class: a WeightConverter pipeline packs per-expert checkpoint tensors into contiguous runtime tensors with async, lazy materialization, cutting Qwen1.5-110B load time from ~66s to ~21s (10s with tensor parallelism) on an A100. A pluggable Experts Backend dispatches tokens via eager, batched_mm (torch.bmm) or grouped_mm (torch._grouped_mm) strategies, suited respectively to debugging, small-batch and large-batch/memory-constrained workloads. Expert parallelism shards experts across GPUs with a single config flag, and a collaboration with Unsloth using Triton grouped-GEMM + LoRA kernels yields ~12× faster MoE training with >35% less VRAM.

  • Welcome Llama 4 Maverick & Scout on Hugging Face

    Hugging Face mediumAdept

    Meta's Llama 4 Maverick (~400B total, 128 experts) and Scout (~109B total, 16 experts) are Mixture-of-Experts multimodal models with 17B active parameters each, now on the Hugging Face Hub with day-one transformers v4.51.0 and TGI support. Long context comes from iRoPE: NoPE layers every fourth layer with full causal attention and temperature-scaled softmax, plus chunked 8K attention in the RoPE layers. Scout adds QK RMS normalization and reaches 10M tokens, while Maverick alternates MoE and dense layers and reaches 1M. Scout fits on a single GPU via on-the-fly int4/int8 quantization, Maverick ships FP8 weights, Xet storage gives ~25% deduplication, and instruct Maverick scores 80.5% on MMLU Pro and 69.8% on GPQA Diamond.

The quest for software engineering knowledge.

Look:
Layout: