TL;DR
Standard Transformers struggle to recognize that a sequence viewed from different moving reference frames (e.g., an object moving at different speeds) represents the same underlying process. This paper introduces the Flow Equivariant Transformer (FET), which uses a "flow-lifting" mechanism to ensure the model treats these related sequences consistently, enabling perfect generalization to unseen velocities.
What Problem Does This Paper Address?
In sequence modeling, we often encounter "flow": signals that change over time according to a geometric symmetry, like an object moving at a constant velocity or a melody shifting in pitch. Ideally, a model should understand that a video of a car driving at 10 mph and the same video at 60 mph are "the same" process viewed through different temporal lenses.
However, standard Transformers lack flow equivariance. They process each sequence as a collection of unrelated tokens. If the reference frame moves (the "flow"), the input tokens change entirely, and the Transformer sees a completely different signal. This forces models to see examples of every possible velocity during training to generalize, which is data-inefficient and fails on out-of-distribution (OOD) speeds.
Methods
The authors propose the Flow Equivariant Transformer (FET), which adapts the concept of "flow-lifting" (previously applied to RNNs) to the Transformer architecture.
- Flow-Lifting Embedding: Instead of a single hidden state, the FET "lifts" the input into a set of moving reference frames. It creates multiple "slices" of the data, where each slice represents the sequence as if the observer were moving at a specific velocity ($\nu$).
- Equivariant Blocks: The model applies standard Transformer operations (self-attention, MLP, layer norm) independently to each velocity slice. Crucially, weights are shared across all slices.
- Group Convolution: To handle spatial symmetries (like translation), the model replaces standard linear layers with group-equivariant convolutions ($G$-CNNs).
- Flow-Mixing (Optional): The authors also describe a more complex variant where different velocity slices can "talk" to each other using flow-convolutions, though the simpler "flow-independent" version was sufficient for their primary tests.
By lifting the signal, a complex temporal transformation (like changing velocity) becomes a simple shift in the "flow index" of the model's internal state, which the architecture is designed to handle.
Datasets
The researchers evaluated their model on a 1-D Bump Detection task:
- Task: Distinguish between "Coherent" sequences (a Gaussian bump moving at a constant velocity through noise) and "Incoherent" sequences (random bumps at each time step).
- Training Set: 10,000 examples, but only featuring stationary bumps ($v=0$).
- Test Set: 2,000 examples for each integer velocity from $v = -7$ to $v = +7$.
- Significance: This setup tests "zero-shot" generalization; the model must identify moving bumps having only ever seen still ones.
Key Insights and Ideas
- Transformers aren't "Natural" Sequence Models: While dominant in the field, Transformers don't inherently respect the geometric structure of time-parameterized symmetries. They are essentially "bag-of-tokens" models with positional encoding.
- Lifting as an Inductive Bias: By hard-coding the requirement that the model must behave consistently across different flows, the authors provide a powerful inductive bias. This allows the model to learn the "essence" of a signal (the bump) independently of its motion.
- Parameter Efficiency: Because the FET shares weights across all velocity slices, it is remarkably compact. In their experiments, the FET had ~49k parameters, while a translation-equivariant baseline required ~2.1M parameters to achieve even mediocre results.
Key Results
The FET demonstrated a "perfect" performance profile compared to standard architectures:
- Perfect Generalization: The FET achieved 100% accuracy and 1.0 AUC across the entire test grid ($v \in \{-7, \dots, 7\}$), despite only being trained on $v=0$.
- Baseline Failure: The Standard Transformer's performance degraded rapidly as soon as the velocity moved away from zero.
- ConvBaseline Limitations: A baseline using 1-D convolutions (translation-equivariant but not flow-equivariant) performed better than the standard Transformer but still crashed at higher velocities, as it couldn't account for the "flow" across time steps.
Limitations and Future Work
- The Curse of Dimensionality: The "lifting" process requires creating $V$ slices. If the flow is high-dimensional (e.g., complex 3D rotations and translations), the memory requirements grow exponentially, making the current approach memory-bound.
- Constant Velocity Only: The current formulation assumes constant-speed motion (linear Lie-algebra generators). Handling accelerating objects or time-varying flows would require lifting over a much larger group of symmetries.
- Boundary Issues: Equivariance is only exact if the velocity stays within the pre-defined range of the model's "slices." If an object moves faster than the fastest slice, the model's guarantees break down.
The authors suggest that future work will focus on more efficient lifting mechanisms and testing the FET on complex real-world tasks like spatiotemporal forecasting.
Summary updated