SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.14870 · NeurIPS · 2023

Composing Parameter-Efficient Modules with Arithmetic Operations

Junxian He, Jinghan Zhang, Junteng Liu, Shiqi Chen

arXiv · PDF · Open in the Atlas

Code that ran

5 of 10 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; 1 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 1 failure 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/2306.14870.json · badge: /api/ran/2306.14870.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
sjtu-lit/pem_composition canonical (classifier label)
classifier basis: census
5 ran · 2 no recorded run
hkust-nlp/pem_composition canonical (classifier label)
classifier basis: classifier_2025
0 ran · 3 no recorded run
FunctionStatusWhere it lives
adjust_length_to_model Ran
ran, honoured the contract we drafted
sjtu-lit/pem_composition/exps/composition_for_unlearning/gpt2_scale.py
code served (permissive licence) · get_code("440751480098ee7d")
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 int, ndim 0, dtype family int, 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 numpy as np

MAX_LENGTH = int(10000)

def adjust_length_to_model(length, max_sequence_length):
    if length < 0 and max_sequence_length > 0:
        length = max_sequence_length
    elif 0 < max_sequence_length < length:
        length = max_sequence_length
    elif length < 0:
        length = MAX_LENGTH
    return length

ARGS = {
    "length": 50,
    "max_sequence_length": 100
}
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 int, ndim 0, dtype family int, 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
compute_pairwise_coefficient_sets Ran
ran on a synthesized input
sjtu-lit/pem_composition/merge.py
pointer only (licence: Apache-2.0) · get_code("2c77d7dc5a31d431")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, sjtu-lit/pem_composition, 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.

find_incomplete_sentence Ran
ran on a synthesized input
sjtu-lit/pem_composition/AlpacaLoRAcomposition/detoxify_api.py
pointer only (licence: Apache-2.0) · get_code("ba7e81c71b1fb5f1")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, sjtu-lit/pem_composition, 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.

load_input_text Ran
ran; our contract draft was wrong, not the code
sjtu-lit/pem_composition/exps/composition_for_unlearning/run_prediction.py
code served (permissive licence) · get_code("0ca28293fa42b301")
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 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 os
import tempfile

# Create a temporary txt file for testing
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_input.txt")
with open(temp_file, 'w') as f:
    f.write("line 1\nline 2\nline 3")

# Test case 1: File path
ARGS = {
    "input_obj": temp_file
}
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 float — 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
load_input_text Ran
ran on a synthesized input
sjtu-lit/pem_composition/AlpacaLoRAcomposition/detoxify_api.py
pointer only (licence: Apache-2.0) · get_code("42dd792cf7755f82")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, sjtu-lit/pem_composition, 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.

adapter_negation Not yet run
unverified (harvested, no recorded run)
sjtu-lit/pem_composition/exps/composition_for_unlearning/gpt2_scale.py
pointer only (licence: Apache-2.0) · get_code("950ec6a2194fb76d")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, sjtu-lit/pem_composition, 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.

adjust_tensors_for_parallel Not yet run
unverified (harvested, no recorded run)
hkust-nlp/pem_composition/src/transformers/adapters/composition.py
code served (permissive licence) · get_code("b3615647974036c4")
How it ran

no invocation recorded.

adjust_tensors_for_parallel Not yet run
unverified (harvested, no recorded run)
sjtu-lit/pem_composition/src/transformers/adapters/composition.py
code served (permissive licence) · get_code("f8ef77acae8f9f42")
How it ran

no invocation recorded.

parse_composition Not yet run
unverified (harvested, no recorded run)
hkust-nlp/pem_composition/src/transformers/adapters/composition.py
code served (permissive licence) · get_code("fd2a1edfdefc5de3")
How it ran

no invocation recorded. this sample carries JSON test cases instead of a setup block; get_reference_implementation serves them with the level they back.

parse_heads_from_composition Not yet run
unverified (harvested, no recorded run)
hkust-nlp/pem_composition/src/transformers/adapters/composition.py
code served (permissive licence) · get_code("ae8bbe37a1f80e76")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 5 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 4 later) and 4 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
adjust_length_to_model 3 other papers
2 dated earlier, 1 same year, order not determinable
2009.06367 (2020-09)
GeDi: Generative Discriminator Guided Sequence Generation
2010.12850 (2020-10)
CoCo: Controllable Counterfactuals for Evaluating Dialogue State Trackers
2023.emnlp-industry.17 (2023 (year only))
Investigating Table-to-Text Generation Capabilities of LLMs in Real-World Information Seeking Scenarios
parse_heads_from_composition 3 other papers
1 dated earlier, 2 later
2303.15647 (2023-03)
Scaling Down to Scale Up: A Guide to Parameter-Efficient Fine-Tuning
2310.20150 (2023-10)
Unlearn What You Want to Forget: Efficient Unlearning for LLMs
2311.11077 (2023-11)
Adapters: A Unified Library for Parameter-Efficient and Modular Transfer Learning
parse_composition 2 other papers
1 dated earlier, 1 later
2303.15647 (2023-03)
Scaling Down to Scale Up: A Guide to Parameter-Efficient Fine-Tuning
2310.20150 (2023-10)
Unlearn What You Want to Forget: Efficient Unlearning for LLMs
adjust_tensors_for_parallel 1 other paper
1 later
2310.20150 (2023-10)
Unlearn What You Want to Forget: Efficient Unlearning for LLMs
load_input_text 1 other paper
1 later
2604.14602 (2026-04)
CausalDetox: Causal Head Selection and Intervention for Language Model Detoxification

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

As an efficient alternative to conventional full finetuning, parameter-efficient finetuning (PEFT) is becoming the prevailing method to adapt pretrained language models. In PEFT, a lightweight module is learned on each dataset while the underlying pretrained language model remains unchanged, resulting in multiple compact modules representing diverse skills when applied to various domains and tasks. In this paper, we propose to compose these parameter-efficient modules through linear arithmetic operations in the weight space, thereby integrating different module capabilities. Specifically, we first define addition and negation operators for the module, and then further compose these two basic operators to perform flexible arithmetic. Our approach requires no additional training and enables highly flexible module composition. We apply different arithmetic operations to compose the parameter-efficient modules for (1) distribution generalization, (2) multi-tasking, (3) unlearning, and (4) domain transfer. Additionally, we extend our approach to detoxify Alpaca-LoRA, the latest instruction-tuned large language model based on LLaMA. Empirical results demonstrate that our approach produces new and effective parameter-efficient modules that significantly outperform existing ones across all settings. 1

For agents

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

get_harvested_code_for_paper("2306.14870")
get_code_for_paper("2306.14870")
have("2306.14870")

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

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

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

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

Connect an agent — have() is free.