# davidmrau/mixture-of-experts

PyTorch Re-Implementation of "The Sparsely-Gated Mixture-of-Experts Layer" by Noam Shazeer et al. https://arxiv.org/abs/1701.06538

Repository: https://github.com/davidmrau/mixture-of-experts
Canonical: https://ross.abutalabs.com/products/mixture-of-experts
Language: Python
License: GPL-3.0
License Family: copyleft
Topics: moe, mixture-of-experts, sparsely-gated-mixture-of-experts, pytorch, re-implementation
Last push: 2024-04-19T08:22:39+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 2602, "days_push": 866, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1252, forks 112 (observed 2026-08-28T04:04:08.484529+00:00)

## What it is
A PyTorch re-implementation of the sparsely-gated Mixture-of-Experts layer from the paper 'Outrageously Large Neural Networks' by Shazeer et al. It provides a drop-in MoE module with noisy gating and auxiliary load-balancing loss, plus minimal training examples.

## Use cases
- add a mixture-of-experts layer to a pytorch model
- reproduce the sparsely-gated MoE paper in pytorch
- train sparse expert networks with noisy gating
- experiment with MoE on CIFAR-10
- reference implementation for single-GPU MoE training

## When to choose
- you want a simple, readable PyTorch MoE layer for research or teaching
- you need the original sparsely-gated MoE with noisy top-k gating and aux loss
- you need a lightweight single-GPU MoE baseline

## When to avoid
- you need distributed or multi-GPU MoE training at scale (use FastMoE or DeepSpeed-MoE)
- you need production-grade, actively maintained MoE implementations
- you need modern token-routing MoE used in LLMs like Mixtral

## Facets
- artifact type: library
- maturity: maintenance
- function: machine-learning, deep-learning
- domain: machine-learning, deep-learning, large-language-models
- platform: python
- tags: mixture-of-experts, pytorch, sparse-gating, noisy-gating, research-code

## Member repositories
- davidmrau/mixture-of-experts (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:08.484529+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T05:07:32.704129+00:00, confidence not recorded.
  - readme: https://github.com/davidmrau/mixture-of-experts (fetched 2026-08-28T04:04:08.484529+00:00, sha a80c09a6b104)
- Data as of 2026-08-30T08:39:29.467469+00:00.
