SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2007.07779 · EMNLP · 2020

AdapterHub: A Framework for Adapting Transformers

Iryna Gurevych, Kyunghyun Cho, Ivan Vulić, Sebastian Ruder, Jonas Pfeiffer, Aishwarya Kamath, Clifton Poth, Andreas Ücklé

arXiv · PDF · Open in the Atlas

Code that ran

11 of 15 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 1 violated it and 3 have no contract verdict; 4 failures of our instrument; 4 no recorded run), measured 2026-11-21; 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/2007.07779.json · badge: /api/ran/2007.07779.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
Adapter-Hub/Hub canonical (classifier label)
classifier basis: census
1 ran · 0 no recorded run
mklimasz/language-arithmetic community (classifier label)
classifier basis not recorded on the link
5 ran · 4 no recorded run
adapter-hub/adapter-transformers-legacy community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
parovicm/badx community
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
Activation_Function_Class Ran
ran on a synthesized input · constructed an object; no result was computed
parovicm/badx/src/transformers/adapters/modeling.py
code served (permissive licence) · get_code("0354fab5ada9f9e0")
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, Activation_Function_Class: 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 math
import torch
from torch import nn

torch.manual_seed(0)

# Test with 'relu' activation
ARGS = {
    'hidden_act': 'relu'
}

# Verify the setup works by instantiating and running forward pass
activation = nn.Module.__new__(type('Activation_Function_Class', (nn.Module,), {
    '__init__': lambda self, hidden_act: (
        setattr(self, 'f', nn.functional.relu),
        super(type(self), self).__init__()
    ),
    'forward': lambda self, x: self.f(x)
}))
activation.__init__(ARGS['hidden_act'])

# Create a small test tensor
test_input = torch.randn(2, 4)
test_output = activation(test_input)

ARGS = {
    'hidden_act': 'relu'
}
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 Activation_Function_Class — 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 Activation_Function_Class 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
Adapter Ran
ran on a synthesized input · constructed an object; no result was computed
parovicm/badx/src/transformers/adapters/modeling.py
code served (permissive licence) · get_code("d8b9b81138d5b50d")
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, Adapter: 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
import torch.nn as nn
from torch import nn

torch.manual_seed(0)

ARGS = {
    "input_size": 8,
    "down_sample": 4,
    "non_linearity": "relu",
    "init_bert_weights": True,
    "add_layer_norm_before": True,
    "add_layer_norm_after": False,
    "residual_before_ln": True,
}
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 Adapter — 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 Adapter 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
check_number_comma Ran
ran, violated the contract we drafted
mklimasz/language-arithmetic/src/transformers/convert_slow_tokenizer.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from UW-Madison-Lee-Lab/looped-tf, is pointer only (licence: NONE) · get_code("a727df5fd2f5599a")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, mklimasz/language-arithmetic, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

create_adapter_card Ran
ran on a synthesized input
Adapter-Hub/Hub/migrate_to_hf.py
code served (permissive licence) · get_code("797e184e2ce0e007")
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 torch
import torch.nn as nn

