FSKA / Research project

NeurIPS 2026

Flow-based Spectral Kernel Learning for Nonstationary Attention

Zi Yang1,*Ying Li2,*Alejandro Lancho3Darío Cabezas Larese3Pablo M. Olmos3,†Michael Minyi Zhang1,†

1 The University of Hong Kong2 National University of Singapore3 Universidad Carlos III de Madrid

* Equal contribution   † Corresponding authors

Expressive kernel attention with competitive accuracy and linear-time aggregation.

Adaptive similarities,
simpler projections

A stationary kernel depends on the difference between two inputs. We want similarities that can also depend on each input individually. Dense attention computes pairwise interactions, so its cost grows quadratically with sequence length.

FSKA learns the similarity kernel through a nonstationary spectral density and uses random features to factorize attention. Each head learns its own kernel and uses a fixed value projection. For fixed feature and value dimensions, aggregation cost grows linearly with sequence length.

Learning the attention kernel

01

Nonstationary spectral features

A joint density over frequency pairs represents similarities beyond functions of the difference between two inputs. The feature map combines sines and cosines evaluated at sampled frequencies.

For a real-valued kernel with the stated normalized spectral probability representation, the signed-feature inner product is an unbiased kernel estimator. The feature dimension is even, with M/2 independent frequency pairs.

02

Flow-based density learning

A RealNVP normalizing flow maps samples from a standard Gaussian to frequency pairs. Its tractable Jacobian determinant lets us evaluate the learned density. Training combines the task loss with a spectral regularizer.

Ground-truth, normalizing-flow, and implicit neural-model kernels and spectral densities
GT denotes ground truth, NF a normalizing flow, and NN an implicit neural model. In this example, the flow recovers more of the target spectrum and kernel pattern.
03

Fixed values, diverse heads

Query and key projections control similarity. Value projections define the space where information is aggregated. Fixed orthogonal value projections retain complementary subspaces across heads.

Each head learns its own kernel, which sets its attention weights.

04

Positive features, linear aggregation

ELU plus one produces positive features to avoid signed cancellation. Each head accumulates feature–value products and feature sums, then combines them with each token's features to compute its output.

Positive features equal ELU of the signed features plus one Normalized output computed from accumulated feature–value products and feature sums

This avoids constructing the full attention-score matrix. For fixed feature and value dimensions, aggregation cost is linear in sequence length, with per-head cost O(LM dv).

The unbiasedness result applies to the original signed features. It does not automatically extend to the ELU-transformed affinity or normalized attention ratio.

Classification and efficiency

5 of 6

datasets with the highest mean macro-F1
among the methods in the comparison below

Sentence classification

Macro-F1 (%), mean ± standard deviation over three runs. KPCA has the highest mean on RT-Polarity.

Sentence classification macro-F1 results
ModelDBPediaAGNewsTRECRT-Pol.SST-2SST-5
Transformer98.13 ± 0.1590.43 ± 0.0786.14 ± 0.9370.52 ± 0.4576.07 ± 1.1035.11 ± 1.46
MIKAN97.74 ± 0.0191.15 ± 0.2485.47 ± 1.0771.30 ± 0.9276.04 ± 0.8632.84 ± 0.39
Performer98.12 ± 0.0990.23 ± 0.3185.70 ± 0.5770.88 ± 0.6277.24 ± 0.4135.92 ± 0.96
RKA98.26 ± 0.0190.80 ± 0.2885.56 ± 0.7571.15 ± 0.7277.08 ± 1.4636.10 ± 0.49
GMM-RKS96.76 ± 0.2190.58 ± 0.4185.36 ± 0.9171.05 ± 1.0276.81 ± 0.8936.42 ± 0.84
KPCA97.59 ± 0.1490.20 ± 0.4985.90 ± 0.9672.16 ± 1.5877.62 ± 1.1336.97 ± 1.36
MetaLA97.24 ± 0.1591.14 ± 0.3685.07 ± 1.0270.28 ± 1.7177.03 ± 0.6935.27 ± 1.41
FSKA98.33 ± 0.1391.20 ± 0.3786.21 ± 1.0272.08 ± 1.4478.74 ± 1.1538.16 ± 1.40

Compared with Transformer, FSKA improves mean macro-F1 from 76.07 to 78.74 on SST-2 and from 35.11 to 38.16 on SST-5.

Fewer projection parameters

Removing learned Q/K and fixing V reduces projection parameters. The figures compare trainable parameters and training throughput as sequence length increases.

Original poster charts comparing model parameter breakdowns and training throughput across sequence lengths
Synthetic LRA-style throughput benchmark, sequence lengths 256–4096. Higher throughput is faster. Successful measurements only.
Additional results · MNIST ablation study

FSKA retains accuracy with simpler projections. Learning V adds little in this experiment, while direct signed random Fourier features reduce accuracy.

Architectural choices on MNIST
ModelQ/KLearn VFlexible kernelPRFAccuracy
TransformerYesYesNo—0.8556
Transformer w/o QKVNoNoNo—0.5267
IKANYesYesYesNo0.8656
FSKANoNoYesYes0.8722
+ Direct RFFNoNoYesNo0.3956
+ Learnable VNoYesYesYes0.8725

The short presentation

The nine-slide deck follows the method from spectral features to linear aggregation, then presents sentence-classification results and efficiency measurements.

Presentation video

Watch on YouTube

Presentation slides

Open PDF · Download slides · 9 pages

Run the experiments

The repository provides the FSKA implementation and runnable configurations for three experiments.

The sentence classification table above reports mean and standard deviation over three runs from the poster. The repository defaults to five model seeds per experiment and fixes the data and split seed at 42.

See configurations and run instructions on GitHub

Cite this work

@inproceedings{yang2026fska,
  title = {Flow-based Spectral Kernel Learning for Nonstationary Attention},
  author = {Yang, Zi and Li, Ying and Lancho, Alejandro and Larese, Dar{\'i}o C. and Olmos, Pablo M. and Zhang, Michael Minyi},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026}
}