SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1911.05507 · 2019

Compressive Transformers for Long-Range Sequence Modelling

arXiv · PDF · Open in the Atlas

Code that ran

6 of 11 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, 2 violated it and 3 have no contract verdict; 1 failure of our instrument; 5 no recorded run), measured 2026-11-23; 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/1911.05507.json · badge: /api/ran/1911.05507.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
ViktorStagge/CompressiveTransformer community (classifier label)
classifier basis not recorded on the link
3 ran · 5 no recorded run
lucidrains/compressive-transformer-pytorch reimplementation (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
cast_tuple Ran
ran, violated the contract we drafted
lucidrains/compressive-transformer-pytorch/compressive_transformer_pytorch/compressive_transformer_pytorch.py
code served (permissive licence) · get_code("369eced62e96d690")
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 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)

# cast_tuple takes a single parameter 'el' and returns it as a tuple if it isn't already one
# We need to test both cases: when el is a tuple and when it isn't

# Test case 1: el is not a tuple (should be wrapped)
el_not_tuple = 42

# Test case 2: el is already a tuple (should be returned as-is)
el_is_tuple = (1, 2, 3)

# We'll use the non-tuple case as the primary test
ARGS = {
    "el": el_not_tuple
}
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 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
default Ran
ran, violated the contract we drafted
lucidrains/compressive-transformer-pytorch/compressive_transformer_pytorch/compressive_transformer_pytorch.py
code served (permissive licence) · get_code("a1bda7590dd9a4d2")
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 str. 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
from inspect import isfunction

torch.manual_seed(0)

def test_function_val():
    return "computed_value"

ARGS = {
    "x": None,
    "val": test_function_val
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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_optimizer Ran
ran on a synthesized input
ViktorStagge/CompressiveTransformer/ct/model/optimizers.py
code served (permissive licence) · get_code("2386968d2b386e18")
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 Adam. 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
from keras import optimizers
from omegaconf import OmegaConf
from dataclasses import dataclass

@dataclass
class Adam:
    learning_rate: float = 0.001
    beta_1: float = 0.9
    beta_2: float = 0.999
    clipnorm: float = 0.1

ARGS = {
    "method": "adam",
    "learning_rate": 0.002,
    "beta_1": 0.95,
    "beta_2": 0.9999,
    "clipnorm": 0.5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
keras, numpy, omegaconf, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Adam — a Adam output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Adam 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
to Ran
ran; our contract draft was wrong, not the code
lucidrains/compressive-transformer-pytorch/compressive_transformer_pytorch/compressive_transformer_pytorch.py
code served (permissive licence) · get_code("7417c98099ec4e15")
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 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)

# Create a small tensor to pass to the function
t = torch.randn(2, 4, dtype=torch.float32, device='cpu')

ARGS = {
    't': t
}
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 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
treebank Ran
ran on a synthesized input
ViktorStagge/CompressiveTransformer/ct/load/treebank.py
code served (permissive licence) · get_code("0a1ea081d7a22055")
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 DataFrame. 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 tempfile
import shutil

# Create a temporary directory with test files
temp_dir = tempfile.mkdtemp()

# Create test files in the format expected by the treebank function
test_files = {
    'file1.txt': '.START Some sample parse tree text here',
    'file2.txt': '.START Another parse tree example',
    'file3.txt': '.START Third sample data'
}

for filename, content in test_files.items():
    filepath = os.path.join(temp_dir, filename)
    with open(filepath, 'w') as f:
        f.write(content)

ARGS = {
    'path_to_dir': temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
wma Ran
ran on a synthesized input
ViktorStagge/CompressiveTransformer/ct/load/wma.py
code served (permissive licence) · get_code("ff138d8d7172a07a")
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 DataFrame. 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

# Create temporary files with sample content
temp_dir = tempfile.mkdtemp()
first_lang_path = os.path.join(temp_dir, "first_lang.txt")
second_lang_path = os.path.join(temp_dir, "second_lang.txt")
output_path = os.path.join(temp_dir, "output.pkl")

# Write sample sentences to files
with open(first_lang_path, 'w', encoding='utf8') as f:
    f.write("Hello world\n")
    f.write("How are you\n")
    f.write("Good morning\n")

with open(second_lang_path, 'w', encoding='utf8') as f:
    f.write("Hallo Welt\n")
    f.write("Wie geht es dir\n")
    f.write("Guten Morgen\n")

ARGS = {
    'path_first_language': first_lang_path,
    'path_second_language': second_lang_path,
    'first_language': 'english',
    'second_language': 'german',
    'output_path': output_path,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
compression_layer Not yet run
unverified (harvested, no recorded run)
ViktorStagge/CompressiveTransformer/ct/model/layers/compression.py
code served (permissive licence) · get_code("9935f8b67694d72e")
How it ran

no invocation recorded.

content_based_attention Not yet run
unverified (harvested, no recorded run)
ViktorStagge/CompressiveTransformer/ct/model/layers/attention.py
code served (permissive licence) · get_code("185debb5bed29c85")
How it ran

no invocation recorded.

content_based_attention_numpy Not yet run
unverified (harvested, no recorded run)
ViktorStagge/CompressiveTransformer/ct/model/layers/attention.py
code served (permissive licence) · get_code("ba5b86960e25b0d6")
How it ran

no invocation recorded.

cosine_similarity Not yet run
unverified (harvested, no recorded run)
ViktorStagge/CompressiveTransformer/ct/model/utils.py
code served (permissive licence) · get_code("3e55a982471a2ac4")
How it ran

no invocation recorded.

euclidean_norm Not yet run
unverified (harvested, no recorded run)
ViktorStagge/CompressiveTransformer/ct/model/utils.py
code served (permissive licence) · get_code("da8e90a779ce9bc4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 3 later) and 8 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
cast_tuple 5 other papers
2 dated earlier, 3 later · 1 only as an assembly brick
1812.01243 (2018-12)
Efficient Attention: Attention with Linear Complexities
1910.06764 (2019-10)
Stabilizing Transformers for Reinforcement Learning
2002.05202 (2020-02)
GLU Variants Improve Transformer
and 2 more not named here
default 3 other papers
2 dated earlier, 1 later
1812.01243 (2018-12)
Efficient Attention: Attention with Linear Complexities
1910.06764 (2019-10)
Stabilizing Transformers for Reinforcement Learning
2002.05202 (2020-02)
GLU Variants Improve Transformer
to 3 other papers
2 dated earlier, 1 later
1812.01243 (2018-12)
Efficient Attention: Attention with Linear Complexities
1910.06764 (2019-10)
Stabilizing Transformers for Reinforcement Learning
2002.05202 (2020-02)
GLU Variants Improve Transformer

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-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

We present the Compressive Transformer, an attentive sequence model which compresses past memories for long-range sequence learning. We find the Compressive Transformer obtains state-of-the-art language modelling results in the WikiText-103 and Enwik8 benchmarks, achieving 17.1 ppl and 0.97 bpc respectively. We also find it can model high-frequency speech effectively and can be used as a memory mechanism for RL, demonstrated on an object matching task. To promote the domain of long-range sequence learning, we propose a new open-vocabulary language modelling benchmark derived from books, PG-19.

For agents

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

get_harvested_code_for_paper("1911.05507")
get_code_for_paper("1911.05507")
have("1911.05507")

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

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

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

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

Connect an agent — have() is free.