SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.14892 · EMNLP · 2023

Air-Decoding: Attribute Distribution Reconstruction for Decoding-Time Controllable Text Generation

Quan Wang, Zhendong Mao, Yongdong Zhang, Tianqi Zhong, Jingxuan Han

arXiv · PDF · Open in the Atlas

Code that ran

7 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 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/2310.14892.json · badge: /api/ran/2310.14892.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
r1047/air-decoding canonical (classifier label)
classifier basis: census
7 ran · 1 no recorded run
FunctionStatusWhere it lives
count_ngram Ran
ran, honoured the contract we drafted
r1047/air-decoding/eval_dist.py
code served (permissive licence) · get_code("630cad41c958eab5")
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 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

torch.manual_seed(0)

# The function expects:
# - hyps_resp: list of lists (each inner list contains tokens/strings)
# - n: int (the n-gram size)

# Create sample data: list of responses where each response is a list of tokens
hyps_resp = [
    ['hello', 'world', 'how', 'are', 'you'],
    ['hello', 'there', 'friend'],
    ['world', 'peace', 'and', 'love'],
    ['how', 'are', 'you', 'doing', 'today']
]

n = 2

ARGS = {
    'hyps_resp': hyps_resp,
    'n': n
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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
eval_distinct Ran
ran, honoured the contract we drafted
r1047/air-decoding/eval_dist.py
code served (permissive licence) · get_code("055f1d87c1438a30")
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 tuple, 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 torch
import numpy as np

# Create a simple stand-in tokenizer class
class SimpleTokenizer:
    def encode(self, text):
        # Simple tokenization: split by spaces and return token ids as strings
        tokens = text.split()
        return [str(i) for i in range(len(tokens))]

# Create tokenizer instance
tokenizer = SimpleTokenizer()

# Create sample hypotheses/responses
hyps_resp = [
    "hello world this is a test",
    "hello world and another test",
    "this is different text here"
]

ARGS = {
    "hyps_resp": hyps_resp,
    "tokenizer": tokenizer
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
padding_fuse_fn Ran
ran; our contract draft was wrong, not the code
r1047/air-decoding/eval_sent_acc.py
code served (permissive licence) · get_code("81b160ae5a338b60")
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 dict. 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

# Analyze the function: padding_fuse_fn takes data_list as parameter
# Each item in data_list must be a dict with keys: 'text', 'sentiment'
# 'text' is a list (gets len() called on it, concatenated with padding)
# 'sentiment' is a scalar value

# Create sample data
sample_item_1 = {
    'text': [1, 2, 3],  # list of 3 elements
    'sentiment': 0.8
}

sample_item_2 = {
    'text': [4, 5],  # list of 2 elements
    'sentiment': 0.2
}

sample_item_3 = {
    'text': [6, 7, 8, 9],  # list of 4 elements
    'sentiment': 0.5
}

data_list = [sample_item_1, sample_item_2, sample_item_3]

ARGS = {
    'data_list': data_list
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
padding_fuse_fn Ran
ran; our contract draft was wrong, not the code
r1047/air-decoding/eval_topic_acc.py
code served (permissive licence) · get_code("f6084b70931b4605")
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 dict. 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)

# Construct a data_list that matches the function's expectations
# Each item should have 'text' (a list of integers) and 'topic' (a value)

data_list = [
    {
        'text': [101, 102, 103],  # list of token IDs
        'topic': 0
    },
    {
        'text': [201, 202],  # shorter text
        'topic': 1
    },
    {
        'text': [301, 302, 303, 304, 305],  # longest text
        'topic': 2
    }
]

ARGS = {
    'data_list': data_list
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
padding_fuse_fn Ran
ran; our contract draft was wrong, not the code
r1047/air-decoding/train_PCLMs.py
code served (permissive licence) · get_code("69d43732bc565135")
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 dict. 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)

# Construct valid arguments for padding_fuse_fn
# The function expects data_list: a list of dicts with 'text' and 'label' keys
# 'text' should be a list of token IDs
# 'label' should be a sentiment label

data_list = [
    {
        'text': [101, 2054, 2003, 102],  # 4 tokens
        'label': 1
    },
    {
        'text': [101, 2054, 102],  # 3 tokens
        'label': 0
    }
]

ARGS = {
    'data_list': data_list
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
tokenized Ran
ran; our contract draft was wrong, not the code
r1047/air-decoding/eval_sent_acc.py
code served (permissive licence) · get_code("cd40a8cc4513a278")
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 json
import tempfile
import os

# Create a minimal tokenizer stand-in that has the encode method
class MinimalTokenizer:
    def encode(self, text, max_length=None, truncation=False):
        # Simple mock: split text into words and convert to token IDs
        tokens = text.split()[:max_length] if max_length else text.split()
        return [i % 1000 for i in range(len(tokens))]

# Create a temporary dataset file with sample data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.jsonl')
dataset_path = temp_file.name

# Write sample JSONL data
sample_data = [
    json.dumps({"sentiment": "Positive", "text": "This is a great product"}),
    json.dumps({"sentiment": "Negative", "review": "This is terrible"}),
    json.dumps({"sentiment": "Positive", "text": "Amazing experience"}),
]

for line in sample_data:
    temp_file.write(line + '\n')

temp_file.close()

# Create tokenizer instance
tokenizer = MinimalTokenizer()

# Define arguments
ARGS = {
    "dataset_path": dataset_path,
    "tokenizer": tokenizer,
}
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
tokenized Ran
ran; our contract draft was wrong, not the code
r1047/air-decoding/eval_topic_acc.py
code served (permissive licence) · get_code("982e9a7c1be6b543")
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 json
import tempfile
import os

# Create a temporary file with sample JSONL data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.jsonl')
temp_file_path = temp_file.name

# Write sample data to the temporary file
sample_data = [
    json.dumps({'label': 'World', 'text': 'Breaking news from around the globe'}),
    json.dumps({'topic': 1, 'text': 'Team wins championship game'}),
    json.dumps({'label': 'Business', 'text': 'Stock market reaches new heights'}),
    json.dumps({'topic': '3', 'text': 'Scientists discover new particle'})
]

for line in sample_data:
    temp_file.write(line + '\n')
temp_file.close()

# Create a minimal tokenizer stand-in class
class MockTokenizer:
    def encode(self, text, max_length=None, truncation=False):
        # Return a simple tokenized representation
        tokens = text.split()[:max_length] if max_length else text.split()
        return [hash(token) % 1000 for token in tokens]

ARGS = {
    'dataset_path': temp_file_path,
    'tokenizer': MockTokenizer()
}
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
cal_ppl Not yet run
unverified (harvested, no recorded run)
r1047/air-decoding/eval_perplexity.py
code served (permissive licence) · get_code("cbb2cea3d40f40de")
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
count_ngram 1 other paper
1 dated earlier
1911.04700 (2019-11)
A Pre-training Based Personalized Dialogue Generation Model with Persona-sparse Data

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

Controllable text generation (CTG) aims to generate text with desired attributes, and decodingtime-based methods have shown promising performance on this task. However, in this paper, we identify the phenomenon of Attribute Collapse for the first time. It causes the fluency of generated text to rapidly decrease when the control strength exceeds a critical value, rendering the text completely unusable. This limitation hinders the effectiveness of decoding methods in achieving high levels of controllability. To address this problem, we propose a novel lightweight decoding framework named Air-Decoding. Its main idea is reconstructing the attribute distributions to balance the weights between attribute words and nonattribute words to generate more fluent text. Specifically, we train prefixes by prefix-tuning to obtain attribute distributions. Then we design a novel attribute distribution reconstruction method to balance the obtained distributions and use the reconstructed distributions to guide language models for generation, effectively avoiding the issue of Attribute Collapse. Experiments on multiple CTG tasks prove that our method achieves a new state-of-the-art control performance 1 .

For agents

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

get_harvested_code_for_paper("2310.14892")
get_code_for_paper("2310.14892")
have("2310.14892")

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

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

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

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

Connect an agent — have() is free.