SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.20078 · ICLR · 2024

Negative Label Guided OOD Detection with Pretrained Vision-Language Models

Bo Han, Feng Liu, Tongliang Liu, Feng Zheng, Hong Chen, Zhen Fang, Xue Jiang

arXiv · PDF · Open in the Atlas

Code that ran

9 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; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 0 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/2403.20078.json · badge: /api/ran/2403.20078.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
tmlr-group/NegLabel canonical (classifier label)
classifier basis: census
8 ran · 0 no recorded run
ma-kjh/CMA-OoDD community
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
annealing_cos Ran
ran, honoured the contract we drafted
tmlr-group/NegLabel/mmcls/core/hook/lr_updater.py
code served (permissive licence) · get_code("9d9b0c55c72acf25")
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 float, ndim 0, dtype family float, 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.

from math import cos, pi

# Construct arguments for annealing_cos function
ARGS = {
    'start': 0.1,
    'end': 0.001,
    'factor': 0.5,
    'weight': 1.0
}
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 float, ndim 0, dtype family float, 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
average_performance Ran
ran, honoured the contract we drafted
tmlr-group/NegLabel/mmcls/core/evaluation/multilabel_eval_metrics.py
code served (permissive licence) · get_code("ba5c9a7d1e9798a4")
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 torch
import numpy as np

torch.manual_seed(0)

# Create small tensors for testing
# pred shape: (N, C) where N=2 samples, C=4 classes
# Values between 0 and 1 for confidence scores
pred = torch.tensor([
    [0.9, 0.1, 0.8, 0.2],
    [0.3, 0.7, 0.4, 0.6]
], dtype=torch.float32)

# target shape: (N, C) where N=2 samples, C=4 classes
# Values are 0 (negative), 1 (positive), or -1 (difficult)
target = torch.tensor([
    [1, 0, 1, 0],
    [0, 1, 0, 1]
], dtype=torch.float32)

ARGS = {
    'pred': pred,
    'target': target,
    'thr': 0.5,
    'k': None
}
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 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
average_precision Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tmlr-group/NegLabel/mmcls/core/evaluation/mean_ap.py
code served (permissive licence) · get_code("84f39870fe2090bf")
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 float64, ndim 0, 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

# Set random seed for reproducibility
np.random.seed(0)

# Create sample prediction and target arrays
# pred: model predictions (confidence scores between 0 and 1)
# target: ground truth labels (1 for positive, 0 for negative, -1 for ignored)
pred = np.array([0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2], dtype=np.float32)
target = np.array([1, 1, 0, 1, 0, 0, 1, -1], dtype=np.int32)

