SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1910.01108 · arXiv.org · 2019

DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter

Thomas Wolf, Victor Sanh, Julien Chaumond, Lysandre Debut

arXiv · PDF · Open in the Atlas

Code that ran

21 of 27 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (5 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 1 violated it and 8 have no contract verdict; 9 failures of our instrument; 6 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/1910.01108.json · badge: /api/ran/1910.01108.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
huggingface/swift-coreml-transformers canonical (classifier label)
classifier basis: census
1 ran · 0 no recorded run
mkavim/finetune_bert community
Papers with Code archive
11 ran · 3 no recorded run
monologg/distilkobert community
Papers with Code archive
3 ran · 2 no recorded run
reycn/multi-modal-scale community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
epfml/collaborative-attention community
Papers with Code archive
2 ran · 1 no recorded run
knuddj1/op_text community (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
FunctionStatusWhere it lives
ArgsAdapterDistilBERT Ran
ran on a synthesized input
epfml/collaborative-attention/src/collaborative_attention/adapter_distilbert.py
code served (permissive licence) · get_code("bd41263948c9f93a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, 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 torch.nn as nn


class MockCollabLayer(nn.Module):
    """Mock collab_layer that mimics a DistilBERT attention layer."""
    
    def __init__(self, hidden_size=4, num_heads=2):
        super().__init__()
        self.hidden_size = hidden_size
        self.num_heads = num_heads
        self.attention = nn.MultiheadAttention(
            embed_dim=hidden_size,
            num_heads=num_heads,
            batch_first=True
        )
    
    def forward(self, hidden_states, attention_mask=None, head_mask=None, 
                encoder_hidden_states=None, encoder_attention_mask=None):
        # Simple mock: return the hidden_states with same shape
        batch_size, seq_len, hidden_size = hidden_states.shape
        return torch.randn(batch_size, seq_len, hidden_size)


class ArgsAdapterDistilBERT(nn.Module):

    def __init__(self, collab_layer):
        super().__init__()
        self.collab_layer = collab_layer

    def forward(self, query, key, value, mask, head_mask):
        return self.collab_layer(hidden_states=query, attention_mask=None, head_mask=head_mask, encoder_hidden_states=key, encoder_attention_mask=None)


INIT_ARGS = {
    'collab_layer': MockCollabLayer(hidden_size=4, num_heads=2)
}

ARGS = {
    'query': torch.randn(2, 3, 4),
    'key': torch.randn(2, 5, 4),
    'value': torch.randn(2, 5, 4),
    'mask': torch.ones(2, 3),
    'head_mask': None
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 3, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
DistillBertConfig Ran
ran on a synthesized input · constructed an object; no result was computed
mkavim/finetune_bert/finetune/modeling_distilbert.py
code served (permissive licence) · get_code("d3e9e3aeb78c5878")
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, DistillBertConfig: 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 logging
import sys

logging.basicConfig(level=logging.INFO)

ARGS = {
    'vocab_size_or_config_json_file': 21128,
    'hidden_size': 768,
    'num_hidden_layers': 6,
    'num_attention_heads': 12,
    'intermediate_size': 3072,
    'hidden_act': 'gelu',
    'hidden_dropout_prob': 0.1,
    'attention_probs_dropout_prob': 0.1,
    'max_position_embeddings': 512,
    'initializer_range': 0.02,
    'layer_norm_eps': 1e-12,
    'sequence_classif_dropout_prob': 0.2,
}
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 DistillBertConfig — 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 DistillBertConfig 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
DistillBertMultiHeadSelfAttention Ran
ran on a synthesized input · constructed an object; no result was computed
mkavim/finetune_bert/finetune/modeling_distilbert.py
code served (permissive licence) · get_code("c73b35f8741d5bbc")
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, DistillBertMultiHeadSelfAttention: 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 tensorflow as tf

# Set random seeds for reproducibility
tf.random.set_seed(0)

# Define parameters for DistillBertMultiHeadSelfAttention
hidden_size = 12  # Must be divisible by num_attention_heads
num_attention_heads = 3
attention_probs_dropout_prob = 0.1
initializer_range = 0.02

# Create sample input tensors
batch_size = 2
sequence_length = 4

# Hidden states: (batch_size, sequence_length, hidden_size)
hidden_states = tf.random.normal((batch_size, sequence_length, hidden_size))

# Attention mask: (batch_size, sequence_length)
# 1.0 for positions to attend to, 0.0 for positions to mask
attention_mask = tf.ones((batch_size, sequence_length))

# Create the inputs tuple as expected by the call method
inputs = (hidden_states, attention_mask)

ARGS = {
    "hidden_size": hidden_size,
    "num_attention_heads": num_attention_heads,
    "attention_probs_dropout_prob": attention_probs_dropout_prob,
    "initializer_range": initializer_range,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DistillBertMultiHeadSelfAttention — 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 DistillBertMultiHeadSelfAttention 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
FeedForward Ran
ran on a synthesized input · constructed an object; no result was computed
mkavim/finetune_bert/finetune/modeling_distilbert.py
code served (permissive licence) · get_code("586463f8edb14bc7")
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, FeedForward: 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 tensorflow as tf
import numpy as np

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

# Create a simple input tensor (batch_size=2, sequence_length=3, hidden_size=4)
input_tensor = tf.constant(np.random.randn(2, 3, 4).astype(np.float32))

ARGS = {
    'intermediate_size': 8,
    'hidden_size': 4,
    'hidden_act': 'gelu',
    'initializer_range': 0.02,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type FeedForward — 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 FeedForward 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
GroupedBatchSampler Ran
ran on a synthesized input · constructed an object; no result was computed
monologg/distilkobert/distillation/distiller.py
code served (permissive licence) · get_code("c01d1e6d469d9bfd")
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, GroupedBatchSampler: 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.utils.data import RandomSampler

torch.manual_seed(0)

# Create a simple dataset-like object to provide a length for the sampler
class SimpleDataset:
    def __init__(self, size):
        self.size = size
    
    def __len__(self):
        return self.size

# Create dataset with 10 samples
dataset = SimpleDataset(10)

# Create a sampler
sampler = RandomSampler(dataset)

# Create group_ids: assign each of 10 samples to a group (0, 1, or 2)
# Must be continuous integers starting from 0
group_ids = [0, 1, 0, 2, 1, 0, 2, 1, 0, 2]

# Batch size
batch_size = 3

ARGS = {
    "sampler": sampler,
    "group_ids": group_ids,
    "batch_size": batch_size,
}
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 GroupedBatchSampler — 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 GroupedBatchSampler 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
PretrainedConfig Ran
ran on a synthesized input · constructed an object; no result was computed
mkavim/finetune_bert/finetune/modeling_distilbert.py
code served (permissive licence) · get_code("aa85de675f71b596")
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, PretrainedConfig: 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 copy
import os
import json
import logging
import tempfile
from io import open

CONFIG_NAME = 'config.json'

logger = logging.getLogger(__name__)

class PretrainedConfig(object):
    pretrained_config_archive_map = {}

    def __init__(self, **kwargs):
        pass

    def save_pretrained(self, save_directory):
        """ Save a configuration object to the directory `save_directory`, so that it
            can be re-loaded using the :func:`~transformers.PretrainedConfig.from_pretrained` class method.
        """
        assert os.path.isdir(save_directory), 'Saving path should be a directory where the model and configuration can be saved'
        output_config_file = os.path.join(save_directory, CONFIG_NAME)
        self.to_json_file(output_config_file)
        logger.info('Configuration saved in {}'.format(output_config_file))

    @classmethod
    def from_pretrained(cls, pretrained_path, **kwargs):
        json_file = os.path.join(pretrained_path)
        config = cls.from_json_file(json_file)
        for key, value in kwargs.items():
            setattr(config, key, value)
        logger.info('Model config %s', config)
        return config

    @classmethod
    def from_dict(cls, json_object):
        """Constructs a `Config` from a Python dictionary of parameters."""
        config = cls(vocab_size_or_config_json_file=-1)
        for key, value in json_object.items():
            setattr(config, key, value)
        return config

    @classmethod
    def from_json_file(cls, json_file):
        """Constructs a `BertConfig` from a json file of parameters."""
        with open(json_file, 'r', encoding='utf-8') as reader:
            text = reader.read()
        return cls.from_dict(json.loads(text))

    def __eq__(self, other):
        return self.__dict__ == other.__dict__

    def __repr__(self):
        return str(self.to_json_string())

    def to_dict(self):
        """Serializes this instance to a Python dictionary."""
        output = copy.deepcopy(self.__dict__)
        return output

    def to_json_string(self):
        """Serializes this instance to a JSON string."""
        return json.dumps(self.to_dict(), indent=2, sort_keys=True) + '\n'

    def to_json_file(self, json_file_path):
        """ Save this instance to a json file."""
        with open(json_file_path, 'w', encoding='utf-8') as writer:
            writer.write(self.to_json_string())


temp_dir = tempfile.mkdtemp()
config_file = os.path.join(temp_dir, 'config.json')
with open(config_file, 'w', encoding='utf-8') as f:
    json.dump({'hidden_size': 768, 'vocab_size': 30522, 'num_hidden_layers': 12}, f)

ARGS = {}
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 PretrainedConfig — 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 PretrainedConfig 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
_quantize Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
monologg/distilkobert/distillation/distiller.py
code served (permissive licence) · get_code("f5d6d16633127806")
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, ndim 1, dtype family int; 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 bisect
import copy

# Construct arguments for _quantize function
# The function takes x (a list of values) and bins (a list of bin boundaries)
# It returns quantized indices based on which bin each value falls into

x = [0.5, 1.5, 2.5, 3.5, 4.5]  # List of values to quantize
bins = [1.0, 2.0, 3.0, 4.0]    # List of bin boundaries

ARGS = {
    "x": x,
    "bins": bins,
}
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 list, ndim 1, dtype family int — a list 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
build_transform Ran
ran; our contract draft was wrong, not the code
reycn/multi-modal-scale/script/3.evaluation.batch.py
code served (permissive licence) · get_code("57e95166ade5f25c")
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 Compose. 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 torchvision.transforms as T
from torchvision.transforms.functional import InterpolationMode
from PIL import Image
import numpy as np

torch.manual_seed(0)

# Create a small test image to verify the transform works
test_image_array = np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8)
test_image = Image.fromarray(test_image_array, mode='RGB')

ARGS = {
    'input_size': 224
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose 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_lengths_groups Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
monologg/distilkobert/distillation/distiller.py
code served (permissive licence) · get_code("2fe0a0a44bca4abd")
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, ndim 1, dtype family int; 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 logging

logging.basicConfig(level=logging.INFO)

# The function takes two parameters: lengths and k
# lengths: should be a list/array of numeric values to quantize
# k: an integer that determines the bins (if k > 0, bins are created from 3 to k with step 4)

# Create sample lengths - a list of integers representing various length values
lengths = [5, 8, 12, 15, 20, 25, 30, 35, 40, 45]

# Create k value - this determines the bins for quantization
# If k > 0, bins will be np.arange(start=3, stop=k, step=4)
# Let's use k=20 to create bins [3, 7, 11, 15, 19]
k = 20

ARGS = {
    "lengths": lengths,
    "k": k
}
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 list, ndim 1, dtype family int — a list 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
create_position_ids Ran
ran; our contract draft was wrong, not the code
mkavim/finetune_bert/finetune/modeling_distilbert.py
code served (permissive licence) · get_code("4e8314bcf966eece")
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 EagerTensor, ndim 2, dtype family int, shape (1, 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 tensorflow as tf

# Create a simple input_ids tensor
# Shape: (batch_size=2, seq_length=4)
# The function expects input_ids to have shape [batch_size, seq_length]
input_ids = tf.constant([
    [101, 2054, 2003, 102],
    [101, 1045, 2572, 102]
], dtype=tf.int32)

ARGS = {
    "input_ids": input_ids
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family int, shape (1, 4) — shape (1, 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
distilbert_layers Ran
ran; our contract draft was wrong, not the code
epfml/collaborative-attention/src/collaborative_attention/adapter_distilbert.py
code served (permissive licence) · get_code("024e22b6643186b4")
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 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
import torch.nn as nn

torch.manual_seed(0)

class TransformerLayer(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

class DistilBertTransformer(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer = nn.ModuleList([
            TransformerLayer(),
            TransformerLayer(),
        ])
    
    def forward(self, x):
        for layer in self.layer:
            x = layer(x)
        return x

class DistilBertModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.distilbert = nn.Module()
        self.distilbert.transformer = DistilBertTransformer()
    
    def forward(self, x):
        return self.distilbert.transformer(x)

class TransformerOnlyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.transformer = DistilBertTransformer()
    
    def forward(self, x):
        return self.transformer(x)

model_with_distilbert = DistilBertModel()
model_without_distilbert = TransformerOnlyModel()

ARGS = {
    "model": model_with_distilbert
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
dynamic_preprocess Ran
ran; our contract draft was wrong, not the code
reycn/multi-modal-scale/script/3.evaluation.batch.py
pointer only (licence: MIT); the stored copy get_code serves, from jam-cc/MMAD, is pointer only (licence: NONE) · get_code("6dc77bb22fb9d660")
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 jam-cc/MMAD, 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.

find_closest_aspect_ratio Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
reycn/multi-modal-scale/script/3.evaluation.batch.py
pointer only (licence: MIT); the stored copy get_code serves, from OpenGVLab/MM-NIAH, is pointer only (licence: NONE) · get_code("bd77f5f8067f18e9")
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 OpenGVLab/MM-NIAH, 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.

gelu Ran
ran, honoured the contract we drafted
mkavim/finetune_bert/finetune/modeling_distilbert.py
code served (permissive licence) · get_code("9bc31d06256e1691")
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 EagerTensor, ndim 2, dtype family float, shape (2, 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 tensorflow as tf
import numpy as np

# Create a small TensorFlow tensor as input
# The function expects a tensor and applies element-wise operations
x = tf.constant([[-2.0, -1.0, 0.0, 1.0], [2.0, 3.0, -0.5, 0.5]], dtype=tf.float32)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
gelu_new Ran
ran, honoured the contract we drafted
mkavim/finetune_bert/finetune/modeling_distilbert.py
code served (permissive licence) · get_code("5b3fd00218623502")
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 EagerTensor, ndim 2, dtype family float, shape (2, 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 tensorflow as tf
import numpy as np

# Create a small TensorFlow tensor for testing
x = tf.constant([[1.0, 2.0, 3.0, 4.0],
                 [0.5, 1.5, 2.5, 3.5]], dtype=tf.float32)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
get_confidence_scores Ran
ran on a synthesized input
knuddj1/op_text/op_text/utils.py
code served (permissive licence) · get_code("b07754f6f7d44e9e")
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 (2, 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
from torch.nn import Softmax

torch.manual_seed(0)

# Create a small logits tensor (batch=2, num_classes=4)
logits = torch.randn(2, 4)

ARGS = {
    "logits": logits
}
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 (2, 4) — shape (2, 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
get_initializer Ran
ran; our contract draft was wrong, not the code
mkavim/finetune_bert/finetune/modeling_distilbert.py
code served (permissive licence) · get_code("333abb7d28cd1f9f")
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 TruncatedNormal. 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 tensorflow as tf

ARGS = {
    "initializer_range": 0.02
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TruncatedNormal — a TruncatedNormal output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a TruncatedNormal 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_input_mask Ran
ran, violated the contract we drafted
mkavim/finetune_bert/finetune/modeling_distilbert.py
code served (permissive licence) · get_code("57e9478bd6df4915")
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 EagerTensor, ndim 2, dtype family float, shape (2, 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 tensorflow as tf
import numpy as np

# Create a small tensor of input IDs
# The function checks which values are greater than 0
# So we need a mix of positive, zero, and negative values
input_ids = tf.constant([
    [0, 1, 2, 3],
    [0, 0, 5, 0]
], dtype=tf.int32)

ARGS = {
    "input_ids": input_ids
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
shape_list Ran
ran; our contract draft was wrong, not the code
mkavim/finetune_bert/finetune/modeling_distilbert.py
code served (permissive licence) · get_code("6220c13c591c68a7")
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, ndim 1, dtype family int; 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 tensorflow as tf
import numpy as np

# Create a small TensorFlow tensor with some dynamic dimensions
# The function uses x.shape.as_list() and tf.shape(x)
x = tf.constant(np.random.randn(2, 4, 3), dtype=tf.float32)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list 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
swish Ran
ran, honoured the contract we drafted
mkavim/finetune_bert/finetune/modeling_distilbert.py
code served (permissive licence) · get_code("86d13b9f67274f19")
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 EagerTensor, ndim 2, dtype family float, shape (2, 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 tensorflow as tf
import numpy as np

# Create a small TensorFlow tensor for testing
x = tf.constant([[1.0, 2.0, 3.0, 4.0],
                 [0.5, 1.5, 2.5, 3.5]], dtype=tf.float32)

ARGS = {
    'x': x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
timeit_and_report_mean Ran
ran on a synthesized input
huggingface/swift-coreml-transformers/model_generation/distilbert-onnx-coreml.py
code served (permissive licence) · get_code("3ae355fe5a2be50f")
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 str. 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 timeit
import numpy as np
import torch

def dummy_function():
    """A simple callable to pass to timeit_and_report_mean"""
    x = torch.randn(2, 4)
    y = x * 2
    return y.sum().item()

ARGS = {
    'f': dummy_function
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
DistilBERTCollaborativeAdapter Not yet run
unverified (harvested, no recorded run)
epfml/collaborative-attention/src/collaborative_attention/adapter_distilbert.py
code served (permissive licence) · get_code("299d28a1eb667c41")
How it ran

no invocation recorded.

DistillBertModel Not yet run
unverified (harvested, no recorded run)
mkavim/finetune_bert/finetune/modeling_distilbert.py
code served (permissive licence) · get_code("1f3a00e205369e86")
How it ran

no invocation recorded.

DistillBertPretrained Not yet run
unverified (harvested, no recorded run)
mkavim/finetune_bert/finetune/modeling_distilbert.py
code served (permissive licence) · get_code("604d8efbff65993f")
How it ran

no invocation recorded.

Distiller Not yet run
unverified (harvested, no recorded run)
monologg/distilkobert/distillation/distiller.py
code served (permissive licence) · get_code("20e3c004457d9336")
How it ran

no invocation recorded.

LmSeqsDataset Not yet run
unverified (harvested, no recorded run)
monologg/distilkobert/distillation/distiller.py
code served (permissive licence) · get_code("2efdc2800d06d37c")
How it ran

no invocation recorded.

load_distillbert_model_weights_from_checkpoint Not yet run
unverified (harvested, no recorded run)
mkavim/finetune_bert/finetune/modeling_distilbert.py
code served (permissive licence) · get_code("4db4878c2df8732e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 27 samples lifted from this paper's linked repositories, 27 carry a function identity and 0 do not. Of the 27 distinct functions with an identity, 14 are also present in other papers whose code we hold (9 with at least one paper dated earlier, 0 the same month, 10 later) and 13 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
find_closest_aspect_ratio 43 other papers
43 later
2312.13271 (2023-12)
Repaint123: Fast and High-quality One Image to 3D Generation with Progressive Controllable 2D Repainting
2403.15952 (2024-03)
IllusionVQA: A Challenging Optical Illusion Dataset for Vision Language Models
2405.14156 (2024-05)
Unveiling the Tapestry of Consistency in Large Vision-Language Models
and 40 more not named here
build_transform 31 other papers
31 later
2312.13271 (2023-12)
Repaint123: Fast and High-quality One Image to 3D Generation with Progressive Controllable 2D Repainting
2403.15952 (2024-03)
IllusionVQA: A Challenging Optical Illusion Dataset for Vision Language Models
2405.14156 (2024-05)
Unveiling the Tapestry of Consistency in Large Vision-Language Models
and 28 more not named here
dynamic_preprocess 17 other papers
17 later
2403.15952 (2024-03)
IllusionVQA: A Challenging Optical Illusion Dataset for Vision Language Models
2410.01733 (2024-10)
ASCIIEval: Benchmarking Models' Visual Perception in Text Strings via ASCII Art
2410.09453 (2024-10)
MMAD: A Comprehensive Benchmark for Multimodal Large Language Models in Industrial Anomaly Detection
and 14 more not named here
swish
brick of this paper's assembly: helper
8 other papers
2 dated earlier, 6 later · 2 only as an assembly brick
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1902.08408 (2019-02)
PhysNet: A Neural Network for Predicting Energies, Forces, Dipole Moments and Partial Charges
2003.03123 (2020-03)
Directional Message Passing for Molecular Graphs
and 5 more not named here
gelu
brick of this paper's assembly: helper
6 other papers
1 dated earlier, 5 later · 1 only as an assembly brick
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
2006.04558 (2020-06)
FastSpeech 2: Fast and High-Quality End-to-End Text to Speech
2006.04884 (2020-06)
On the Stability of Fine-tuning BERT: Misconceptions, Explanations, and Strong Baselines
and 3 more not named here
gelu_new
brick of this paper's assembly: helper
6 other papers
1 dated earlier, 5 later · 1 only as an assembly brick
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
2006.04558 (2020-06)
FastSpeech 2: Fast and High-Quality End-to-End Text to Speech
2006.04884 (2020-06)
On the Stability of Fine-tuning BERT: Misconceptions, Explanations, and Strong Baselines
and 3 more not named here
get_initializer
brick of this paper's assembly: helper
6 other papers
3 dated earlier, 3 later · 1 only as an assembly brick
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1909.05017 (2019-09)
Question Generation by Transformers
1909.11942 (2019-09)
ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
and 3 more not named here
shape_list
brick of this paper's assembly: helper
3 other papers
1 dated earlier, 2 later · 1 only as an assembly brick
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
2006.00555 (2020-06)
Transferring Inductive Biases through Knowledge Distillation
2601.10926 (2026-01)
Selecting Language Models for Social Science: Start Small, Start Open, and Validate Preprint XX(X):1-22 ©The Author(s) 2026
FeedForward
brick of this paper's assembly: model
1 other paper
1 dated earlier · 1 only as an assembly brick
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
GroupedBatchSampler
brick of this paper's assembly: helper
1 other paper
1 later
2506.16196 (2025-06)
Efficient and Privacy-Preserving Soft Prompt Transfer for LLMs
PretrainedConfig
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
create_lengths_groups
brick of this paper's assembly: helper
1 other paper
1 later
2506.16196 (2025-06)
Efficient and Privacy-Preserving Soft Prompt Transfer for LLMs
create_position_ids
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
get_input_mask
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding

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

More are linked than shown here.

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

Abstract

As Transfer Learning from large-scale pre-trained models becomes more prevalent in Natural Language Processing (NLP), operating these large models in on-theedge and/or under constrained computational training or inference budgets remains challenging. In this work, we propose a method to pre-train a smaller generalpurpose language representation model, called DistilBERT, which can then be finetuned with good performances on a wide range of tasks like its larger counterparts. While most prior work investigated the use of distillation for building task-specific models, we leverage knowledge distillation during the pre-training phase and show that it is possible to reduce the size of a BERT model by 40%, while retaining 97% of its language understanding capabilities and being 60% faster. To leverage the inductive biases learned by larger models during pre-training, we introduce a triple loss combining language modeling, distillation and cosine-distance losses. Our smaller, faster and lighter model is cheaper to pre-train and we demonstrate its capabilities for on-device computations in a proof-of-concept experiment and a comparative on-device study.

For agents

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

get_harvested_code_for_paper("1910.01108")
get_code_for_paper("1910.01108")
have("1910.01108")

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

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

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

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

Connect an agent — have() is free.