SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.03298 · 2021

End-to-End Supermask Pruning: Learning to Prune Image Captioning Models

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 (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 2 have no contract verdict; 1 failure of our instrument; 2 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/2110.03298.json · badge: /api/ran/2110.03298.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
jiahuei/sparse-image-captioning canonical (classifier label)
classifier basis not recorded on the link
4 ran · 2 no recorded run
FunctionStatusWhere it lives
clones Ran
ran; our contract draft was wrong, not the code
jiahuei/sparse-image-captioning/sparse_caption/utils/model_utils.py
code served (permissive licence) · get_code("1535ade78e8d6274")
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 ModuleList. 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
from copy import deepcopy

torch.manual_seed(0)

# Create a simple module to be cloned
module = nn.Linear(4, 3)

# Define arguments for the clones function
ARGS = {
    "module": module,
    "N": 5
}
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 ModuleList — a ModuleList output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModuleList 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
register_tokenizer Ran
ran on a synthesized input
jiahuei/sparse-image-captioning/sparse_caption/tokenizer.py
code served (permissive licence) · get_code("51e50297a7cc524a")
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 function. 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
from typing import List

# Create a minimal concrete Tokenizer implementation for testing
class SimpleTokenizer:
    def __init__(self):
        self._vocab = {
            '<bos>': 0,
            '<eos>': 1,
            '<unk>': 2,
            '<pad>': 3,
            '<mask>': 4,
            'hello': 5,
            'world': 6,
        }
    
    def __len__(self):
        return len(self._vocab)
    
    def encode(self, input_str: str, add_bos_eos: bool=True, max_seq_length: int=16, sampling=False) -> List[int]:
        return [0, 5, 6, 1]
    
    def encode_tokenized(self, input_list: List[str], add_bos_eos: bool=True, max_seq_length: int=16) -> List[int]:
        return [0, 5, 6, 1]
    
    def decode(self, input_ids: List[int]) -> str:
        return "hello world"
    
    def tokenize(self, input_str: str):
        from typing import NamedTuple
        class Token(NamedTuple):
            value: str
            start: int
            end: int
        return [Token("hello", 0, 5), Token("world", 6, 11)]
    
    def token_to_id(self, token):
        return self._vocab.get(token, 2)
    
    def id_to_token(self, token_id):
        for token, tid in self._vocab.items():
            if tid == token_id:
                return token
        return '<unk>'
    
    @property
    def bos_token_id(self):
        return 0
    
    @property
    def eos_token_id(self):
        return 1
    
    @property
    def unk_token_id(self):
        return 2
    
    @property
    def pad_token_id(self):
        return 3
    
    @property
    def mask_token_id(self):
        return 4


# The register_tokenizer function takes one parameter: name (str)
ARGS = {
    'name': 'MyCustomTokenizer'
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
repeat_tensors Ran
ran on a synthesized input
jiahuei/sparse-image-captioning/sparse_caption/utils/model_utils.py
code served (permissive licence) · get_code("9620631b06fe8585")
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 float, shape (6, 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

torch.manual_seed(0)

# Test case 1: Simple tensor
tensor_simple = torch.randn(2, 4)

# Test case 2: Nested list of tensors
tensor_list = [torch.randn(2, 4), torch.randn(2, 3)]

# Test case 3: Tuple of tensors
tensor_tuple = (torch.randn(2, 4), torch.randn(2, 5))

# Test case 4: Mixed nested structure
mixed_structure = [torch.randn(2, 4), (torch.randn(2, 3), torch.randn(2, 6))]

ARGS = {
    "n": 3,
    "x": tensor_simple,
    "dim": 0
}
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 2, dtype family float, shape (6, 4) — shape (6, 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
split_tensors Ran
ran, violated the contract we drafted
jiahuei/sparse-image-captioning/sparse_caption/utils/model_utils.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from cuhksz-nlp/R2Gen, is pointer only (licence: NONE) · get_code("936178513bc7b9d7")
How it ran

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

get_tokenizer Not yet run
unverified (harvested, no recorded run)
jiahuei/sparse-image-captioning/sparse_caption/tokenizer.py
code served (permissive licence) · get_code("4943ef90db98a6cc")
How it ran

no invocation recorded.

parse_opt Not yet run
unverified (harvested, no recorded run)
jiahuei/sparse-image-captioning/sparse_caption/opts.py
code served (permissive licence) · get_code("b3a5bb38ed85f23d")
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, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 4 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
split_tensors 2 other papers
2 dated earlier
2008.02693 (2020-08)
Fashion Captioning: Towards Generating Accurate Descriptions with Semantic Rewards
2010.16056 (2020-10)
Generating Radiology Reports via Memory-driven Transformer
clones 1 other paper
1 later
2202.13024 (2022-02)
ASSIST: Towards Label Noise-Robust Dialogue State Tracking

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

With the advancement of deep models, research work on image captioning has led to a remarkable gain in raw performance over the last decade, along with increasing model complexity and computational cost. However, surprisingly works on compression of deep networks for image captioning task has received little to no attention. For the first time in image captioning research, we provide an extensive comparison of various unstructured weight pruning methods on three different popular image captioning architectures, namely Soft-Attention, Up-Down and Object Relation Transformer. Following this, we propose a novel end-to-end weight pruning method that performs gradual sparsification based on weight sensitivity to the training loss. The pruning schemes are then extended with encoder pruning, where we show that conducting both decoder pruning and training simultaneously prior to the encoder pruning provides good overall performance. Empirically, we show that an 80% to 95% sparse network (up to 75% reduction in model size) can either match or outperform its dense counterpart. The code and pre-trained models for Up-Down and Object Relation Transformer that are capable of achieving CIDEr scores &gt;120 on the MS-COCO dataset but with only 8.7 MB and 14.5 MB in model size (size reduction of 96% and 94% respectively against dense versions) are publicly available at https://github.com/jiahuei/sparse-image-captioning.

For agents

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

get_harvested_code_for_paper("2110.03298")
get_code_for_paper("2110.03298")
have("2110.03298")

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

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

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

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

Connect an agent — have() is free.