Skip to content

MoE (Mixture of Experts)

Коротко:

MoE (Mixture of Experts) — sparse transformer architecture: вместо monolithic FFN, модель содержит много expert networks + router, который выбирает top-k experts для каждого token. Total params huge (1.8T), но active per-token меньше (400B). Inference cost sub-linear к total size. Public MoE models: Mixtral 8x7B (47B total, 13B active), DeepSeek R1 (671B, ~37B active), GPT-4 suspected MoE.

Ниже: подробности, пример, смежные термины, FAQ.

Попробовать бесплатно →

Подробности

  • Router: для каждого token выбирает top-k=2 experts (из 8-128)
  • Expert: обычно FFN блок в transformer layer
  • Parameters: 10-100× больше чем dense equivalent at same inference cost
  • Pros: capacity huge + inference cost manageable + experts могут специализироваться
  • Cons: complexity training, routing collapse (few experts overused), serving overhead

Пример

# Run Mixtral 8x7B via Ollama (quantized)
$ ollama pull mixtral:8x7b
$ ollama run mixtral:8x7b "What is MoE?"

# Python with transformers
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained('mistralai/Mixtral-8x7B-Instruct-v0.1')
# 47B total params, but only 13B 'active' при inference

Смежные термины

Больше по теме

Часто задаваемые вопросы

Почему MoE такой тренд?

Позволяет scale parameters дешево (inference cost ~ active params). Frontier models 2025+ — почти все MoE (GPT-4, Claude 3.5, Gemini, DeepSeek R1).

Fine-tuning MoE?

Сложнее чем dense. LoRA на router + experts отдельно. Requires more data.

Running MoE locally?

Нужно memory для total params (все experts грузятся). Mixtral 8x7B → 47B × 2 bytes FP16 = 94 GB. INT4 quant → ~26 GB.