The useful part, up front

What you’ll take away

  • The Switch-style balancing score combines hard assignment fractions f with mean router probabilities P; neither summary can be recovered from the scalar alone.
  • The same four-to-zero choices give S values of 1.8, 1.02 and 1.0002 as the winning probability changes.
  • An explicit three-to-one assignment record gives S=0.885, so the uniform reference of one is not a universal finite-record lower bound.
  • Uniform assignment fractions or uniform probability means each give S=1 under the stated normalization.
  • Two opposite one-sided groups can each score 1.8 while their combined record scores 1; grouping is part of the statistic.
  • Keep token counts, probability means, coefficients, routing stage and aggregation rules alongside the logged loss.
01

What does the router’s balancing score measure?

An AI model with several expert networks needs a rule for choosing which expert receives each token. A router can assign a score to every available expert, then choose the highest. During training, an extra loss can encourage work to spread across experts. The Switch Transformer paper describes one such loss [1]. But reading that loss is different from counting where the work went.

Suppose a dashboard shows the balancing loss getting smaller. Did an overloaded expert receive fewer tokens, or did the router simply become less confident about sending the same tokens there? Both possibilities deserve attention. The number combines the actual choices with the probabilities behind those choices. It does not display either set of information separately.

We will use invented records containing four tokens and two experts, called A and B. Each token chooses exactly one expert. There are no tied scores, padding tokens or rejected assignments. These are arithmetic examples, not measurements from a trained model. Keeping the records small lets us inspect every choice and understand precisely what the loss can tell us.

All four choices stay with A. Original records: every token has the listed A probability; B gets its complement. All rows have a unique A winner. S changes while the assignment counts do not.
Original records: every token has the listed A probability; B gets its complement. All rows have a unique A winner. S changes while the assignment counts do not. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
02

Count the choices, then average the probabilities

For each token, write two probabilities that add to one. The larger probability determines the selected expert. If the pair is 0.51 for A and 0.49 for B, the token chooses A in our rule. That is one complete choice for A, not half a token for each expert. The probabilities describe the router’s scores before the choice [1].

Now make two summaries. First, count the tokens choosing each expert and divide by the total number of tokens. We call these choice fractions f. Second, average each expert’s probabilities across all tokens. We call these averages P. With four tokens, one additional choice changes a choice fraction by one quarter, while the average probability can change by a much smaller amount.

For a first record, let A’s probabilities be 0.8, 0.7, 0.3 and 0.2; B gets the remainder in each row. Two tokens choose each expert. Both choice fractions are 0.5, and both average probabilities are also 0.5. This convenient starting record has equal choices and equal average scores. Later records will separate those properties.

03

Separate the unscaled score from its weight

Multiply each expert’s choice fraction by its average probability, add the results, and multiply by the number of experts. Call this unscaled score S. For our starting record, S is 2 times the sum of 0.5 times 0.5 and 0.5 times 0.5. The result is 1. The original paper then multiplies this score by a coefficient called alpha before adding the auxiliary term to the training loss [1].

The coefficient changes how strongly this term is weighted. If S is 1.8, multiplying by 0.01 gives 0.018. Multiplying the same S by 0.001 gives 0.0018. The second reported contribution is ten times smaller even though every probability and every expert choice is unchanged.

This is why a log needs to say which number it reports. The historical paper uses 0.01, while the pinned Transformers 4.49.0 configuration documents an auxiliary coefficient default of 0.001 [1][2]. Those are facts about those sources, not a recommendation to copy either value. Comparing two runs requires their actual coefficients and logging definitions.

04

A score of one does not uniquely identify a state

The starting example gives S equal to 1. Now change A’s probabilities to 0.99, 0.99, 0.49 and 0.49. The first two tokens still choose A, and the last two choose B. Choices remain evenly split, but A’s average probability becomes 0.74 and B’s becomes 0.26. The score is still 1: 2 times the sum of 0.5 times 0.74 and 0.5 times 0.26.

In fact, whenever the choice fractions are equal, this formula gives S equal to 1 regardless of how the average probabilities are divided. Equal choices are enough to produce the reference value. They are not enough to prove that the router’s average scores are equal too.

