Path Lengths and Long-Range Dependency Learning
A critical factor governing a model's ability to learn long-range dependencies is the maximum path length signals must traverse between arbitrary input and output positions in the network. Shorter paths preserve gradient flow and make dependency learning easier.
Self-attention directly connects every position to every other position, resulting in a constant maximum path length of . Recurrent architectures, by processing sequences sequentially step-by-step, require a maximum path length of .
Convolutional layers with kernel width cannot connect all pairs of input and output positions in a single layer. Connecting all positions requires a stack of convolutional layers for contiguous kernels, or layers in the case of dilated convolutions, yielding maximum path lengths of and , respectively. If restricted self-attention over a neighborhood is utilized instead of full self-attention, the maximum path length increases to .
0
1
Tags
Prep Sessions
Foundational Deep Learning Architectures: Transformers and Residual Networks @ University of Michigan - Ann Arbor
Ch.2 Transformer Training and Evaluation - Foundational Deep Learning Architectures: Transformers and Residual Networks @ University of Michigan - Ann Arbor
Complexity and Path Lengths in Self-Attention - Foundational Deep Learning Architectures: Transformers and Residual Networks @ University of Michigan - Ann Arbor
Learn After
Match each layer architecture to its corresponding maximum path length between arbitrary input and output positions.
Connecting all pairs of input and output positions using a stack of convolutional layers with contiguous kernels of width k requires a maximum path length of ___.
Order these layer architectures from shortest to longest maximum path length between arbitrary input and output positions (assuming kernel width 1 < k < n):
Based on path length analysis, explain how adopting restricted self-attention changes the maximum path length compared to full self-attention, and describe the resulting effect on gradient flow and long-range dependency learning.