Pre-norm and post-norm: where does it go

Normalization and fragmentation contribute to deep network training, but the order of exchange of them changes functions.

• Step by stepCollate in 2 self-measured2 First-hand sources
Start Body
Learning objectives and first steps2 objectives . 1 first fix

Try to do it after reading

  • Explain Pre-norm and post-norm: Mechanisms and premises that differ from where they are being normalized
  • Positioning the mechanism ' s fault limits with fixed examples

Suggested first

  • Fragmentation Link and Normalization

Issues and mechanisms

Normalization and fragmentation contribute to deep network training, but the order of exchange of them changes functions. Pre-norm Regularize input before entering sublayers and then add back input; post-norm Adds input to sublevel results and regularizes it. The two shapes can be fully consistent, but they do not mean that computing or pre-training weights can be exchanged, and reading models must be judged in the order in which they are actually used.

Normalized with N, sublayer with F, x+F(N(x)) and N(x+F(x) respectively. The former reservation is directly impaired and the latter output is always normalized. (b) Deep extension, learning rates and initialization interact with this choice; One cannot be declared superior to the other on all model sizes by name alone. An additional layer of standardization is also checked at the end of the network.

A concrete example

Synthetic 2-D input x = [1,3] to keep F to zero, ignoring learning scaling bias. The Pre-norm output remains [1,3]; post-norm regularizes the sum result, with a mean value of two, one difference, and the output approximately [−1,1]. This counter-offensive does not require training to prove that the two order is different. If F is not zero, the difference is also magnified by the subsequent layer, so loading the same size parameters is not equivalent to restoring the same model.

Borders and checks

Nor can the process of reclassification and homogenization be confused into a class of values. (a) The former is reduced by mean value and the latter is usually re-scaled only; Equivalence between the two is not guaranteed by the same reclassification. Debugs record axes, accuracy, stabilize items and learning scaling, comparing fixed weights with short input and checking model quality instead of simply checking whether training can be started.

A method of verification

To locate order differences, random discards and regularized parameters can be closed first, and each intermediate load is aligned to the layer. If the first layer output is already different, the subsequent large differences are usually not attributable to sampling. The constant input should also be tested: the zero-time stabilization factor prevents the elimination of zero and the learning bias may still produce output. If the code miswrites the normative axis into a sequenced dimension, the comparison between the two sequences deviates from the original problem, and the question of training stability has to be addressed before the axis definition is discussed.

Check understanding

Same shape. Can post-norm be changed to pre-norm and then directly reuse weights?

Usually, this cannot be considered an equivalent change. The zero-level reverse has given different outputs; There is a need to re-validate or have clear conversion and retraining methods.

Does Pre-norm guarantee that all layers of gradient will not decay?

There is no such guarantee. Direct access has changed the distribution structure, but parameters, depth, scales and other algorithms still affect optimization, and physical stability requires controlled experiments.

Sources and reconciliations

Definitions, methods and interfaces are available.

  1. Attention Is All You Need
  2. Root Mean Square Layer Normalization

Figures and calculations are reorganized according to this chapter. Mathematical measurements, framework operations and real business effects are described separately in the body of the text.

← Back to the knowledge directory
Ask Max Ask about this site
Ask Max ↗

Opening the assistant…

Paper figure

Photo comments

LEAVE A NOTE

About this photograph

Connecting to the discussion board…

    Comments become public after moderation. You can delete your own comments from this browser.
    No email is required. Clearing cookies prevents this browser from claiming earlier comments.

    MAX WANG / INDEX

    Find something

    Enter a keyword, or explore the directory below.