RayRoPE: Projective Ray Positional Encoding
- RayRoPE is a projective ray positional encoding framework that uniquely represents image patches as 3D ray segments defined by camera centers and predicted depths.
- It projects tokens into query frames using multi-frequency rotary embeddings to achieve SE(3)-invariant attention in multi-view transformer architectures.
- Empirical evaluations show significant improvements in novel-view synthesis and stereo depth estimation, validating its effectiveness across various benchmarks.
RayRoPE (Projective Ray Positional Encoding) is a positional encoding framework for multi-view transformer architectures that process tokens from sets of posed images. Its design addresses three primary requirements of multi-view attention: (1) uniquely and geometrically encoding image patches, (2) enabling attention that is invariant under the SE(3) group of rigid motions, and (3) adaptively reflecting scene geometry, including cases with known depth (e.g., RGB-D input) or predicted depth under uncertainty. RayRoPE represents the position of image patches via predicted points along their respective camera rays, projects these into each query view, and finally applies a frequency-rich (Fourier/rotary) embedding designed to ensure SE(3)-invariance and robust similarity computation in attention. The canonical reference for RayRoPE is "RayRoPE: Projective Ray Positional Encoding for Multi-view Attention" (Wu et al., 21 Jan 2026).
1. Geometric and Mathematical Formulation
Let denote the global Euclidean frame. For cameras, each is specified by extrinsic parameters and intrinsic matrix , yielding the projection matrix . Each token, representing a center pixel in image , is associated with:
- camera center ,
- normalized ray direction ,
- a predicted depth .
The predicted 3D point along the ray is given by:
For each token, learnable feature vectors 0 produce query, key, and value vectors (1, 2, 3) and estimates for depth (4) and uncertainty (5) via small linear heads.
2. Projective Ray Positional Encoding Mechanism
RayRoPE encodes a ray segment 6 in a form that is robust to arbitrary rigid motions (SE(3) invariance). The encoding pipeline comprises:
2.1. Query-Frame Projection
Given a query token from view 7 (with projection 8), any source token's ray 9 is projected into the query frame: 0 The resulting vector 1 concatenates transformed camera center (3 coordinates) and pixel-disparity tuple (3 coordinates).
2.2. Multi-frequency Rotary Positional Embedding
A Fourier embedding is applied to 2 for multi-frequency similarity, selecting frequencies 3. The embedding is: 4 where each 5 is represented by a 6 matrix encoding a rotation.
2.3. Incorporation into Attention and SE(3) Invariance
In the self/cross-attention layer, positional rotary embeddings are injected: 7 By coding all coordinates in the query’s local frame, rigid motions cancel, yielding exact SE(3) invariance in attention computations.
3. Uncertainty-Aware Positional Encoding
Each token's 3D position is subject to uncertainty 8 (predicted per token). RayRoPE models this as a uniform distribution over intervals of projected coordinates, 9. The expected rotary embedding is: 0 For each scalar 1, expectation is computed as: 2 yielding a closed-form 3 block for each frequency-channel pair. This expected encoding introduces smoothing of high frequencies according to uncertainty, thereby attenuating high-frequency noise without sacrificing the property that relative encodings are maintained: 4
4. Algorithmic Workflow
A high-level algorithm for applying RayRoPE within a multi-view transformer layer comprises the following:
- Transform token features to queries, keys, values, and predict depth and uncertainty.
- For each token, construct the global ray segment 5.
- For each query view, project all rays into the query frame.
- Compute the expected rotary positional encoding, incorporating each token’s predicted uncertainty.
- Transform query, key, value tensors by the corresponding embeddings.
- Perform standard attention, apply inverse transformation to outputs.
The following table summarizes the high-level steps:
| Step | Description | Output |
|---|---|---|
| Feature projection | Linear heads yield Q, K, V, depth, uncertainty per token | 6 |
| Ray construction | Compute 7 per token | Global ray segments |
| Query-frame projection | Project all source rays into query view | 8 |
| Expected rotary embedding | Integrate over depth-uncertainty interval | 9 |
| Rotational transformation | Embed and rotate Q, K, V | Embedded Q, K, V |
| Attention and output | SE(3)-invariant attention and return to global space | Output tensor |
5. Experimental Results and Empirical Findings
RayRoPE has been validated on both novel-view synthesis and stereo depth estimation tasks.
5.1. Novel-View Synthesis
On the CO3D dataset (large pose variation), RayRoPE, evaluated on the LVSM backbone, achieved 15% relative improvement in LPIPS over prior position encoding schemes, with reported results: PSNR = 18.40, LPIPS = 0.461, compared to PRoPE (PSNR = 17.49, LPIPS = 0.539) and other baselines (e.g., Plücker-raymap APE, RoPE on global rays, GTA). Similar trends were observed on Objaverse and RealEstate10K, with RayRoPE providing sharper high-frequency texture and improved global shape, especially in cases of low view overlap. With RGB-D input (known depth), RayRoPE directly incorporates reference depths and yields further improvements: for instance, CO3D with depth, PSNR increased from 19.10 (PRoPE) to 20.47 (RayRoPE), and Objaverse from 23.20 to 25.19 (Wu et al., 21 Jan 2026).
5.2. Stereo Depth Estimation
Benchmarks on RGBD, SUN3D, and Scenes11 datasets using the UniMatch backbone demonstrate that RayRoPE improves depth accuracy over PRoPE, particularly in RMSE and RMSE log metrics (e.g., RGBD: RMSE = 0.589→0.574, RMSE log = 0.186→0.177; SUN3D: RMSE = 0.338→0.328, RMSE log = 0.152→0.146; Scenes11: RMSE = 0.494→0.473, RMSE log = 0.116→0.110). RayRoPE consistently produces sharper 3D reconstructions and more accurate depth maps.
6. Extensions and Implications
RayRoPE seamlessly integrates RGB-D inputs by substituting the predicted depth and uncertainty with known values; i.e., 0. This compatibility enables more precise geometry-aware encoding when ground truth depth is available. The approach, by encoding positional information via explicit projective geometry and token-level uncertainty, generalizes prior absolute and relative encoding schemes which lack SE(3) invariance or adaptability to geometric uncertainty. A plausible implication is that RayRoPE-type position encodings are beneficial in any multi-view transformer where input geometry is variable, uncertain, or only partially observed, such as in robotics, scene reconstruction, and augmented reality.
7. Summary of Contributions
RayRoPE provides a complete position encoding framework for multi-view attention transformers:
- Every patch is uniquely represented as a finite ray segment parameterized by camera center and predicted 3D point along the ray.
- Ray positions are projected into the query frame and embedded using multi-frequency rotary embeddings to enable SE(3)-invariant attention.
- Token-dependent depth uncertainty is handled analytically via expectation over projective coordinate intervals, smoothing the encoding as appropriate.
- Empirical evaluations confirm significant improvements over leading absolute and relative encoding schemes in both synthesized view quality and depth prediction.
- The method naturally extends to cases with known depth, further increasing model performance across both geometry-centric and RGB-D settings (Wu et al., 21 Jan 2026).