SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1803.02155 · 2018

Self-Attention with Relative Position Representations

Jakob Uszkoreit, Ashish Vaswani, Peter Shaw

arXiv · PDF · Open in the Atlas

Code that ran

13 of 23 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 5 failures of our instrument; 10 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/1803.02155.json · badge: /api/ran/1803.02155.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
thumt/THUMT community
Papers with Code archive
3 ran · 4 no recorded run
Chatha-Sphere/pno-ai community
Papers with Code archive
3 ran · 0 no recorded run
OpenNMT/OpenNMT-tf community
Papers with Code archive
2 ran · 4 no recorded run
HarunoriKawano/Conformer community
Papers with Code archive
2 ran · 0 no recorded run
The-AI-Summer/self-attention-cv community
Papers with Code archive
1 ran · 0 no recorded run
anonymouscode115/autoregressive_inference community
Papers with Code archive
1 ran · 0 no recorded run
bzhangGo/zero community
Papers with Code archive
1 ran · 0 no recorded run
mehdibenamorr/bert-positional-bias-ner community
Papers with Code archive
0 ran · 1 no recorded run
ololo123321/maestro community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
AttentionError Ran
ran on a synthesized input · constructed an object; no result was computed
Chatha-Sphere/pno-ai/model/attention.py
code served (permissive licence) · get_code("d2320a9b0f803ace")
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 an instance of its own class, AttentionError: the run constructed the object and did not call it, so no result was computed. 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)

# AttentionError is a simple Exception subclass with no additional parameters
# beyond those inherited from Exception (message, args, etc.)
# The __init__ signature is: __init__(self, *args, **kwargs)
# which is inherited from BaseException

ARGS = {
    # Exception can take a message as the first positional argument
    # We'll pass a simple error message
}

# Actually, let's be more explicit about what Exception accepts
# Exception.__init__(self, *args) - takes variable positional arguments

# For a minimal valid instantiation:
ARGS = {}
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 AttentionError — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a AttentionError 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
Config Ran
ran on a synthesized input · constructed an object; no result was computed
HarunoriKawano/Conformer/model/self_attention.py
code served (permissive licence) · get_code("e668a7dc515efd4a")
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 an instance of its own class, Config: the run constructed the object and did not call it, so no result was computed. 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 dataclasses import dataclass

torch.manual_seed(0)

@dataclass(frozen=True)
class Config:
    hidden_size: int
    intermediate_size: int
    num_attention_heads: int
    conv_depth_wise_kernel_size: int
    num_hidden_layers: int
    max_source_positions: int
    mel_filter_size: int
    with_cls: bool

