SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2302.10289 · ICML · 2023

Tackling Shortcut Learning in Deep Neural Networks: An Iterative Approach with Interpretable Models

Ke Yu, Kayhan Batmanghelich, Shantanu Ghosh, Forough Arabshahi

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-22; 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/2302.10289.json · badge: /api/ran/2302.10289.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
batmanlab/ICML-2023-Route-interpret-repeat marked official in Papers with Code
Papers with Code archive
4 ran · 2 no recorded run
FunctionStatusWhere it lives
Conceptizator Ran
ran on a synthesized input · constructed an object; no result was computed
batmanlab/ICML-2023-Route-interpret-repeat/src/codebase/Explainer/models/Gated_Logic_Net.py
code served (permissive licence) · get_code("a46486dd14aec8fe")
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 an instance of its own class, Conceptizator: the run constructed the object and did not call it, so no result was computed. 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
from torch import nn

torch.manual_seed(0)

ARGS = {
    'activation': 'sigmoid'
}
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 Conceptizator — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Conceptizator 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
EntropyLinear Ran
ran on a synthesized input · constructed an object; no result was computed
batmanlab/ICML-2023-Route-interpret-repeat/src/codebase/Explainer/models/Gated_Logic_Net.py
code served (permissive licence) · get_code("74c85a622b33033a")
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 an instance of its own class, EntropyLinear: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn
import math

torch.manual_seed(0)

# Define identity function that may be referenced
def identity(x):
    return x

# Build ARGS dictionary with all parameters for EntropyLinear
ARGS = {
    'in_features': 4,
    'out_features': 3,
    'n_classes': 2,
    'temperature': 0.6,
    'bias': True,
    'conceptizator': 'identity_bool'
}
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 EntropyLinear — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a EntropyLinear 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
Explainer Ran
ran on a synthesized input · constructed an object; no result was computed
batmanlab/ICML-2023-Route-interpret-repeat/src/codebase/Explainer/models/Gated_Logic_Net.py
code served (permissive licence) · get_code("1811ff5c9672a4f8")
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 an instance of its own class, Explainer: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn
import math

torch.manual_seed(0)

def identity(x):
    return x

class Conceptizator(nn.Module):
    """Saves the encoding for input concepts.
    """

    def __init__(self, activation: str='sigmoid') -> None:
        super(Conceptizator, self).__init__()
        self.concepts = None
        self.activation_name = activation
        self.activation = torch.sigmoid
        if self.activation_name == 'sigmoid':
            self.activation = torch.sigmoid
            self.threshold = 0.5
        if self.activation_name == 'relu':
            self.activation = torch.relu
            self.threshold = 0.0
        if self.activation_name == 'leaky_relu':
            self.activation = torch.nn.functional.leaky_relu
            self.threshold = 0.0
        if self.activation_name == 'identity':
            self.activation = identity
            self.threshold = 0.0
        if self.activation_name == 'identity_bool':
            self.activation = identity
            self.threshold = 0.5

    def forward(self, input: torch.Tensor) -> torch.Tensor:
        self.concepts = self.activation(input)
        return self.concepts

    def extra_repr(self) -> str:
        return 'activation={}, threshold={}'.format(self.activation_name, self.threshold)

