Papers › Nearness of Neighbors Attention for Regression in Supervised Finetuning

Nearness of Neighbors Attention for Regression in Supervised Finetuning

9 Jun 2025arXiv:2506.08139archive 2025-07-28

Aviad Susman, Mayte Suárez-Fariñas, Joseph T Colonel

It is common in supervised machine learning to combine the feature extraction capabilities of neural networks with the predictive power of traditional algorithms, such as k-nearest neighbors (k-NN) or support vector machines. This procedure involves performing supervised fine-tuning (SFT) on a domain-appropriate feature extractor, followed by training a traditional predictor on the resulting SFT embeddings. When used in this manner, traditional predictors often deliver increased performance over the SFT model itself, despite the fine-tuned feature extractor yielding embeddings specifically optimized for prediction by the neural network's final dense layer. This suggests that directly incorporating traditional algorithms into SFT as prediction layers may further improve performance. However, many traditional algorithms have not been implemented as neural network layers due to their non-differentiable nature and their unique optimization requirements. As a step towards solving this problem, we introduce the Nearness of Neighbors Attention (NONA) regression layer. NONA uses the mechanics of neural network attention and a novel learned attention-masking scheme to yield a differentiable proxy of the k-NN regression algorithm. Results on multiple unstructured datasets show improved performance over both dense layer prediction and k-NN on SFT embeddings for regression.

PaperPDFCode

Code

aviadsusman/nona_anon officialmentioned in paperpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

Not run by Syntology. Nothing on this page verifies that the listed code works.

Tasks

Predictionregression

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

AttentionSFTSoftmaxk-NN

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections