SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1910.03771 · 2019

HuggingFace's Transformers: State-of-the-art Natural Language Processing

Teven Le Scao, Alexander Rush, Canwen Xu, Quentin Lhoest, Yacine Jernite, Thomas Wolf, Victor Sanh, Patrick Von Platen, Julien Chaumond, Sam Shleifer, Joe Davison, Clara Ma, and 10 more

arXiv · PDF · Open in the Atlas

Code that ran

3 of 3 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 0 have no contract verdict; 3 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/1910.03771.json · badge: /api/ran/1910.03771.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/transformers canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
prepare_ctrl_input Ran
ran; our contract draft was wrong, not the code
huggingface/transformers/examples/pytorch/text-generation/run_generation.py
code served (permissive licence) · get_code("a766a95b9fd5ee9c")
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 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 logging
import torch

logger = logging.getLogger(__name__)

class MockTokenizer:
    def __init__(self):
        self.control_codes = {
            'Links': 12345,
            'Books': 12346,
            'Recipes': 12347
        }
    
    def encode(self, text, add_special_tokens=False):
        # Return a list starting with a control code
        return [12345, 1, 2, 3, 4, 5]

class MockArgs:
    def __init__(self):
        self.temperature = 0.5

ARGS = {
    'args': MockArgs(),
    '_': None,
    'tokenizer': MockTokenizer(),
    'prompt_text': 'Links This is a test prompt'
}
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 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
prepare_xlm_input Ran
ran; our contract draft was wrong, not the code
huggingface/transformers/examples/pytorch/text-generation/run_generation.py
code served (permissive licence) · get_code("b7bf53f6b6b11a4b")
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 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 torch
import torch.nn as nn

torch.manual_seed(0)

class MockConfig:
    def __init__(self):
        self.use_lang_emb = True
        self.lang2id = {'en': 0, 'fr': 1, 'de': 2}
        self.lang_id = None

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.config = MockConfig()
    
    def forward(self, x):
        return x

class MockTokenizer:
    def __init__(self):
        pass
    
    def encode(self, text):
        return [101, 2054, 2003, 102]

class MockArgs:
    def __init__(self):
        self.xlm_language = 'en'

model = MockModel()
tokenizer = MockTokenizer()
args = MockArgs()
prompt_text = "What is this?"

ARGS = {
    'args': args,
    'model': model,
    'tokenizer': tokenizer,
    'prompt_text': prompt_text
}
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 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
prepare_xlnet_input Ran
ran; our contract draft was wrong, not the code
huggingface/transformers/examples/pytorch/text-generation/run_generation.py
code served (permissive licence) · get_code("80844fa7cfa6e8d8")
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 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 torch
import numpy as np

torch.manual_seed(0)

class MockTokenizer:
    def __init__(self):
        pass

class MockArgs:
    def __init__(self):
        self.prefix = "Custom prefix text. "
        self.padding_text = "Padding text fallback. "

ARGS = {
    "args": MockArgs(),
    "_": None,
    "tokenizer": MockTokenizer(),
    "prompt_text": "This is the prompt text to append."
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 0 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
prepare_ctrl_input 11 other papers
11 later
2009.14259 (2020-09)
Visually-Grounded Planning without Vision: Language Models Infer Detailed Plans from High-level Instructions
2106.06168 (2021-06)
Generate, Annotate, and Learn: NLP with Synthetic Text
2112.13834 (2021-12)
What do Large Language Models Learn about Scripts?
and 8 more not named here
prepare_xlm_input 11 other papers
11 later
2009.14259 (2020-09)
Visually-Grounded Planning without Vision: Language Models Infer Detailed Plans from High-level Instructions
2106.06168 (2021-06)
Generate, Annotate, and Learn: NLP with Synthetic Text
2112.13834 (2021-12)
What do Large Language Models Learn about Scripts?
and 8 more not named here
prepare_xlnet_input 8 other papers
8 later
2210.15097 (2022-10)
Contrastive Decoding: Open-ended Text Generation as Optimization
2305.01625 (2023-05)
Unlimiformer: Long-Range Transformers with Unlimited Length Input
2402.05827 (2024-02)
On the Robustness of Editing Large Language Models
and 5 more not named here

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

Recent progress in natural language processing has been driven by advances in both model architecture and model pretraining. Transformer architectures have facilitated building higher-capacity models and pretraining has made it possible to effectively utilize this capacity for a wide variety of tasks. Transformers is an open-source library with the goal of opening up these advances to the wider machine learning community. The library consists of carefully engineered stateof-the art Transformer architectures under a unified API. Backing this library is a curated collection of pretrained models made by and available for the community. Transformers is designed to be extensible by researchers, simple for practitioners, and fast and robust in industrial deployments. The library is available at https://github.com/ huggingface/transformers.

For agents

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

get_harvested_code_for_paper("1910.03771")
get_code_for_paper("1910.03771")
have("1910.03771")

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

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

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

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

Connect an agent — have() is free.