Where to Attend: A Principled Vision-Centric Position Encoding with Parabolas Christoffer Koo Øhrstrøm, Rafael I. Cabral Muchacho, Yifei Dong, Filippos Moumtzidellis, Ronja Güldenring, Florian T. Pokorny, Lazaros Nalpantidis Abstract We propose Parabolic Position Encoding (PaPE), a parabola-based position encoding for vision modalities in attention-based architectures. Given a set of vision tokens—such as images, point clouds, videos, or event camera streams—our objective is to encode their positions while accounting for the characteristics of vision modalities. Prior works have largely extended position encodings from 1D-sequences in language to nD-structures in vision, but only with partial account of vision characteristics. We address this gap by designing PaPE from principles distilled from prior work: translation invariance, rotation invariance (PaPE-RI), distance decay, directionality, and context awareness. We evaluate PaPE on 8 datasets that span 4 modalities. We find that either PaPE or PaPE-RI achieves the top performance on 7 out of 8 datasets. Extrapolation experiments on ImageNet-1K show that PaPE extrapolates remarkably well, improving in absolute terms by up to 10.5% over the next-best position encoding. Code is available at this URL . Figure 1 : Parabolic Position Encoding (PaPE). (a) PaPE encodes positions using an attention bias based on a sum of learnable parabolas with the relative position between tokens as the dependent variable. (b) Our experiments show that PaPE is general—either PaPE or PaPE-RI outperforms all baselines on 7 out of 8 datasets that span 4 vision modalities. (c) PaPE has remarkable classification extrapolation, showing high robustness beyond the training resolution of 224^{2} . 1 Introduction & Related Works In this work, we propose a position encoding that is designed specifically for vision modalities. Transformers ( Vaswani et al. 2017 ) are widely used for computer vision and robotics tasks. They have proven to be highly flexible, finding applications in several vision-based modalities such as images ( Dosovitskiy et al. 2020 ) , point clouds ( Wu et al. 2024 ) , videos ( Bertasius et al. 2021 ; Arnab et al. 2021 ) , and event cameras ( Sabater et al. 2022 ; Gehrig & Scaramuzza 2023 ) . Despite their success in the vision domain, they tend to use position encodings that are first designed for language ( Vaswani et al. 2017 ; Press et al. 2021 ; Su et al. 2024 ) and later adapted for vision ( Wang & Liu 2021 ; Fuller et al. 2023 ; Schenck et al. 2025 ) . Although adaptations can account for vision-specific characteristics—e.g., directionality ( Heo et al. 2024 ; Fuller et al. 2024 ) )—we hypothesize that they are incomplete in their coverage of those, because some characteristics matter little in language. This leads us to identify relevant ideas in prior works and use these as guiding design principles for our proposed position encoding. Absolute position encodings. Vaswani et al. 2017 propose sinusoidal position embeddings that are added directly to the input embeddings. These are extended from 1D to 2D by Wang & Liu 2021 by using half of the position vector for one position dimension and the other half for the second position dimension. The extension to arbitrary dimensions follows naturally from this. While sinusoidal position encoding handles multiple positional dimensions, its absolute nature lacks properties that RoPE-based and attention bias methods possess. However, it provides the exact location of each token, which can be relevant for some tasks, as we observe in Section 5.2 . RoPE-based methods. RoPE ( Su et al. 2024 ) stands out as a state-of-the-art position encoding. It rotates queries and keys by a product of their position and a set of fixed frequencies, so the query-key dot product encodes the relative position, yielding translation invariance . One of the properties of RoPE is that attention strength diminishes as tokens move farther apart, a property we denote as distance decay . While vanilla RoPE operates purely in 1D, Axial RoPE ( Chu et al. 2024 ) generalizes RoPE to arbitrary dimensionality by assigning disjoint subsets of the query and key vectors to each positional dimension and applying RoPE separately to each. However, because these dimensions are treated independently, Axial RoPE cannot naturally capture diagonal interactions. RoPE-Mixed ( Heo et al. 2024 ) , along with related approaches ( Ostmeier et al. 2025 ; Yu et al. 2025 ; Schenck et al. 2025 ) , introduces distinct learnable frequencies per positional dimension to imbue directionality into RoPE. More recently, context-aware variants of RoPE ( Veisi et al. 2025 ; Wang et al. 2025 ) have shown that letting frequencies depend on each token improves the ability of language models to generalize to sequence lengths beyond what is seen during training. Attention biases modify attention scores by adding a bias term directly into the attention matrix before the softmax. This bias depends on the relative positions of the query and key, reinforcing the importance of translation invariance . However, these bias terms often require materializing the full attention matrix, making them incompatible with efficient attention kernels ( Dao et al. 2022 ; Dao 2024 ) . ALiBI ( Press et al. 2021 ) , designed for autoregressive language models, subtracts a multiple of the relative distance between the tokens. This simple mechanism enforces both translation invariance and distance decay of attention scores. 2D-ALiBi ( Fuller et al. 2023 ) generalizes this idea to images by subtracting a multiple of the 2D Euclidean distance between positions, further endowing the encoding with rotation invariance . LookHere ( Fuller et al. 2024 ) extends 2D-ALiBi with directionality by restricting the field of view of each head to different directions. This adds directionality , but at the cost of losing rotation invariance . From the prior works, we have identified the following set of guiding design principles that we consider to be important for position encoding of vision modalities, and elaborate on in Section 3 : translation invariance , rotation invariance , distance decay , directionality , and context awareness . To the best of our knowledge, no existing position encoding is derived from all five principles. We use the principles to propose a novel position encoding: Pa rabolic P osition E ncoding (PaPE). PaPE treats the relative position between two tokens as the dependent variable in a sum of parabolas and uses this to encode positions. Concretely, we incorporate a quadratic term (capturing distance) and a linear term (capturing direction) into the attention logits. Therefore, PaPE falls under attention bias methods; however, its formulation supports separate query-key transformations, which means PaPE does not have to materialize the full attention matrix. In addition, we propose a rotation invariant version—PaPE-RI. We summarize our contributions as follows: 1 Parabolic Position Encoding. We propose PaPE and PaPE-RI: parabola-based position encodings for vision modalities that are designed from the compiled principles. 2 Compatibility with efficient attention kernels. PaPE uses query-key transformations—similar to RoPE ( Su et al. 2024 ) —to be compatible with efficient attention kernels ( Dao et al. 2022 ; Dao 2024 ) . 3 High Generality. We evaluate PaPE on 8 datasets across 4 vision modalities (images, point clouds, videos, and event cameras) and find that PaPE is superior to the baselines in 6 of 8 datasets and PaPE-RI in 1 of 8. 4 Strong Classification Extrapolation. PaPE is found to extrapolate significantly better beyond its training resolution in image classification than any other baseline considered. 2 Preliminaries Attention ( Vaswani et al. 2017 ) for a collection of tokens X=\{x_{1},\cdots,x_{n}\} with x_{i}\in\mathbb{R}^{d} is given by A\cdot V=\textrm{softmax}\left(\frac{Q\cdot K^{T}}{\sqrt{h}}\right)\cdot V, (1) where queries, keys, and values are derived through learnable matrices W_{q},W_{k},W_{v}\in\mathbb{R}^{h\times d} , so that q_{i}=W_{q}\cdot x_{i} , k_{i}=W_{k}\cdot x_{i} , and v_{i}=W_{v}\cdot x_{i} . For clarity, we omit attention heads here and in the next section, noting that the extension to multi-head attention is straightforward. We define S=Q\cdot K^{T} and obtain from Equation 1 that S_{ij}=\langle q_{i},k_{j}\rangle, (2) i.e., token similarity is measured as the dot products between all query-key pairs. Since attention is permutation invariant, we require positional information to encode information about the arrangement of tokens. To this end, we associate a position vector r_{i}\in\mathbb{R}^{p} with each token, where p is the position dimensionality. For example, p=2 for images (x, y) and p=3 for point clouds (x, y, z). Our goal is to leverage these position vectors to inject positional information into the dot products. 3 Design Principles We now describe and motivate the design principles that we identified in prior works. These principles are not a rigid checklist for the perfect position encoding. They are a set of properties that we reason---and empirically evaluate in the experiments---are valuable in practice. We give mathematical definitions of the principles when applicable. 1 1 1 We assume that token positions reside in a standard p -dimensional Euclidean space ( \mathbb{R}^{p} ). Translation invariance matters because vision tasks usually depend on patterns defined by how parts relate to each other, not by where they are. A cat is a cat whether it appears in the top-left or bottom-right of an image. This calls for position encodings that are invariant to global translations. Definition 3.1 . A function f is translation invariant if, f(r_{i}+t,r_{j}+t)=f(r_{i},r_{j}),\forall t,r_{i},r_{j}\in\mathbb{R}^{p}. (3) Rotation invariance is valuable in settings where the orientation of an object should not affect the prediction. For instance, classifying a 3D object from a point cloud should not depend on how it is rotated in space. However, we do not treat rotation invariance as a universal requirement: orientation often carries key information about motion and action. We therefore consider rotation invariance as a task-dependent, special-case principle. Definition 3.2 . A function f is rotation invariant if, \displaystyle f(Rr_{i},Rr_{j})=f(r_{i},r_{j}),\forall r_{i},r_{j}\in\mathbb{R}^{p},\forall R\in\textrm{SO}(p). (4) Distance decay captures the intuition that nearby tokens should interact more strongly than distant ones. Specifically, attention between two tokens should decrease as their distance increases. This biases the position encoding towards local interactions. Directionality is the ability to modulate attention not just by how far tokens are from each other, but also by which direction. Unlike language, which is 1D and largely indifferent to geometric direction, vision is inherently directional: above, below, left, right, and diagonal often carry distinct semantic roles. As we move to higher-dimensional settings, e.g. 3D and spatio-temporal data, the amount of possible directions amplify this effect. A good position encoding for vision modalities should account for these directional cues. Context awareness. Position encodings must be capable of emphasizing local neighborhoods while also enabling long-range interactions. At first glance, these appear to be conflicting goals. Context awareness reconciles the two by letting the model adapt the decay and direction strength conditioned on the content of the token. Rather than enforcing a fixed decay and direction pattern, the model can decide when to emphasize local neighborhoods and when to focus on long-range interactions. 4 Parabolic Position Encoding Figure 2 : Overview of Parabolic Position Encoding (PaPE). PaPE decomposes attention (a) into distance (b), direction (c), and semantics (d). Using the dog’s eye as the query, PaPE learns to look in a bottom-right direction, while decaying attention with distance. The attention (a) is compatible with efficient attention kernels through separate query-key transformations. Colormap: We now introduce Pa rabolic P osition E ncoding (PaPE) and its rotation invariant version, PaPE-RI. We begin by deriving the method and then illustrate how the design principles are incorporated into PaPE. Afterwards, we derive query-key transformations that ensure compatibility with efficient attention kernels. A general form 1D parabola can be written as y=ax^{2}+bx+c. (5) Our goal is to reshape the attention score in Equation 2 into a sum of m such parabolas. To this end, we first define \Delta r_{ij}=W_{p}\cdot(r_{j}-r_{i}), (6) where W_{p}\in\mathbb{R}^{m\times p} is a learnable projection. 2 2 2 While W_{p} is not strictly required to achieve our goal, our empirical results (see Section 5.4 ) show that it is beneficial. \Delta r_{ij} serves as the dependent variable of the parabolas ( x=\Delta r_{ij} ). We obtain the a and b coefficients directly from the token representation, x_{i} , using the learnable projections W_{a},W_{b}\in\mathbb{R}^{m\times d} : \displaystyle a_{i} \displaystyle=-\mathrm{softplus}\!\left(W_{a}\cdot x_{i}\right) (7) \displaystyle b_{i} \displaystyle=W_{b}\cdot x_{i}, (8) where softplus followed by negation guarantees {a_{i}\in\mathbb{R}_{<0}^{m}} , ensuring that each parabola is concave. We now present the main equation that describes PaPE, where (\cdot)^{\odot 2} denotes the Hadamard (element-wise) square: S_{ij}=\langle a_{i},\Delta r_{ij}^{\odot 2}\rangle+\langle b_{i},\Delta r_{ij}\rangle+\langle q_{i},k_{j}\rangle. (9) Figure 2 visualizes this equation as a sum of three attention maps. Expanding the dot products makes the parabolic structure explicit: the attention score decomposes into a sum of m general form parabolas, S_{ij}=\sum_{\ell=1}^{m}\underbrace{a_{i\ell}\Delta r_{ij\ell}^{2}}_{ax^{2}}+\underbrace{b_{i\ell}\Delta r_{ij\ell}}_{bx}+\underbrace{\frac{\langle q_{i},k_{j}\rangle}{m}}_{c}. (10) PaPE instantiates our design principles, as we will see next. PaPE is translation invariant . This follows directly from modeling the relative position, \Delta r_{ij} , between pairs of tokens: W_{p}((r_{j}+t)-(r_{i}+t))=W_{p}(r_{j}-r_{i}),\forall t\in\mathbb{R}^{p} . PaPE-RI: a rotation invariant instantiation of PaPE. In the form given in Equation 9 , PaPE is not rotation invariant. By imposing simple constraints on its parameters, we obtain a rotation invariant instantiation, which we call PaPE-RI. PaPE-RI is defined by setting all b_{i}=0 , choosing a_{ik}=\alpha_{i} with \alpha_{i}\in\mathbb{R}_{<0} , and enforcing W_{p}=w_{p}I_{p}\in\mathbb{R}^{p\times p} with w_{p}\in\mathbb{R} . Under these constraints, PaPE-RI becomes provably rotation invariant; we provide the formal proof in Appendix A.1 . An implication of setting b_{i}=0 is that PaPE-RI loses directionality. PaPE has distance decay. Since a_{i} is constrained to be negative, it follows that the square terms penalize the distances as \Delta r_{ij} moves away from the origin. PaPE is directional. Recall that the dot product between two vectors x,y is proportional to the cosine of the angle \theta between them: \langle x,y\rangle=\|x\|\|y\|\cos(\theta). (11) The dot product is maximized when \theta=0 since {\cos(0)=1} . Therefore, \langle b_{i},\Delta r_{ij}\rangle acts as a direction term and it is largest when \Delta r_{ij} is aligned with the direction defined by b_{i} . PaPE has context awareness. The distance decay and direction are governed by a_{i} and b_{i} , respectively. Because both vectors are computed from the token content itself, Equations 7 and 8 , PaPE naturally adapts to context instead of relying on a fixed pattern. This enables PaPE to support long-range interactions. By effectively turning off positional information—letting a_{i}\rightarrow 0 and setting b_{i}=0 — Equation 9 reduces to the standard attention score in Equation 2 . In this regime, PaPE no longer depends on position, enabling long-range interactions. PaPE decomposes attention. The decomposition in Equation 9 cleanly separates distinct contributions to the attention score: \langle a_{i},\Delta r_{ij}^{\odot 2}\rangle encodes distance , \langle b_{i},\Delta r_{ij}\rangle captures direction , and \langle q_{i},k_{j}\rangle is the familiar semantic term between tokens from Equation 2 . Although this separation is not one of our design principles, it is a valuable property for model analysis, which we briefly investigate in Section 5.6 . 4.1 Compatibility with Efficient Attention Kernels The formulation in Equation 9 is not directly compatible with efficient attention kernels such as FlashAttention ( Dao et al. 2022 ; Dao 2024 ) , because it explicitly depends on all pairwise relative positions. To recover compatibility, we draw inspiration from RoPE ( Su et al. 2024 ) and inject positional information directly into the dot product through separate position-aware transformations of the query and key. These transformations must ensure that the resulting dot product exactly recover Equation 9 . That is, to guarantee that \langle f_{q}(q_{i},r_{i}),f_{k}(k_{j},r_{j})\rangle= \langle a_{i},\Delta r_{ij}^{\odot 2}\rangle+\langle b_{i},\Delta r_{ij}\rangle+\langle q_{i},k_{j}\rangle. (12) Crucially, this preserves the standard attention computation. Queries and keys are transformed independently using only absolute positions, and the attention kernel itself remains unchanged. As a result, PaPE becomes plug-and-play compatible with efficient attention kernels. Let \odot denote the Hadamard (element-wise) product, \oplus vector concatenation, and s_{i}=W_{p}\cdot r_{i} . We can then transform the query as f_{q}(q_{i},r_{i})= q_{i}\oplus\langle a_{i},s_{i}^{\odot 2}\rangle\oplus a_{i}\oplus(-2\,a_{i}\odot s_{i})\oplus\langle-b_{i},s_{i}\rangle\oplus b_{i}, (13) and the key as f_{k}(k_{j},r_{j})= k_{j}\oplus 1\oplus s_{j}^{\odot 2}\oplus s_{j}\oplus 1\oplus s_{j}. (14) We prove in Appendix A.2 that these transformations exactly recover Equation 9 . This construction preserves compatibility with efficient attention kernels, but introduces overhead: the dimensionality of queries and keys increases from h to h+3m+2 . The additional cost is negligible for small m , but becomes significant as m grows. We measure this effect in Section 5.5 . 5 Experiments We demonstrate the usefulness of PaPE by 3 testing its generality on 8 datasets across 4 vision modalities ( Section 5.2 ), and 4 probing its ability to extrapolate in classification ( Section 5.3 ). Beyond this, we validate components of PaPE in an ablation study ( Section 5.4 ), measure PaPE’s efficiency ( Section 5.5 ), and briefly explore how the decomposed attention can be used for model analysis ( Section 5.6 ). 5.1 Experimental Setup Baselines. We compare to five representative baselines: • nD-sincos ( Wang & Liu 2021 ) serves as a multi-dimensional generalization of the classic sinusoidal positional encoding of Vaswani et al. 2017 . We use it to compare against an absolute position encoding. • RoPE ( Su et al. 2024 ) is a state-of-the-art and frequently used position encoding, combining translation invariance with distance decay. We specifically adopt the axial RoPE variant ( Chu et al. 2024 ) to handle multiple position dimensions. • RoPE-Mixed ( Heo et al. 2024 ) is included both because it is a common choice for adapting RoPE to vision and because it extends RoPE with directionality. • nD-ALiBi 3 3 3 Wang & Liu 2021 and Fuller et al. 2023 introduce 2D variants of sinusoidal and ALiBi, respectively, but extending them to arbitrary dimensionality is straightforward. ( Fuller et al. 2023 ) extends ALiBi ( Press et al. 2021 ) to multiple dimensions using Euclidean distances, thereby achieving translation invariance, rotation invariance, and distance decay. • LookHere ( Fuller et al. 2024 ) imbues directionality to nD-ALiBi and loses rotation invariance in doing so. It delivers high classification accuracy and strong extrapolation. However, LookHere is only defined for images and does not admit a straightforward extension to other modalities, so we have to restrict it to image-based experiments. Datasets. We evaluate PaPE on 8 datasets that span diverse vision modalities and tasks, showcasing its broad applicability. ImageNet-1K ( Deng et al. 2009 ; Russakovsky et al. 2015 ) offers 1M images for classification of 1K categories. COCO ( Lin et al. 2014 ) provides more than 200K images for 2D object detection of 80 categories. Together, ImageNet-1K and COCO evaluate PaPE on large-scale image-based datasets. ScanNet ( Dai et al. 2017 ) and ModelNet40 ( Wu et al. 2015 ) are 3D point cloud datasets. ScanNet focuses on indoor scenes with widely distributed points and point-level semantic segmentation. ModelNet40 contains densely sampled object shapes and targets object-level classification. We consider three spatio-temporal datasets. UCF101 ( Soomro et al. 2012 ) contains videos for action recognition of 101 actions. DvsGesture ( Amir et al. 2017 ) and GEN1 ( de Tournemire et al. 2020 ) are event camera datasets. Event streams are asynchronous, spatially sparse and temporally continuous, in contrast to synchronous, spatially dense, and temporally discrete videos. DvsGesture targets action recognition of 11 actions and has high spatial sparsity. GEN1 provides 39 hours of automotive driving for 2D object detection of cars and pedestrians and has medium spatial sparsity. Thus, we get a rich variety of spatio-temporal data types. Finally, nuScenes ( Caesar et al. 2020 ) combines camera and LiDAR inputs for 3D object detection. We use nuScenes to test PaPE in a challenging multi-modal real-world setting. Models. The different modalities call for modality-specific Transformer variants. We choose to use standard models that stay close to the original Transformer architecture. For images, we adopt ViT ( Dosovitskiy et al. 2020 ) and equip it with a YOLOv10 ( Wang et al. 2024 ) head for object detection. For point clouds, we rely on Point Transformer V3 ( Wu et al. 2024 ) , optimized for 3D reasoning. For videos, we use ViViT ( Arnab et al. 2021 ) , a dedicated video vision transformer. For event cameras, we employ a ViT with spatio-temporal tokens obtained from Spiking Patches ( Øhrstrøm et al. 2025 ) and re-use the YOLOv10 head for object detection on GEN1. For nuScenes, we use UniTR ( Wang et al. 2023 ) , a unified multi-modal transformer. Training. We implement all models in PyTorch ( Ansel et al. 2024 ) using 16-bit mixed precision and optimize them with AdamW ( Loshchilov & Hutter 2019 ) . All PaPE models are trained with m=50 . Models are validated at every epoch, and we select the checkpoint with the highest validation score for final evaluation on the test set. All models are randomly initialized with uniform Kaiming initialization ( He et al. 2015 ) . Crucially, for each dataset we fix the model size and all hyperparameters across position encodings, so that the only systematic difference between runs is the choice of position encoding (up to training stochasticity). This setup yields a fair comparison of the position encodings. See Appendix E for additional training details. 5.2 Generality Table 1 : PaPE: a general vision position encoding. Comparison of PaPE and baselines across 8 diverse datasets, with best in bold and next-best underlined . mAP is measured at 0.5:0.95:0.05 IoU intervals. PaPE has the highest score on 6 of 8 datasets, with PaPE-RI leading on 1, demonstrating the usefulness of PaPE across multiple vision modalities and tasks. Image Point cloud Spatio-temporal Multi-modal Position Encoding ImageNet-1K COCO ScanNet ModelNet40 UCF101 DvsGesture GEN1 nuScenes Average Acc. mAP mIoU Acc. Acc. Acc. mAP mAP nD-sincos ( Wang & Liu 2021 ) 79.9 34.7 72.6 92.2 38.7 93.4 27.3 67.4 63.3 RoPE ( Su et al. 2024 ) 80.3 38.8 71.7 93.0 43.9 93.1 33.6 68.3 65.3 RoPE-Mixed ( Heo et al. 2024 ) 80.0 38.0 71.1 93.0 41.2 83.3 31.7 66.3 63.1 nD-ALiBi ( Fuller et al. 2023 ) 80.0 33.9 70.6 93.2 41.6 89.2 28.8 68.5 63.2 LookHere ( Fuller et al. 2024 ) 80.5 37.3 - - - - - - - PaPE (ours) 80.6 38.9 71.0 93.3 49.5 93.4 34.8 68.7 66.3 PaPE-RI (ours) 80.0 34.3 69.3 92.7 42.2 90.6 28.5 68.9 63.3 Table 1 reports the results on the 8 datasets. PaPE emerges as the top position encoding on 6 of 8 datasets, with PaPE-RI being best on 1 of 8, and achieves the highest average score of 66.3—surpassing the next-best method, RoPE, by a clear margin of 1 point (65.3 vs. 66.3). These results highlight PaPE’s strong generality across modalities and tasks. In contrast, PaPE-RI lags behind with a markedly lower average score of 63.3, highlighting the importance of directionality and the added flexibility in a_{i} and W_{p} . Breaking down the results reveals further insight: PaPE is well-suited for images. Across image datasets, PaPE edges out strong baselines, even if by slim margins. On ImageNet-1K, PaPE increases accuracy by 0.1 over LookHere, and on COCO it lifts mAP by 0.1 over RoPE. These gains are small but consistent, showing PaPE’s applicability to large-scale image datasets. PaPE excels on spatio-temporal data. On UCF101, PaPE delivers the largest absolute accuracy gain among all datasets: 49.5 vs. 43.9 for RoPE. We follow the official 3-fold cross-validation and report the mean accuracy, highlighting the robustness of the result. A potential reason for PaPE’s strong UCF101 performance is that many actions unfold very quickly, causing objects to move rapidly across frames—making directionality and context awareness matter greatly for understanding a fast moving object. PaPE also leads on event camera datasets, outperforming RoPE by 1.2 mAP on GEN1 and tying for top accuracy with sinusoidal encodings on DvsGesture. By contrast, RoPE-Mixed performs notably poorly in the spatio-temporal setting, especially on DvsGesture. These results underscore how challenging spatio-temporal reasoning is—and how non-trivial it is for models to capture these relations effectively. PaPE is capable of handling multiple modalities. PaPE-RI delivers the strongest performance on nuScenes with 68.9 mAP, trailed by PaPE at 68.7, with nD-ALiBi close behind at 68.5. This ranking is striking and points to an unexpectedly important role of rotation invariance in multi-modal processing. Mirroring our findings on spatio-temporal data, RoPE-Mixed again lags behind in this setting, showing how challenging it is to learn multi-modal positional structure. When translation invariance matters. nD-sincos ranks as the lowest performing encoding on 4 of 8 datasets and is trailing as second-lowest on 2 of 8 datasets. In particular, it consistently lags behind on object detection tasks (COCO, GEN1, and nuScenes). While there are a few exceptions (ScanNet and DvsGesture), the pattern is clear: the results suggest that translation invariance is often crucial, as nD-sincos is the only encoding in our study that lacks it. When absolute position encoding matters. The ScanNet results reveal additional findings. It is the only dataset on which PaPE trails the baselines. What is more, the sinusoidal baseline surpasses all others, including RoPE by 0.9 mIoU. This suggests that absolute positional information is important for ScanNet. A potential explanation is that everyday household objects have characteristic absolute sizes. For example, a table typically sits about 1\,\mathrm{m} above the floor. Purely relative encodings may fail to capture such relationships when the context in Point Transformer V3 does not span sufficiently distant points. This explanation is supported by ModelNet40, where the translation invariant encodings surpass sinusoidal encodings by at least 0.8 accuracy. Here, each sample is a single object with no surrounding scene, so absolute position carries less semantic weight. In this setting, all methods achieve similar accuracy, yet PaPE remains the top performer, reinforcing it as a robust position encoding. Rotation invariance matters less than hypothesized. Our point cloud experiments show that rotation invariant position encodings do not improve over rotation variant alternatives. This is evident from how neither rotation invariant encoding (nD-ALiBi and PaPE-RI) manages to outperform the rotation-variant encodings. One possible explanation is that the rotation invariant position encodings trade strict rotation invariance for less representation flexibility, and that decreased flexibility matters more than what they gain from invariance ( Wilson 2025 ) . 5.3 Classification Extrapolation We want models that train cheaply at low resolutions, yet seamlessly run inference at higher ones. We call this capability extrapolation . Extrapolation reduces training costs and is an indicator of robustness. Moreover, strong extrapolation suggests that a model pretrained at low resolutions can be fine-tuned more easily to high-resolution target domains. Prior works ( Sun et al. 2023 ; Heo et al. 2024 ; Fuller et al. 2024 ) have shown that position encoding greatly determines the extrapolation capabilities of a model. Motivated by this, we assess PaPE’s extrapolation ability (for classification) by evaluating how well it scales from its training resolution of 224^{2} up to 1024^{2} on ImageNet-1K. Importantly, we do not change the models in any way for evaluation at higher resolutions. The results are shown in Figure 1 c. See details in Appendix B , including position interpolation experiments. We find that PaPE extrapolates far better than any baseline, even outperforming LookHere, which is itself highly capable at extrapolating. PaPE increases accuracy by 1% for resolutions up to and including 512^{2} , and only falls below its training-resolution accuracy after 640^{2} . In contrast, PaPE-RI does not share the strong extrapolation. This may be a consequence of the trade-off we made, sacrificing directionality to achieve rotation invariance. Similarly, LookHere can be viewed as an nD-ALiBi variant, enhanced with directionality. In both cases, introducing directionality leads to better extrapolation, indicating that directionality is a key ingredient for effective extrapolation. Unlike the baselines, PaPE is context aware. This aligns with the findings of Wang et al. 2025 , who find that adding a context aware term significantly boosts RoPE’s extrapolation in language models. Taken together, these results suggest that context awareness has a role to play in extrapolation. 5.4 Ablation Study Table 2 : Ablation of PaPE on ImageNet-1K. All components of PaPE contribute to its accuracy as removing any component results in lower accuracy. Ablation Accuracy PaPE 79.2 - \langle a_{i},\Delta r_{ij}^{\odot 2}\rangle 77.2 - \langle b_{i},\Delta r_{ij}\rangle 77.0 - W_{a},W_{b} 77.2 - a_{i} activation 77.5 - W_{p} 78.9 Table 3 : Ablation of m on ImageNet-1K. PaPE requires at least m=8 on ImageNet-1K to perform well as the effect saturates beyond that point. m 2 4 8 16 32 64 Accuracy 77.1 77.3 79.0 79.0 78.9 79.2 We systematically ablate each component of PaPE to understand its contribution and to simultaneously validate the instantiations of distance decay, directionality, and context awareness. To ablate context awareness, we remove W_{a} and W_{b} and instead treat a_{i} and b_{i} as learned parameters, where the softplus activation is still applied to the a coefficients. They are learned distinctly for all layers and heads, but are shared between tokens such that a_{i}=a_{j} and b_{i}=b_{j} for any pair of i and j . This way, we maintain distance decay and directionality without context awareness. To keep the study computationally feasible, we conduct all ablations on ImageNet-1K using a ViT-S instead of a ViT-B model size, and train for 150 epochs rather than 300. The primary ablation results are shown in Table 2 . Overall, we see that the complete PaPE method has an accuracy of 79.2 and that all ablations result in lower accuracy. Noticeably, removing any of the three instantiations of the design principles—distance decay ( \langle a_{i},\Delta r_{ij}^{\odot 2}\rangle ), directionality ( \langle b_{i},\Delta r_{ij}\rangle ), and context awareness ( W_{a},W_{b} )—causes an accuracy drop around 2%, validating the relevance of instantiating those principles in PaPE. Distance decay is further validated by how the model struggles to use the squared distance term when removing the softplus activation, resulting in a lower accuracy of 77.5. Lastly, although its impact is modest at a 0.3 difference in accuracy, adding W_{p} contributes positively to PaPE. Beyond our main ablations, we also vary m —the output dimensionality of W_{p} —and report the results in Table 3 . We observe that PaPE needs at least m=8 to approach the base performance of 79.2 (achieved with m=50 ), and that increasing m beyond 8 yields diminishing returns. 5.5 Efficiency Table 4 : Efficiency. Average inference time for a single image on ImageNet-1K and the number of learnable positional parameters. PaPE increases inference time by a small amount, up to 0.4 ms, and adds up to 13.6M position-specific parameters. nD-sincos nD-ALiBi RoPE RoPE-Mixed Time (ms) 1.5 1.5 1.6 1.6 Pos. Params. 0 0 0 18.4K PaPE m 2 4 8 16 32 64 Time (ms) 1.7 1.7 1.7 1.8 1.8 1.9 Pos. Params. 0.5M 0.9M 1.8M 3.6M 7.1M 13.6M As shown in Section 4.1 , PaPE increases the effective head size from h to h+3m+2 . It also introduces positional parameters: W_{a} , W_{b} , and W_{p} . We measure the number of additional positional parameters and the impact on inference time for different m in Table 4 . The analysis considers a ViT-B/16 on ImageNet-1K at resolution 224^{2} . A standard ViT-B (including its classification head) has 86.4M parameters. With PaPE, this footprint grows only by 0.6%–15.7%. Although this exceeds the baseline sizes, PaPE still delivers its advantages with only a moderate increase in parameters. Inference time is measured on an RTX 4090 GPU with a batch size of 1. PaPE increases inference time between 0.2 ms and 0.4 ms over the fastest baselines. In absolute terms, this overhead is tiny, so PaPE remains fast. However, the relative increase is between 13%–27% and can become significant for very large inputs and models. Consequently, m offers a trade-off between accuracy and efficiency, as demonstrated in Tables 3 and 4 . 5.6 Model Analysis Figure 3 : Model analysis on ImageNet-1K. Red ( z>0 ) highlights heads that lean heavily on positional information, while blue ( z<0 ) marks heads that prioritize semantic content in deciding what to attend to. Positions are used most strongly in early layers. The decomposed attention in PaPE eases the investigation of how the model uses position and semantic information. Although model analysis is not the focus of this work, here we demonstrate an analysis method that is enabled by PaPE. The attention matrix can—disregarding the dot product scaling factor—be represented as A_{ij}=\frac{1}{\gamma_{i}}P_{ij}Y_{ij} , with positional components \displaystyle P_{ij}=\exp\left(\left+\left\right), (15) semantic components Y_{ij}=\exp\left(\left\right) , and normalization factors \gamma_{i}=\sum_{j}P_{ij}Y_{ij} . We introduce the score z , \displaystyle z=\mathbb{E}_{ij}\left[\tfrac{1}{\gamma_{i}}(P_{ij}-Y_{ij})\right], (16) to quantify the relative importance of positional vs. semantic terms of a given attention head. Since attention patterns are often sparse, it is helpful to refine the analysis by considering only the top-attended keys for each query, which we define as the minimal set of keys whose cumulative attention in A_{i} reaches a threshold \tau . Figure 3 breaks down how each head in the ImageNet-1K model focuses on positions and semantics on average by visualizing the scores z , using the threshold \tau=80\% . Most heads balance positions and semantics quite evenly. Yet, a few stand out: some heads (e.g., L2H2) are clearly position-focused, whereas L1H10 is highly driven by semantics. Interestingly, these specialized heads cluster in the early layers (L1–L5), suggesting that emphasizing positional or semantic signals is especially beneficial when transforming low-level inputs into higher-level representations. 6 Limitations & Future Work PaPE’s main limitation is its extra inference cost and additional parameters, both affected by m . Future work will focus on how to lower m in practice, or removing W_{p} altogether and thereby keeping m=p , which is small for all modalities and tasks considered here. A complementary direction is to apply PaPE to dynamic token selection. This has the potential to increase efficiency by reducing the number of attention dot products. More broadly, PaPE can be viewed as the first instance of a larger family of multivariate polynomials on \Delta r_{ij} with context-dependent coefficients. We elaborate on this perspective in Appendix C . Although we leave this direction unexplored in the current work, we are eager to investigate other members of this function family in future work. Finally, we want to investigate whether rotation invariance and directionality can be jointly achieved, since the derivation of PaPE-RI indicates that one can only get one. 7 Conclusions We introduce Parabolic Position Encoding (PaPE), a principled, vision-centric position encoding. PaPE, along with its rotation invariant version PaPE-RI, is derived from principles identified in prior research and is compatible with efficient attention kernels. We evaluate PaPE on 8 datasets spanning images, point clouds, videos, event cameras, and multi-modal settings. The results demonstrate the broad applicability of PaPE: it achieves the best performance on 6 of 8 datasets, while PaPE-RI attains the highest score on 1 of the 8. We further observe that PaPE exhibits exceptional classification extrapolation capabilities, substantially outperforming all baselines. Thus, PaPE paves a new path for position encoding of vision modalities, and we anticipate that its underlying principles will motivate future research. Impact Statement This paper presents work whose goal is to advance the field of machine learning. There are many potential societal consequences of our work, none of which we feel must be specifically highlighted here. Appendix A Proofs A.1 PaPE-RI is Rotation Invariant By the definition of PaPE-RI, assume b_{i}=0 , a_{i\ell}=\alpha_{i}\in\mathbb{R}_{<0} , and W_{p}=w_{p}I_{p} with w_{p}\in\mathbb{R} , where I_{p} represents the identity matrix of shape p\times p . Let \Delta r_{ij}=W_{p}\cdot(r_{j}-r_{i}) and \Delta r_{ij}^{\prime}=W_{p}\cdot(Rr_{j}-Rr_{i}) for R\in\textrm{SO}(p) . In this proof, we show that restricting the model to the conditions assumed above, guarantees that A_{ij}{=}A_{ij}^{\prime} , where entries A_{ij} depend on \Delta r_{ij} , and entries A_{ij}^{\prime} depend respectively on \Delta r_{ij}^{\prime} . Thus, satisfying Definition 3.2 . Inserting the conditions in the position-dependent terms leads to the simplified expression, \displaystyle\left(\sum_{\ell=1}^{m}a_{i\ell}\Delta r_{ij\ell}^{2}+b_{i\ell}\Delta r_{ij\ell}\right) (17) \displaystyle=\sum_{\ell=1}^{m}a_{i\ell}\Delta r_{ij\ell}^{2}\quad\text{using}\quad b_{i\ell}=0 (18) \displaystyle=\alpha_{i}\sum_{\ell=1}^{m}\Delta r_{ij\ell}^{2}\quad\text{using}\quad a_{i\ell}=\alpha_{i} (19) \displaystyle=\alpha_{i}\Delta r_{ij}^{T}\Delta r_{ij}. (20) The equivalence of the position dependent terms ( \Delta r_{ij}^{\prime T}\Delta r_{ij}^{\prime}=\Delta r_{ij}^{T}\Delta r_{ij} ) proves the rotation invariance of PaPE-RI: \displaystyle\Delta r_{ij}^{\prime T}\Delta r_{ij}^{\prime} (21) \displaystyle=(W_{p}\cdot R(r_{j}-r_{i}))^{T}(W_{p}\cdot R(r_{j}-r_{i})) (22) \displaystyle=w_{p}^{2}(r_{j}-r_{i})^{T}R^{T}R(r_{j}-r_{i})\quad\text{using}\quad W_{p}=w_{p}I_{p} (23) \displaystyle=w_{p}^{2}(r_{j}-r_{i})^{T}(r_{j}-r_{i})\quad\text{using}\quad R^{T}R=I_{p},R\in\textrm{SO}(p) (24) \displaystyle=\Delta r_{ij}^{T}\Delta r_{ij} (25) \displaystyle\implies A_{ij}=A_{ij}^{\prime}\quad\square. (26) A.2 PaPE is Compatible with Efficient Attention Kernels We claim in Section 4.1 that \langle f_{q}(q_{i},r_{i}),f_{k}(k_{j},r_{j})\rangle=\langle a_{i},\Delta r_{ij}^{\odot 2}\rangle+\langle b_{i},\Delta r_{ij}\rangle+\langle q_{i},k_{j}\rangle. (27) Recall that we define in Equations ( 13 ) and ( 14 ) (using s_{i}=W_{p}\cdot r_{i} ) the feature vectors f_{q} and f_{k} as f_{q}(q_{i},r_{i}) = q_{i} \oplus \langle a_{i},s_{i}^{\odot 2}\rangle \oplus a_{i} \oplus (-2\,a_{i}\odot s_{i}) \oplus \langle-b_{i},s_{i}\rangle \oplus b_{i} , f_{k}(k_{j},r_{j}) = k_{j} \oplus 1 \oplus s_{j}^{\odot 2} \oplus s_{j} \oplus 1 \oplus s_{j} . We verify Equation 27 below: \displaystyle\langle f_{q}(q_{i},r_{i}),f_{k}(k_{j},r_{j})\rangle \displaystyle=\langle q_{i},k_{j}\rangle+\langle a_{i},s_{i}^{\odot 2}\rangle+\langle a_{i},s_{j}^{\odot 2}\rangle-\langle 2\,a_{i}\odot s_{i},s_{j}\rangle-\langle b_{i},s_{i}\rangle+\langle b_{i},s_{j}\rangle (28) \displaystyle=\langle q_{i},k_{j}\rangle+\langle a_{i},s_{i}^{\odot 2}+s_{j}^{\odot 2}-2\,s_{i}\odot s_{j}\rangle+\langle b_{i},-s_{i}+s_{j}\rangle (29) \displaystyle=\langle q_{i},k_{j}\rangle+\langle a_{i},(s_{j}-s_{i})^{\odot 2}\rangle+\langle b_{i},s_{j}-s_{i}\rangle\quad\text{using}\quad m^{2}+n^{2}-2mn=(m-n)^{2} (30) \displaystyle=\langle q_{i},k_{j}\rangle+\langle a_{i},(W_{p}\cdot r_{j}-W_{p}\cdot r_{i})^{\odot 2}\rangle+\langle b_{i},W_{p}\cdot r_{j}-W_{p}\cdot r_{i}\rangle (31) \displaystyle=\langle q_{i},k_{j}\rangle+\langle a_{i},((W_{p}\cdot(r_{j}-r_{i}))^{\odot 2}\rangle+\langle b_{i},W_{p}\cdot(r_{j}-r_{i})\rangle (32) \displaystyle=\langle q_{i},k_{j}\rangle+\langle a_{i},\Delta r_{ij}^{\odot 2}\rangle+\langle b_{i},\Delta r_{ij}\rangle (33) \displaystyle=\langle a_{i},\Delta r_{ij}^{\odot 2}\rangle+\langle b_{i},\Delta r_{ij}\rangle+\langle q_{i},k_{j}\rangle\quad\square. (34) Appendix B Extrapolation Details Table 5 : Extrapolation results without position interpolation. Position encodings are trained on ImageNet-1K at a resolution of 224^{2} and evaluated without modifications at resolutions up to 1024^{2} . Best in bold and next-best underlined . PaPE improves classification extrapolation significantly by up to 10.5 % over the next-best encoding. Position Encoding 224^{2} 320^{2} 384^{2} 448^{2} 512^{2} 640^{2} 768^{2} 896^{2} 1024^{2} nD-sincos ( Wang & Liu 2021 ) 79.9 76.8 72.6 65.9 57.5 41.3 27.2 16.8 9.3 RoPE ( Su et al. 2024 ) 80.3 80.9 80.6 79.7 78.2 74.0 67.0 56.2 42.3 RoPE-Mixed ( Heo et al. 2024 ) 80.0 80.4 79.2 77.1 73.6 61.5 43.4 27.1 17.1 nD-ALiBi ( Fuller et al. 2023 ) 80.0 78.4 77.8 76.6 75.3 72.2 68.3 64.1 59.1 LookHere ( Fuller et al. 2024 ) 80.5 81.4 81.1 80.4 79.7 77.5 74.2 69.6 64.4 PaPE (ours) 80.6 81.6 81.7 81.6 81.3 80.5 79.2 77.3 74.9 PaPE-RI (ours) 80.0 80.2 79.2 78.1 76.9 73.6 69.7 64.6 58.6 Here, we further elaborate on the extrapolation performance of PaPE and the baseline methods. First, Table 5 reports the raw results corresponding to the extrapolation experiment shown in Figure 1 . From this we observe the previously mentioned 10.5% improvement in absolute terms from LookHere to PaPE at a resolution of 1024^{2} . Without position interpolation. The main extrapolation experiment evaluates how the methods perform without position interpolation. Concretely, during training we only see positions in the range [1,14] because we train at a resolution of 224^{2} with a patch size of 16, since 224/16=14 . At higher resolutions, however, this expands up to [1,64] , since 1024/16=64 . As mentioned above, we see in Table 5 that PaPE excels in this setting. With position interpolation. Prior works find that sinusoidal and RoPE-based position encodings extrapolate better with position interpolation ( Chen et al. 2023 ; Ding et al. 2024 ) . It works by mapping the test-time position range back into the original training range. We do this by scaling the positions by a factor of 224/R , where R is the target resolution. For example, at R=448 , each position is multiplied by 0.5 , compressing the effective positions back into the [1,14] training range. Table 6 : Extrapolation results with position interpolation. The brackets indicate the increase ( green ) or decrease ( red ) compared to the corresponding configuration without interpolation in Table 5 . Best in bold and next-best underlined . nD-sincos benefits greatly from interpolation while RoPE and RoPE-Mixed benefit from resolution 640^{2} and above. Position interpolation is detrimental to all of the attention bias methods (nD-ALiBi, LookHere, PaPE, and PaPE-RI). Position Encoding 224^{2} 320^{2} 384^{2} 448^{2} 512^{2} 640^{2} 768^{2} 896^{2} 1024^{2} nD-sincos ( Wang & Liu 2021 ) 79.9 79.9 (+3.1) 78.8 (+6.2) 77.4 (+11.5) 75.8 (+18.3) 71.8 (+30.5) 66.9 (+39.7) 61.3 (+44.5) 56.0 (+46.7) RoPE ( Su et al. 2024 ) 80.3 80.6 (-0.3) 80.0 (-0.6) 78.9 (-0.8) 77.6 (-0.6) 74.5 (+0.5) 69.9 (+2.9) 64.8 (+8.6) 59.8 (+17.5) RoPE-Mixed ( Heo et al. 2024 ) 80.0 72.9 (-7.5) 72.1 (-7.1) 73.0 (-4.1) 67.8 (-5.8) 63.5 (+2.0) 56.1 (+12.7) 49.5 (+22.4) 42.9 (+25.8) nD-ALiBi ( Fuller et al. 2023 ) 80.0 77.9 (-0.5) 77.2 (-0.6) 76.0 (-0.6) 74.4 (-0.9) 70.6 (-1.6) 65.4 (-2.9) 59.8 (-4.3) 53.9 (-5.2) LookHere ( Fuller et al. 2024 ) 80.5 80.9 (-0.5) 80.2 (-0.9) 78.9 (-1.5) 77.4 (-2.3) 73.6 (-3.9) 68.8 (-5.4) 63.7 (-5.9) 59.0 (-5.4) PaPE (ours) 80.6 80.7 (-0.9) 79.6 (-2.1) 78.1 (-3.5) 76.5 (-4.8) 72.0 (-8.5) 66.4 (-12.8) 60.4 (-16.9) 54.8 (-20.1) PaPE-RI (ours) 80.0 80.3 (+0.1) 79.4 (+0.2) 78.1 (0.0) 76.4 (-0.5) 72.2 (-1.4) 66.5 (-3.2) 59.7 (-4.9) 52.8 (-5.8) Table 6 shows how PaPE and the baselines perform with position interpolation. We clearly see how nD-sincos in particular is greatly improved with position interpolation. RoPE and RoPE-Mixed drop for resolutions below 640^{2} , but greatly increase their accuracy from there and up. These results confirm that position interpolation is useful for sinusoidal encodings and partially useful for RoPE-based encodings. We also find that all four attention bias position encodings, including PaPE, are negatively affected by position interpolation. Best-performing configuration. Although position interpolation partially mitigates the shortcomings of sinusoidal and RoPE-based encodings, there is still no encoding that approaches the extrapolation performance of PaPE without position interpolation. Table 7 : Extrapolation results for best-performing configuration per position encoding. With position interpolation: nD-sincos, RoPE, and RoPE-Mixed. Without: nD-ALiBi, LookHere, PaPE, and PaPE-RI. Best in bold and next-best underlined . Although position interpolation is detrimental to PaPE, it remains the best encoding for classification extrapolation—even when applying position interpolation to the encodings that benefit from it. Position Encoding 224^{2} 320^{2} 384^{2} 448^{2} 512^{2} 640^{2} 768^{2} 896^{2} 1024^{2} nD-sincos ( Wang & Liu 2021 ) 79.9 79.9 78.8 77.4 75.8 71.8 66.9 61.3 56.0 RoPE ( Su et al. 2024 ) 80.3 80.6 80.0 78.9 77.6 74.5 69.9 64.8 59.8 RoPE-Mixed ( Heo et al. 2024 ) 80.0 72.9 72.1 73.0 67.8 63.5 56.1 49.5 42.9 nD-ALiBi ( Fuller et al. 2023 ) 80.0 78.4 77.8 76.6 75.3 72.2 68.3 64.1 59.1 LookHere ( Fuller et al. 2024 ) 80.5 81.4 81.1 80.4 79.7 77.5 74.2 69.6 64.4 PaPE (ours) 80.6 81.6 81.7 81.6 81.3 80.5 79.2 77.3 74.9 PaPE-RI (ours) 80.0 80.2 79.2 78.1 76.9 73.6 69.7 64.6 58.6 This is evident in Table 7 , which reports extrapolation scores for the best-performing configuration of each position encoding. In this comparison, nD-sincos, RoPE, and RoPE-Mixed rely on interpolation, whereas nD-ALiBi, LookHere, PaPE, and PaPE-RI do not. We observe in particular that PaPE remains the strongest encoding across all resolutions, with LookHere consistently ranking as the next-best method for extrapolation. As a result, the 10.5% improvement at resolution 1024^{2} persists even after taking position interpolation into account. Appendix C Polynomial Generalizations of PaPE We here describe polynomial generalizations of PaPE. We believe these generalizations to be interesting to explore further in future work. Let x_{i}\in\mathbb{R}^{d} and x_{j}\in\mathbb{R}^{d} be two tokens at positions r_{i}\in\mathbb{R}^{p} and r_{j}\in\mathbb{R}^{p} . An expressive family of continuous, context-aware, and translation invariant functions are polynomials of the difference (r_{j}-r_{i})\in\mathbb{R}^{p} , \displaystyle g(x_{i},r_{i},x_{j},r_{j})=\sum_{n=0}^{N}a_{n}(x_{i},x_{j})(r_{j}-r_{i})^{\odot n}, (35) with coefficients a_{n}\in\mathbb{R}^{1\times p} and where (\cdot)^{\odot n} represents the element-wise exponentiation. For compatibility with efficient attention kernels, the function g needs to be representable as a dot product of finite feature vectors that each only depend on the position and content of either of the two tokens. Since (r_{j}-r_{i})^{n} can be expanded to sums of monomials r_{i}^{l}r_{j}^{n-l} , the expression is separable into feature vectors, as long as the coefficients a_{n} are of the type a_{n}=h_{q}(x_{i})h_{k}(x_{j}) for functions h_{q},h_{k} . This results in terms of type \langle h_{q}(x_{i})r_{i}^{l},r_{j}^{n-l}h_{x}(k_{j})\rangle . Note that in PaPE we set h_{k}(x_{j})=1 , leading to coefficients of type a_{n}(x_{i},x_{j})=h_{q}(x_{i}) . A further generalization of PaPE is into the multivariate polynomials. To simplify notation, let x=(r_{j}-r_{i})=(x_{1},x_{2},\dots,x_{p}) . Multivariate polynomials are finite sums of terms of the type c_{\alpha}x_{1}^{\alpha_{1}}x_{2}^{\alpha_{2}}\dots x_{p}^{\alpha_{p}} , where c_{\alpha}\in\mathbb{R} , and \alpha=(\alpha_{1},\alpha_{2},\dots,\alpha_{p})\in\mathbb{N}^{p} is a multi-index. The degree N of the multivariate polynomial is the largest sum of exponents corresponding to non-zero coefficients, i.e., N=\max\{\sum_{i=1}^{p}\alpha_{i}\mid c_{\alpha}\neq 0\} . This broader family can represent terms that cannot be represented in the former, e.g., bilinear forms (r_{j}-r_{i})^{T}B(r_{j}-r_{i}) for any B\in\mathbb{R}^{p\times p} . Similar to the former case, multivariate polynomials can also be separated into feature vectors for efficient attention kernel compatibility, as long as coefficients c_{\alpha} are of the type h_{q}(q_{i})h_{k}(k_{j}) . Appendix D Comparison of nD-ALiBi and PaPE-RI The methods nD-ALiBi and PaPE-RI have methodological similarities, which we compare here. nD-ALiBi works by subtracting the distance matrix D , \displaystyle D_{ij}=\lVert r_{j}-r_{i}\rVert_{2}, (36) between token positions from the S matrix (pre-softmax attention matrix), with a constant scaling factor for each attention head. For simplicity, we consider the case of one head without loss of generality, \displaystyle S_{\text{ALiBi}}=QK^{T}+\alpha D (37) \displaystyle\alpha\in\mathbb{R}_{<0}. (38) Similar behavior is obtained by PaPE-RI, inducing the same properties—translation and rotation invariance. The main difference being that PaPE-RI is designed to subtract the squared distance matrix, where the coefficient can also depend on the token content, leading to \displaystyle S_{\text{PaPE-RI}}=QK^{T}+\alpha(X)\odot D^{2} (39) \displaystyle\alpha_{ij}(X)=\alpha_{ij}(x_{i})\in\mathbb{R}_{<0}. (40) A further difference is that PaPE-RI is compatible with efficient attention kernels, while nD-ALiBi is not. Appendix E Training Details We now detail the training configurations used for all datasets. All models are optimized with AdamW ( Loshchilov & Hutter 2019 ) , using a OneCycle ( Smith & Topin 2019 ) learning rate schedule with cosine decay. The only exception is UniTR on nuScenes, which uses Adam ( Kingma & Ba 2015 ) . Table 8 summarizes the common hyperparameters for all datasets. Unless otherwise specified, all models use the same Transformer settings (i.e. #layers, #heads, dimensionality, and head size) as ViT-B ( Dosovitskiy et al. 2020 ) . Dataset-specific configurations are detailed in the following paragraphs. Table 8 : Hyperparameters. The hyperparameters are shared for all position encodings for a given dataset. Parameter ImageNet-1K COCO ScanNet ModelNet40 UCF101 DvsGesture GEN1 nuScenes Batch size 1024 64 12 32 32 32 64 3 Learning rate 0.0006 0.0006 0.006 0.001 0.00003 0.00005 0.0001 0.003 Weight decay 0.05 0.05 0.05 0.01 0.05 0.05 0.05 0.03 Momemtum ( B_{1}) 0.9 0.9 0.9 0.9 0.9 0.9 0.9 0.9 Momemtum ( B_{2}) 0.999 0.999 0.999 0.999 0.999 0.999 0.999 0.99 Warmup epochs 15 15 40 5 20 15 7.5 1 Total epochs 300 150 800 300 200 300 150 10 Training resolution ( W\times H ) 224^{2} 640^{2} - - 320\times 240 128^{2} 304\times 240 704\times 256 Patch size 16 16 1024 1024 16 16 16 8 Drop path 0.1 0.1 0.3 0.3 0.1 0.1 0.1 - Label smoothing 0.1 - - - - 0.1 - - ImageNet-1K. We treat the official validation split as our test set and divide the original training split into a new training set and a validation set. The ratio is 99% for training and 1% for validation, using a stratified split that preserves class balance in each subset. For the classifier head, we initialize the weights to 0 and the bias to -\log(1000) , so that the initial class probabilities are uniform. We use the following set of augmentations: RandAugment ( Cubuk et al. 2020 ) , HorizontalFlip, MixUp ( Zhang et al. 2018 ) , and CutMix ( Yun et al. 2019 ) . COCO. The detection model pairs a ViT-B backbone with a ViTDet ( Li et al. 2022b ) neck (strides 8, 16, and 32) and a YOLOv10 ( Wang et al. 2024 ) head and loss. For data augmentation, we keep RandAugment but explicitly drop shear and rotation, as they corrupt ground-truth bounding boxes. In addition, we apply Large Scale Jitter ( Ghiasi et al. 2020 ) , following ViTDet. ScanNet and ModelNet40. We use Point Transformer V3 ( Wu et al. 2024 ) with the dataset-specific configurations from the official code repository. This includes the same augmentations as well as model configuration and size. However, we do not initialize the weights from pretrained models. UCF101. We follow ViViT ( Arnab et al. 2021 ) , using 2-tubelets for each video sample and drawing up to 5 samples per video, with 10 frames separating consecutive 2-tubelets. The augmentations are RandAugment and HorizontalFlip. For both training and evaluation, we use the official 3-fold cross-validation splits and report the mean test performance. Mirroring the ImageNet-1K protocol, we further partition each training split into new training and validation sets. We do this by assigning the first video group of every action class to the validation set. DvsGesture. We utilize Spiking Patches ( Øhrstrøm et al. 2025 ) to extract asynchronous and spatially sparse spatio-temporal tokens, configured with a spike threshold, \sigma , of 256 and a refractory period, T , of 100 ms. The model is a ViT-B where we follow the token embedding method of Øhrstrøm et al. 2025 . Since the temporal positions are at a microsecond resolution, we rescale them by 1/50000 . We apply two sets of augmentations: NDA ( Li et al. 2022a ) and EventDrop ( Gu et al. 2021 ) . GEN1. Similar to DvsGesture, we extract tokens using Spiking Patches with \sigma=256 and T=100 ms, and process them with a ViT-B backbone. Here, however, we scale temporal positions by 1/100000 and sample the most recent 500K events relative to the prediction time. Because the tokens are asynchronous, they are not directly compatible with the image-like tensors expected by the ViTDet neck and YOLOv10 head. Therefore, we first convert the backbone outputs into an image-like tensor. The way it works is that for each spatial location, we fill its slot with the most recent token at that spatial position. We augment with EventDrop and rotations. nuScenes. We use UniTR ( Wang et al. 2023 ) , following the same architecture, model size, hyperparameters, and augmentations as in the official code repository.