SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2204.07937 · NeurIPS · 2022

Unsupervised Cross-Task Generalization via Retrieval Augmentation

Xiang Ren, Bill Lin, Kangmin Tan, Chris Miller, Beiwen Tian

arXiv · PDF · Open in the Atlas

Code that ran

11 of 12 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 10 have no contract verdict; 1 failure 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/2204.07937.json · badge: /api/ran/2204.07937.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
INK-USC/ReCross canonical (classifier label)
classifier basis not recorded on the link
11 ran · 1 no recorded run
FunctionStatusWhere it lives
Linear Ran
ran on a synthesized input · constructed an object; no result was computed
INK-USC/ReCross/metax/models/bart_with_adapter.py
code served (permissive licence) · get_code("a21cea116f20e132")
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 an instance of its own class, Linear: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

ARGS = {
    "in_features": 4,
    "out_features": 3,
    "bias": True
}
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 Linear — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Linear 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
convert_model_to_single_gpu Ran
ran on a synthesized input
INK-USC/ReCross/metax/models/utils.py
code served (permissive licence) · get_code("f755f6d51643523a")
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

torch.manual_seed(0)

# The function convert_model_to_single_gpu takes a state_dict (dictionary)
# and converts keys that start with 'module.' to remove that prefix.
# This is typically used when converting a DataParallel model to single GPU.

# Create a sample state_dict with some keys that have 'module.' prefix
# and some that don't, to test the conversion logic.
state_dict = {
    'module.layer1.weight': torch.randn(4, 3),
    'module.layer1.bias': torch.randn(4),
    'module.layer2.weight': torch.randn(3, 4),
    'layer3.weight': torch.randn(2, 5),
    'layer3.bias': torch.randn(2),
}

ARGS = {
    'state_dict': state_dict,
}
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 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
gen Ran
ran on a synthesized input
INK-USC/ReCross/metax/commons.py
code served (permissive licence) · get_code("55ff340691da06d2")
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 Generator. 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 numpy as np

ARGS = {
    "seed": 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Generator — a Generator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Generator 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
get_all_dataset_names Ran
ran on a synthesized input
INK-USC/ReCross/metax/distant_supervision/ds_gen.py
code served (permissive licence) · get_code("2fbd18b1fe5dc565")
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 set. 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: it expects 'data' to be an iterable of items
# Each item dp has dp[2] which is a string that can be split by '|'
# The first part before '|' is the dataset name

# Create sample data matching the expected structure
data = [
    (None, None, "dataset_a|other|info|more", None),
    (None, None, "dataset_b|other|info|more", None),
    (None, None, "dataset_a|other|info|more", None),
    (None, None, "dataset_c|other|info|more", None),
]

ARGS = {
    "data": data
}
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 set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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
get_all_upstream_data_from_single_file Ran
ran on a synthesized input
INK-USC/ReCross/metax/datasets.py
code served (permissive licence) · get_code("fba4f4bef7b7fdac")
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 json
import tempfile
import os

# Create a temporary JSON file with sample data
temp_dir = tempfile.mkdtemp()
temp_filename = os.path.join(temp_dir, "test_data.json")

sample_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "data"}
}

with open(temp_filename, 'w') as f:
    json.dump(sample_data, f)

ARGS = {
    "filename": temp_filename
}
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 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
get_formatted_data Ran
ran on a synthesized input
INK-USC/ReCross/metax/datasets.py
code served (permissive licence) · get_code("2ab2132badad31e3")
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 os
import json
import tempfile
from typing import List, Optional

# Create temporary directory structure with mock data files
temp_dir = tempfile.mkdtemp()
data_dir = os.path.join(temp_dir, 'data')

# Create dataset directories and mock JSON files
dataset_names = ['dataset1', 'dataset2']
for name in dataset_names:
    dataset_path = os.path.join(data_dir, name)
    os.makedirs(dataset_path, exist_ok=True)
    
    # Create upstream-2000.json
    upstream_file = os.path.join(dataset_path, 'upstream-2000.json')
    with open(upstream_file, 'w') as f:
        json.dump({'samples': [1, 2, 3], 'labels': ['a', 'b', 'c']}, f)
    
    # Create fewshot.json
    fewshot_file = os.path.join(dataset_path, 'fewshot.json')
    with open(fewshot_file, 'w') as f:
        json.dump({'few_samples': [10, 20]}, f)

# Change to temp directory so relative paths work
original_cwd = os.getcwd()
os.chdir(temp_dir)

# Define arguments
ARGS = {
    'names': ['dataset1', 'dataset2'],
    't': 'upstream',
    'num': 2000
}
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 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
label_smoothed_nll_loss Ran
ran on a synthesized input
INK-USC/ReCross/metax/models/utils.py
code served (permissive licence) · get_code("e9d63f8ce1c64098")
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

torch.manual_seed(0)