ARGS = {
    "pred": pred,
    "target": target,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
calculate_confusion_matrix Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tmlr-group/NegLabel/mmcls/core/evaluation/eval_metrics.py
code served (permissive licence) · get_code("7aa2a71e9cdafd0a")
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 2, dtype family int, shape (4, 4) 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
import numpy as np

torch.manual_seed(0)

# Create sample predictions and targets
# pred: shape (N, C) where N=2 samples, C=4 classes
# Predictions are logits/probabilities
pred = torch.randn(2, 4)

# target: shape (N,) or (N, 1) with class labels
target = torch.tensor([1, 3])

ARGS = {
    'pred': pred,
    'target': target
}
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 Tensor, ndim 2, dtype family int, shape (4, 4) — shape (4, 4) 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
concatenate_and_scale Ran
ran; our contract draft was wrong, not the code
ma-kjh/CMA-OoDD/inference.py
pointer only (licence: NONE) · get_code("0e9e0f266b072182")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ma-kjh/CMA-OoDD 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.

mAP Ran
ran, honoured the contract we drafted
tmlr-group/NegLabel/mmcls/core/evaluation/mean_ap.py
code served (permissive licence) · get_code("3246acca1a5877de")
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 float64, ndim 0, 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 torch

torch.manual_seed(0)

# Create small sample data
# pred: model predictions with shape (N, C) where N=2 samples, C=4 classes
pred = torch.tensor([
    [0.9, 0.1, 0.8, 0.2],
    [0.7, 0.6, 0.3, 0.9]
], dtype=torch.float32)

# target: ground truth labels with shape (N, C)
# 1 = positive, 0 = negative, -1 = difficult (ignored)
target = torch.tensor([
    [1, 0, 1, -1],
    [1, 1, 0, 1]
], dtype=torch.float32)

ARGS = {
    'pred': pred,
    'target': target
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
precision Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tmlr-group/NegLabel/mmcls/core/evaluation/eval_metrics.py
code served (permissive licence) · get_code("8555810d566238b0")
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 float, ndim 0, dtype family float, 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
import numpy as np
from numbers import Number

torch.manual_seed(0)

# Create small test data
# pred: shape (N, C) - N samples, C classes
# For a multi-class classification task with 2 samples and 4 classes
pred_tensor = torch.tensor([
    [0.9, 0.1, 0.05, 0.02],
    [0.1, 0.8, 0.05, 0.03]
], dtype=torch.float32)

# target: shape (N,) or (N, 1) - class labels for each sample
target_tensor = torch.tensor([0, 1], dtype=torch.long)

ARGS = {
    'pred': pred_tensor,
    'target': target_tensor,
    'average_mode': 'macro',
    'thrs': 0.0
}
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 float, ndim 0, dtype family float, 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
precision_recall_f1 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tmlr-group/NegLabel/mmcls/core/evaluation/eval_metrics.py
code served (permissive licence) · get_code("3b86f0a822461cbf")
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 torch
import numpy as np
from numbers import Number

torch.manual_seed(0)

# Create sample predictions and targets
# pred shape: (N, C) where N=2 samples, C=4 classes
pred = torch.tensor([
    [0.9, 0.1, 0.2, 0.3],
    [0.2, 0.8, 0.1, 0.4]
], dtype=torch.float32)

# target shape: (N,) with class indices
target = torch.tensor([0, 1], dtype=torch.long)

ARGS = {
    'pred': pred,
    'target': target,
    'average_mode': 'macro',
    'thrs': 0.0
}
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 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
scaled_all_reduce Ran
ran; our contract draft was wrong, not the code
tmlr-group/NegLabel/mmcls/core/hook/precise_bn_hook.py
code served (permissive licence) · get_code("84b0ff113e7a1efe")
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. 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.functional import Tensor
from typing import List

torch.manual_seed(0)

# Create a list of small tensors for testing
tensor1 = torch.randn(2, 4)
tensor2 = torch.randn(3, 4)

# Define ARGS mapping all parameters
ARGS = {
    "tensors": [tensor1, tensor2],
    "num_gpus": 1
}
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 — a list 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

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, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 later) and 7 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
annealing_cos 2 other papers
1 dated earlier, 1 later
2204.12440 (2022-04)
Neuro-BERT: Rethinking Masked Autoencoding for Self-supervised Neurological Pretraining
2407.07805 (2024-07)
SUMix: Mixup with Semantic and Uncertain Information
scaled_all_reduce 1 other paper
1 dated earlier
2204.12440 (2022-04)
Neuro-BERT: Rethinking Masked Autoencoding for Self-supervised Neurological Pretraining

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

Out-of-distribution (OOD) detection aims at identifying samples from unknown classes, playing a crucial role in trustworthy models against errors on unexpected inputs. Extensive research has been dedicated to exploring OOD detection in the vision modality. Vision-language models (VLMs) can leverage both textual and visual information for various multi-modal applications, whereas few OOD detection methods take into account information from the text modality. In this paper, we propose a novel post hoc OOD detection method, called NegLabel, which takes a vast number of negative labels from extensive corpus databases. We design a novel scheme for the OOD score collaborated with negative labels. Theoretical analysis helps to understand the mechanism of negative labels. Extensive experiments demonstrate that our method NegLabel achieves state-ofthe-art performance on various OOD detection benchmarks and generalizes well on multiple VLM architectures. Furthermore, our method NegLabel exhibits remarkable robustness against diverse domain shifts. The codes are available at https://github.com/tmlr-group/NegLabel.

For agents

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

get_harvested_code_for_paper("2403.20078")
get_code_for_paper("2403.20078")
have("2403.20078")

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

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

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

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

Connect an agent — have() is free.