Skip to content

xjffff/FUNCATTN

Repository files navigation

From Pairwise Affinities to Functional Correspondences: Rethinking Attention

Preliminary work. Under review at ICML.

We introduce Functional Attention (FuncAttn), which reinterprets attention as a functional correspondence between adaptive bases rather than pairwise affinities between tokens. Inspired by the functional maps framework, FuncAttn replaces the dense softmax score matrix with a compact linear operator learned via optimal least-squares in a spectral space, reducing complexity from O(n²) to O(k²) with k ≪ n.


Architecture

architecture


Showcase

showcase

Qualitative comparison against Transolver on Elasticity (top) and Darcy flow (bottom). FuncAttn produces predictions with lower relative error.


Repository Structure

Directory Description
Few-Shot-Regression/ Few-shot sinusoid regression comparing FuncAttn, Attention, Intention, Transolver
PDE-StandardBenchmark/ Six PDE benchmarks: Darcy, Navier-Stokes, Airfoil, Pipe, Plasticity, Elasticity
RNA-Segmentation/ 3D point cloud segmentation on RNA structures
Airfoil-Design-AirfRANS/ OOD generalization on the AirfRANS airfoil design dataset
Burgers-Super-Res/ Zero-shot super-resolution on the 1D Burgers equation

Installation

pip install -r requirements.txt

Results

main results

Relative L² error (%) on six standard PDE benchmarks. FuncAttn outperforms the previous best model Transolver across all tasks.


Acknowledgement

We appreciate the following GitHub repos for their valuable code base and datasets on which we built our code:

  1. https://github.com/neuraloperator/neuraloperator
  2. https://github.com/thuml/Transolver
  3. https://github.com/Extrality/AirfRANS
  4. https://github.com/nmwsharp/diffusion-net

About

From Pairwise Affinities to Functional Correspondences: Rethinking Attention

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors