SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2104.08247 · EMNLP · 2021

What to Pre-Train on? Efficient Intermediate Task Selection

Iryna Gurevych, Andreas Rücklé, Jonas Pfeiffer, Clifton Poth

arXiv · PDF · Open in the Atlas

Code that ran

2 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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 2 failures of our instrument; 4 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/2104.08247.json · badge: /api/ran/2104.08247.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
adapter-hub/efficient-task-transfer canonical (classifier label)
classifier basis: census
2 ran · 4 no recorded run
FunctionStatusWhere it lives
compute_Fisher Ran
ran; our contract draft was wrong, not the code
adapter-hub/efficient-task-transfer/task_selection/taskemb.py
code served (permissive licence) · get_code("0d17aa3f96aa84ea")
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 torch.nn as nn

torch.manual_seed(0)

# Create a minimal config class
class Config:
    def __init__(self):
        self.num_hidden_layers = 2
        self.model_type = 'bert'

# Create a minimal base model with required structure
class BaseModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.config = Config()
        # Create some parameters that require gradients
        self.embedding = nn.Linear(4, 4)
        self.linear = nn.Linear(4, 4)
        # Store model outputs for later retrieval
        self._outputs_cache = {}
    
    def _get_model_outputs(self, key='multihead_output'):
        # Return a list of tensors for each layer
        # Shape: [batch_size=2, seq_len=3, hidden_dim=4]
        if key not in self._outputs_cache:
            outputs = [torch.randn(2, 3, 4, requires_grad=True) for _ in range(self.config.num_hidden_layers)]
            self._outputs_cache[key] = outputs
        return self._outputs_cache[key]
    
    def named_parameters(self, recurse=True):
        return super().named_parameters(recurse=recurse)

# Create a minimal full model with base_model and config
class Model(nn.Module):
    def __init__(self):
        super().__init__()
        self.base_model = BaseModel()
        self.config = Config()
        # Add some task-specific parameters (not in base_model)
        self.classifier = nn.Linear(4, 2)
    
    def named_parameters(self, recurse=True):
        return super().named_parameters(recurse=recurse)

# Create args object
class Args:
    def __init__(self):
        self.feature_type = 'grads'  # or 'params'
        self.pow = 2

# Build all required objects
args = Args()
model = Model()

# Enable gradients and set them for parameters
for param in model.parameters():
    if param.requires_grad:
        param.grad = torch.randn_like(param)

# Create input_mask: shape [batch_size=2, seq_len=3]
input_mask = torch.ones(2, 3, dtype=torch.long)

# Total tokens count
total_tokens = 6  # batch_size * seq_len = 2 * 3

ARGS = {
    'args': args,
    'model': model,
    'input_mask': input_mask,
    'total_tokens': total_tokens
}
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
create_position_ids_from_input_ids Ran
ran; our contract draft was wrong, not the code
adapter-hub/efficient-task-transfer/task_selection/modeling/modeling_roberta.py
code served (permissive licence) · get_code("bbfc47d976ee7225")
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 int, 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

torch.manual_seed(0)

# Create a small batch of input_ids tensor
# Shape: (batch_size=2, seq_length=4)
# Values: token indices, with some padding tokens mixed in
input_ids = torch.tensor([
    [1, 2, 0, 3],
    [5, 0, 0, 4]
], dtype=torch.long)

# padding_idx is typically 0 in most transformer models
padding_idx = 0

ARGS = {
    "input_ids": input_ids,
    "padding_idx": padding_idx,
}
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 Tensor, ndim 2, dtype family int, 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
compute_Fisher_no_labels_cr Not yet run
unverified (harvested, no recorded run)
adapter-hub/efficient-task-transfer/task_selection/taskemb.py
code served (permissive licence) · get_code("c7c8798f0a8242ad")
How it ran

no invocation recorded.

compute_Fisher_no_labels_qa Not yet run
unverified (harvested, no recorded run)
adapter-hub/efficient-task-transfer/task_selection/taskemb.py
code served (permissive licence) · get_code("d7de9f5a86551bf4")
How it ran

no invocation recorded.

get_full_name Not yet run
unverified (harvested, no recorded run)
adapter-hub/efficient-task-transfer/task_selection/utils.py
code served (permissive licence) · get_code("5daa4a28d9949694")
How it ran

no invocation recorded.

load_tf_weights_in_bert Not yet run
unverified (harvested, no recorded run)
adapter-hub/efficient-task-transfer/task_selection/modeling/modeling_bert.py
code served (permissive licence) · get_code("26be70dca3249c0b")
How it ran

no invocation recorded.

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, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 2 later) and 4 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
load_tf_weights_in_bert 28 other papers
1 dated earlier, 1 the same month, 25 later, 1 same year, order not determinable
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
2021.emnlp-main.154 (2021 (year only))
Reconstruction Attack on Instance Encoding for Language Understanding
2104.06599 (2021-04)
Learning How to Ask: Querying LMs with Mixtures of Soft Prompts
and 25 more not named here
create_position_ids_from_input_ids 8 other papers
7 later, 1 same year, order not determinable
2021.emnlp-main.154 (2021 (year only))
Reconstruction Attack on Instance Encoding for Language Understanding
2201.03514 (2022-01)
Black-Box Tuning for Language-Model-as-a-Service
2023.acl-long.264 (2023 (year only))
Towards Robust Low-Resource Fine-Tuning with Multi-View Compressed Representations
and 5 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

Intermediate task fine-tuning has been shown to culminate in large transfer gains across many NLP tasks. With an abundance of candidate datasets as well as pre-trained language models, it has become infeasible to experiment with all combinations to find the best transfer setting. In this work, we provide a comprehensive comparison of different methods for efficiently identifying beneficial tasks for intermediate transfer learning. We focus on parameter and computationally efficient adapter settings, highlight different data-availability scenarios, and provide expense estimates for each method. We experiment with a diverse set of 42 intermediate and 11 target English classification, multiple choice, question answering, and sequence tagging tasks. Our results demonstrate that efficient embedding based methods, which rely solely on the respective datasets, outperform computational expensive few-shot fine-tuning approaches. Our best methods achieve an average Regret@3 of 1% across all target tasks, demonstrating that we are able to efficiently identify the best datasets for intermediate training. 1 * Contributions made prior to joining Amazon. 1 Code released at https://github.com/ Adapter-Hub/efficient-task-transfer.

For agents

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

get_harvested_code_for_paper("2104.08247")
get_code_for_paper("2104.08247")
have("2104.08247")

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

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

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

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

Connect an agent — have() is free.