SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2311.11077 · EMNLP · 2023

Adapters: A Unified Library for Parameter-Efficient and Modular Transfer Learning

Iryna Gurevych, Sebastian Ruder, Jonas Pfeiffer, Sukannya Purkayastha, Indraneil Paul, Hannah Sterz, Ivan Vuli'c, Timo Imhof, Clifton A. Poth, Leon Arne Engländer

arXiv · PDF · Open in the Atlas

Code that ran

3 of 8 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 0 have no contract verdict; 2 failures of our instrument; 5 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/2311.11077.json · badge: /api/ran/2311.11077.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/adapters canonical (classifier label)
classifier basis: census
3 ran · 5 no recorded run
FunctionStatusWhere it lives
get_adapter_config_hash Ran
ran; our contract draft was wrong, not the code
adapter-hub/adapters/src/adapters/utils.py
code served (permissive licence) · get_code("ecfe68a3e8b4e502")
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 hashlib
import json
from collections.abc import Mapping

ADAPTER_CONFIG_HASH_IGNORE = []

ADAPTER_CONFIG_HASH_IGNORE_DEFAULT = {'phm_layer': True, 'phm_dim': 4, 'factorized_phm_W': True, 'shared_W_phm': False, 'shared_phm_rule': True, 'factorized_phm_rule': False, 'phm_c_init': 'normal', 'phm_init_range': 0.0001, 'learn_phm': True, 'hypercomplex_nonlinearity': 'glorot-uniform', 'phm_rank': 1, 'phm_bias': True, 'init_weights': 'bert', 'scaling': 1.0}

def _minimize_dict(d):
    if isinstance(d, Mapping):
        return {k: _minimize_dict(v) for k, v in d.items() if v}
    else:
        return d

def get_adapter_config_hash(config, length=16, ignore_params=[]):
    """
    Calculates the hash of a given adapter configuration which is used to identify this configuration.

    Returns:
        str: The resulting hash of the given config dict.
    """
    minimized_config = _minimize_dict({k: v for k, v in config.items() if k not in ADAPTER_CONFIG_HASH_IGNORE + ignore_params})
    for name, default in ADAPTER_CONFIG_HASH_IGNORE_DEFAULT.items():
        if minimized_config.get(name, None) == default:
            del minimized_config[name]
    dict_str = json.dumps(minimized_config, sort_keys=True)
    h = hashlib.sha1()
    h.update(dict_str.encode(encoding='utf-8'))
    return h.hexdigest()[:length]


# Construct valid arguments for get_adapter_config_hash
ARGS = {
    "config": {
        "adapter_type": "lora",
        "hidden_size": 768,
        "num_layers": 12,
        "phm_layer": False,
        "phm_dim": 8,
        "reduction_factor": 16,
        "non_linearity": "gelu",
        "use_bottleneck": True,
        "scaling": 2.0
    },
    "length": 16,
    "ignore_params": ["num_layers"]
}
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 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
multigetattr Ran
ran; our contract draft was wrong, not the code
adapter-hub/adapters/src/adapters/utils.py
code served (permissive licence) · get_code("4a0b4484fd1adec4")
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 Linear. 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)

# Create a simple nested object structure to test multigetattr
class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer = nn.Linear(4, 3)
        self.name = "test_module"

class NestedObject:
    def __init__(self):
        self.module = SimpleModule()
        self.value = 42

# Create test object with nested attributes
test_obj = NestedObject()

# Test cases for multigetattr
ARGS = {
    "o": test_obj,
    "name": "module.layer",
    "default": None
}
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 Linear — a Linear output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Linear 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
multihasattr Ran
ran, violated the contract we drafted
adapter-hub/adapters/src/adapters/utils.py
code served (permissive licence) · get_code("7c12b2dc54485dee")
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 bool, ndim 0, dtype family float, shape () 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
import torch.nn as nn

torch.manual_seed(0)

# Create a simple nested object structure to test multihasattr
class Level3:
    def __init__(self):
        self.value = 42

class Level2:
    def __init__(self):
        self.level3 = Level3()
        self.name = "level2"

class Level1:
    def __init__(self):
        self.level2 = Level2()
        self.data = torch.randn(2, 4)

# Test object with nested attributes
test_obj = Level1()

# Test cases:
# 1. Empty name should return False
# 2. Single level attribute access
# 3. Multi-level nested attribute access

ARGS = {
    "o": test_obj,
    "name": "level2.level3.value"
}
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 bool, ndim 0, dtype family float, shape () — shape () 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
adjust_tensors_for_parallel Not yet run
unverified (harvested, no recorded run)
adapter-hub/adapters/src/adapters/composition.py
code served (permissive licence) · get_code("d4873822373665b6")
How it ran

no invocation recorded.

get_head_config_and_rename_list Not yet run
unverified (harvested, no recorded run)
adapter-hub/adapters/src/adapters/head_utils.py
code served (permissive licence) · get_code("8cbc91d9a5f1d924")
How it ran

no invocation recorded.

parse_composition Not yet run
unverified (harvested, no recorded run)
adapter-hub/adapters/src/adapters/composition.py
code served (permissive licence) · get_code("35e3ad6b7aed8bed")
How it ran

no invocation recorded.

parse_heads_from_composition Not yet run
unverified (harvested, no recorded run)
adapter-hub/adapters/src/adapters/composition.py
code served (permissive licence) · get_code("3f3d88b639bd4b13")
How it ran

no invocation recorded.

setup_adapter_training Not yet run
unverified (harvested, no recorded run)
adapter-hub/adapters/src/adapters/training.py
code served (permissive licence) · get_code("8c11032f0bd8049f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 7 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
parse_heads_from_composition 3 other papers
3 dated earlier
2303.15647 (2023-03)
Scaling Down to Scale Up: A Guide to Parameter-Efficient Fine-Tuning
2306.14870 (2023-06)
Composing Parameter-Efficient Modules with Arithmetic Operations
2310.20150 (2023-10)
Unlearn What You Want to Forget: Efficient Unlearning for LLMs

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

We introduce Adapters, an open-source library that unifies parameter-efficient and modular transfer learning in large language models. By integrating 10 diverse adapter methods into a unified interface, Adapters offers ease of use and flexible configuration. Our library allows researchers and practitioners to leverage adapter modularity through composition blocks, enabling the design of complex adapter setups. We demonstrate the library's efficacy by evaluating its performance against full finetuning on various NLP tasks. Adapters provides a powerful tool for addressing the challenges of conventional fine-tuning paradigms and promoting more efficient and modular transfer learning. The library is available via https://adapterhub.ml/adapters. AdapterHub, we, therefore, propose Adapters, a new library aimed at unifying parameter-efficient and modular transfer learning. Compared to the first AdapterHub iteration and concurrent libraries, our main contributions can be summarized as fol-

For agents

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

get_harvested_code_for_paper("2311.11077")
get_code_for_paper("2311.11077")
have("2311.11077")

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

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

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

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

Connect an agent — have() is free.