SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2111.12933 · 2021

ML-Decoder: Scalable and Versatile Classification Head

arXiv · PDF · Open in the Atlas

Code that ran

4 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 2 have no contract verdict; 2 failures of our instrument; 1 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/2111.12933.json · badge: /api/ran/2111.12933.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
alibaba-miil/ml_decoder canonical (classifier label)
classifier basis not recorded on the link
4 ran · 1 no recorded run
FunctionStatusWhere it lives
average_precision Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
alibaba-miil/ml_decoder/src_files/helper_functions/helper_functions.py
pointer only (licence: MIT); the stored copy get_code serves, from kjmillerCURIS/SPARC, is pointer only (licence: NONE) · get_code("f52b226226096fdd")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from kjmillerCURIS/SPARC, 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.

conv2d Ran
ran; our contract draft was wrong, not the code
alibaba-miil/ml_decoder/src_files/models/tresnet/tresnet.py
code served (permissive licence) · get_code("ad1cabd96edaffc7")
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 Sequential. 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

torch.manual_seed(0)

ARGS = {
    "ni": 3,
    "nf": 16,
    "stride": 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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
mAP Ran
ran on a synthesized input
alibaba-miil/ml_decoder/src_files/helper_functions/helper_functions.py
code served (permissive licence) · get_code("0759c5625039d127")
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

# Create small test data
# The function expects:
# - targs: array of shape (num_samples, num_classes) with binary targets (0 or 1)
# - preds: array of shape (num_samples, num_classes) with prediction scores

num_samples = 2
num_classes = 4

# Create target labels (binary: 0 or 1)
targs = np.array([
    [1, 0, 1, 0],
    [0, 1, 1, 0]
], dtype=np.float32)

# Create prediction scores (should be in range [0, 1] typically)
preds = np.array([
    [0.9, 0.2, 0.8, 0.1],
    [0.3, 0.7, 0.6, 0.4]
], dtype=np.float32)

ARGS = {
    "targs": targs,
    "preds": preds
}
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
parse_args Ran
ran on a synthesized input
alibaba-miil/ml_decoder/src_files/helper_functions/helper_functions.py
code served (permissive licence) · get_code("14016c70fb929ac2")
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 Namespace. 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 argparse

torch_manual_seed = __import__('torch').manual_seed(0)

parser = argparse.ArgumentParser(description='Test parser')
parser.add_argument('--name', type=str, default='test')
parser.add_argument('--count', type=int, default=42)
parser.add_argument('--flag', action='store_true')

ARGS = {
    'parser': parser
}
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
create_model Not yet run
unverified (harvested, no recorded run)
alibaba-miil/ml_decoder/src_files/models/utils/factory.py
code served (permissive licence) · get_code("54592dfdb8ffa941")
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, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 3 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
average_precision 7 other papers
1 dated earlier, 6 later
2009.14119 (2020-09)
Asymmetric Loss For Multi-Label Classification
2112.07368 (2021-12)
Simple and Robust Loss Design for Multi-Label Learning with Missing Labels
and 4 more not named here
conv2d 3 other papers
1 dated earlier, 2 later
2009.14119 (2020-09)
Asymmetric Loss For Multi-Label Classification
2403.07603 (2024-03)
ProPML: Probability Partial Multi-label Learning
2403.12559 (2024-03)
Confidence Self-Calibration for Multi-Label Class-Incremental Learning
mAP 3 other papers
1 dated earlier, 2 later
2009.14119 (2020-09)
Asymmetric Loss For Multi-Label Classification
2112.07368 (2021-12)
Simple and Robust Loss Design for Multi-Label Learning with Missing Labels
parse_args 2 other papers
2 dated earlier
1506.08909 (2015-06)
The Ubuntu Dialogue Corpus: A Large Dataset for Research in Unstructured Multi-Turn Dialogue Systems
1909.05316 (2019-09)
What Makes A Good Story? Designing Composite Rewards for Visual Storytelling

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

In this paper, we introduce ML-Decoder, a new attention-based classification head. ML-Decoder predicts the existence of class labels via queries, and enables better utilization of spatial data compared to global average pooling. By redesigning the decoder architecture, and using a novel group-decoding scheme, ML-Decoder is highly efficient, and can scale well to thousands of classes. Compared to using a larger backbone, ML-Decoder consistently provides a better speed-accuracy trade-off. ML-Decoder is also versatile - it can be used as a drop-in replacement for various classification heads, and generalize to unseen classes when operated with word queries. Novel query augmentations further improve its generalization ability. Using ML-Decoder, we achieve state-of-the-art results on several classification tasks: on MS-COCO multi-label, we reach 91.4% mAP; on NUS-WIDE zero-shot, we reach 31.1% ZSL mAP; and on ImageNet single-label, we reach with vanilla ResNet50 backbone a new top score of 80.7%, without extra data or distillation. Public code is available at: https://github.com/Alibaba-MIIL/ML_Decoder

For agents

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

get_harvested_code_for_paper("2111.12933")
get_code_for_paper("2111.12933")
have("2111.12933")

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

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

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

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

Connect an agent — have() is free.