Distance generalization in transformers: why bother with positional encoding?
Abstract
Out-of-distribution length generalization, namely to extrapolate a task from short to longer context, has been studied intensively for transformers. Here we focus on distance generalization, which probes performance when inter-token distances are changed between training and inference, while keeping a fixed context length. We construct two synthetic delay copy tasks, both involving finite distances between source and recall, where tokens are copied either fully or selectively, and test models on delays unseen during training. We address three questions: (A) Do positional encoding schemes such as RoPE and ALiBi improve distance resolution relative to no positional encoding (NoPE)? (B) How does data diversity, the number of inter-token distances seen in training, affect performance? (C) When is distance transfer learning positive or negative? We present a thorough investigation, finding that it is paramount to improve our understanding of the underlying mechanisms.
Create a lesson
Metadata
- Comments
- 15 pages, 7 figures
Related papers
Fine-Tuning Without Gradients? Closed-Form, LLM-Written Classifiers on a Frozen Encoder
Shared title terminologycs.CLMd Nasir Uddin, Musa Tur Farazi, Soumik Bhattacharjee et al.
FrIdéo: French News Outlet Ideology Scoring via Multi-Source Evidence Fusion and Distancing-Aware Lexical Scoring
Shared title terminologycs.CLAmr Sobhy
Is Prosody Encoded in the Neural Audio Codec Mimi?
Shared title terminologycs.CLNicolas Ballier, Artem Saloev, Erin Pacquetet et al.
Implementation of Machine Translation for the Uzbek Language Based on Transformer Models
Shared title terminologycs.CLMukhammadjon Musaev, Mannon Ochilov
Localizing Cross-Lingual Generalization in Parameter Space
Shared title terminologycs.CLYeoreum Lee, Jaeseong Lee, Seung-won Hwang
ModernELECTRA: Replaced-Token Detection with Boundary-Window Reconstruction for Compact Encoders that Classify and Embed
Shared title terminologycs.CLMykhailo Shtopko, Ihor Stepanov, Dmytro Vodianytskyi et al.