ARGS = {
    'file_name': 'adapters/text_classification/adapter.md',
    'adapter_name': 'bert-adapter-sst',
    'data': {
        'task': 'sentiment-analysis',
        'subtask': 'sst-2',
        'type': 'text',
        'model_name': 'bert-base-uncased',
        'model_type': 'bert',
        'author': 'John Doe',
        'email': 'john@example.com',
        'url': 'https://example.com',
        'github': 'johndoe/adapter-repo',
        'twitter': 'johndoe',
        'description': 'An adapter for sentiment analysis on SST-2 dataset.',
        'citation': '@inproceedings{adapter2021,\n  title={Adapters},\n  author={Doe, John},\n  year={2021}\n}',
        'config': {
            'using': 'bottleneck'
        },
        'default_version': '1.0',
        'files': [
            {
                'version': '1.0',
                'description': 'Initial version'
            },
            {
                'version': '2.0',
                'description': 'Improved version'
            }
        ]
    },
    'subtask_info': {
        'url': 'https://nlp.stanford.edu/sentiment/',
        'displayname': 'Stanford Sentiment Treebank',
        'hf_datasets_id': 'sst2'
    },
    'version': '1.0',
    'head_type': 'classification',
    'hf_org_name': 'AdapterHub',
    'license': 'apache-2.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 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
ensure_valid_input Ran
ran; our contract draft was wrong, not the code
mklimasz/language-arithmetic/src/transformers/convert_graph_to_onnx.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from kabirahuja2431/transformers-hg, is pointer only (licence: NONE) · get_code("b220e701be05a184")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, mklimasz/language-arithmetic, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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_fast Ran
ran, honoured the contract we drafted
adapter-hub/adapter-transformers-legacy/src/transformers/activations_tf.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from VITA-Group/READ-ME, is pointer only (licence: NONE) · get_code("37a5eed2dbd663ca")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, adapter-hub/adapter-transformers-legacy, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

generate_identified_filename Ran
ran; our contract draft was wrong, not the code
mklimasz/language-arithmetic/src/transformers/convert_graph_to_onnx.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from UW-Madison-Lee-Lab/looped-tf, is pointer only (licence: NONE) · get_code("7efe3db5c9e2f94d")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, mklimasz/language-arithmetic, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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_config_class_from_processor_class Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mklimasz/language-arithmetic/utils/create_dummy_models.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from takagi97/OXA-Fine-tuning, is pointer only (licence: NONE) · get_code("3d999b95009c7537")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, mklimasz/language-arithmetic, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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_processor_types_from_config_class Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mklimasz/language-arithmetic/utils/create_dummy_models.py
pointer only (licence: Apache-2.0) · get_code("36f3ecdc3e086edb")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, mklimasz/language-arithmetic, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

mish Ran
ran, honoured the contract we drafted
adapter-hub/adapter-transformers-legacy/src/transformers/activations_tf.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from VITA-Group/READ-ME, is pointer only (licence: NONE) · get_code("cc8c8c3ebf0c343f")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, adapter-hub/adapter-transformers-legacy, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

quick_gelu Ran
ran, honoured the contract we drafted
adapter-hub/adapter-transformers-legacy/src/transformers/activations_tf.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from VITA-Group/READ-ME, is pointer only (licence: NONE) · get_code("e2d56cb91f999bef")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, adapter-hub/adapter-transformers-legacy, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

convert_slow_tokenizer Not yet run
unverified (harvested, no recorded run)
mklimasz/language-arithmetic/src/transformers/convert_slow_tokenizer.py
pointer only (licence: Apache-2.0) · get_code("9d93436a1b858d0e")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, mklimasz/language-arithmetic, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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. No invocation recorded.

get_architectures_from_config_class Not yet run
unverified (harvested, no recorded run)
mklimasz/language-arithmetic/utils/create_dummy_models.py
pointer only (licence: Apache-2.0) · get_code("a00c425fa9fa3aed")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, mklimasz/language-arithmetic, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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. No invocation recorded.

get_configuration_file Not yet run
unverified (harvested, no recorded run)
mklimasz/language-arithmetic/src/transformers/configuration_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from VITA-Group/READ-ME, is pointer only (licence: NONE) · get_code("dd3166a87bc972ff")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, mklimasz/language-arithmetic, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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. No invocation recorded.

infer_shapes Not yet run
unverified (harvested, no recorded run)
mklimasz/language-arithmetic/src/transformers/convert_graph_to_onnx.py
pointer only (licence: Apache-2.0) · get_code("0da835817b8a57bc")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, mklimasz/language-arithmetic, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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. No invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 12 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 12 later) and 3 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
get_config_class_from_processor_class 27 other papers
27 later
2308.12219 (2023-08)
Diffusion Language Models Can Perform Many Tasks with Scaling and Instruction-Finetuning
2311.07468 (2023-11)
An Analysis and Mitigation of the Reversal Curse
2312.15710 (2023-12)
Alleviating Hallucinations of Large Language Models through Induced Hallucinations
and 24 more not named here
mish 25 other papers
25 later
2104.08400 (2021-04)
Structure-Aware Abstractive Conversation Summarization via Discourse and Action Graphs
2106.00420 (2021-06)
Dialogue-oriented Pre-training
2107.00910 (2021-07)
Learned Token Pruning for Transformers
and 22 more not named here
gelu_fast 19 other papers
19 later
2110.04366 (2021-10)
Towards a Unified View of Parameter-Efficient Transfer Learning
2111.00160 (2021-11)
DSEE: Dually Sparsity-embedded Efficient Tuning of Pre-trained Language Models
2022.naacl-main.130 (2022 (year only))
BAD-X: Bilingual Adapters Improve Zero-Shot Cross-Lingual Transfer
and 16 more not named here
quick_gelu 16 other papers
16 later
2202.00666 (2022-02)
Locally Typical Sampling
2211.05392 (2022-11)
EVENTS REALM: Event Reasoning of Entity States via Language Models
2212.00921 (2022-12)
AGRO: Adversarial Discovery of Error-prone groups for Robust Optimization
and 13 more not named here
ensure_valid_input 14 other papers
14 later
2107.00910 (2021-07)
Learned Token Pruning for Transformers
2111.00160 (2021-11)
DSEE: Dually Sparsity-embedded Efficient Tuning of Pre-trained Language Models
2111.05498 (2021-11)
Attention Approximates Sparse Distributed Memory
and 11 more not named here
generate_identified_filename 14 other papers
14 later
2107.00910 (2021-07)
Learned Token Pruning for Transformers
2111.00160 (2021-11)
DSEE: Dually Sparsity-embedded Efficient Tuning of Pre-trained Language Models
2111.05498 (2021-11)
Attention Approximates Sparse Distributed Memory
and 11 more not named here
infer_shapes 14 other papers
14 later
2107.00910 (2021-07)
Learned Token Pruning for Transformers
2111.00160 (2021-11)
DSEE: Dually Sparsity-embedded Efficient Tuning of Pre-trained Language Models
2111.05498 (2021-11)
Attention Approximates Sparse Distributed Memory
and 11 more not named here
check_number_comma 13 other papers
13 later
2107.00910 (2021-07)
Learned Token Pruning for Transformers
2111.00160 (2021-11)
DSEE: Dually Sparsity-embedded Efficient Tuning of Pre-trained Language Models
2111.05498 (2021-11)
Attention Approximates Sparse Distributed Memory
and 10 more not named here
convert_slow_tokenizer 13 other papers
13 later
2107.00910 (2021-07)
Learned Token Pruning for Transformers
2111.00160 (2021-11)
DSEE: Dually Sparsity-embedded Efficient Tuning of Pre-trained Language Models
2111.05498 (2021-11)
Attention Approximates Sparse Distributed Memory
and 10 more not named here
get_configuration_file 11 other papers
11 later
2202.00666 (2022-02)
Locally Typical Sampling
2211.05392 (2022-11)
EVENTS REALM: Event Reasoning of Entity States via Language Models
2212.00921 (2022-12)
AGRO: Adversarial Discovery of Error-prone groups for Robust Optimization
and 8 more not named here
get_architectures_from_config_class 2 other papers
2 later
2305.10614 (2023-05)
Token-wise Decomposition of Autoregressive Language Model Hidden States for Analyzing Model Predictions
2024.findings-acl.699 (2024 (year only))
SCALEARN: Simple and Highly Parameter-Efficient Task Transfer by Learning to Scale
get_processor_types_from_config_class 2 other papers
2 later
2305.10614 (2023-05)
Token-wise Decomposition of Autoregressive Language Model Hidden States for Analyzing Model Predictions
2024.findings-acl.699 (2024 (year only))
SCALEARN: Simple and Highly Parameter-Efficient Task Transfer by Learning to Scale

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-21.

