mlsanityData to 14 Oct 2026

Interpolation between Convolution and Attention via K-Nearest Neighbors

arXiv 2606.14725 ↗First posted 31 May 2026cs.CVcited by 0

Not on the map. Why?

Abstract (arXiv)

The shift from Convolutional Neural Networks to Transformers has reshaped computer vision, yet these two architectural families are typically viewed as fundamentally distinct. Convolutional Neural Networks are defined by spatially local convolution operations, while Transformers rely on global self-attention. We argue that convolution and self-attention, despite their apparent differences, can be unified within a single k-nearest neighbor aggregation framework. The critical insight is that both operations are special cases of neighbor selection and weighted aggregation. Convolution selects neighbors by spatial proximity while self-attention selects by feature similarity, revealing that they lie on a continuous spectrum rather than representing categorically different computations. We introduce Convolutional Nearest Neighbors (ConvNN), a unified framework that formalizes this connection. ConvNN exactly recovers standard and depthwise convolution by restricting neighbor selection to normalized spatial coordinates, and exactly recovers self-attention and its sparse variants, including KVT-attention, by replacing spatial proximity with scaled dot-product similarity. Beyond these special cases, ConvNN serves as a drop-in replacement for both convolution and attention layers, enabling systematic exploration of the intermediate spectrum between local and global aggregation through configurable similarity functions, neighbor selection strategies, positional encodings, and aggregation kernels.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 15 of its 66 references that are in the map. First posted on arXiv 31 May 2026.

Builds on

15 of 66 references.

References · 15

  1. 2014Adam: A Method for Stochastic Optimizationcited by 37,240
  2. 2014Very Deep Convolutional Networks for Large-Scale Image Recognitioncited by 15,364
  3. 2017mixup: Beyond Empirical Risk Minimizationcited by 5,183
  4. 2016SGDR: Stochastic Gradient Descent with Warm Restartscited by 5,045
  5. 2016Gaussian Error Linear Units (GELUs)cited by 3,502
  6. 2016Xception: Deep Learning with Depthwise Separable Convolutionscited by 2,332
  7. 2017Decoupled Weight Decay Regularizationcited by 1,831
  8. 2019Generating Long Sequences with Sparse Transformerscited by 1,546
  9. 2021Conditional Positional Encodings for Vision Transformerscited by 406
  10. 2016A guide to convolution arithmetic for deep learningcited by 185
  11. 2021RegionViT: Regional-to-Local Attention for Vision Transformerscited by 127
  12. 2021On the Connection between Local Attention and Dynamic Depth-wise Convolutioncited by 62
3 more
  1. 2024Towards noise contrastive estimation with soft targets for conditional modelscited by 5
  2. 2024Practical Aspects on Solving Differential Equations Using Deep Learning: A Primercited by 1
  3. 2024Local Attention Mechanism: Boosting the Transformer Architecture for Long-Sequence Time Series Forecastingcited by 1

Built on by

Not cited yet.