SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2109.10686 · ICLR · 2021

Scale Efficiently: Insights from Pre-training and Fine-tuning Transformers

Yi Tay, Donald Metzler, Mostafa Dehghani, William Fedus, Dani Yogatama, Jinfeng Rao, Samira Abnar, Hyung Chung, Sharan Narang, Ashish Vaswani

arXiv · PDF · Open in the Atlas

Code that ran

12 of 12 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; 4 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 1 failure of our instrument; 0 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/2109.10686.json · badge: /api/ran/2109.10686.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
aaronmueller/emergent-syntax community (classifier label)
classifier basis not recorded on the link
7 ran · 0 no recorded run
gsarti/it5 community (classifier label)
classifier basis not recorded on the link
5 ran · 0 no recorded run
FunctionStatusWhere it lives
compute_input_and_target_lengths Ran
ran, honoured the contract we drafted
aaronmueller/emergent-syntax/run_t5_mlm_flax.py
code served (permissive licence) · get_code("eb29f6682a2426ad")
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 int; 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)

ARGS = {
    "inputs_length": 512,
    "noise_density": 0.15,
    "mean_noise_span_length": 3.0,
}
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 int — 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
evaluate_predictions Ran
ran on a synthesized input
aaronmueller/emergent-syntax/models/pred_eval.py
code served (permissive licence) · get_code("0c5a6c34f4b57d8b")
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 tempfile
import json
import os

# Create temporary files for predictions and gold labels
pred_temp = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
gold_temp = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')

# Write prediction data
pred_temp.write("hello world\n")
pred_temp.write("the cat sat\n")
pred_temp.close()

# Write gold data (plain text format with tab-separated values)
gold_temp.write("dummy\thello world\n")
gold_temp.write("dummy\tthe dog sat\n")
gold_temp.close()

ARGS = {
    'pred_filename': pred_temp.name,
    'gold_filename': gold_temp.name,
    'passiv': False
}
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 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
exact_match Ran
ran, honoured the contract we drafted
aaronmueller/emergent-syntax/models/metrics.py
code served (permissive licence) · get_code("66552297bbb6cd38")
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) and returned int, ndim 0, dtype family int, 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

torch.manual_seed(0)

ARGS = {
    "pred_sentence": "Hello World",
    "gold_sentence": "hello world",
    "src_sentence": "Bonjour le monde"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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
first_word Ran
ran, honoured the contract we drafted
aaronmueller/emergent-syntax/models/metrics.py
code served (permissive licence) · get_code("30008b8c34f29539")
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) and returned int, ndim 0, dtype family int, 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

torch.manual_seed(0)

# The function takes three string parameters and calls .split() on them,
# then accesses the first element and calls .lower() on it.
# We need three sentences as strings.

pred_sentence = "Hello world from prediction"
gold_sentence = "Hello there from gold"
src_sentence = "This is the source sentence"

ARGS = {
    "pred_sentence": pred_sentence,
    "gold_sentence": gold_sentence,
    "src_sentence": src_sentence,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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
generate_batch_splits Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
aaronmueller/emergent-syntax/run_t5_mlm_flax.py
pointer only (licence: MIT); the stored copy get_code serves, from shwai-he/meo, is pointer only (licence: NONE) · get_code("26eb4e2856b3d7a1")
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 shwai-he/meo, 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.

get_bsz Ran
ran on a synthesized input
gsarti/it5/finetuning/vars.py
code served (permissive licence) · get_code("a747070e3ebf347f")
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 int, ndim 0, dtype family int, 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 torch.nn as nn

# The function only uses the 'model' parameter as a string
# It calls .startswith() on it and checks for substrings
# We need to provide a string that will match one of the conditions

ARGS = {
    'model': 'gsarti/it5-small'
}
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 int, ndim 0, dtype family int, 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
get_bsz Ran
ran on a synthesized input
gsarti/it5/inference/vars.py
code served (permissive licence) · get_code("d79ddc3312ab8f78")
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 int, ndim 0, dtype family int, 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 torch.nn as nn

# The function get_bsz takes a single parameter 'model' which is a string
# It uses string methods like .startswith() and 'in' operator
# So we need to provide a valid model string that matches one of the conditions

ARGS = {
    'model': 'it5/it5-small'
}
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 int, ndim 0, dtype family int, 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
get_dirs Ran
ran on a synthesized input
aaronmueller/emergent-syntax/analysis/plot_scaling.py
code served (permissive licence) · get_code("219961813fa6d977")
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 os
import tempfile
import shutil

# Create a temporary directory structure to simulate /scratch/am12057/
temp_base = tempfile.mkdtemp()
scratch_path = os.path.join(temp_base, 'scratch', 'am12057')
os.makedirs(scratch_path, exist_ok=True)

# Create some test directories that match various prefix/suffix combinations
os.makedirs(os.path.join(scratch_path, 'model_v1.txt'), exist_ok=True)
os.makedirs(os.path.join(scratch_path, 'model_v2.txt'), exist_ok=True)
os.makedirs(os.path.join(scratch_path, 'data_v1.csv'), exist_ok=True)
os.makedirs(os.path.join(scratch_path, 'output_v1.txt'), exist_ok=True)
os.makedirs(os.path.join(scratch_path, 'test_file.log'), exist_ok=True)

# Monkey patch os.listdir to use our temp directory
_original_listdir = os.listdir
_original_isdir = os.path.isdir
_original_join = os.path.join

def patched_listdir(path):
    if path == '/scratch/am12057/':
        return _original_listdir(scratch_path)
    return _original_listdir(path)

def patched_isdir(path):
    if path.startswith('/scratch/am12057/'):
        actual_path = path.replace('/scratch/am12057/', scratch_path + '/')
        return _original_isdir(actual_path)
    return _original_isdir(path)

def patched_join(path, *args):
    if path == '/scratch/am12057/':
        return _original_join(scratch_path, *args)
    return _original_join(path, *args)

os.listdir = patched_listdir
os.path.isdir = patched_isdir
os.path.join = patched_join

# Define arguments for get_dirs function
ARGS = {
    'prefixes': ['model', 'data'],
    'suffixes': ['.txt', '.csv']
}
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 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
get_lr Ran
ran on a synthesized input
gsarti/it5/finetuning/vars.py
code served (permissive licence) · get_code("c4f59346ce8a05d9")
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 float, 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

def get_lr(model):
    if model.startswith('gsarti/it5-small'):
        return 0.0008
    elif model.startswith('gsarti/it5-base') or model.startswith('it5/it5-efficient-small'):
        return 0.0003
    elif 'mt5-base' in model or model.startswith('gsarti/it5-large'):
        return 5e-05
    raise Exception(f'Unknown model: {model}')

ARGS = {
    'model': 'gsarti/it5-small'
}
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 float, 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
get_params Ran
ran on a synthesized input
gsarti/it5/inference/vars.py
code served (permissive licence) · get_code("f74861ceb9e003dd")
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 get_params takes two parameters: model and config
# - model: a string that is checked with startswith() and 'in' operator
# - config: a string that is used as a key to lookup in settings dict

# We need to provide valid values for both parameters
model = 'it5/it5-small'
config = 'fst_i2f'

ARGS = {
    'model': model,
    'config': config
}
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
get_time Ran
ran on a synthesized input
gsarti/it5/finetuning/vars.py
code served (permissive licence) · get_code("07d60309bc634d37")
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 int, ndim 0, dtype family int, 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 torch.nn as nn

# The function takes a single parameter 'model' which is a string
# that it checks with startswith() and 'in' operations
# Let's test with a valid model string that matches one of the conditions

ARGS = {
    'model': 'gsarti/it5-small'
}
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 int, ndim 0, dtype family int, 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
second_word Ran
ran, honoured the contract we drafted
aaronmueller/emergent-syntax/models/metrics.py
code served (permissive licence) · get_code("bd0d4ea62311e45d")
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) and returned int, ndim 0, dtype family int, 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

