SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2205.12647 · EMNLP · 2022

Overcoming Catastrophic Forgetting in Zero-Shot Cross-Lingual Generation

Noah Constant, Mohit Iyyer, Tu Vu, Brian Lester, Daniel Cer, Aditya Barua

arXiv · PDF · Open in the Atlas

Code that ran

6 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; 1 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 failures of our instrument; 0 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/2205.12647.json · badge: /api/ran/2205.12647.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
google-research/prompt-tuning canonical (classifier label)
classifier basis not recorded on the link
6 ran · 0 no recorded run
FunctionStatusWhere it lives
fetch_eval_metrics Ran
ran on a synthesized input
google-research/prompt-tuning/prompt_tuning/recycling/collect_recycling_results.py
code served (permissive licence) · get_code("9f6209dd6743deab")
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 csv
import io
import itertools
import json
import os
import re
from typing import Optional, Mapping, Any, Set
from unittest.mock import Mock, patch, MagicMock
import tempfile

# Mock gfile since we can't do real file I/O
def mock_gfile_exists(path):
    return True

def mock_gfile_listdir(path):
    return [
        'recycled_from_Large_at_100_to_Default',
        'recycled_from_Seed_1_at_200_to_Large',
        'invalid_dir_name',
    ]

def mock_gfile_open(path, *args, **kwargs):
    # Create mock file content for metrics
    if 'metrics.jsonl' in path:
        content = json.dumps({"accuracy": 0.95, "loss": 0.05}) + '\n'
        return io.StringIO(content)
    return io.StringIO('')

# Create a temporary directory structure for testing
temp_dir = tempfile.mkdtemp()

# Create subdirectories and metric files
os.makedirs(os.path.join(temp_dir, 'recycled_from_Large_at_100_to_Default', 'inference_eval'), exist_ok=True)
os.makedirs(os.path.join(temp_dir, 'recycled_from_Seed_1_at_200_to_Large', 'inference_eval'), exist_ok=True)

# Write metric files
metric_file_1 = os.path.join(temp_dir, 'recycled_from_Large_at_100_to_Default', 'inference_eval', 'my_task-metrics.jsonl')
with open(metric_file_1, 'w') as f:
    f.write(json.dumps({"accuracy": 0.92}) + '\n')

metric_file_2 = os.path.join(temp_dir, 'recycled_from_Seed_1_at_200_to_Large', 'inference_eval', 'my_task-metrics.jsonl')
with open(metric_file_2, 'w') as f:
    f.write(json.dumps({"accuracy": 0.88}) + '\n')

# Patch gfile to use real filesystem for our temp directory
def patched_gfile_exists(path):
    if path.startswith(temp_dir):
        return os.path.exists(path)
    return True

def patched_gfile_listdir(path):
    if path == temp_dir:
        return os.listdir(path)
    return []

def patched_gfile_open(path, mode='r'):
    if path.startswith(temp_dir):
        return open(path, mode)
    return io.StringIO('')

