SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2112.00791 · ICML · 2022

Controlling Conditional Language Models without Catastrophic Forgetting

Tomasz Korbak, Hady Elsahar, Marc Dymetman, Germán Kruszewski

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 (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 3 failures of our instrument; 1 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/2112.00791.json · badge: /api/ran/2112.00791.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
naver/gdc canonical (classifier label)
classifier basis: classifier_2025
3 ran · 1 no recorded run
google/t5patches community (classifier label)
classifier basis not recorded on the link
4 ran · 0 no recorded run
FunctionStatusWhere it lives
BaseTrainer Ran
ran on a synthesized input · constructed an object; no result was computed
naver/gdc/cdpg/cdpg/pointwise_gdc.py
pointer only (licence: NOASSERTION) · get_code("4e11394481ba47b3")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, naver/gdc (NOASSERTION). 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.

dot_product_attention Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
google/t5patches/t5patches/layers.py
code served (permissive licence) · get_code("dac0288079ac279f")
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 ArrayImpl, ndim 4, dtype family float, shape (2, 3, 2, 6) 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 jax
import jax.numpy as jnp
from jax import random

# Set seed for reproducibility
key = random.PRNGKey(0)

# Dimensions
batch = 2
q_length = 3
kv_length = 4
num_heads = 2
qk_depth_per_head = 5
v_depth_per_head = 6

# Create query, key, value tensors with distinct sizes
query = jnp.ones((batch, q_length, num_heads, qk_depth_per_head), dtype=jnp.float32)
key = jnp.ones((batch, kv_length, num_heads, qk_depth_per_head), dtype=jnp.float32)
value = jnp.ones((batch, kv_length, num_heads, v_depth_per_head), dtype=jnp.float32)

# Create bias (optional) - broadcastable to [batch, num_heads, q_length, kv_length]
bias = jnp.zeros((batch, num_heads, q_length, kv_length), dtype=jnp.float32)

# Generate dropout RNG key
dropout_rng = random.PRNGKey(1)

# Define arguments
ARGS = {
    "query": query,
    "key": key,
    "value": value,
    "bias": bias,
    "dropout_rng": dropout_rng,
    "dropout_rate": 0.1,
    "deterministic": False,
    "dtype": jnp.float32,
    "float32_logits": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 4, dtype family float, shape (2, 3, 2, 6) — shape (2, 3, 2, 6) 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
entropy_from_logits Ran
ran; our contract draft was wrong, not the code
naver/gdc/cdpg/cdpg/pointwise_gdc.py
pointer only (licence: NOASSERTION) · get_code("499346faba26ea21")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, naver/gdc (NOASSERTION). 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_first_diff_mask Ran
ran on a synthesized input
google/t5patches/t5patches/feature_converters_utils.py
code served (permissive licence) · get_code("84ee976a4b8362c9")
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 EagerTensor, ndim 1, dtype family int, shape (4,) 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 tensorflow.compat.v2 as tf

# Enable eager execution for TensorFlow 2
tf.enable_v2_behavior()

# Create test sequences as 1D tensors
seq1 = tf.constant([1, 2, 3, 4], dtype=tf.int32)
seq2 = tf.constant([1, 2, 5, 6, 7], dtype=tf.int32)

ARGS = {
    "seq1": seq1,
    "seq2": seq2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 1, dtype family int, shape (4,) — shape (4,) 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
logprobs_from_logits Ran
ran; our contract draft was wrong, not the code
naver/gdc/cdpg/cdpg/pointwise_gdc.py
pointer only (licence: NOASSERTION) · get_code("fdebc86ab591bd34")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, naver/gdc (NOASSERTION). 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_attention_mask Ran
ran on a synthesized input
google/t5patches/t5patches/layers.py
code served (permissive licence) · get_code("1184cae8ca10c644")
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 ArrayImpl, ndim 4, dtype family float, shape (2, 1, 3, 2) 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 jax.numpy as jnp

# Create small query and key input arrays
# query_input shape: [batch, len_q]
query_input = jnp.array([[1.0, 2.0, 3.0],
                         [4.0, 5.0, 6.0]])  # shape: (2, 3)

# key_input shape: [batch, len_kv]
key_input = jnp.array([[1.0, 2.0],
                       [3.0, 4.0]])  # shape: (2, 2)

# Pairwise function - using jnp.multiply as default
pairwise_fn = jnp.multiply

# Extra batch dims
extra_batch_dims = 0

# Data type
dtype = jnp.float32

ARGS = {
    "query_input": query_input,
    "key_input": key_input,
    "pairwise_fn": pairwise_fn,
    "extra_batch_dims": extra_batch_dims,
    "dtype": dtype
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 4, dtype family float, shape (2, 1, 3, 2) — shape (2, 1, 3, 2) 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
make_causal_mask Ran
ran on a synthesized input
google/t5patches/t5patches/layers.py
code served (permissive licence) · get_code("94c13ffc5f28dfba")
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 ArrayImpl, ndim 4, dtype family float, shape (2, 1, 4, 4) 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 jax.numpy as jnp

# Create a small input array for make_causal_mask
# Shape: [batch, len] where batch=2, len=4
x = jnp.ones((2, 4), dtype=jnp.float32)

# Define all parameters for make_causal_mask
ARGS = {
    "x": x,
    "extra_batch_dims": 0,
    "dtype": jnp.float32,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 4, dtype family float, shape (2, 1, 4, 4) — shape (2, 1, 4, 4) 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
PointwiseGDCTrainer Not yet run
unverified (harvested, no recorded run)
naver/gdc/cdpg/cdpg/pointwise_gdc.py
pointer only (licence: NOASSERTION) · get_code("da3e3fa9219ccd85")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, naver/gdc (NOASSERTION). 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 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, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 2 later) and 5 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
dot_product_attention 5 other papers
1 dated earlier, 4 later
2106.03598 (2021-06)
SciFive: a text-to-text transformer model for biomedical literature
2206.05408 (2022-06)
Multi-instrument Music Synthesis with Spectrogram Diffusion
2212.04356 (2022-12)
Robust Speech Recognition via Large-Scale Weak Supervision
and 2 more not named here
make_attention_mask 2 other papers
1 dated earlier, 1 later
2106.03598 (2021-06)
SciFive: a text-to-text transformer model for biomedical literature
2206.05408 (2022-06)
Multi-instrument Music Synthesis with Spectrogram Diffusion
make_causal_mask 1 other paper
1 dated earlier
2106.03598 (2021-06)
SciFive: a text-to-text transformer model for biomedical literature

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

Machine learning is shifting towards generalpurpose pretrained generative models, trained in a self-supervised manner on large amounts of data, which can then be applied to solve a large number of tasks. However, due to their generic training methodology, these models often fail to meet some of the downstream requirements (e.g., hallucinations in abstractive summarization or style violations in code generation). This raises the important question of how to adapt pre-trained generative models to meet all requirements without destroying their general capabilities ("catastrophic forgetting"). Recent work has proposed to solve this problem by representing task-specific requirements through energy-based models (EBMs) and approximating these EBMs using distributional policy gradients (DPG). Despite its effectiveness, this approach is however limited to unconditional distributions. In this paper, we extend DPG to conditional tasks by proposing Conditional DPG (CDPG). We evaluate CDPG on four different control objectives across three tasks (translation, summarization and code generation) and two pretrained models (T5 and GPT-Neo). Our results show that finetuning using CDPG robustly moves these pretrained models closer towards meeting control objectives and -in contrast with baseline approaches -does not result in catastrophic forgetting.

For agents

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

get_harvested_code_for_paper("2112.00791")
get_code_for_paper("2112.00791")
have("2112.00791")

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

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

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

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

Connect an agent — have() is free.