SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.09752 · EMNLP · 2023

COLT5: Faster Long-Range Transformers with Conditional Computation

Yi Tay, Joshua Ainslie, Yury Zemlyanskiy, Sumit Sanghai, Michiel De Jong, Tao Lei, Siddhartha Brahma, Mandy Guo, James Lee-Thorp, David Uthus, Santiago Ontañón, Yun-Hsuan Sung

arXiv · PDF · Open in the Atlas

Code that ran

5 of 9 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 5 have no contract verdict; 0 failures of our instrument; 4 no recorded run), measured 2026-11-22; 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/2303.09752.json · badge: /api/ran/2303.09752.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/flaxformer canonical (classifier label)
classifier basis not recorded on the link
5 ran · 4 no recorded run
FunctionStatusWhere it lives
get_int_regex_matches Ran
ran on a synthesized input
google/flaxformer/flaxformer/param_conversion_util.py
code served (permissive licence) · get_code("1f9f1e7ebe408df5")
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 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 re
from typing import Any, Dict, List, Mapping

# The function uses:
# 1. pattern: str - a regex pattern with a capture group
# 2. state: Mapping[str, Any] - a mapping where keys are matched against the pattern

# Create a simple state dict with keys that match a regex pattern with integer capture groups
state = {
    "layer_0": {"weight": 1.0},
    "layer_1": {"weight": 2.0},
    "layer_5": {"weight": 5.0},
    "other_key": {"weight": 3.0},
    "layer_3": {"weight": 4.0},
}

# Create a regex pattern that captures integers from keys like "layer_N"
pattern = r"layer_(\d+)"

ARGS = {
    "pattern": pattern,
    "state": state,
}
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 int — 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
load_tf_params Ran
ran on a synthesized input
google/flaxformer/flaxformer/param_conversion_util.py
code served (permissive licence) · get_code("692429c64001e4a5")
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 tempfile
import os
import tensorflow as tf

# Create a minimal TensorFlow checkpoint for testing
temp_dir = tempfile.mkdtemp()
checkpoint_path = os.path.join(temp_dir, "test_checkpoint")

# Create a simple TensorFlow checkpoint with some variables
with tf.Graph().as_default():
    var1 = tf.Variable(tf.constant([[1.0, 2.0], [3.0, 4.0]]), name="var1")
    var2 = tf.Variable(tf.constant([5.0, 6.0, 7.0]), name="var2")
    
    with tf.compat.v1.Session() as sess:
        sess.run(tf.compat.v1.global_variables_initializer())
        saver = tf.compat.v1.train.Saver()
        saver.save(sess, checkpoint_path)

ARGS = {
    "checkpoint_path": checkpoint_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 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
reduce_fn Ran
ran on a synthesized input
google/flaxformer/flaxformer/sharding.py
code served (permissive licence) · get_code("9cc93ab2811f82f5")
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 AxisMetadata. 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.

from flax.linen import partitioning

# Create valid AxisMetadata instances for testing
axis_metadata_1 = partitioning.AxisMetadata(names=('batch',))
axis_metadata_2 = partitioning.AxisMetadata(names=('batch',))
axis_metadata_3 = partitioning.AxisMetadata(names=('feature',))

# Test case 1: x is (), y is AxisMetadata (initial call)
x_initial = ()
y_valid = axis_metadata_1

ARGS = {
    'x': x_initial,
    'y': y_valid
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
flax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type AxisMetadata — a AxisMetadata output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AxisMetadata 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
with_sharding Ran
ran on a synthesized input
google/flaxformer/flaxformer/activation_partitioning.py
code served (permissive licence) · get_code("6219a1b59a2276fd")
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 ArrayImpl, ndim 3, dtype family float, shape (2, 4, 8) 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 jax
import jax.numpy as jnp

# Create small JAX arrays for testing
# The function expects an array x and an integer partitioning_dims

# Create a 3D array (batch=2, sequence=4, model=8)
x_3d = jnp.ones((2, 4, 8))

# Create a 4D array (batch=2, sequence=4, model=8, heads=3)
x_4d = jnp.ones((2, 4, 8, 3))

ARGS = {
    'x': x_3d,
    'partitioning_dims': 1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 3, dtype family float, shape (2, 4, 8) — shape (2, 4, 8) 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
with_sharding_migration Ran
ran on a synthesized input
google/flaxformer/flaxformer/activation_partitioning.py
code served (permissive licence) · get_code("a896ada3b6e0ee35")
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 ArrayImpl, ndim 3, dtype family float, shape (2, 4, 8) 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 jax
import jax.numpy as jnp
from typing import Optional, Tuple

# Set up JAX to use CPU
jax.config.update('jax_platform_name', 'cpu')

# Create test arguments for with_sharding_migration function
# The function signature is:
# def with_sharding_migration(x: T, activation_partitioning_dims: Optional[int], logical_axis_names: Tuple[str, ...]) -> T

# Create a small JAX array (representing the activation tensor)
x = jnp.ones((2, 4, 8), dtype=jnp.float32)

# activation_partitioning_dims can be None, 1, or 2
activation_partitioning_dims = 1

# logical_axis_names is a tuple of strings representing axis names
logical_axis_names = ('batch', 'sequence', 'model')

ARGS = {
    'x': x,
    'activation_partitioning_dims': activation_partitioning_dims,
    'logical_axis_names': logical_axis_names,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
absl, flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 3, dtype family float, shape (2, 4, 8) — shape (2, 4, 8) 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
check_params_and_axis_names_match Not yet run
unverified (harvested, no recorded run)
google/flaxformer/flaxformer/sharding.py
code served (permissive licence) · get_code("57e16ed2adc5f653")
How it ran

no invocation recorded.

convert_tf_params Not yet run
unverified (harvested, no recorded run)
google/flaxformer/flaxformer/param_conversion_util.py
code served (permissive licence) · get_code("b23204e3d76a4881")
How it ran

no invocation recorded.

crop_train_batch Not yet run
unverified (harvested, no recorded run)
google/flaxformer/flaxformer/architectures/perceiver_ar/t5_models.py
code served (permissive licence) · get_code("b9e1282bcb6f5fed")
How it ran

no invocation recorded.

get_axis_names Not yet run
unverified (harvested, no recorded run)
google/flaxformer/flaxformer/sharding.py
code served (permissive licence) · get_code("171e53e587dfe99f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 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 9 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

Many natural language processing tasks benefit from long inputs, but processing long documents with Transformers is expensive --not only due to quadratic attention complexity but also from applying feedforward and projection layers to every token. However, not all tokens are equally important, especially for longer documents. We propose COLT5, a long-input Transformer model that builds on this intuition by employing conditional computation, devoting more resources to important tokens in both feedforward and attention layers. We show that COLT5 achieves stronger performance than LONGT5 with much faster training and inference, achieving SOTA on the long-input SCROLLS benchmark. Moreover, COLT5 can effectively and tractably make use of extremely long inputs, showing strong gains up to 64k input length.

For agents

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

get_harvested_code_for_paper("2303.09752")
get_code_for_paper("2303.09752")
have("2303.09752")

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

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

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

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

Connect an agent — have() is free.