Universal 3D Relative Positional Encoding
- Universal 3D Relative Positional Encoding is a class of transformer mechanisms that conditions attention on relative 3D geometry across diverse views and continuous spaces.
- It employs methodologies like URoPE, which projects key tokens into the query view using camera intrinsics and extrinsics, preserving the benefits of rotary embeddings.
- Empirical results across tasks such as novel view synthesis, 3D detection, and stereo depth estimation demonstrate its improved performance over standard positional encoding schemes.
Universal 3D Relative Positional Encoding (RPE) denotes a class of transformer positional mechanisms in which attention is conditioned on relative geometry in three-dimensional, cross-view, or cross-dimensional settings rather than on absolute positions in a single sequence or a regular grid. In this literature, the shared objective is to preserve the relative-position property of rotary or bias-based encodings while extending it to geometries such as calibrated camera systems, irregular point sets, object-centric box frames, continuous coordinates, and spherical manifolds. Representative formulations include URoPE for projective cross-view reasoning, FourierLearner-Transformers for learned translation-invariant masks, RelFlexformer for integrable 3D modulation with NU-FFT, LieRE for Lie-group rotational encodings, V-DETR for query-conditioned vertex-relative biasing, and PRoPE for camera-frustum-relative attention (Xie et al., 20 Apr 2026, Choromanski et al., 2023, Kim et al., 11 May 2026, Ostmeier et al., 2024, Shen et al., 2023, Li et al., 14 Jul 2025).
1. Problem setting and the meaning of “universal”
The immediate motivation for universal 3D RPE is that standard positional encodings are typically tied to a single coordinate system. Absolute encodings such as sinusoidal or learned absolute positional embeddings, and relative mechanisms such as ALiBi or standard RoPE, assume either a 1D sequence or a regular 2D or 3D grid. That assumption fails in multiview and 2D–3D tasks. A pixel in one camera may be close in 3D to a pixel in another camera but distant on the two image grids; image tokens and 3D tokens may inhabit different spaces; and single-space attention biases do not encode camera intrinsics, extrinsics, rays, or projective geometry (Xie et al., 20 Apr 2026).
Across the literature, “universal” does not denote a single formula. In URoPE, universality means extending RoPE across geometric spaces by lifting key tokens along camera rays and projecting them into the query image plane before applying standard 2D RoPE. In FourierLearner-Transformers, universality means that any translation-invariant RPE depending on relative displacements in dimensions can be parameterized through a learned spectral representation and inserted into linear attention. In RelFlexformer, universality is defined in terms of arbitrary integrable modulation functions over relative displacements on irregular 3D token sets. In LieRE, universality refers to a single Lie-group construction that maps positions in to high-dimensional rotations via an exponential map. In V-DETR, the relative encoding is universal in a different sense: it is query-conditioned, translation-aware, rotation-aware, and scale-aware in a canonical box frame (Choromanski et al., 2023, Kim et al., 11 May 2026, Ostmeier et al., 2024, Shen et al., 2023).
A recurrent source of ambiguity is the meaning of “3D.” In camera-aware work, 3D refers to scene geometry and projective relations between views. In point-cloud and molecular modeling, it refers to continuous Euclidean coordinates. In spherical encoding, it refers to geographic angles on a sphere. In long-context language modeling, “3D-RPE” refers to a Bloch-sphere-inspired rotary construction with within-chunk and across-chunk angular variables rather than Euclidean scene geometry (Unlu, 2023, Ma et al., 2024).
2. URoPE and the projective formulation of cross-view relative position
URoPE is a universal extension of Rotary Position Embedding to cross-view or cross-dimensional geometric spaces. Its central construction is explicit projective mapping from a key/value token’s source space into the query token’s space, followed by standard 2D RoPE in that shared plane. The method assumes a pinhole camera model. Each camera has intrinsics and extrinsics with world-to-camera mapping
For a key token in source camera at pixel 0, the ray direction in key-camera coordinates is
1
URoPE samples 3D points along that ray at predefined depth anchors 2,
3
moves them into world coordinates and then into query-camera coordinates,
4
and projects them into the query image plane,
5
The projected point 6 is then used in place of the original key coordinate when applying 2D RoPE (Xie et al., 20 Apr 2026).
The RoPE component follows the standard 2D decomposition. For image coordinates 7, the per-head channels are partitioned into 8 and 9 subspaces, and
0
For a query pixel 1 and a projected key pixel 2 associated with head 3 and depth anchor 4,
5
This preserves the relative-position effect of RoPE, but now the relative quantity is projective and cross-view. Multi-head attention implements multi-depth reasoning by assigning different anchors to different heads or head-groups, so near- and far-field hypotheses along the epipolar line are covered without a learned per-layer depth estimator (Xie et al., 20 Apr 2026).
The depth-anchor design is deliberately simple. Uniform spacing in 6 works well and is robust to upper-bound choices; log-uniform or LID sampling yield similar performance; and a small number of anchors is typical. The reported guidance is that 7 works well across tasks, 8–9 is typically robust, 0 degrades performance, and very many anchors offer diminishing returns (Xie et al., 20 Apr 2026).
3. Formal properties, computational profile, and implementation constraints
URoPE is explicitly intrinsics-aware because projected positions depend on 1, 2, and the extrinsics. It is parameter-free because depth anchors are fixed. It is also invariant to the global coordinate frame. Eliminating world coordinates yields the relative transform
3
so that
4
Under a global 5 change of the world frame, 6, 7, 8, and 9 change consistently, but 0 and 1 remain unchanged. Therefore
2
is unchanged, which establishes invariance to global rigid-frame reparameterization (Xie et al., 20 Apr 2026).
A further design constraint is compatibility with existing attention kernels. URoPE leaves the attention kernel unchanged and applies standard RoPE on rotated 3 and 4, so it remains compatible with RoPE-optimized kernels, including FlashAttention. Its asymptotic attention complexity remains
5
the same as standard attention, while the additional cost of computing per-head projected positions is
6
arithmetic. Batched multiview attention is handled by reshaping queries so that all queries in one kernel call share a single view and repeating keys and values along the batch dimension as needed (Xie et al., 20 Apr 2026).
The implementation notes are highly geometric. The pinhole model is assumed and distortion is not modeled. Extremely small 7 values in query-camera coordinates require clipping or guards against numerical instability. Projected positions may fall outside the image plane; URoPE remains valid in that case because 2D RoPE still computes a relative angle, though clamping or coordinate normalization may stabilize angles. For stability across resolutions, the recommended practice is to scale 8 by image width 9 and 0 by image height 1 before mapping to RoPE angles, using 2 and 3. Head-wise anchor assignment is markedly better than channel-wise splitting, and learned per-layer depth prediction underperforms fixed anchors, especially in shallow layers (Xie et al., 20 Apr 2026).
The same formalism is used beyond view-to-view cross-attention. The paper states that URoPE can be integrated into 2D–3D fusion by measuring relative positions between 3D queries and lifted points in 3D or by projecting 3D queries into each image and applying 2D RoPE. It also applies across temporal sequences using per-frame intrinsics and extrinsics, and it degenerates to standard 2D RoPE when query and key belong to the same view (Xie et al., 20 Apr 2026).
4. Empirical performance of URoPE across geometric tasks
URoPE was evaluated as a plug-in positional encoding across novel view synthesis, 3D object detection, object tracking, and stereo depth estimation, covering 2D–2D, 2D–3D, and temporal scenarios. The reported pattern is consistent improvement over transformer baselines in all tasks considered (Xie et al., 20 Apr 2026).
In novel view synthesis integrated into LVSM, URoPE improved Objaverse to PSNR 4, SSIM 5, and LPIPS 6, outperforming Plücker rays at 7, 6D RoPE at 8, P-RoPE at 9, and RayRoPE at 0. On RealEstate10k, it reached PSNR 1, SSIM 2, and LPIPS 3, exceeding Plücker rays at 4, 6D RoPE at 5, P-RoPE at 6, and RayRoPE at 7. Under scaled training at approximately 8 compute, URoPE still improved over Plücker rays, with PSNR 9 versus 0, SSIM 1 versus 2, and LPIPS 3 versus 4 (Xie et al., 20 Apr 2026).
In nuScenes 3D detection and tracking, PETR with URoPE achieved NDS 5, mAP 6, and AMOTA 7, improving baseline PETR at 8, 9, and 0. StreamPETR with URoPE reached NDS 1, mAP 2, and AMOTA 3, improving the baseline at 4, 5, and 6. The qualitative description reports better identification of small objects and improved temporal consistency (Xie et al., 20 Apr 2026).
In stereo depth estimation with UniMatch, URoPE yielded on RGBD an AbsRel of 7, RMSE of 8, and RMSE log of 9; on Scenes11 an AbsRel of 0, RMSE of 1, and RMSE log of 2; and on SUN3D an AbsRel of 3, RMSE of 4, and RMSE log of 5. The associated ablations report that URoPE alone suffices, combining it with global Plücker rays gives little gain, local camera-ray direction gives only small improvements, and head-entropy analysis shows no multi-head collapse relative to P-RoPE (Xie et al., 20 Apr 2026).
These results are accompanied by practical ablation findings. Uniform and LID sampling are both strong, log-uniform is competitive, sensitivity to the upper depth bound is low provided near-field coverage is included, and 6 is the empirical sweet spot. The paper also reports that fixed anchors are more stable than parametric depth prediction modules (Xie et al., 20 Apr 2026).
5. Comparative landscape of universal 3D RPE formulations
Universal 3D RPE is not a single architecture family. The following formulations instantiate different notions of relative geometry:
| Formulation | Core mechanism | Distinguishing scope |
|---|---|---|
| FourierLearner-Transformers (Choromanski et al., 2023) | Learned spectral representation of 7 with random Fourier features | Linear attention with translation-invariant RPE on continuous coordinates |
| V-DETR 3DV-RPE (Shen et al., 2023) | Query-conditioned additive bias from canonical offsets to box vertices | Locality-conforming 3D detection in an object-centric frame |
| RelFlexformer (Kim et al., 11 May 2026) | Integrable modulation 8 applied by NU-FFT | Subquadratic masked attention on irregular 3D token layouts |
| PRoPE (Li et al., 14 Jul 2025) | Projective frustum transform 9 in attention | Relative multiview conditioning with intrinsics and extrinsics |
| LieRE (Ostmeier et al., 2024) | High-dimensional rotation 00 | Modality-agnostic rotary encoding for positions in 01 |
| Spherical PE / 3D-RPE (Unlu, 2023, Ma et al., 2024) | Geographic 02 rotations / Bloch-sphere chunk rotary | Spherical geotokens or long-context sequence modeling |
FourierLearner-Transformers formulate RPE as a translation-invariant mask 03 and learn its Fourier transform 04. The mask is estimated by spectral random features and absorbed into linearized softmax attention via augmented query and key features. For 3D molecular modeling on OC20 IS2RE, FLT-12L improved Performer-12L from energy MAE 05 eV and EwT 06 to MAE 07 eV and EwT 08; FLT-10L reached MAE 09 eV and EwT 10 (Choromanski et al., 2023).
V-DETR’s 3D Vertex Relative Position Encoding uses the predicted box of each decoder query to define a canonical frame. The key quantity is the vertex offset
11
which is processed by per-vertex MLPs and summed into an additive attention bias, yielding
12
This encoding is translation-invariant, rotation-aware, and scale-aware. On ScanNetV2, it improved 3DETR from 13 to 14, and on SUN RGB-D it reached up to 15 (Shen et al., 2023).
RelFlexformer instead works at the level of arbitrary integrable modulation functions. With tokens at coordinates 16 and 17, it computes masked multiplication through a forward NU-FFT, multiplication by the spectral envelope 18, and an adjoint NU-FFT. This yields 19 time for the masked step without materializing the 20 mask. The paper reports improvements over Performer on ModelNet40, ScanObjectNN, ScanNet, ScanNet200, ScanNet++, nuScenes, S3DIS, NYU Depth v2, and SUN RGB-D, and notes that small spectral quadrature sizes such as 21–22 are often sufficient (Kim et al., 11 May 2026).
PRoPE, introduced in the multiview camera-conditioning literature, represents each camera by
23
and injects the pairwise transform 24 into attention. This explicitly captures both intrinsics and extrinsics as a relative projective transform. On RealEstate10K with varying intrinsics, PRoPE achieved 25 in PSNR/LPIPS/SSIM, compared with GTA at 26, CaPE at 27, Plücker at 28, and Naive at 29. In hybrid form, PRoPE+CamRay reached 30 (Li et al., 14 Jul 2025).
LieRE generalizes RoPE by replacing fixed block-diagonal 31 rotations with 32, where 33 is learned. For 3D tasks, the construction uses positions 34 and the generator 35. On UCF101, LieRE improved Absolute from 36 and RoPE-Mixed from 37 to 38 accuracy; on RSNA it improved Absolute from 39 and RoPE-Mixed from 40 to 41 (Ostmeier et al., 2024).
Spherical Position Encoding and 3D-RPE illustrate a different branch of the literature. The former replaces 2D rotary blocks with repeated 42 rotations 43 built from longitude and latitude, targeting “geotokens” on the sphere; the paper is conceptual and reports no experiments. The latter introduces a Bloch-sphere-inspired construction for long-context LLMs in which the score depends on within-chunk offset 44 and chunk-level phase difference 45; it reports improvements over RoPE on LongBench, LEval, PG19, and Proof-Pile (Unlu, 2023, Ma et al., 2024).
6. Limitations, ambiguities, and open technical directions
Camera-aware universal 3D RPE methods inherit calibration requirements. URoPE requires calibrated intrinsics and extrinsics and is not directly applicable to uncalibrated settings without camera estimation. Its performance can degrade under depth-range mis-specification, extreme perspective changes, or very wide baselines, which may require more anchors or broader anchor ranges. Numerical issues arise for tiny 46 values or points behind the camera, and large images or many anchors increase the per-head projection arithmetic even though the attention kernel itself remains standard (Xie et al., 20 Apr 2026).
PRoPE shares similar dependencies on camera quality. Calibration errors in 47, 48, and 49 corrupt the projective transform; very small parallax reduces geometric signal; and the formulation assumes a pinhole model unless inputs are pre-undistorted or the distortion model is explicitly incorporated (Li et al., 14 Jul 2025). V-DETR exhibits a different failure mode: if the provisional box prediction is poor in early decoder layers, the resulting query-conditioned bias may misguide attention, although iterative refinement and auxiliary losses mitigate this (Shen et al., 2023).
Spectral and Fourier-based approaches trade geometric specificity for broader applicability. FLT depends on the choice of sampling distribution 50; poor choices increase variance and may require larger numbers of spectral features. Very sharp local masks are band-unlimited and must be approximated with finite bandwidth. RelFlexformer presumes translation-invariant masks and introduces quadrature and NU-FFT approximation error; extreme token sparsity or highly clustered distributions may require retuning the quadrature size 51 or kernel widths (Choromanski et al., 2023, Kim et al., 11 May 2026).
LieRE is universal over positions in 52, but the paper states that it does not directly encode 53 poses. Spherical Position Encoding leaves scaling for distance proportionality unspecified and does not include altitude or empirical validation. The long-context 3D-RPE construction depends on chunk size and base schedules; too-small chunk size can overly restrict locality, while too-large chunk size reintroduces RoPE-like long-range decay in the within-chunk component (Ostmeier et al., 2024, Unlu, 2023, Ma et al., 2024).
Taken together, the literature indicates that “universal” is best understood as geometry-appropriate relative encoding rather than as a single canonical 3D recipe. Projective methods such as URoPE and PRoPE are matched to calibrated multiview vision; object-centric encodings such as 3DV-RPE are matched to detection; spectral and NU-FFT methods are matched to irregular continuous 3D token sets; and Lie-group or spherical rotary methods generalize the rotational principle underlying RoPE to broader positional domains.