Learning Invariant Representations with a Nonparametric Nadaraya-Watson Head

Alan Q. Wang, Minh Nguyen, M. Sabuncu
2/12/2026

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Machine learning models will often fail when deployed in an environment with a data distribution that is different than the training distribution. When multiple environments are available during training, many methods exist that learn representations which are invariant across the different distributions, with the hope that these representations will be transportable to unseen domains. In this work, we present a nonparametric strategy for learning invariant representations based on the recently-proposed Nadaraya-Watson (NW) head. The NW head makes a prediction by comparing the learned representations of the query to the elements of a support set that consists of labeled data. We demonstrate that by manipulating the support set, one can encode different causal assumptions. In particular, restricting the support set to a single environment encourages the model to learn invariant features that do not depend on the environment. We present a causally-motivated setup for our modeling and training strategy and validate on three challenging real-world domain generalization tasks in computer vision.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wang2026learning,
  title  = {Learning Invariant Representations with a Nonparametric Nadaraya-Watson Head},
  author = {Alan Q. Wang and Minh Nguyen and M. Sabuncu},
  year   = {2026},
  eprint = {2309.13377},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2309.13377},
  journal = {NEURIPS 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2309.13377.svg)](https://codeofpaper.com/paper/2309.13377)

Discussion