← All models

MODEL EXPLORER / MODERN LLMS

A gate inside the feed-forward block

Why does this feed-forward block split into two branches?

Curated by TensorVizSwiGLU · 4-step tour
Static architecture
Why does this feed-forward block split into two branches?
Opening the interactive graph…
Architecture snapshot · No Python requiredDownload graph ↓

RECORDED NUMERICAL EXAMPLE

One branch controls another.

Recorded CPU calculations using the same input and seed-0 initialization. The gate is the only changed branch.

Only the gate weights change. SiLU gates can be negative and are not probabilities. These initialized weights illustrate arithmetic, not learned language behavior.

SiLU gate · 16 features
0.4366
-0.2352
0.488
-0.2783
0.3057
-0.2343
0.6628
0.586
-0.1231
0.3373
-0.2758
-0.2784
0.2844
0.5555
1.051
0.2713
Value branch · 16 features
1.282
0.67
1.218
1.066
-0.04006
1.191
0.8918
-0.1968
0.7624
1.386
-0.3392
1.824
-1.961
1.821
0.8461
-1.081
Elementwise product · 16 features
0.5598
-0.1576
0.5945
-0.2966
-0.01225
-0.2792
0.5911
-0.1153
-0.09388
0.4674
0.09355
-0.5079
-0.5576
1.011
0.8892
-0.2932
Output projection · 8 features
-0.6103
0.08339
0.1183
-0.04378
-0.059
-0.03362
0.1589
-0.4319

Bars share one scale within this example. Values are rounded to four significant digits.

Ordinary FFN parameters
384
SwiGLU parameters
384
Verified by the local recipe
  • Both comparison branches contain exactly 384 parameters
  • Gradients reach the gate, value, and output projections
  • A zero gate suppresses SwiGLU without changing the ordinary FFN

Download the source and run.py to reproduce these checks. Choosing an example here replays recorded values.

ABOUT THIS EXAMPLE

Trace a SiLU gate, multiply it with a second projection, and compare a conventional FFN at the same parameter count.

Component · 2020

SwiGLU

Bias-free width-8 FFNs: conventional hidden width 24 and SwiGLU hidden width 16, each with 384 parameters.

Source, capture & limitations +

These are untrained feed-forward components. Equal parameter counts do not imply equal quality or runtime. SiLU gate values are not probabilities and can be negative.

Original TensorViz teaching example. PyTorch provides the underlying operators.

No separate redistribution license has been declared for these project examples.

Content revision
2e269c77c5e058b6
Source SHA-256
610c6468be240a995ad5285135094c1c71ec0204c6ede4db5d72ccd721e09b78
Captured
2026-09-17 · Python 3.13.13 / Torch 2.7.1

One seeded CPU forward plus recorded numerical invariants. Untrained, reduced teaching implementation; no accuracy claim.

Read the model manifest ↗