Rúben GalvãoThe Rabbit Hole

The Rabbit Hole / AI and machine learning / Language models / Choosing and combining experts

Shared experts: a path every token takes

Every token chooses its specialists. What about the work that almost every token needs?

Our mixture of experts lets tokens take different paths. Each selected network has its own weights to learn from.

But some useful features may be needed across many of those paths. Must every expert learn its own copy?

Give them a common branch

Keep the routed experts. Beside them, add another feed-forward network that every token runs through.

Its output joins the weighted outputs from the selected experts. This is a shared expert.

Routed experts and a shared expert update the same tokenThe token vector splits into two branches. The router selects two feed-forward experts on the left. A shared feed-forward expert on the right always runs. The weighted routed outputs and the shared output are added to the residual stream.Token vectorResidual streamRouter weightsScoresSelected expertsShared expertact.1act.2act.3act.4act.Weighted sumAlways runs+Updated token
The token takes both branches. The router chooses the experts on the left; the shared expert on the right always runs. Their updates join the residual stream.

The router chooses the left-hand path. The right-hand path runs regardless of that choice.

Different tokens, different routes

As tokens arrive, different experts light up. The shared branch runs for every one.

Different tokens, the same shared branch

Interactive
intheburrowsleptarabbit
Routed experts and a shared expert update the same tokenThe token vector splits into two branches. The router selects two feed-forward experts on the left. A shared feed-forward expert on the right always runs. The weighted routed outputs and the shared output are added to the residual stream.Token vectorResidual streamRouter weightsScoresSelected expertsShared expertact.1act.2act.3act.4act.Weighted sumAlways runs+Updated token

Each token takes its selected routes and the shared branch.

A token can use different routed experts while retaining the common branch.

The shared expert does not compete for a place in the selected set. Changing how many routed experts run leaves the shared branch in place.

Learning what belongs in each branch

Both branches are trained together. The shared network gives the model somewhere to put work useful across many tokens; the routed networks have room to develop different features.

Their outputs meet before the update returns to the residual stream.

There is still a practical problem: what if the router keeps choosing the same few experts? That can leave some devices busy and others waiting.

Next, give the router a way to balance the work.

Sources

Sources: DeepSeekMoE, DeepSeek-V3 report, Qwen3-Next implementation.

← Browse all subjectsBack to the beginning ↑