ARGS = {
    "hidden_size": 64,
    "intermediate_size": 128,
    "num_attention_heads": 4,
    "conv_depth_wise_kernel_size": 3,
    "num_hidden_layers": 2,
    "max_source_positions": 512,
    "mel_filter_size": 128,
    "with_cls": 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 Config — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Config 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
MultiHeadSelfAttentionWithRelativePosition Ran
ran on a synthesized input · constructed an object; no result was computed
HarunoriKawano/Conformer/model/self_attention.py
code served (permissive licence) · get_code("1cb2afe736f259b7")
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 an instance of its own class, MultiHeadSelfAttentionWithRelativePosition: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn
from dataclasses import dataclass

torch.manual_seed(0)

@dataclass(frozen=True)
class Config:
    hidden_size: int
    intermediate_size: int
    num_attention_heads: int
    conv_depth_wise_kernel_size: int
    num_hidden_layers: int
    max_source_positions: int
    mel_filter_size: int
    with_cls: bool

config = Config(
    hidden_size=8,
    intermediate_size=32,
    num_attention_heads=2,
    conv_depth_wise_kernel_size=3,
    num_hidden_layers=2,
    max_source_positions=16,
    mel_filter_size=128,
    with_cls=True
)

attention_module = nn.Module()

batch_size = 2
sequence_length = 5
hidden_size = 8

hidden_states = torch.randn(batch_size, sequence_length, hidden_size)
position_embeddings = torch.randn(sequence_length, sequence_length, hidden_size)
attention_mask = torch.ones(batch_size, sequence_length)

ARGS = {
    "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 MultiHeadSelfAttentionWithRelativePosition — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MultiHeadSelfAttentionWithRelativePosition 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
MultiheadedAttention Ran
ran on a synthesized input
Chatha-Sphere/pno-ai/model/attention.py
code served (permissive licence) · get_code("4d00521ff1fb8ddc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from scipy import linalg

# Setup for MultiheadedAttention
INIT_ARGS = {
    'd_model': 4,
    'heads': 2,
    'dropout': 0.1,
    'relative_pos': True
}

# Create input tensors for forward pass
batch_size = 2
seq_len = 3
d_model = INIT_ARGS['d_model']

x = torch.randn(batch_size, seq_len, d_model)
mask = torch.ones(batch_size, seq_len, dtype=torch.bool)
mask[0, -1] = False  # Example mask: first sequence's last position is masked

ARGS = {
    'x': x,
    'mask': mask
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, scipy, 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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
RelPosEmb1D Ran
ran on a synthesized input · constructed an object; no result was computed
The-AI-Summer/self-attention-cv/self_attention_cv/pos_embeddings/relative_embeddings_1D.py
code served (permissive licence) · get_code("53c95ac1e55640a3")
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 an instance of its own class, RelPosEmb1D: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

# Parameters for RelPosEmb1D.__init__
tokens = 3
dim_head = 4
heads = 2

ARGS = {
    'tokens': tokens,
    'dim_head': dim_head,
    'heads': heads,
}

# Verify the module can be instantiated and used
model = nn.Module()
model.rel_pos = nn.Sequential()

# Create a test query tensor: [batch, heads, tokens, dim]
batch = 2
q = torch.randn(batch, heads, tokens, dim_head)

# This demonstrates the function works with these args
rel_pos_module = nn.Module()
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type RelPosEmb1D — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a RelPosEmb1D 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
d Ran
ran; our contract draft was wrong, not the code
Chatha-Sphere/pno-ai/model/attention.py
code served (permissive licence) · get_code("903e293032057e87")
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 str. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 d() takes an optional tensor parameter
# When tensor is None, it returns device string based on cuda availability
# When tensor is provided, it checks tensor.is_cuda attribute

# Create a small CPU tensor
tensor = torch.randn(2, 4)

# Construct arguments dict
ARGS = {
    'tensor': tensor
}
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 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
dropout Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
OpenNMT/OpenNMT-tf/opennmt/layers/transformer.py
code served (permissive licence) · get_code("3b70cfc3a2e7647c")
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 EagerTensor, 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 tensorflow as tf
import numpy as np

# Create a small tensor for input x
x = tf.constant([[1.0, 2.0, 3.0, 4.0],
                 [5.0, 6.0, 7.0, 8.0]], dtype=tf.float32)

# Create arguments dict
ARGS = {
    "x": x,
    "rate": 0.5,
    "training": True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, 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_scope Ran
ran on a synthesized input
thumt/THUMT/thumt/modules/attention.py
code served (permissive licence) · get_code("ce57057c1591618c")
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 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
import numpy as np

torch.manual_seed(0)

# get_scope() takes no parameters
# The function simply returns the value of the global _NAME_STACK variable
# which is initialized as an empty string ''

ARGS = {}
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 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
position_encoding_relative Ran
ran, honoured the contract we drafted
anonymouscode115/autoregressive_inference/voi/nn/position_encoding.py
pointer only (licence: NONE) · get_code("71c0ce87dcaac659")
How it ran

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

relative_attention_inner Ran
ran; our contract draft was wrong, not the code
bzhangGo/zero/modules/rpr.py
code served (permissive licence) · get_code("d6ec71d67f113b51")
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 EagerTensor, ndim 4, dtype family float, shape (2, 3, 4, 5) 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 tensorflow as tf
import numpy as np

# Set seed for reproducibility
tf.random.set_seed(0)
np.random.seed(0)

# Create small tensors with distinct dimensions for clarity
batch_size = 2
heads = 3
length = 4
depth = 5

# x: [batch_size, heads, length, length or depth]
# Using length as last dimension
x = tf.constant(np.random.randn(batch_size, heads, length, length).astype(np.float32))

# y: [batch_size, heads, length, depth]
y = tf.constant(np.random.randn(batch_size, heads, length, depth).astype(np.float32))

# z: [length, length, depth]
z = tf.constant(np.random.randn(length, length, depth).astype(np.float32))

# transpose: boolean flag
transpose = False

ARGS = {
    "x": x,
    "y": y,
    "z": z,
    "transpose": transpose,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float, shape (2, 3, 4, 5) — shape (2, 3, 4, 5) 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
relative_positions Ran
ran, honoured the contract we drafted
OpenNMT/OpenNMT-tf/opennmt/layers/transformer.py
code served (permissive licence) · get_code("c372eab93e763761")
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 EagerTensor, ndim 2, dtype family int, shape (5, 5) 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 tensorflow as tf

ARGS = {
    "length": 5,
    "maximum_position": 3,
    "with_cache": False,
}
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 EagerTensor, ndim 2, dtype family int, shape (5, 5) — shape (5, 5) 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
scope Ran
ran; our contract draft was wrong, not the code
thumt/THUMT/thumt/modules/attention.py
code served (permissive licence) · get_code("da6d13db984a8839")
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 _GeneratorContextManager. 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 re
import contextlib

_NAMES_IN_USE = {}
_NAME_STACK = ''
_VALID_OP_NAME_REGEX = re.compile('^[A-Za-z0-9.][A-Za-z0-9_.\\-/]*$')
_VALID_SCOPE_NAME_REGEX = re.compile('^[A-Za-z0-9_.\\-/]*$')

def unique_name(name, mark_as_used=True):
    global _NAME_STACK
    if _NAME_STACK:
        name = _NAME_STACK + '/' + name
    i = _NAMES_IN_USE.get(name, 0)
    if mark_as_used:
        _NAMES_IN_USE[name] = i + 1
    if i > 0:
        base_name = name
        while name in _NAMES_IN_USE:
            name = '%s_%d' % (base_name, i)
            i += 1
        if mark_as_used:
            _NAMES_IN_USE[name] = 1
    return name

@contextlib.contextmanager
def scope(name):
    global _NAME_STACK
    if name:
        if _NAME_STACK:
            if not _VALID_SCOPE_NAME_REGEX.match(name):
                raise ValueError("'%s' is not a valid scope name" % name)
        elif not _VALID_OP_NAME_REGEX.match(name):
            raise ValueError("'%s' is not a valid scope name" % name)
    try:
        old_stack = _NAME_STACK
        if not name:
            new_stack = None
        elif name and name[-1] == '/':
            new_stack = name[:-1]
        else:
            new_stack = unique_name(name)
        _NAME_STACK = new_stack
        yield ('' if new_stack is None else new_stack + '/')
    finally:
        _NAME_STACK = old_stack

ARGS = {
    'name': 'layer1'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 _GeneratorContextManager — a _GeneratorContextManager output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a _GeneratorContextManager 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
unique_name Ran
ran; our contract draft was wrong, not the code
thumt/THUMT/thumt/modules/attention.py
code served (permissive licence) · get_code("1a8621ca6bef124e")
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 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.

# Reset global state
_NAMES_IN_USE = {}
_NAME_STACK = ''

# Define ARGS with all parameters for unique_name
ARGS = {
    'name': 'test_layer',
    'mark_as_used': True
}
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 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
Affine Not yet run
unverified (harvested, no recorded run)
thumt/THUMT/thumt/modules/attention.py
code served (permissive licence) · get_code("12c7f6b929650b4c")
How it ran

no invocation recorded.

BertSelfAttention Not yet run
unverified (harvested, no recorded run)
mehdibenamorr/bert-positional-bias-ner/models/attention.py
pointer only (licence: NONE) · get_code("a9285738d93fbcb8")
How it ran

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

Module Not yet run
unverified (harvested, no recorded run)
thumt/THUMT/thumt/modules/attention.py
code served (permissive licence) · get_code("49d8363941029a9b")
How it ran

no invocation recorded.

MultiHeadAttention Not yet run
unverified (harvested, no recorded run)
OpenNMT/OpenNMT-tf/opennmt/layers/transformer.py
code served (permissive licence) · get_code("5fd90f133d0b4da5")
How it ran

no invocation recorded.

MultiHeadAttention Not yet run
unverified (harvested, no recorded run)
thumt/THUMT/thumt/modules/attention.py
code served (permissive licence) · get_code("5697fe35ac9c0449")
How it ran

no invocation recorded.

MultiHeadAttentionBase Not yet run
unverified (harvested, no recorded run)
thumt/THUMT/thumt/modules/attention.py
code served (permissive licence) · get_code("9ed944fa439aacb7")
How it ran

no invocation recorded.

RelativeMHA Not yet run
unverified (harvested, no recorded run)
ololo123321/maestro/TF1/maestro.py
pointer only (licence: NONE) · get_code("5ed8b4d74e31e691")
How it ran

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

combine_heads Not yet run
unverified (harvested, no recorded run)
OpenNMT/OpenNMT-tf/opennmt/layers/transformer.py
code served (permissive licence) · get_code("a14d3e5d54c5f021")
How it ran

no invocation recorded.

matmul_with_relative_representations Not yet run
unverified (harvested, no recorded run)
OpenNMT/OpenNMT-tf/opennmt/layers/transformer.py
code served (permissive licence) · get_code("3d1e1d0aa578918b")
How it ran

no invocation recorded.

split_heads Not yet run
unverified (harvested, no recorded run)
OpenNMT/OpenNMT-tf/opennmt/layers/transformer.py
code served (permissive licence) · get_code("615a2551db0eca16")
How it ran

no invocation recorded.

Also present in other papers' code

Of 23 samples lifted from this paper's linked repositories, 23 carry a function identity and 0 do not. Of the 23 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 22 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
RelPosEmb1D
brick of this paper's assembly: entry
1 other paper
1 later
2101.11605 (2021-01)
Bottleneck Transformers for Visual Recognition

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

Relying entirely on an attention mechanism, the Transformer introduced by Vaswani et al. ( 2017) achieves state-of-the-art results for machine translation. In contrast to recurrent and convolutional neural networks, it does not explicitly model relative or absolute position information in its structure. Instead, it requires adding representations of absolute positions to its inputs. In this work we present an alternative approach, extending the self-attention mechanism to efficiently consider representations of the relative positions, or distances between sequence elements. On the WMT 2014 English-to-German and English-to-French translation tasks, this approach yields improvements of 1.3 BLEU and 0.3 BLEU over absolute position representations, respectively. Notably, we observe that combining relative and absolute position representations yields no further improvement in translation quality. We describe an efficient implementation of our method and cast it as an instance of relation-aware self-attention mechanisms that can generalize to arbitrary graphlabeled inputs.

For agents

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

get_harvested_code_for_paper("1803.02155")
get_code_for_paper("1803.02155")
have("1803.02155")

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

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

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

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

Connect an agent — have() is free.