SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.11074 · ICML · 2023

Simple and Fast Group Robustness by Automatic Feature Reweighting

Pavel Izmailov, Andrew Wilson, Andres Potapczynski, Shikai Qiu, Gordon Wilson

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 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 0 have no contract verdict; 6 failures of our instrument; 3 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/2306.11074.json · badge: /api/ran/2306.11074.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
AndPotap/afr canonical (classifier label)
classifier basis: census
6 ran · 3 no recorded run
FunctionStatusWhere it lives
acc_and_f1 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
AndPotap/afr/gdro_fork/utils_glue.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from danrsc/bert_brain_neurips_2019, is pointer only (licence: NONE) · get_code("cac113ca87b9d9f3")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from danrsc/bert_brain_neurips_2019, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
AndPotap/afr/gdro_fork/utils.py
code served (permissive licence) · get_code("621de5dd9c62c06d")
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 list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type and ndim 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 torch.nn as nn

torch.manual_seed(0)

# Create small batch of output logits (batch_size=2, num_classes=4)
output = torch.randn(2, 4)

# Create small batch of target labels (batch_size=2)
target = torch.tensor([1, 3])

# Define topk parameter
topk = (1,)

ARGS = {
    "output": output,
    "target": target,
    "topk": topk
}
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 list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
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
conv3x3 Ran
ran; our contract draft was wrong, not the code
AndPotap/afr/models/preresnet.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from amerch/CIFAR100-Training, is pointer only (licence: NONE) · get_code("583f9780bdd00a45")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from amerch/CIFAR100-Training, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

convert_examples_to_features Ran
ran; our contract draft was wrong, not the code
AndPotap/afr/gdro_fork/utils_glue.py
code served (permissive licence) · get_code("c4c16e96906f44c1")
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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 logging

logging.basicConfig(level=logging.INFO)

class SimpleTokenizer:
    """Mock tokenizer for testing."""
    def __init__(self):
        self.vocab = {
            '[CLS]': 101,
            '[SEP]': 102,
            '[PAD]': 0,
            'hello': 1,
            'world': 2,
            'this': 3,
            'is': 4,
            'a': 5,
            'test': 6,
            'example': 7,
            'text': 8,
            'good': 9,
            'bad': 10,
        }
    
    def tokenize(self, text):
        """Tokenize text into tokens."""
        return text.lower().split()
    
    def convert_tokens_to_ids(self, tokens):
        """Convert tokens to IDs."""
        return [self.vocab.get(token, 1) for token in tokens]


class Example:
    """Simple example class."""
    def __init__(self, guid, text_a, text_b, label):
        self.guid = guid
        self.text_a = text_a
        self.text_b = text_b
        self.label = label


# Create simple examples
examples = [
    Example('1', 'hello world', 'this is test', 'good'),
    Example('2', 'example text', None, 'bad'),
]

# Create label list
label_list = ['good', 'bad']

# Create tokenizer
tokenizer = SimpleTokenizer()

