RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Eruo Fredoline
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
  1. >
  2. Home
  3. /Learn
  4. /How-to
  5. /How to understand MoE architecture and expert routing
HOW-TO · INF

How to understand MoE architecture and expert routing

intermediate·15 min·By Eruo Fredoline
PREREQUISITES

Basic understanding of transformer models

What this does

Mixture-of-Experts (MoE) splits a model into multiple "expert" sub-networks with a router that selects which experts activate per token. This guide explains the architecture and shows how to inspect routing behavior at inference time.

Steps

  1. Understand expert count and activation. DeepSeek-V3 has 256 experts, activating 8 per token. Mixtral 8x7B has 8 experts, activating 2 per token.

  2. Inspect routing decisions via logits. Use the Ollama API to retrieve raw output scores:

    curl -s http://localhost:11434/api/generate \
      -d '{"model": "deepseek-r1:14b", "prompt": "What is MoE?", "options": {"temperature": 0}}' \
      | jq '.'
    
  3. Measure expert load balance. A healthy MoE model distributes tokens evenly. Skewed routing indicates training issues.

    import torch
    # Pseudo: retrieve per-expert token counts from router logits
    # Balanced: each expert receives ~total_tokens / num_experts tokens
    
  4. Compare active vs. total parameters. DeepSeek-V3 has 671B total but activates only ~37B per token. Verify efficient compute:

    ollama show deepseek-r1:14b | grep -i parameter
    

Verification

# Check model parameter distribution
ollama show deepseek-r1:14b
# Expected: "total parameters: 671B, active parameters: 37B per token"

Common failures

  • Confusing total vs. active parameter counts: MoE papers list total parameters first; active count is what determines compute cost.
  • Router collapse: If training went wrong, all tokens route to the same expert. Balanced routing is a health indicator.
  • Overlooking expert capacity: Each expert has a token budget; exceeding it causes token dropping in some implementations.

Operator checkpoint

Before treating this as solved, write down the local runtime, model or package version, hardware/backend if relevant, and the verification output. This keeps the guide useful as a Will-It-Run style decision instead of a one-off command transcript.

Operator checkpoint

Before treating this as solved, write down the local runtime, model or package version, hardware/backend if relevant, and the verification output. This keeps the guide useful as a Will-It-Run style decision instead of a one-off command transcript.

Related guides

  • How to pull and run DeepSeek MoE models efficiently
  • How to benchmark DeepSeek against dense models of similar size
RELATED GUIDES
INF
How to pull and run DeepSeek MoE models efficiently
INF
How to benchmark DeepSeek against dense models of similar size
← All how-to guidesCourses →