The reverse implication also needs care. A value of 1 does not prove that the choices were evenly split. We will build that counterexample shortly. Treat 1 as a useful reference calculation, not a certificate describing every part of the router. A single output number cannot show the full pair of distributions that produced it.

Three close wins, one strong loss. Original four-token matrix. Counts A/B = 3/1; mean probabilities = 0.385/0.615. Substitution into the published formula gives S = 0.885, below the uniform reference.
Original four-token matrix. Counts A/B = 3/1; mean probabilities = 0.385/0.615. Substitution into the published formula gives S = 0.885, below the uniform reference. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
05

The loss can fall while all four choices stay put

Give all four tokens the same probabilities: 0.9 for A and 0.1 for B. Every token chooses A. The choice fractions are 1 and 0, and the average probabilities are 0.9 and 0.1. The unscaled score is therefore 1.8. Nothing in this record is evenly divided between the experts.

Reduce A’s probability to 0.51 for every token and raise B’s to 0.49. A still wins every choice, but S falls to 1.02. Make the pair 0.5001 and 0.4999, and S becomes 1.0002. The score is now very close to the uniform reference even though B still receives no tokens at all.

The reason is that our router chooses the larger probability; it does not randomly divide tokens according to those probabilities. A narrow winning margin is still a win. The example separates a useful change in confidence from a change in assignment counts. A dashboard showing only the loss cannot tell you which change happened.

06

An uneven record can even score below one

Consider a different four-token record. The first three tokens each give A probability 0.51 and B probability 0.49. The fourth gives A probability 0.01 and B probability 0.99. Three tokens choose A and one chooses B, so the choice fractions are 0.75 and 0.25.

Average the scores separately. A’s total is 0.51 plus 0.51 plus 0.51 plus 0.01, which is 1.54. Dividing by four gives 0.385. B’s average is 0.615. The unscaled score is 2 times the sum of 0.75 times 0.385 and 0.25 times 0.615. That gives 0.885, below the evenly split starting record’s score of 1.

There is no missing token or rounding trick. A wins three close contests, while B wins one very strongly. Those different margins pull the average probabilities toward B despite A winning more choices. This invented record shows why a lower scalar does not always rank two assignment histograms by how evenly they divide the work. It does not report a failed training run.

07

The score combines two kinds of imbalance

The previous record puts more choices on A but more average probability on B. The score mixes those two summaries through multiplication. It is not simply measuring how far the choice counts are from an even split. That distinction explains the apparently surprising value below 1.

For another example, give the first three tokens A probability 0.6 and the fourth A probability 0.2. A again wins three choices. Its average probability is now exactly 0.5, and B’s is also 0.5. The score returns to 1 despite the uneven 3-to-1 choice count.

Together the examples show three different meanings hidden behind a familiar value. A score of 1 can accompany equal choices and equal averages, equal choices and unequal averages, or unequal choices and equal averages. Keeping both summaries beside the scalar makes the record understandable. The extra information comes from retaining the inputs to the calculation, not from interpreting more digits of the final score.

A score of one can describe different records. Original probability matrices are fully specified in the article. Equal choice fractions or equal probability means are each sufficient for S = 1 under the stated formula.
Original probability matrices are fully specified in the article. Equal choice fractions or equal probability means are each sufficient for S = 1 under the stated formula. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
08

A gradient can move probabilities before choices change

Why use a score involving probabilities at all? Small changes to a router’s scores can change its probabilities even when the winning expert stays the same. The paper distinguishes the probability part, through which the loss can be differentiated, from the hard choice fraction [1]. This supplies a direction for adjusting the router during training.

In the all-A record, lowering A’s probabilities while keeping them above B’s lowers the score without moving any token. Our earlier sequence from 0.9 to 0.51 demonstrates that effect directly. The loss is responding to something real in the invented record: the strength of the router’s preference. The unchanged histogram is also real.

Once a winning expert changes, the choice fractions must be counted again. A calculation describing tiny changes that keep every winner fixed cannot predict every later step of training. Other loss terms also affect a real update. Reading a local training signal as a complete promise about the next allocation would give it more meaning than the calculation supports.

09

Combining groups changes the question

Imagine two groups of four tokens. Every token in the first group has probabilities 0.9 for A and 0.1 for B. Every token in the second has the reverse probabilities. Each group sends all its tokens to one expert. Calculating S separately gives 1.8 for each group, so their average score is 1.8.

