ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Sum the selected expert outputs with their routing weights

Each chosen expert evaluates the same input representation h. Its output vector is multiplied by the associated routing weight, and the selected vectors are added. The implementation groups tokens by expert for efficient evaluation and restores their original order…

Donor architecture mathematicshistorical source recovered; expression not executed in this website audit
Learn with the Atlas

Learn to read this model

Start with the symbols, follow the operations, and check what the result means.

Open guided lesson
donor-deepseek-moe-weighted-sumdocumented formula or resource estimate
y = moe_infer(h, topk_idx, topk_weight) # sum_i w_i * Expert_i(h)

Read the equation

Each chosen expert evaluates the same input representation h. Its output vector is multiplied by the associated routing weight, and the selected vectors are added. The implementation groups tokens by expert for efficient evaluation and restores their original order before summing; those data-movement steps preserve this intended mixture formula.

Terms & definitions

TermMeaning in this source
h

Token representation

w_i

Routing weight for selected expert i

y

Routed output vector

How it works

Read the definition from its right-hand expression to the quantity on the left. Its surrounding source records the intended input, state, or parameter context. Where the source leaves an operation unspecified, this page preserves that gap.

Assumptions & limits

Source recovery establishes that the expression appears in this record. Its mathematical validity, implementation behavior, and interpretation must be assessed separately. See the linked source and research notes for the checks available for this version.

Original context

Read the surrounding source passage
Then in DeepseekV3MoE.forward (lines 522-532):

      identity = h                            # the PRE-MoE residual
      y = moe_infer(h, topk_idx, topk_weight) # sum_i w_i * Expert_i(h)
      y = y + shared_experts(identity)        # shared expert added afterwards

  The shared expert consumes the pre-MoE hidden state, not the routed output.
Exact original notation
y = moe_infer(h, topk_idx, topk_weight) # sum_i w_i * Expert_i(h)

Related builds

Sources & provenance

01
DEEPSEEK_R1_COMPLETE.txt
lines 854–854 · Aug 5, 2026
y = moe_infer(h, topk_idx, topk_weight) # sum_i w_i * Expert_i(h)
02
DEEPSEEK_R1_COMPLETE.txt
lines 854–854 · Aug 5, 2026
y = moe_infer(h, topk_idx, topk_weight) # sum_i w_i * Expert_i(h)

Search equations, builds, manuscript text, and recovered sources.