ARGS = {
    'eval_dir': temp_dir,
    'task_name': 'my_task',
    'metric_name': 'accuracy',
    'display_metric': 'Acc',
    'constant_fields': {'exp_name': 'test_exp', 'run_id': '1'},
    'steps': {100, 200},
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
absl, tensorflow — 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
fetch_training_metrics Ran
ran on a synthesized input
google-research/prompt-tuning/prompt_tuning/recycling/collect_recycling_results.py
code served (permissive licence) · get_code("804afc34670de73d")
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 csv
import io
import itertools
import json
import os
import tempfile
from typing import Optional, Mapping, Any, Set
from unittest.mock import patch, MagicMock

# Create a temporary directory and mock jsonl file
temp_dir = tempfile.mkdtemp()
inference_eval_dir = os.path.join(temp_dir, 'inference_eval')
os.makedirs(inference_eval_dir, exist_ok=True)

# Create mock jsonl data
task_name = 'test_task'
jsonl_path = os.path.join(inference_eval_dir, f'{task_name}-metrics.jsonl')

mock_data = [
    {'step': 100, 'accuracy': 0.85},
    {'step': 200, 'accuracy': 0.90},
    {'step': 300, 'accuracy': 0.92},
    {'step': 400, 'accuracy': 0.94},
]

with open(jsonl_path, 'w') as f:
    for item in mock_data:
        f.write(json.dumps(item) + '\n')

# Define ARGS for the function
ARGS = {
    'model_dir': temp_dir,
    'task_name': task_name,
    'metric_name': 'accuracy',
    'display_metric': 'Acc',
    'constant_fields': {'model_id': 'test_model', 'experiment': 'exp1'},
    'steps': {100, 200, 300},
}
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 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
identity Ran
ran, honoured the contract we drafted
google-research/prompt-tuning/prompt_tuning/extended/multitask_prompts.py
code served (permissive licence) · get_code("e636ec980fcbe847")
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 Tensor, ndim 2, dtype family float, shape (2, 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 torch
import numpy as np
from typing import Any

torch.manual_seed(0)

# The identity function takes a single parameter 'x' of type Any
# and simply returns it unchanged. We need to provide a valid value for x.
# Since x can be ANY type, we'll use a simple value - a tensor.

x_value = torch.randn(2, 4)

ARGS = {
    "x": x_value
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
read_jsonl Ran
ran on a synthesized input
google-research/prompt-tuning/prompt_tuning/recycling/collect_recycling_results.py
code served (permissive licence) · get_code("cb6ca8f7f505ca27")
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 JSONL file with valid test data
temp_dir = tempfile.mkdtemp()
temp_jsonl_path = os.path.join(temp_dir, "test.jsonl")

# Write test JSONL data
test_data = [
    {"id": 1, "text": "hello world"},
    {"id": 2, "text": "foo bar"},
    {"id": 3, "text": "test data"}
]

with open(temp_jsonl_path, 'w') as f:
    for obj in test_data:
        f.write(json.dumps(obj) + '\n')

ARGS = {
    "path": temp_jsonl_path
}
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 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
summarize_attention Ran
ran on a synthesized input
google-research/prompt-tuning/prompt_tuning/extended/masks.py
code served (permissive licence) · get_code("1c9147a70ebbe592")
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 torch
import torch.nn as nn

# Define valid attention types as specified in the function
INPUT_INPUT = 'input->input'
INPUT_PROMPT = 'input->prompt'
PROMPT_PROMPT = 'prompt->prompt'
PROMPT_PROMPT_CAUSAL = 'prompt->prompt;causal'
PROMPT_INPUT = 'prompt->input'

# Construct ARGS dictionary with valid arguments for summarize_attention
ARGS = {
    'attentions': {INPUT_INPUT, INPUT_PROMPT, PROMPT_PROMPT_CAUSAL},
    'decoder': False
}
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 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
translate_recycler_name Ran
ran on a synthesized input
google-research/prompt-tuning/prompt_tuning/recycling/run_recycle.py
code served (permissive licence) · get_code("c35a443987679a55")
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 torch

ARGS = {
    "name": "v2v-nn"
}
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 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

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, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 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
identity 2 other papers
2 later
2301.03150 (2023-01)
MOTOR: A Time-To-Event Foundation Model For Structured Medical Records
2412.04604 (2024-12)
ARC Prize 2024: Technical Report

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

In this paper, we explore the challenging problem of performing a generative task in a target language when labeled data is only available in English, using summarization as a case study. We assume a strict setting with no access to parallel data or machine translation and find that common transfer learning approaches struggle in this setting, as a generative multilingual model fine-tuned purely on English catastrophically forgets how to generate non-English. Given the recent rise of parameter-efficient adaptation techniques, we conduct the first investigation into how one such method, prompt tuning (Lester et al., 2021), can overcome catastrophic forgetting to enable zero-shot cross-lingual generation. Our experiments show that parameter-efficient prompt tuning provides gains over standard fine-tuning when transferring between lessrelated languages, e.g., from English to Thai. However, a significant gap still remains between these methods and fully-supervised baselines. To improve cross-lingual transfer further, we explore several approaches, including: (1) mixing in unlabeled multilingual data, and (2) explicitly factoring prompts into recombinable language and task components. Our approaches can provide further quality gains, suggesting that robust zero-shot crosslingual generation is within reach.

For agents

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

get_harvested_code_for_paper("2205.12647")
get_code_for_paper("2205.12647")
have("2205.12647")

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

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

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

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

Connect an agent — have() is free.