Learn Before
Layer-wise Transformation of Hidden States
In a multi-layer neural network architecture, such as a Transformer, the computation proceeds sequentially through its layers. The output from layer , represented by the matrix of hidden states , becomes the input for the subsequent layer, . This transformation is generally expressed by the formula: This equation signifies that the hidden states of the next layer are a function of the current layer's hidden states, encapsulating the layer's specific operations (e.g., self-attention, feed-forward network).

0
1
Tags
Ch.3 Prompting - Foundations of Large Language Models
Foundations of Large Language Models
Foundations of Large Language Models Course
Computing Sciences
Related
Transformer Layer Output Formula
General Formula for a Transformer Layer
Input Composition in a Prefix-Tuned Transformer Layer
A language model is processing an input sentence that has been broken down into 5 distinct tokens. The input to the first processing layer is represented as a matrix containing 5 separate vectors, one for each token. Why is it fundamentally important for the model to maintain this structure—a sequence of individual vectors—as the input to each subsequent layer, rather than, for example, averaging or concatenating them into a single vector?
Structure of a Transformer Layer's Input
When a Transformer model processes a sentence with 12 tokens, the input to the fifth layer is a single, high-dimensional vector that represents the aggregated meaning of the entire sentence as computed by the first four layers.
Layer-wise Transformation of Hidden States
Learn After
Inter-Layer Data Flow in Prefix-Tuning
In a deep neural network composed of many layers, the output representation from one layer serves as the complete input for the subsequent layer. What is the most critical consequence of this strictly sequential processing structure?
Data Flow in a Multi-Layer Network
Debugging a Multi-Layer Network