Skip to content

architectures

Residual Connection

A skip connection that adds the input of a layer directly to its output, allowing gradients to flow through the network without degradation. Residual connections enable training of very deep networks and are a key component of transformers.

In practice

In a transformer block, the output is layer_norm(x + attention(x)), where the '+x' is the residual connection.