paper-with-me

홈 › Papers

Analyzing and Improving Representations with the Soft Nearest Neighbor Loss

2019-02-05 · Nicholas Frosst, Nicolas Papernot, Geoffrey Hinton

We explore and expand the $\textit{Soft Nearest Neighbor Loss}$ to measure the $\textit{entanglement}$ of class manifolds in representation space: i.e., how close pairs of points from the same class are relative to pairs of points from different classes. We demonstrate several use cases of the loss. As an analytical tool, it provides insights into the evolution of class similarity structures during learning. Surprisingly, we find that $\textit{maximizing}$ the entanglement of representations of different classes in the hidden layers is beneficial for discrimination in the final layer, possibly because it encourages representations to identify class-independent similarity structures. Maximizing the soft nearest neighbor loss in the hidden layers leads not only to improved generalization but also to better-calibrated estimates of uncertainty on outlier data. Data that is not from the training distribution can be recognized by observing that in the hidden layers, it has fewer than the normal number of neighbors from the predicted class.

📄 PDF Abstract BibTeX arXiv:1902.01889

Code (6)

MindSpore-scientific/code-14/tree/main/the-Soft-Nearest-Neighbor-Loss mindspore
RheaChowers/SNNL-pytorch pytorch
gaudelbijay/SNNL-Loss tf
pwc-1/Paper-9/tree/main/4/the-Soft-Nearest-Neighbor-Loss mindspore
vimarshc/fastai_experiments tf
https://gitlab.com/afagarap/pt-snnl pytorch

Tasks

Classification

Similar Papers 제목 키워드 기반

Lost in Embeddings: Information Loss in Vision-Language Models

2025-09-15 · Wenyan Li, Raphael Tang, Chengzu Li, Caiqi Zhang 외 arxiv

Vision--language models (VLMs) often process visual inputs through a pretrained vision encoder, followed by a projection into the language model's embedding space via a connector component. While crucial for modality fus…

One-Layer Transformer Provably Learns One-Nearest Neighbor In Context

2024-11-16 · Zihao Li, Yuan Cao, Cheng Gao, Yihan He 외

Transformers have achieved great success in recent years. Interestingly, transformers have shown particularly strong in-context learning capability -- even without fine-tuning, they are still able to solve unseen tasks w…

In-Context Learning

SOAR: Improved Indexing for Approximate Nearest Neighbor Search

2024-03-31 · NeurIPS 2023 11 · Philip Sun, David Simcha, Dave Dopson, Ruiqi Guo 외

This paper introduces SOAR: Spilling with Orthogonality-Amplified Residuals, a novel data indexing technique for approximate nearest neighbor (ANN) search. SOAR extends upon previous approaches to ANN search, such as spi…

Mixture of Experts with Soft Nearest Neighbor Loss: Resolving Expert Collapse via Representation Disentanglement

2026-03-20 · Abien Fred Agarap, Arnulfo P. Azcarraga arxiv

The Mixture-of-Experts (MoE) model uses a set of expert networks that specialize on subsets of a dataset under the supervision of a gating network. A common issue in MoE architectures is ``expert collapse'' where overlap…

Image Classification

With a Little Help from My Friends: Nearest-Neighbor Contrastive Learning of Visual Representations

2021-04-29 · ICCV 2021 10 · Debidatta Dwibedi, Yusuf Aytar, Jonathan Tompson, Pierre Sermanet 외

Self-supervised learning algorithms based on instance discrimination train encoders to be invariant to pre-defined transformations of the same instance. While most methods treat different views of the same image as posit…

Contrastive LearningFine-Grained Image ClassificationImage ClassificationSelf-Supervised Image Classification+3