TL;DR
Applying Transformers to 3D point clouds forces an uncomfortable choice: pay an astronomical $O(L^2)$ memory cost to capture fine-grained spatial relationships, or use linear-time approximations that lose their sense of geometry. RelFlexformer resolves this tradeoff by sneaking continuous 3D spatial awareness into fast, kernelized attention using the Non-Uniform Fast Fourier Transform (NU-FFT). It runs in $O(L \log L)$ time, handles messy, unstructured 3D coordinates effortlessly, and frequently outperforms standard dense Transformers.
What Problem Does This Paper Address?
Standard Transformers are natural fits for 3D point clouds because they don't care about token order, only relationships. However, raw point clouds are scattered irregularly in 3D space rather than sitting neatly on a 1D line or 2D pixel grid. To make sense of them, models rely on Relative Positional Encodings (RPE)—essentially geometric masks injected into the attention matrix so tokens know how far apart they are in Euclidean space.
Unfortunately, materializing that $L \times L$ attention matrix for $L$ points hits a quadratic wall, quickly exhausting GPU memory on dense scenes. Efficient alternatives like Performers reduce attention to $O(L)$ linear time using kernel tricks (approximating softmax via random features) so the giant $L \times L$ matrix is never built. Here lies the catch: if you never build the attention matrix, you have nowhere to apply your element-wise 3D geometric mask! Existing workarounds rely on rigid grids or pre-computing auxiliary graphs/trees. How do you inject continuous, arbitrary 3D distance biases into sub-quadratic attention without wrecking its speed?
Methods
RelFlexformer builds on Performers (standard) and a prior mathematical insight (also standard) showing that masked linear attention can stay fast if you can multiply your mask matrix $\mathbf{M}$ by an arbitrary vector $\mathbf{u}$ in sub-quadratic time—without ever constructing $\mathbf{M}$ explicitly.
The authors' core novelty is $\text{FastMult}_\mathbf{M}$, an algorithm that computes this exact matrix-vector product for irregular 3D points in $O(L \log L)$ time:
- Masking as Convolution: If a spatial modulation function $f(\mathbf{r}_i - \mathbf{r}_j)$ depends on relative 3D positions, multiplying $\mathbf{M}\mathbf{u}$ is mathematically equivalent to a continuous spatial convolution over a field of Dirac delta spikes placed at each point's 3D coordinates.
- Into the Frequency Domain: By the Convolution Theorem, convolution in 3D space is just element-wise multiplication in Fourier space.
- Enter NU-FFT: Because point clouds don't live on uniform grids, standard FFTs fail. Instead, the authors use the Non-Uniform Fast Fourier Transform (NU-FFT) to project the irregular point signals onto $S$ sampled frequencies, multiply them by the Fourier transform of the spatial mask $\mathcal{F}_f$, and invert back to the 3D point coordinates via an inverse NU-FFT.
Any $L_1$-integrable distance function $f$ works out of the box (or frequencies can be learned directly), yielding smooth spatial decay behaviors akin to Heat or Laplace kernels.
Datasets
No new datasets are introduced; instead, RelFlexformer is tested as a drop-in replacement across an extensive suite of established 3D benchmarks:
- 3D Object Classification: ModelNet40 (synthetic CAD objects) and ScanObjectNN (real-world scanned objects with background clutter).
- 3D Semantic Segmentation: ScanNet, ScanNet200, ScanNet++, and S3DIS (dense indoor scenes), plus nuScenes (sparse outdoor automotive LiDAR).
- RGB-D Segmentation: NYU Depth v2 and SUN RGB-D (2D images lifted into 3D space via patch depth signals).
Key Insights and Ideas
- A Grand Unifier for Positional Encodings: RelFlexformer isn't just an isolated trick—it mathematically subsumes popular positional encodings. The authors prove that choosing discrete harmonic functions for $f$ analytically recovers RoPE (Rotary Position Embedding), while learning frequencies directly recovers recent multidimensional encodings like STRING.
- Two Geometric Pathways Are Better Than One: Token-level encodings (like PointRoPE, which rotates individual queries/keys) and interaction-level RPEs (RelFlexformer, which modulates pair-wise strength by distance) are complementary. Combining them consistently yields extra accuracy gains.
- The Geometric Prior Helps Everyone: Even when plugged into standard $O(L^2)$ softmax Transformers, RelFlexformer's RPE boosts accuracy across every tested dataset—proving the gains come from genuine geometric inductive bias, not an artifact of linear attention.
Key Results
Across PCT, Point Transformer V3 (PTv3), and DFormer backbones, RelFlexformer erases the accuracy drop typically suffered by linear Performers—and often beats quadratic Transformers outright:
- Scalability: Standard Transformers hit Out-Of-Memory (OOM) errors at sequence lengths $L \ge 16\text{k}$, whereas RelFlexformer scales smoothly past $64\text{k}$ tokens.
- Classification: On ScanObjectNN, RelFlexformer reaches 84.45% Overall Accuracy, beating both Performer (83.16%) and the dense Transformer baseline (84.0%).
- Segmentation: On outdoor LiDAR (nuScenes), vanilla Performer drops to 72.0 mIoU (vs. Transformer's 80.4). RelFlexformer rebounds to 80.3 mIoU, and reaches 81.2 mIoU when paired with PointRoPE. It similarly surpasses dense attention on ScanNet++ (48.8 vs. 48.2 mIoU).
- RGB-D: On SUN RGB-D, it lifts Performer from 48.49% to 51.04% mIoU (nearly matching Softmax's 51.2%) while beating STRING without needing STRING's ~70K extra parameters.
Limitations and Future Work
Not discussed in the paper. (While the main text notes a controllable $O(1/\sqrt{S})$ stochastic quadrature approximation error and slightly higher constant-time overhead at tiny sequence lengths $L \le 1\text{k}$ compared to vanilla Performers in Figure 1, explicit limitations and future directions are not formally detailed in the provided pages.)
Summary updated