SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.16390 · CVPR · 2023

Are Data-driven Explanations Robust against Out-of-distribution Data?

Xi Peng, Tang Li, Fengchun Qiao, Mengmeng Ma

arXiv · PDF · Open in the Atlas

Code that ran

2 of 2 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, 1 violated it and 0 have no contract verdict; 1 failure of our instrument; 0 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/2303.16390.json · badge: /api/ran/2303.16390.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
tangli-udel/DRE community
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
MixupLoss Ran
ran; our contract draft was wrong, not the code
tangli-udel/DRE/dre/mixuploss.py
code served (permissive licence) · get_code("0fe81972dad3604f")
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) and returned tuple. 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 torch.nn.functional as F
from captum.attr import LayerGradCam

torch.manual_seed(0)

# Build a minimal model that satisfies the function's usage
class MinimalLayer(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 8, kernel_size=3, padding=1)
    
    def forward(self, x):
        return self.conv(x)

class MinimalNetwork(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer4 = MinimalLayer()
    
    def forward(self, x):
        return self.layer4(x)

class MinimalNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.network = MinimalNetwork()
        self.classifier = nn.Linear(8 * 4 * 4, 3)
    
    def forward(self, x):
        # x shape: (batch, 3, 4, 4)
        features = self.network(x)  # (batch, 8, 4, 4)
        features_flat = features.view(features.size(0), -1)  # (batch, 128)
        out = self.classifier(features_flat)  # (batch, 3)
        return out

# Wrap model to have .module attribute (mimicking DataParallel)
class WrappedNet(nn.Module):
    def __init__(self, net):
        super().__init__()
        self.module = net
    
    def forward(self, x):
        return self.module(x)

# Create model
net = WrappedNet(MinimalNet())

# Create inputs and targets
batch_size = 2
num_classes = 3
inputs = torch.randn(batch_size, 3, 4, 4)
targets = torch.tensor([0, 1])

device = 'cpu'

ARGS = {
    'inputs': inputs,
    'targets': targets,
    'net': net,
    'num_classes': num_classes,
    'device': device
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
captum, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple 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
norm Ran
ran, violated the contract we drafted
tangli-udel/DRE/dre/mixuploss.py
code served (permissive licence) · get_code("2d1316f9f86a0471")
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 Tensor, ndim 4, dtype family float, shape (2, 4, 3, 5) 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

torch.manual_seed(0)

# The function expects a tensor x with shape (batch_size, channels, height, width)
# It computes min/max across spatial and channel dimensions per batch element,
# then normalizes accordingly.
# The reshaping to (batch_size, -1) and then unsqueeze operations suggest
# this is designed for 4D tensors (like images or feature maps)

x = torch.randn(2, 4, 3, 5)  # batch=2, channels=4, height=3, width=5

ARGS = {
    "x": x
}
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 Tensor, ndim 4, dtype family float, shape (2, 4, 3, 5) — shape (2, 4, 3, 5) 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

Also present in other papers' code

Of 2 samples lifted from this paper's linked repositories, 2 carry a function identity and 0 do not. Of the 2 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 2 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-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

As black-box models increasingly power high-stakes applications, a variety of data-driven explanation methods have been introduced. Meanwhile, machine learning models are constantly challenged by distributional shifts. A question naturally arises: Are data-driven explanations robust against out-of-distribution data? Our empirical results show that even though predict correctly, the model might still yield unreliable explanations under distributional shifts. How to develop robust explanations against out-of-distribution data? To address this problem, we propose an end-to-end model-agnostic learning framework Distributionally Robust Explanations (DRE). The key idea is, inspired by self-supervised learning, to fully utilizes the inter-distribution information to provide supervisory signals for the learning of explanations without human annotation. Can robust explanations benefit the model's generalization capability? We conduct extensive experiments on a wide range of tasks and data types, including classification and regression on image and scientific tabular data. Our results demonstrate that the proposed method significantly improves the model's performance in terms of explanation and prediction robustness against distributional shifts.

For agents

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

get_harvested_code_for_paper("2303.16390")
get_code_for_paper("2303.16390")
have("2303.16390")

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

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

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

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

Connect an agent — have() is free.