class EntropyLinear(nn.Module):
    """Applies a linear transformation to the incoming data: :math:`y = xA^T + b`
    """

    def __init__(self, in_features: int, out_features: int, n_classes: int, temperature: float=0.6, bias: bool=True, conceptizator: str='identity_bool') -> None:
        super(EntropyLinear, self).__init__()
        self.in_features = in_features
        self.out_features = out_features
        self.n_classes = n_classes
        self.temperature = temperature
        self.conceptizator = Conceptizator(conceptizator)
        self.alpha = None
        self.weight = nn.Parameter(torch.Tensor(n_classes, out_features, in_features))
        if bias:
            self.bias = nn.Parameter(torch.Tensor(n_classes, 1, out_features))
        else:
            self.register_parameter('bias', None)
        self.reset_parameters()

    def reset_parameters(self) -> None:
        nn.init.kaiming_uniform_(self.weight, a=math.sqrt(5))
        if self.bias is not None:
            fan_in, _ = nn.init._calculate_fan_in_and_fan_out(self.weight)
            bound = 1 / math.sqrt(fan_in)
            nn.init.uniform_(self.bias, -bound, bound)

    def forward(self, input: torch.Tensor) -> torch.Tensor:
        if len(input.shape) == 2:
            input = input.unsqueeze(0)
        self.conceptizator.concepts = input
        gamma = self.weight.norm(dim=1, p=1)
        self.alpha = torch.exp(gamma / self.temperature) / torch.sum(torch.exp(gamma / self.temperature), dim=1, keepdim=True)
        self.alpha_norm = self.alpha / self.alpha.max(dim=1)[0].unsqueeze(1)
        self.concept_mask = self.alpha_norm > 0.5
        x = input.multiply(self.alpha_norm.unsqueeze(1))
        x = x.matmul(self.weight.permute(0, 2, 1)) + self.bias
        return x.permute(1, 0, 2)

    def extra_repr(self) -> str:
        return 'in_features={}, out_features={}, n_classes={}'.format(self.in_features, self.out_features, self.n_classes)

class Explainer(nn.Module):

    def __init__(self, n_concepts, n_classes, explainer_hidden, conceptizator, temperature):
        super(Explainer, self).__init__()
        self.model_layers = []
        self.model_layers.append(EntropyLinear(n_concepts, explainer_hidden[0], n_classes, temperature, conceptizator=conceptizator))
        self.model_layers.append(torch.nn.LeakyReLU())
        for i in range(1, len(explainer_hidden)):
            self.model_layers.append(torch.nn.Linear(explainer_hidden[i - 1], explainer_hidden[i]))
            self.model_layers.append(torch.nn.LeakyReLU())
        self.model_layers.append(torch.nn.Linear(explainer_hidden[-1], 1))
        self.model = torch.nn.Sequential(*self.model_layers)

    def forward(self, x):
        y_out = self.model(x).squeeze(-1)
        return y_out

ARGS = {
    'n_concepts': 4,
    'n_classes': 3,
    'explainer_hidden': [8, 6],
    'conceptizator': 'identity_bool',
    'temperature': 0.6,
}
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 Explainer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Explainer 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_device Ran
ran on a synthesized input
batmanlab/ICML-2023-Route-interpret-repeat/src/codebase/Explainer/models/Gated_Logic_Net.py
code served (permissive licence) · get_code("62701de75737b698")
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 device. 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 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

torch.manual_seed(0)

# The function get_device() takes no parameters
ARGS = {}
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 device — a device output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a device 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
Gated_Logic_Net Not yet run
unverified (harvested, no recorded run)
batmanlab/ICML-2023-Route-interpret-repeat/src/codebase/Explainer/models/Gated_Logic_Net.py
code served (permissive licence) · get_code("b4d2aff01e9dca4e")
How it ran

no invocation recorded.

test Not yet run
unverified (harvested, no recorded run)
batmanlab/ICML-2023-Route-interpret-repeat/src/codebase/Explainer/models/Gated_Logic_Net.py
code served (permissive licence) · get_code("bfbd35755954072a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 6 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.

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-22.

Repositories linked to this paper

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

Abstract

We use concept-based interpretable models to mitigate shortcut learning. Existing methods lack interpretability. Beginning with a Blackbox, we iteratively carve out a mixture of interpretable experts (MoIE) and a residual network. Each expert explains a subset of data using First Order Logic (FOL). While explaining a sample, the FOL from biased BB-derived MoIE detects the shortcut effectively. Finetuning the BB with Metadata Normalization (MDN) eliminates the shortcut. The FOLs from the finetuned-BB-derived MoIE verify the elimination of the shortcut. Our experiments show that MoIE does not hurt the accuracy of the original BB and eliminates shortcuts effectively.

For agents

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

get_harvested_code_for_paper("2302.10289")
get_code_for_paper("2302.10289")
have("2302.10289")

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

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

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

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

Connect an agent — have() is free.