SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2112.12986 · ICLR · 2022

Is Importance Weighting Incompatible with Interpolating Classifiers?

Tatsunori Hashimoto, Ke Wang, Niladri Chatterji, Saminul Haque

arXiv · PDF · Open in the Atlas

Code that ran

3 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2112.12986.json · badge: /api/ran/2112.12986.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
keawang/importance-weighting-interpolating-classifiers canonical (classifier label)
classifier basis not recorded on the link
3 ran · 2 no recorded run
FunctionStatusWhere it lives
size_to_int Ran
ran on a synthesized input
keawang/importance-weighting-interpolating-classifiers/src/architectures/simple_models.py
code served (permissive licence) · get_code("e800928d4f822a38")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from collections.abc import Iterable
from typing import Union

Size = Union[int, tuple]

# Test case 1: int input
arg1 = 5

# Test case 2: tuple input with single element
arg2 = (10,)

# Test case 3: list input (iterable) with single element
arg3 = [7]

ARGS = {
    "size": arg1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
subsample_groups Ran
ran on a synthesized input
keawang/importance-weighting-interpolating-classifiers/src/pl_datamodules/celeba_datamodule.py
code served (permissive licence) · get_code("e6e8883a68fd5457")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Subset. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import torch
from torch.utils.data import Dataset

torch.manual_seed(0)

# Create a minimal dataset class with the required attributes
class SimpleDataset(Dataset):
    def __init__(self, size=10, num_groups=3):
        self.size = size
        self.num_groups = num_groups
        # Create group_array with groups 0, 1, 2
        self.group_array = np.array([i % num_groups for i in range(size)])
        # Create y_array with labels
        self.y_array = np.array([i for i in range(size)])
        # Create some dummy data
        self.data = np.random.randn(size, 4)
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        return self.data[idx], self.y_array[idx]

# Construct the dataset
dataset = SimpleDataset(size=12, num_groups=3)

# new_group_sizes should specify how many samples to keep from each group
# We have 3 groups with 4 samples each, so we can subsample to 2 from each
new_group_sizes = [2, 2, 2]

# seed for reproducibility
seed = 42

ARGS = {
    "dataset": dataset,
    "new_group_sizes": new_group_sizes,
    "seed": seed
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Subset — a Subset output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
undersampling_schedule Ran
ran on a synthesized input
keawang/importance-weighting-interpolating-classifiers/src/datasets/utils.py
code served (permissive licence) · get_code("de524736ca317085")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned generator. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create a small weights tensor
weights = torch.tensor([0.1, 0.5, 0.8, 0.3], dtype=torch.float32)

# Define parameters
T = 5
annealing_fn = 'linear'
annealing_params = (2.0,)  # c parameter for sigmoid case

ARGS = {
    'weights': weights,
    'T': T,
    'annealing_fn': annealing_fn,
    'annealing_params': annealing_params
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type generator — a generator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a generator output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_transforms_list Not yet run
unverified (harvested, no recorded run)
keawang/importance-weighting-interpolating-classifiers/src/pl_datamodules/celeba_datamodule.py
code served (permissive licence) · get_code("c946a1ff1f518dd9")
How it ran

no invocation recorded.

split_dataset Not yet run
unverified (harvested, no recorded run)
keawang/importance-weighting-interpolating-classifiers/src/datasets/utils.py
code served (permissive licence) · get_code("47d36c87f2335145")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 5 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 5 later) and 0 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
get_transforms_list 1 other paper
1 later
2205.13094 (2022-05)
Undersampling is a Minimax Optimal Robustness Intervention in Nonparametric Classification
size_to_int 1 other paper
1 later
2205.13094 (2022-05)
Undersampling is a Minimax Optimal Robustness Intervention in Nonparametric Classification
split_dataset 1 other paper
1 later
2205.13094 (2022-05)
Undersampling is a Minimax Optimal Robustness Intervention in Nonparametric Classification
subsample_groups 1 other paper
1 later
2205.13094 (2022-05)
Undersampling is a Minimax Optimal Robustness Intervention in Nonparametric Classification
undersampling_schedule 1 other paper
1 later
2205.13094 (2022-05)
Undersampling is a Minimax Optimal Robustness Intervention in Nonparametric Classification

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Importance weighting is a classic technique to handle distribution shifts. However, prior work has presented strong empirical and theoretical evidence demonstrating that importance weights can have little to no effect on overparameterized neural networks. Is importance weighting truly incompatible with the training of overparameterized neural networks? Our paper answers this in the negative. We show that importance weighting fails not because of the overparameterization, but instead, as a result of using exponentially-tailed losses like the logistic or cross-entropy loss. As a remedy, we show that polynomially-tailed losses restore the effects of importance reweighting in correcting distribution shift in overparameterized models. We characterize the behavior of gradient descent on importance weighted polynomially-tailed losses with overparameterized linear models, and theoretically demonstrate the advantage of using polynomially-tailed losses in a label shift setting. Surprisingly, our theory shows that using weights that are obtained by exponentiating the classical unbiased importance weights can improve performance. Finally, we demonstrate the practical value of our analysis with neural network experiments on a subpopulation shift and a label shift dataset. When reweighted, our loss function can outperform reweighted cross-entropy by as much as 9% in test accuracy. Our loss function also gives test accuracies comparable to, or even exceeding, well-tuned state-of-the-art methods for correcting distribution shifts. * Equal contribution.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2112.12986")
get_code_for_paper("2112.12986")
have("2112.12986")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2112.12986.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2112.12986.svg)](https://syntology.ai/paper/2112.12986)

Connect an agent — have() is free.