SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2212.09387 · 2022

An Extensible Plug-and-Play Method for Multi-Aspect Controllable Text Generation

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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 2 have no contract verdict; 2 failures of our instrument; 1 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/2212.09387.json · badge: /api/ran/2212.09387.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
thunlp-mt/promptgating4mctg canonical (classifier label)
classifier basis not recorded on the link
5 ran · 1 no recorded run
FunctionStatusWhere it lives
classify_sentence Ran
ran on a synthesized input
thunlp-mt/promptgating4mctg/codes/exp_tense/tense_detector_t.py
code served (permissive licence) · get_code("c7fda9edb0a825ac")
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.

TT_UNDECIDED = 0
TT_PAST = 1
TT_PRESENT = 2
TT_NO_VERB = 3
TT_FUTURE = 4

tense_strs = {TT_UNDECIDED: 'undecided', TT_PAST: 'the past tense', TT_PRESENT: 'the present tense', TT_NO_VERB: 'undecided', TT_FUTURE: 'the future tense'}

tense_tags = {'VB': TT_UNDECIDED, 'VBD': TT_PAST, 'VBG': TT_PRESENT, 'VBN': TT_PAST, 'VBP': TT_PRESENT, 'VBZ': TT_PRESENT, 'MD': TT_FUTURE}

line = "The cat walked quickly down the street."

sorted_d = {
    'verb1': {'pos': 'VBD', 'dep': 0},
    'verb2': {'pos': 'VB', 'dep': 2},
    'verb3': {'pos': 'VBZ', 'dep': 3}
}

ARGS = {
    'line': line,
    'sorted_d': sorted_d
}
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
import_params Ran
ran on a synthesized input
thunlp-mt/promptgating4mctg/codes/thumt/bin/scorer.py
code served (permissive licence) · get_code("40ababf4a5b7509f")
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 MockParams. 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 os
import json
import tempfile


class MockParams:
    """Stand-in params object with parse_json method."""
    def __init__(self):
        self.data = {}
    
    def parse_json(self, json_str):
        """Parse JSON string and store in data dict."""
        self.data = json.loads(json_str)


# Create a temporary directory and a test JSON file
temp_dir = tempfile.mkdtemp()
model_name = "test_model"
model_file = os.path.join(temp_dir, model_name + ".json")

# Write a test JSON file with some parameters
test_params = {"learning_rate": 0.001, "batch_size": 32, "layers": 3}
with open(model_file, "w") as f:
    json.dump(test_params, f)

# Create params object
params = MockParams()

ARGS = {
    "model_dir": temp_dir,
    "model_name": model_name,
    "params": params
}
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 MockParams — a MockParams output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockParams 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
invert_mask Ran
ran, violated the contract we drafted
thunlp-mt/promptgating4mctg/codes/thumt/models/modeling_bart.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from yeliu918/KG-BART, is pointer only (licence: NONE) · get_code("874a42377fa0659f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-3-Clause), but get_code serves the stored copy, first harvested from yeliu918/KG-BART, 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.

make_padding_mask Ran
ran; our contract draft was wrong, not the code
thunlp-mt/promptgating4mctg/codes/thumt/models/modeling_bart.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from yeliu918/KG-BART, is pointer only (licence: NONE) · get_code("f20c9b1aead27fea")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-3-Clause), but get_code serves the stored copy, first harvested from yeliu918/KG-BART, 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.

shift_tokens_right Ran
ran; our contract draft was wrong, not the code
thunlp-mt/promptgating4mctg/codes/thumt/models/modeling_bart.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from yeliu918/KG-BART, is pointer only (licence: NONE) · get_code("e00ccf7847d12b59")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-3-Clause), but get_code serves the stored copy, first harvested from yeliu918/KG-BART, 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.

fetch Not yet run
unverified (harvested, no recorded run)
thunlp-mt/promptgating4mctg/codes/exp_tense/tense_detector_t.py
code served (permissive licence) · get_code("cb76fc23dc68c244")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 3 later) and 2 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
shift_tokens_right 11 other papers
8 dated earlier, 3 later
1910.13461 (2019-10)
BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
2009.12005 (2020-09)
MinTL: Minimalist Transfer Learning for Task-Oriented Dialogue Systems
2009.12677 (2020-09)
KG-BART: Knowledge Graph-Augmented BART for Generative Commonsense Reasoning
and 8 more not named here
invert_mask 10 other papers
7 dated earlier, 3 later
1910.13461 (2019-10)
BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
2009.12005 (2020-09)
MinTL: Minimalist Transfer Learning for Task-Oriented Dialogue Systems
2009.12677 (2020-09)
KG-BART: Knowledge Graph-Augmented BART for Generative Commonsense Reasoning
and 7 more not named here
make_padding_mask 9 other papers
8 dated earlier, 1 later
1910.13461 (2019-10)
BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
2009.12005 (2020-09)
MinTL: Minimalist Transfer Learning for Task-Oriented Dialogue Systems
2009.12677 (2020-09)
KG-BART: Knowledge Graph-Augmented BART for Generative Commonsense Reasoning
and 6 more not named here
import_params 2 other papers
1 dated earlier, 1 same year, order not determinable
2110.06609 (2021-10)
MSP: Multi-Stage Prompting for Making Pre-trained Language Models Better Translators
2022.findings-acl.203 (2022 (year only))
Prompt-Driven Neural Machine Translation

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

Recently, multi-aspect controllable text generation that controls the generated text in multiple aspects (e.g., sentiment, topic, and keywords) has attracted increasing attention. Although methods based on parameter efficient tuning like prefix-tuning could achieve multi-aspect controlling in a plug-and-play way, the mutual interference of multiple prefixes leads to significant degeneration of constraints and limits their extensibility to training-time unseen aspect combinations. In this work, we provide a theoretical lower bound for the interference and empirically found that the interference grows with the number of layers where prefixes are inserted. Based on these analyses, we propose using trainable gates to normalize the intervention of prefixes to restrain the growing interference. As a result, controlling training-time unseen combinations of aspects can be realized by simply concatenating corresponding plugins such that new constraints can be extended at a lower cost. In addition, we propose a unified way to process both categorical and free-form constraints. Experiments on text generation and machine translation demonstrate the superiority of our approach over baselines on constraint accuracy, text quality, and extensibility.

For agents

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

get_harvested_code_for_paper("2212.09387")
get_code_for_paper("2212.09387")
have("2212.09387")

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

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

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

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

Connect an agent — have() is free.