SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1807.03819 · 2018

Universal Transformers

Łukasz Kaiser, Oriol Vinyals, Mostafa Dehghani, Jakob Uszkoreit, Stephan Gouws

arXiv · PDF · Open in the Atlas

Code that ran

17 of 25 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (8 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 16 have no contract verdict; 0 failures of our instrument; 8 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/1807.03819.json · badge: /api/ran/1807.03819.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
cfiken/universal_transformer community
Papers with Code archive
6 ran · 4 no recorded run
moon23k/Transformer_Archs community
Papers with Code archive
5 ran · 3 no recorded run
sidney1505/arc_maml_transformer community
Papers with Code archive
4 ran · 1 no recorded run
andreamad8/Universal-Transformer-Pytorch community
Papers with Code archive
1 ran · 0 no recorded run
MostafaDehghani/bAbI-T2T community (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
FunctionStatusWhere it lives
ACT Ran
ran on a synthesized input
cfiken/universal_transformer/model/ut.py
pointer only (licence: NONE) · get_code("df7ba9e22f4021de")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cfiken/universal_transformer 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.

ACT_basic Ran
ran on a synthesized input
andreamad8/Universal-Transformer-Pytorch/models/UTransformer.py
pointer only (licence: NONE) · get_code("48da21be9c4b565a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, andreamad8/Universal-Transformer-Pytorch 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.

EmbeddingSharedWeights Ran
ran on a synthesized input · constructed an object; no result was computed
cfiken/universal_transformer/model/ut.py
pointer only (licence: NONE) · get_code("ab44c54bef771f0e")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cfiken/universal_transformer 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.

Embeddings Ran
ran on a synthesized input
moon23k/Transformer_Archs/model/recurrent.py
pointer only (licence: NONE) · get_code("50973ad904b644b9")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, moon23k/Transformer_Archs 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.

FeedForwardNetwork Ran
ran on a synthesized input · constructed an object; no result was computed
cfiken/universal_transformer/model/ut.py
pointer only (licence: NONE) · get_code("81f546780efe0c63")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cfiken/universal_transformer 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.

LayerNormalization Ran
ran on a synthesized input · constructed an object; no result was computed
sidney1505/arc_maml_transformer/keras_transformer/transformer.py
pointer only (licence: NONE) · get_code("8187fac026534417")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, sidney1505/arc_maml_transformer 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.

LayerWrapper Ran
ran on a synthesized input · constructed an object; no result was computed
cfiken/universal_transformer/model/ut.py
pointer only (licence: NONE) · get_code("8f3fd62209af26f0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cfiken/universal_transformer 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.

MultiHeadSelfAttention Ran
ran on a synthesized input · constructed an object; no result was computed
sidney1505/arc_maml_transformer/keras_transformer/transformer.py
pointer only (licence: NONE) · get_code("99fc6b1e929c1a86")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, sidney1505/arc_maml_transformer 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.

MultiheadAttention Ran
ran on a synthesized input · constructed an object; no result was computed
cfiken/universal_transformer/model/ut.py
pointer only (licence: NONE) · get_code("97703c2875660e0b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cfiken/universal_transformer 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.

PositionalEncoding Ran
ran on a synthesized input
moon23k/Transformer_Archs/model/recurrent.py
pointer only (licence: NONE) · get_code("55f808c7c4cab374")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, moon23k/Transformer_Archs 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.

RecurrentEncoder Ran
ran on a synthesized input
moon23k/Transformer_Archs/model/recurrent.py
pointer only (licence: NONE) · get_code("1e5ecdd2d7834bc5")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, moon23k/Transformer_Archs 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.

SelfAttention Ran
ran on a synthesized input
cfiken/universal_transformer/model/ut.py
pointer only (licence: NONE) · get_code("72219f63ad9d256a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cfiken/universal_transformer 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.

StandardDecoder Ran
ran on a synthesized input
moon23k/Transformer_Archs/model/recurrent.py
pointer only (licence: NONE) · get_code("ac79741037ef4e2b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, moon23k/Transformer_Archs 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.

TransformerTransition Ran
ran on a synthesized input · constructed an object; no result was computed
sidney1505/arc_maml_transformer/keras_transformer/transformer.py
pointer only (licence: NONE) · get_code("d297901c2cb19187")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, sidney1505/arc_maml_transformer 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.

_BaseMultiHeadAttention Ran
ran on a synthesized input · constructed an object; no result was computed
sidney1505/arc_maml_transformer/keras_transformer/transformer.py
pointer only (licence: NONE) · get_code("1eb7bb2c7019e81d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, sidney1505/arc_maml_transformer 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.

generate_signal Ran
ran, honoured the contract we drafted
moon23k/Transformer_Archs/model/recurrent.py
pointer only (licence: NONE) · get_code("58801803f9aacb41")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, moon23k/Transformer_Archs 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.

log_decode_results Ran
ran on a synthesized input
MostafaDehghani/bAbI-T2T/t2t_usr_dir/babi_transformer_decoder.py
code served (permissive licence) · get_code("82a2fb5195404bdd")
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 torch
import numpy as np

torch.manual_seed(0)

class SimpleVocab:
    """Stand-in vocab class with decode method."""
    def __init__(self, name):
        self.name = name
    
    def decode(self, indices):
        """Convert indices to space-separated string."""
        return ' '.join([f'{self.name}_{int(i)}' for i in indices])

# Create small tensors
stories = torch.randint(0, 10, (2, 4))  # batch=2, seq_len=4
questions = torch.randint(0, 10, (2, 3))  # batch=2, seq_len=3
outputs = torch.randint(0, 5, (2, 5))  # batch=2, output_len=5
targets = torch.randint(0, 5, (2, 5))  # batch=2, output_len=5

# Create vocab instances
stories_vocab = SimpleVocab('story')
questions_vocab = SimpleVocab('question')
targets_vocab = SimpleVocab('target')

ARGS = {
    'stories': stories,
    'questions': questions,
    'outputs': outputs,
    'stories_vocab': stories_vocab,
    'questions_vocab': questions_vocab,
    'targets_vocab': targets_vocab,
    'targets': targets,
    'identity_output': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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 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
DecoderStack Not yet run
unverified (harvested, no recorded run)
cfiken/universal_transformer/model/ut.py
pointer only (licence: NONE) · get_code("785dd04c3d9161a4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cfiken/universal_transformer 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. No invocation recorded.

EncoderStack Not yet run
unverified (harvested, no recorded run)
cfiken/universal_transformer/model/ut.py
pointer only (licence: NONE) · get_code("9d2c61e66b4346a7")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cfiken/universal_transformer 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. No invocation recorded.

LayerNormalization Not yet run
unverified (harvested, no recorded run)
cfiken/universal_transformer/model/ut.py
pointer only (licence: NONE) · get_code("d65227646941963e")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cfiken/universal_transformer 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. No invocation recorded.

ModelBase Not yet run
unverified (harvested, no recorded run)
moon23k/Transformer_Archs/model/recurrent.py
pointer only (licence: NONE) · get_code("6dd3fd72476b96f4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, moon23k/Transformer_Archs 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. No invocation recorded.

RecurrentDecoder Not yet run
unverified (harvested, no recorded run)
moon23k/Transformer_Archs/model/recurrent.py
pointer only (licence: NONE) · get_code("d939293e6a574006")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, moon23k/Transformer_Archs 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. No invocation recorded.

RecurrentTransformer Not yet run
unverified (harvested, no recorded run)
moon23k/Transformer_Archs/model/recurrent.py
pointer only (licence: NONE) · get_code("848001379d12e45b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, moon23k/Transformer_Archs 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. No invocation recorded.

TransformerBlock Not yet run
unverified (harvested, no recorded run)
sidney1505/arc_maml_transformer/keras_transformer/transformer.py
pointer only (licence: NONE) · get_code("bfa58c8b92ee3953")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, sidney1505/arc_maml_transformer 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. No invocation recorded.

UniversalTransformer Not yet run
unverified (harvested, no recorded run)
cfiken/universal_transformer/model/ut.py
pointer only (licence: NONE) · get_code("b3026a17c1914957")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cfiken/universal_transformer 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. No invocation recorded.

Also present in other papers' code

Of 25 samples lifted from this paper's linked repositories, 25 carry a function identity and 0 do not. Of the 25 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 0 later) and 21 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
Embeddings
brick of this paper's assembly: model
1 other paper
1 dated earlier
1706.03762 (2017-06)
Attention Is All You Need
ModelBase
brick of this paper's assembly: helper
1 other paper
1 dated earlier
1706.03762 (2017-06)
Attention Is All You Need
PositionalEncoding
brick of this paper's assembly: helper
1 other paper
1 dated earlier
1706.03762 (2017-06)
Attention Is All You Need
StandardDecoder
brick of this paper's assembly: model
1 other paper
1 dated earlier
1706.03762 (2017-06)
Attention Is All You Need

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

Recurrent neural networks (RNNs) sequentially process data by updating their state with each new data point, and have long been the de facto choice for sequence modeling tasks. However, their inherently sequential computation makes them slow to train. Feed-forward and convolutional architectures have recently been shown to achieve superior results on some sequence modeling tasks such as machine translation, with the added advantage that they concurrently process all inputs in the sequence, leading to easy parallelization and faster training times. Despite these successes, however, popular feed-forward sequence models like the Transformer fail to generalize in many simple tasks that recurrent models handle with ease, e.g. copying strings or even simple logical inference when the string or formula lengths exceed those observed at training time. We propose the Universal Transformer (UT), a parallel-in-time self-attentive recurrent sequence model which can be cast as a generalization of the Transformer model and which addresses these issues. UTs combine the parallelizability and global receptive field of feed-forward sequence models like the Transformer with the recurrent inductive bias of RNNs. We also add a dynamic per-position halting mechanism and find that it improves accuracy on several tasks. In contrast to the standard Transformer, under certain assumptions UTs can be shown to be Turing-complete. Our experiments show that UTs outperform standard Transformers on a wide range of algorithmic and language understanding tasks, including the challenging LAMBADA language modeling task where UTs achieve a new state of the art, and machine translation where UTs achieve a 0.9 BLEU improvement over Transformers on the WMT14 En-De dataset. * Equal contribution, alphabetically by last name. † Work performed while at Google Brain.

For agents

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

get_harvested_code_for_paper("1807.03819")
get_code_for_paper("1807.03819")
have("1807.03819")

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

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

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

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

Connect an agent — have() is free.