def second_word(pred_sentence, gold_sentence, src_sentence):
    pred_words = pred_sentence.split()
    gold_words = gold_sentence.split()
    if len(pred_words) > 1 and pred_words[1].lower() == gold_words[1].lower():
        return 1
    return 0

ARGS = {
    "pred_sentence": "The quick brown fox",
    "gold_sentence": "The quick red fox",
    "src_sentence": "Le renard rapide"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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

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, 5 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 5 later) and 7 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
compute_input_and_target_lengths 4 other papers
4 later
2304.06248 (2023-04)
LasUIE: Unifying Information Extraction with Latent Adaptive Structure-aware Generative Language Model
2309.02373 (2023-09)
nanoT5: A PyTorch Framework for Pre-training and Fine-tuning T5-style Models with Limited Resources
2310.14709 (2023-10)
Once Upon a $\textit{Time}$ in $\textit{Graph}$: Relative-Time Pretraining for Complex Temporal Reasoning
and 1 more not named here
exact_match 1 other paper
1 later
2203.09397 (2022-03)
Coloring the Blank Slate: Pre-training Imparts a Hierarchical Inductive Bias to Sequence-to-sequence Models
first_word 1 other paper
1 later
2203.09397 (2022-03)
Coloring the Blank Slate: Pre-training Imparts a Hierarchical Inductive Bias to Sequence-to-sequence Models
generate_batch_splits 1 other paper
1 later
2310.09832 (2023-10)
Merging Experts into One: Improving Computational Efficiency of Mixture of Experts
second_word 1 other paper
1 later
2203.09397 (2022-03)
Coloring the Blank Slate: Pre-training Imparts a Hierarchical Inductive Bias to Sequence-to-sequence Models

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

There remain many open questions pertaining to the scaling behaviour of Transformer architectures. These scaling decisions and findings can be critical, as training runs often come with an associated computational cost which have both financial and/or environmental impact. The goal of this paper is to present scaling insights from pretraining and finetuning Transformers. While Kaplan et al. ( 2020) presents a comprehensive study of the scaling behaviour of Transformer language models, the scope is only on the upstream (pretraining) loss. Therefore, it is still unclear if these set of findings transfer to downstream task within the context of the pretrain-finetune paradigm. The key findings of this paper are as follows: (1) we show that aside from only the model size, model shape matters for downstream fine-tuning, (2) scaling protocols operate differently at different compute regions, (3) widely adopted T5-base and T5-large sizes are Pareto-inefficient. To this end, we present improved scaling protocols whereby our redesigned models achieve similar downstream fine-tuning quality while having 50% fewer parameters and training 40% faster compared to the widely adopted T5-base model. We publicly release over 100 pretrained checkpoints of different T5 configurations to facilitate future research and analysis.

For agents

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

get_harvested_code_for_paper("2109.10686")
get_code_for_paper("2109.10686")
have("2109.10686")

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

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

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

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

Connect an agent — have() is free.