Now combine the eight tokens before making the summaries. Four choose A and four choose B. The combined average probabilities are 0.5 and 0.5, and the combined score is 1. The probabilities and choices have not changed. We changed which records were grouped together for the calculation.

Both answers are correct for their stated grouping. The combined record is evenly split overall, while each smaller record is completely one-sided. A global number can therefore hide differences between its parts. These groups are invented collections of records; we are not claiming to measure a device, a distributed training system or the workload of a particular processor.

Mean local loss differs from pooled loss. Original equal-size groups: first-group rows are (0.9,0.1); second-group rows are (0.1,0.9). Mean local S is 1.8; pooling all eight tokens gives S = 1.
Original equal-size groups: first-group rows are (0.9,0.1); second-group rows are (0.1,0.9). Mean local S is 1.8; pooling all eight tokens gives S = 1. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
10

Unequal groups need unequal weights

Change the example so that the first group has three tokens, each favouring A by 0.9 to 0.1. The second group has just one token, favouring B by 0.9 to 0.1. Each group still has an individual score of 1.8. Together, however, the choices are three for A and one for B.

The combined average probability for A is the sum of 0.9, 0.9, 0.9 and 0.1 divided by four: 0.7. B’s average is 0.3. With choice fractions 0.75 and 0.25, the combined score is 2 times the sum of 0.75 times 0.7 and 0.25 times 0.3, giving 1.2.

Giving the two groups equal weight would lose the fact that one contains three times as many tokens. Weight each group by its token count when rebuilding the combined summaries. Keep the choice counts and their denominator at the same level. That is also a specific requirement in NVIDIA’s documented balancing-loss arguments [3].

11

Keep the routing stage and other losses visible

There is another boundary to record: are we counting the experts initially selected, or the tokens those experts actually process? Our examples assume every selected token is processed. A router with a capacity limit may not satisfy that assumption. The pinned Transformers documentation explicitly warns that its router does not guarantee an expert processes every token [2].

The original paper’s pseudocode calculates its balancing term from the initial choice mask before later capacity filtering [1]. That ordering matters when interpreting the counts. A log of accepted work after filtering is not automatically the same input that was used for the auxiliary score. Keep the stage named instead of silently comparing different counts.

Also keep the balancing term separate from router z-loss. The pinned configuration gives them separate coefficients, and NVIDIA describes z-loss as encouraging smaller logits for stability [2][3]. A combined label such as router loss can hide that distinction. Neither term by itself supplies an answer about generated text quality, elapsed time or whether a particular expert learned a useful skill.

12

What to keep beside the scalar

A useful record keeps the expert-choice counts, the average probabilities, the number of tokens and the coefficient together. It also says whether the score belongs to one small group or a combined population. Those details let another reader reproduce the calculation instead of guessing what the loss label means.

For our examples, the distinctions are concrete. The same 4-to-0 choices give scores from 1.8 down to 1.0002 as confidence changes. An uneven 3-to-1 record gives 0.885. Two opposite one-sided groups each score 1.8, while their evenly split combined record scores 1. None of those results is contradictory once the probabilities and grouping are visible.

Use the balancing score as one part of the record it summarizes. If the question is where tokens went, inspect the counts. If it is how strongly the router preferred an expert, inspect the probabilities. If two losses are being compared, preserve the coefficient, routing stage and population first. That makes the number useful without asking it to reveal information it discarded.

The coefficient changes the contribution. Original arithmetic with exactly the same S and routing record. Coefficients weight the auxiliary objective; a smaller contribution alone does not establish changed assignments.
Original arithmetic with exactly the same S and routing record. Coefficients weight the auxiliary objective; a smaller contribution alone does not establish changed assignments. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
Follow the evidence

Sources & further reading

Explore the references behind this guide. External pages may change after our review.

  1. Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity
    Fedus, Zoph and Shazeer / Google / arXiv · Accessed 7 Nov 2026
  2. SwitchTransformers · Hugging Face
    Hugging Face · Accessed 7 Nov 2026
  3. core.transformer.moe.moe_utils — Megatron Core
    NVIDIA · Accessed 7 Nov 2026

Article updated 7 Nov 2026.

Found something we should revisit?

Good explanations get better with thoughtful feedback.

Suggest a correction