Practice in Lab: Project: train sparse experts and audit capacity under load →
Project: train sparse experts and audit capacity under load
A functioning mixture-of-experts model needs routing, optimization, evaluation and overflow evidence together. This project trains a sparse classifier on generated nonlinear regions, then selects a checkpoint without seeing test targets. A separate capacity stress run reveals how admission order and dropped assignments affect the result. Export and fresh reload check that the router and every expert belong to the artifact. The experiment measures local correctness and utilization; it does not infer sparse hardware efficiency from the model’s name.
Prepare offline
Choose Download entire course or Download entire category first. After completion, code and checks run locally on CPU. The independent example needs no account, remote service or API key.
import torch
requested = torch.tensor([0, 1, 0, 2])
print(torch.bincount(requested, minlength=4))Review the evidence
Compare quality with a dense baseline on representative data, inspect requested and accepted loads, and measure real deployment latency. Capacity-dependent predictions also require a declared batching and ordering policy.
Your task
Complete the generated XOR-region experiment with a four-expert, top-two sparse classifier. Train router and expert parameters with cross entropy plus .03 times the declared load-balancing auxiliary; choose only by validation cross entropy. Export model/initialization states, reload into a fresh model and evaluate held-out row identities. Report measured accuracy, load distribution, dropped assignments and a separate bounded-capacity stress run. Preserve the reference schema and keep test targets out of training/selection. Actual selected expert rows execute on CPU; this is not a GPU/distributed throughput benchmark. The CLI saves a real model and JSON report.
The explanation opens here once every check passes.