# Set up ARGS
ARGS = {
    'examples': examples,
    'label_list': label_list,
    'max_seq_length': 32,
    'tokenizer': tokenizer,
    'output_mode': 'classification',
    'cls_token_at_end': False,
    'cls_token': '[CLS]',
    'cls_token_segment_id': 0,
    'sep_token': '[SEP]',
    'sep_token_extra': False,
    'pad_on_left': False,
    'pad_token': 0,
    'pad_token_segment_id': 0,
    'sequence_a_segment_id': 0,
    'sequence_b_segment_id': 1,
    'mask_padding_with_zero': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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
get_accs_for_epoch_across_batches Ran
ran; our contract draft was wrong, not the code
AndPotap/afr/gdro_fork/analysis_utils.py
code served (permissive licence) · get_code("381380e09fd105f8")
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 tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 pandas as pd

# Create a small DataFrame that matches the expected structure
# The function expects:
# - 'epoch' column
# - 'avg_acc_group:{group}' columns for each group
# - 'processed_data_count_group:{group}' columns for each group

n_groups = 3
n_rows = 4

data = {
    'epoch': [1, 1, 1, 2],
}

# Add accuracy and count columns for each group
for group in range(n_groups):
    data[f'avg_acc_group:{group}'] = np.random.rand(n_rows)
    data[f'processed_data_count_group:{group}'] = np.random.randint(10, 50, n_rows)

df = pd.DataFrame(data)

ARGS = {
    'df': df,
    'epoch': 1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
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
sanitize_df Ran
ran; our contract draft was wrong, not the code
AndPotap/afr/gdro_fork/analysis_utils.py
code served (permissive licence) · get_code("8a66892616008c7f")
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 DataFrame. 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 pandas as pd
import numpy as np

# Create a valid DataFrame with epoch and batch columns
# The function expects a df with at least 'epoch' and 'batch' columns
data = {
    'epoch': [0, 0, 0, 1, 1, 1, 2, 2],
    'batch': [0, 1, 2, 0, 1, 2, 0, 1],
    'loss': [0.5, 0.4, 0.3, 0.25, 0.2, 0.15, 0.1, 0.05]
}
df = pd.DataFrame(data)

ARGS = {
    'df': df
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
bert_pretrained Not yet run
unverified (harvested, no recorded run)
AndPotap/afr/models/text_models.py
code served (permissive licence) · get_code("360487ab4aafdda6")
How it ran

no invocation recorded.

load_log Not yet run
unverified (harvested, no recorded run)
AndPotap/afr/gdro_fork/analysis_utils.py
code served (permissive licence) · get_code("10e220982fed5f01")
How it ran

no invocation recorded.

simple_accuracy Not yet run
unverified (harvested, no recorded run)
AndPotap/afr/gdro_fork/utils_glue.py
code served (permissive licence) · get_code("3c241ecfe3749a6d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 8 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 1 the same month, 8 later) and 1 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
conv3x3 686 other papers
482 dated earlier, 6 the same month, 191 later, 7 same year, order not determinable · 31 only as an assembly brick
1406.2661 (2014-06)
Generative Adversarial Networks
1409.0575 (2014-09)
ImageNet Large Scale Visual Recognition Challenge
1412.6572 (2014-12)
Explaining and Harnessing Adversarial Examples
and 683 more not named here
simple_accuracy 59 other papers
46 dated earlier, 10 later, 3 same year, order not determinable
1506.05865 (2015-06)
LCSTS: A Large Scale Chinese Short Text Summarization Dataset
1509.01626 (2015-09)
Character-level Convolutional Networks for Text Classification *
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
and 56 more not named here
acc_and_f1 22 other papers
15 dated earlier, 5 later, 2 same year, order not determinable
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1905.12866 (2019-05)
Semantically Conditioned Dialog Response Generation via Hierarchical Disentangled Self-Attention
1908.09355 (2019-08)
Patient Knowledge Distillation for BERT Model Compression
and 19 more not named here
accuracy 6 other papers
1 dated earlier, 5 later
2302.02931 (2023-02)
Bitrate-Constrained DRO: Beyond Worst Case Robustness To Unknown Group Shifts
2309.06717 (2023-09)
Bias Amplification Enhances Minority Group Performance
2310.06161 (2023-10)
Mitigating Simplicity Bias in Deep Learning for Improved OOD Generalization and Robustness
and 3 more not named here
convert_examples_to_features 5 other papers
1 dated earlier, 4 later
2010.10418 (2020-10)
CONJNLI: Natural Language Inference Over Conjunctive Sentences
2309.06717 (2023-09)
Bias Amplification Enhances Minority Group Performance
2310.06161 (2023-10)
Mitigating Simplicity Bias in Deep Learning for Improved OOD Generalization and Robustness
and 2 more not named here
get_accs_for_epoch_across_batches 4 other papers
4 later
2310.06161 (2023-10)
Mitigating Simplicity Bias in Deep Learning for Improved OOD Generalization and Robustness
2312.03044 (2023-12)
REST: Enhancing Group Robustness in DNNs through Reweighted Sparse Training
2510.02818 (2025-10)
Mitigating Spurious Correlation via Distributionally Robust Learning with Hierarchical Ambiguity Sets
and 1 more not named here
load_log 4 other papers
4 later
2310.06161 (2023-10)
Mitigating Simplicity Bias in Deep Learning for Improved OOD Generalization and Robustness
2312.03044 (2023-12)
REST: Enhancing Group Robustness in DNNs through Reweighted Sparse Training
2510.02818 (2025-10)
Mitigating Spurious Correlation via Distributionally Robust Learning with Hierarchical Ambiguity Sets
and 1 more not named here
sanitize_df 4 other papers
4 later
2310.06161 (2023-10)
Mitigating Simplicity Bias in Deep Learning for Improved OOD Generalization and Robustness
2312.03044 (2023-12)
REST: Enhancing Group Robustness in DNNs through Reweighted Sparse Training
2510.02818 (2025-10)
Mitigating Spurious Correlation via Distributionally Robust Learning with Hierarchical Ambiguity Sets
and 1 more not named here

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

A major challenge to out-of-distribution generalization is reliance on spurious features -patterns that are predictive of the class label in the training data distribution, but not causally related to the target. Standard methods for reducing the reliance on spurious features typically assume that we know what the spurious feature is, which is rarely true in the real world. Methods that attempt to alleviate this limitation are complex, hard to tune, and lead to a significant computational overhead compared to standard training. In this paper, we propose Automatic Feature Reweighting (AFR), an extremely simple and fast method for updating the model to reduce the reliance on spurious features. AFR retrains the last layer of a standard ERM-trained base model with a weighted loss that emphasizes the examples where the ERM model predicts poorly, automatically upweighting the minority group without group labels. With this simple procedure, we improve upon the best reported results among competing methods trained without spurious attributes on several vision and natural language classification benchmarks, using only a fraction of their compute.

For agents

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

get_harvested_code_for_paper("2306.11074")
get_code_for_paper("2306.11074")
have("2306.11074")

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

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

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

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

Connect an agent — have() is free.