# emerging-techniques-moe-training

Provides guidance and code templates for training Mixture of Experts models with DeepSpeed and Transformers. Scales model capacity without matching compute growth.

- skill · `type=skill` · Claude Code · 59 installs
- Author: Orchestra Research
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/ai-research/emerging-techniques-moe-training
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/emerging-techniques-moe-training

## What it does

This skill guides developers through implementing sparse Mixture of Experts (MoE) architectures like Mixtral 8x7B or DeepSeek-V3. It helps write custom routing layers and combine outputs from active experts.

The template covers Top-1 and Top-2 routing alongside expert choice mechanisms. To keep the router stable, it details auxiliary balancing loss and router z-loss calculations that prevent tokens from flooding a single expert.

Running the training scripts requires `torch`, `deepspeed`, `transformers`, and `accelerate`. Without installing these Python packages, distributed execution will fail immediately.

## Install

### Claude Code (native platform)

1. **claude-code-templates**
```bash
npx claude-code-templates@latest --skill ai-research/emerging-techniques-moe-training
```

2. **Skills CLI (Vercel)**
```bash
npx skills add davila7/claude-code-templates --skill emerging-techniques-moe-training -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/emerging-techniques-moe-training/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/emerging-techniques-moe-training/

### Codex

**Manually: put the files in place**
- File: `.agents/skills/emerging-techniques-moe-training/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

**Manually: put the files in place**
- File: `.cursor/skills/emerging-techniques-moe-training/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install davila7/claude-code-templates emerging-techniques-moe-training
```

2. **Manually: put the files in place**
- File: `.github/skills/emerging-techniques-moe-training/SKILL.md`

### Gemini CLI

**Platform CLI**
```bash
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/ai-research/emerging-techniques-moe-training
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/emerging-techniques-moe-training/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/ai-research/emerging-techniques-moe-training

## When to use it
- build custom PyTorch MoE layers with Top-1 or Top-2 gating
- implement auxiliary loss terms to balance expert utilization
- set up DeepSpeed flags for distributed expert parallelism
- train sparse architectures comparable to Mixtral or DeepSeek-V3

## Example prompts
- Help me build a custom PyTorch MoE layer with Top-2 gating and auxiliary loss
- Write a DeepSpeed launch command for pretraining an MoE model with 128 experts

## Similar
- [skill-creator](https://affpapa.org/en/nevibecode/skills/skill-creator.md) — skill · 414180 installs
- [writing-for-agents](https://affpapa.org/en/nevibecode/skills/writing-for-agents.md) — skill · 466719 installs
- [media-use](https://affpapa.org/en/nevibecode/skills/media-use.md) — skill · 1100000 installs
- [mcp-builder](https://affpapa.org/en/nevibecode/skills/mcp-builder.md) — skill · 130949 installs
- [subagent-driven-development](https://affpapa.org/en/nevibecode/skills/subagent-driven-development.md) — skill · 237746 installs
- [orchestration](https://affpapa.org/en/nevibecode/skills/orchestration.md) — skill · 350300 installs

From the same set: [davila7/claude-code-templates](https://affpapa.org/en/nevibecode/by/davila7/claude-code-templates.md) — 804 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