# lprobs: log probabilities, shape (batch, vocab_size)
# target: target indices, shape (batch,) or (batch, 1)
# epsilon: label smoothing parameter, float
# ignore_index: index to ignore in loss calculation, int

batch_size = 2
vocab_size = 4

# Create log probabilities (typically output from log_softmax)
lprobs = torch.log(torch.softmax(torch.randn(batch_size, vocab_size), dim=-1))

# Create target indices (values in range [0, vocab_size))
target = torch.randint(0, vocab_size, (batch_size,))

ARGS = {
    "lprobs": lprobs,
    "target": target,
    "epsilon": 0.1,
    "ignore_index": -100,
}
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 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
last_n_increasing Ran
ran on a synthesized input
INK-USC/ReCross/metax/utils.py
code served (permissive licence) · get_code("672288825fb7edc2")
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 bool, ndim 0, dtype family float, 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)

# Analyze the function:
# - l: a list-like object that supports len() and indexing with []
# - n: an integer (default 3)
# - thres: a float (default 0.01)
# The function checks if the last n elements are increasing (with threshold)

# Create a list that satisfies the logic
# For last_n_increasing to return True, we need len(l) > n
# and at least one pair in the last n elements where l[i-1] < l[i] - thres

l = [1.0, 2.0, 3.0, 4.0, 5.5]  # Last 3 elements: [3.0, 4.0, 5.5]
# Check: 3.0 < 4.0 - 0.01? Yes (3.0 < 3.99)
# So this should return True

n = 3
thres = 0.01

ARGS = {
    "l": l,
    "n": n,
    "thres": thres
}
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 bool, ndim 0, dtype family float, 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
load_grouping Ran
ran on a synthesized input
INK-USC/ReCross/metax/distant_supervision/ds_gen.py
code served (permissive licence) · get_code("a9275e10fc437520")
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 json
import tempfile
import os

# Create a temporary JSON file with sample grouping data
temp_dir = tempfile.mkdtemp()
grouping_file = os.path.join(temp_dir, 'task_groupings.json')

sample_grouping = {
    "group_a": ["dataset_1", "dataset_2"],
    "group_b": ["dataset_3", "dataset_4", "dataset_5"],
    "group_c": ["dataset_6"]
}

with open(grouping_file, 'w') as f:
    json.dump(sample_grouping, f)

ARGS = {
    'grouping_path': grouping_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 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
load_upstream_data Ran
ran on a synthesized input
INK-USC/ReCross/metax/distant_supervision/ds_gen.py
code served (permissive licence) · get_code("022f5f4a4a63d51e")
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 2, 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 JSON file with mock upstream data
mock_data = [
    ["text1", "source1", "dataset1|split1|id1|extra1", "label1"],
    ["text2", "source2", "dataset2|split2|id2|extra2", "label2"],
    ["text3", "source1", "dataset1|split3|id3|extra3", "label3"],
    ["text4", "source3", "dataset3|split4|id4|extra4", "label4"],
]

# Create temporary directory and file
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, 'bart0_upstream_train_lines.json')

with open(temp_file, 'w') as f:
    json.dump(mock_data, f)

ARGS = {
    'upstream_data_path': 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 2, 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
trim_batch Ran
ran; our contract draft was wrong, not the code
INK-USC/ReCross/metax/models/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from Sahandfer/CEM, is pointer only (licence: NONE) · get_code("eeb8dc60c6ef1fa4")
How it ran

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

train Not yet run
unverified (harvested, no recorded run)
INK-USC/ReCross/metax/models/run_bart.py
code served (permissive licence) · get_code("6afb875d7936f908")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 1 later) and 11 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
trim_batch 9 other papers
3 dated earlier, 1 the same month, 5 later
2005.01107 (2020-05)
Simplifying Paragraph-level Question Generation via Transformer Language Models
2104.08661 (2021-04)
Explaining Answers with Entailment Trees
2108.02866 (2021-08)
Dual Reader-Parser on Hybrid Textual and Tabular Evidence for Open Domain Question Answering
and 6 more not named here

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

Humans can perform unseen tasks by recalling relevant skills acquired previously and then generalizing them to the target tasks, even if there is no supervision at all. In this paper, we aim to improve this kind of cross-task generalization ability of massive multi-task language models, such as T0 and FLAN, in an unsupervised setting. We propose a retrieval-augmentation method named ReCross that takes a few unlabelled examples as queries to retrieve a small subset of upstream data and uses them to update the multi-task model for better generalization. ReCross is a straightforward yet effective retrieval method that combines both efficient dense retrieval and effective pair-wise reranking. Our results and analysis show that it significantly outperforms both non-retrieval methods and other baseline methods. 1

For agents

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

get_harvested_code_for_paper("2204.07937")
get_code_for_paper("2204.07937")
have("2204.07937")

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

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

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

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

Connect an agent — have() is free.