SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2212.00196 · 2022

Data-Efficient Finetuning Using Cross-Task Nearest Neighbors

arXiv · PDF · Open in the Atlas

Code that ran

1 of 2 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, 0 violated it and 1 has no contract verdict; 0 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.00196.json · badge: /api/ran/2212.00196.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
allenai/data-efficient-finetuning canonical (classifier label)
classifier basis not recorded on the link
1 ran · 1 no recorded run
FunctionStatusWhere it lives
modify_with_ia3 Ran
ran on a synthesized input
allenai/data-efficient-finetuning/attribution/ia3.py
code served (permissive licence) · get_code("b5bdc12575d3d1db")
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 MinimalTransformer. 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
from transformers import PreTrainedModel

torch.manual_seed(0)

# Create a minimal PreTrainedModel subclass for testing
class MinimalTransformer(PreTrainedModel):
    def __init__(self):
        # Skip parent __init__ to avoid config requirements
        nn.Module.__init__(self)
        
        # Create a nested module structure matching the regex patterns
        self.attention = nn.Module()
        self.attention.q_proj = nn.Linear(4, 8)
        self.attention.v_proj = nn.Linear(4, 8)
        
        self.feed_forward = nn.Module()
        self.feed_forward.dense = nn.Linear(8, 16)
        
    def forward(self, x):
        return x

# Instantiate the transformer
transformer = MinimalTransformer()

# Define regex patterns to match module and layer names
lora_modules = r"(attention|feed_forward)"  # Matches "attention" or "feed_forward"
lora_layers = r"(q_proj|v_proj|dense)"      # Matches specific linear layer names

ARGS = {
    "transformer": transformer,
    "lora_modules": lora_modules,
    "lora_layers": lora_layers,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MinimalTransformer — a MinimalTransformer output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MinimalTransformer 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
modify_with_mam Not yet run
unverified (harvested, no recorded run)
allenai/data-efficient-finetuning/attribution/mam.py
code served (permissive licence) · get_code("f9e85cad5fb8eafd")
How it ran

no invocation recorded.

Also present in other papers' code

Of 2 samples lifted from this paper's linked repositories, 2 carry a function identity and 0 do not. Of the 2 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 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.

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

Obtaining labeled data to train a model for a task of interest is often expensive. Prior work shows training models on multitask data augmented with task descriptions (prompts) effectively transfers knowledge to new tasks. Towards efficiently building task-specific models, we assume access to a small number (32-1000) of unlabeled target-task examples and use those to retrieve the most similar labeled examples from a large pool of multitask data augmented with prompts. Compared to the current practice of finetuning models on uniformly sampled prompted multitask data (e.g.: FLAN, T0), our approach of finetuning on cross-task nearest neighbors is significantly more data-efficient. Using only 2% of the data from the P3 pool without any labeled target-task data, our models outperform strong baselines trained on all available data by 3-30% on 12 out of 14 datasets representing held-out tasks including legal and scientific document QA. Similarly, models trained on cross-task nearest neighbors from SuperNaturalInstructions, representing about 5% of the pool, obtain comparable performance to state-of-the-art models on 12 held-out tasks from that pool. Moreover, the models produced by our approach also provide a better initialization than single multitask finetuned models for few-shot finetuning on target-task data, as shown by a 2-23% relative improvement over few-shot finetuned T0-3B models on 8 datasets.

For agents

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

get_harvested_code_for_paper("2212.00196")
get_code_for_paper("2212.00196")
have("2212.00196")

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

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

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

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

Connect an agent — have() is free.