SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.06295 · NeurIPS · 2021

Going Beyond Linear Transformers with Recurrent Fast Weight Programmers

Jürgen Schmidhuber, Kazuki Irie, Imanol Schlag, Róbert Csordás

arXiv · PDF · Open in the Atlas

Code that ran

9 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; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 6 failures of our instrument; 3 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/2106.06295.json · badge: /api/ran/2106.06295.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
IDSIA/lmtool-fwms community (classifier label)
classifier basis not recorded on the link
9 ran · 3 no recorded run
FunctionStatusWhere it lives
create_exp_dir Ran
ran; our contract draft was wrong, not the code
IDSIA/lmtool-fwms/src/utils/exp_utils.py
code served (permissive licence) · get_code("37f99ec30f5d5bfd")
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 partial. 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 functools
import os
import shutil
import tempfile

# Create a temporary directory for testing
temp_dir = tempfile.mkdtemp()

# Create a dummy script file to save
dummy_script = os.path.join(temp_dir, 'dummy_script.py')
with open(dummy_script, 'w') as f:
    f.write('# dummy script\n')

ARGS = {
    'dir_path': os.path.join(temp_dir, 'exp_dir'),
    'scripts_to_save': [dummy_script],
    'debug': 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 partial — a partial output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a partial 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
draw_orthogonal_random_matrix Ran
ran on a synthesized input
IDSIA/lmtool-fwms/src/utils/performer_helper.py
code served (permissive licence) · get_code("6cb3694398e5d411")
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 float, shape (8, 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
import math

torch.manual_seed(0)

ARGS = {
    "nb_rows": 8,
    "nb_columns": 4,
    "scaling": 0,
    "qr_uniform_q": False,
    "device": None,
}
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 float, shape (8, 4) — shape (8, 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
elu_p1 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
IDSIA/lmtool-fwms/src/utils/cuda_fast_weight_layer.py
code served (permissive licence) · get_code("fa08c36ab5558b55")
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 Tensor, ndim 2, dtype family float, 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
import torch.nn.functional as F

torch.manual_seed(0)

# The function elu_p1 takes a single parameter 'x' which is used with F.elu
# F.elu expects a tensor input
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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 Tensor, ndim 2, dtype family float, 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
get_logger Ran
ran; our contract draft was wrong, not the code
IDSIA/lmtool-fwms/src/utils/exp_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from stefvk/Elliptical-Attention, is pointer only (licence: NONE) · get_code("d142e8a68b535885")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from stefvk/Elliptical-Attention, 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.

orthogonal_matrix_chunk Ran
ran on a synthesized input
IDSIA/lmtool-fwms/src/utils/performer_helper.py
code served (permissive licence) · get_code("aa14b5ef69b1c4ef")
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 float, shape (4, 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)

ARGS = {
    "cols": 4,
    "qr_uniform_q": False,
    "device": None,
    "qr_on_cpu": True,
}
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 float, shape (4, 4) — shape (4, 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
prime Ran
ran on a synthesized input
IDSIA/lmtool-fwms/src/utils/performer_helper.py
code served (permissive licence) · get_code("8bbdda53b57249e6")
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 float, shape (2, 6) 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)

# Construct a small batch of input data
# The function expects x to have shape (batch_size, input_dim)
x = torch.randn(2, 4)

# Construct proj_matrix with shape (input_dim, m)
# where m is extracted as _, m = proj_matrix.shape
# Let's use m=3 for a distinct size
proj_matrix = torch.randn(4, 3)

# kernel_eps is a small float
kernel_eps = 0.0001

# old_behavior is a boolean flag
old_behavior = False

ARGS = {
    "x": x,
    "proj_matrix": proj_matrix,
    "kernel_eps": kernel_eps,
    "old_behavior": old_behavior,
}
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 float, shape (2, 6) — shape (2, 6) 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
sample_logits Ran
ran; our contract draft was wrong, not the code
IDSIA/lmtool-fwms/src/utils/log_uniform_sampler.py
code served (permissive licence) · get_code("93228a3eb5c4d179")
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 3, dtype family float, shape (2, 3, 6) 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

torch.manual_seed(0)

# Small embedding layer
n_vocab = 20
n_emb = 4
embedding = nn.Embedding(n_vocab, n_emb)

# Bias vector
bias = torch.randn(n_vocab)

# Labels: [b1, b2] with valid vocab indices
b1, b2 = 2, 3
labels = torch.randint(0, n_vocab, (b1, b2))

# Inputs: [b1, b2, n_emb]
inputs = torch.randn(b1, b2, n_emb)

# Sampler that implements the sample() method
class LogUniformSampler:
    def __init__(self, n_vocab, n_sample=5):
        self.n_vocab = n_vocab
        self.n_sample = n_sample
    
    def sample(self, labels):
        # Sample negative samples
        neg_samples = torch.randint(0, self.n_vocab, (self.n_sample,))
        
        # Log probabilities
        true_log_probs = torch.randn(labels.size(0), labels.size(1))
        samp_log_probs = torch.randn(self.n_sample)
        
        return true_log_probs, samp_log_probs, neg_samples

sampler = LogUniformSampler(n_vocab=n_vocab, n_sample=5)

ARGS = {
    "embedding": embedding,
    "bias": bias,
    "labels": labels,
    "inputs": inputs,
    "sampler": sampler
}
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 3, dtype family float, shape (2, 3, 6) — shape (2, 3, 6) 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
sum_norm Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
IDSIA/lmtool-fwms/src/utils/cuda_fast_weight_layer.py
code served (permissive licence) · get_code("379d7685e2a746e5")
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 Tensor, ndim 2, dtype family float, 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)

# The function sum_norm takes a single parameter 'x' which is a tensor
# It performs: x / x.sum(-1, keepdim=True)
# This means x should be a tensor where we can sum along the last dimension

# Create a small tensor with distinct dimensions
# batch_size=2, feature_dim=4
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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 Tensor, ndim 2, dtype family float, 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
sum_norm_eps Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
IDSIA/lmtool-fwms/src/utils/cuda_fast_weight_layer.py
code served (permissive licence) · get_code("90f48cc1487150b9")
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 Tensor, ndim 2, dtype family float, 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)

# The function sum_norm_eps takes a single parameter x
# It performs: x / (x.sum(-1, keepdim=True) + 1e-05)
# So x should be a tensor that supports sum operation along the last dimension

x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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 Tensor, ndim 2, dtype family float, 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
format_log Not yet run
unverified (harvested, no recorded run)
IDSIA/lmtool-fwms/src/eval_sliding_window.py
code served (permissive licence) · get_code("b0a73836f5b2859d")
How it ran

no invocation recorded.

scatter Not yet run
unverified (harvested, no recorded run)
IDSIA/lmtool-fwms/src/utils/data_parallel.py
code served (permissive licence) · get_code("69598ced7806d8c3")
How it ran

no invocation recorded.

scatter_kwargs Not yet run
unverified (harvested, no recorded run)
IDSIA/lmtool-fwms/src/utils/data_parallel.py
code served (permissive licence) · get_code("aa1de448b0528802")
How it ran

no invocation recorded.

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, 9 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 9 later) and 3 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
sample_logits 14 other papers
11 dated earlier, 3 later · 2 only as an assembly brick
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
1906.08237 (2019-06)
XLNet: Generalized Autoregressive Pretraining for Language Understanding
1908.09355 (2019-08)
Patient Knowledge Distillation for BERT Model Compression
and 11 more not named here
scatter_kwargs 11 other papers
1 dated earlier, 10 later
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
2204.03883 (2022-04)
Vision Transformers for Single Image Dehazing
2207.00735 (2022-07)
Can Language Models Make Fun? A Case Study in Chinese Comical Crosstalk
and 8 more not named here
scatter 8 other papers
1 dated earlier, 7 later
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
2204.03883 (2022-04)
Vision Transformers for Single Image Dehazing
2207.00735 (2022-07)
Can Language Models Make Fun? A Case Study in Chinese Comical Crosstalk
and 5 more not named here
elu_p1 4 other papers
4 later
2310.16076 (2023-10)
Practical Computational Power of Linear Transformers and Their Recurrent and Self-Referential Extensions
2312.00276 (2023-12)
Metalearning Continual Learning Algorithms
2406.01012 (2024-06)
Attention-based Iterative Decomposition for Tensor Product Representation
and 1 more not named here
sum_norm 4 other papers
4 later
2310.16076 (2023-10)
Practical Computational Power of Linear Transformers and Their Recurrent and Self-Referential Extensions
2312.00276 (2023-12)
Metalearning Continual Learning Algorithms
2406.01012 (2024-06)
Attention-based Iterative Decomposition for Tensor Product Representation
and 1 more not named here
get_logger 3 other papers
1 dated earlier, 2 later
2004.12585 (2020-04)
A Batch Normalized Inference Network Keeps the KL Vanishing Away
2304.11062 (2023-04)
Scaling Transformer to 1M tokens and beyond with RMT
2406.13770 (2024-06)
Elliptical Attention
sum_norm_eps 2 other papers
2 later
2406.01012 (2024-06)
Attention-based Iterative Decomposition for Tensor Product Representation
2406.06976 (2024-06)
Discrete Dictionary-based Decomposition Layer for Structured Representation Learning
create_exp_dir 1 other paper
1 later
2304.11062 (2023-04)
Scaling Transformer to 1M tokens and beyond with RMT
format_log 1 other paper
1 later
2406.06976 (2024-06)
Discrete Dictionary-based Decomposition Layer for Structured Representation Learning

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

Transformers with linearised attention ("linear Transformers") have demonstrated the practical scalability and effectiveness of outer product-based Fast Weight Programmers (FWPs) from the '90s. However, the original FWP formulation is more general than the one of linear Transformers: a slow neural network (NN) continually reprograms the weights of a fast NN with arbitrary architecture. In existing linear Transformers, both NNs are feedforward and consist of a single layer. Here we explore new variations by adding recurrence to the slow and fast nets. We evaluate our novel recurrent FWPs (RFWPs) on two synthetic algorithmic tasks (code execution and sequential ListOps), Wikitext-103 language models, and on the Atari 2600 2D game environment. Our models exhibit properties of Transformers and RNNs. In the reinforcement learning setting, we report large improvements over LSTM in several Atari games. Our code is public. 1

For agents

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

get_harvested_code_for_paper("2106.06295")
get_code_for_paper("2106.06295")
have("2106.06295")

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

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

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

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

Connect an agent — have() is free.