liveBook · Manning

Shared weight

As explained in Natural Language Processing in Action, Second Edition

Weight sharing is the reuse of the same learned parameters across multiple inputs, positions, or computation steps.

Shared weight means reusing the same learned weight matrices across multiple positions or computation steps. In an RNN, one set of matrices is applied to every token, while hidden states and outputs pass from one step to the next. section 8.3

This reuse reduces the model’s distinct parameters but makes training dependent across time. Backpropagation through time must propagate each token’s error backward through every earlier use of the shared matrices, serially. section 8.3

Shared matrices in an unrolled RNN

For a text sequence, the RNN applies the same weight matrices to token 1, token 2, and later tokens. After comparing the final output with the correct label, training works backward through those repeated applications and adjusts the shared weights using each token’s error. section 8.3

Figure 8.10 Data fed into a recurrent network
figure

Trace how token inputs, hidden states, and recurrent computations are arranged across time. section 8.3

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Explains repeated matrix use and serial gradient propagation, but does not provide implementation code or parameter-count analysis.
Examples
Uses an unrolled RNN processing text tokens and propagating errors backward through repeated weight-matrix multiplications.
What it assumes
Assumes familiarity with tokens, vectors, weight matrices, outputs, labels, and gradients while relating gradient calculation to the chain rule.
What you can do after
Understand how recurrent models reuse parameters and why their training must process sequence errors backward one token at a time.
How it connects
Connects shared weight to recurrent neural networks, hidden states, backpropagation through time, gradients, and the chain rule.

Also explained in

Compare how 2 books explain shared weight →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.