Gate

Experimental alpha. Expect breaking changes and major bugs. Your feedback is much appreciated.

Gate

Multiplies its two inputs number by number, so one signal can scale, open or close another.

elementwise multiplication

Shapes

The same shapes as the Residual Junction takes.

Parameters

None.

In PyTorch

y = F.silu(self.gate(x)) * self.up(x)

Notes

Gates sit inside the feed-forward layers of most recent language models. SwiGLU multiplies SiLU(xW₁) by a second projection xW₃ before projecting back down. To build one: two Linear Layers reading the same input, an Activation set to SiLU after one of them, a Gate joining them, and a Linear Layer back to the original width. LSTMs, the recurrent networks that came before transformers, controlled their memory with gates like this.

Making it

The Fabricator makes it with no mask. See The Bench and the Fabricator.