Repositories linked to this paper

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

Abstract

The current modus operandi in NLP involves downloading and fine-tuning pre-trained models consisting of hundreds of millions, or even billions of parameters. Storing and sharing such large trained models is expensive, slow, and time-consuming, which impedes progress towards more general and versatile NLP methods that learn from and for many tasks. Adapters-small learnt bottleneck layers inserted within each layer of a pretrained model-ameliorate this issue by avoiding full fine-tuning of the entire model. However, sharing and integrating adapter layers is not straightforward. We propose AdapterHub, a framework that allows dynamic "stichingin" of pre-trained adapters for different tasks and languages. The framework, built on top of the popular HuggingFace Transformers library, enables extremely easy and quick adaptations of state-of-the-art pre-trained models (e.g., BERT, RoBERTa, XLM-R) across tasks and languages. Downloading, sharing, and training adapters is as seamless as possible using minimal changes to the training scripts and a specialized infrastructure. Our framework enables scalable and easy access to sharing of task-specific models, particularly in lowresource scenarios. AdapterHub includes all recent adapter architectures and can be found at AdapterHub.ml.

For agents

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

get_harvested_code_for_paper("2007.07779")
get_code_for_paper("2007.07779")
have("2007.07779")

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

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

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

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

Connect an agent — have() is free.