SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1609.08144 · 2016

Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation

Łukasz Kaiser, Wei Wang, Mohammad Norouzi, Quoc Le, Melvin Johnson, Oriol Vinyals, Yonghui Wu, Yuan Cao, Wolfgang Macherey, Zhifeng Chen, Maxim Krikun, Keith Stevens, and 19 more

arXiv · PDF · Open in the Atlas

Code that ran

34 of 46 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, 2 violated it and 21 have no contract verdict; 9 failures of our instrument; 12 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/1609.08144.json · badge: /api/ran/1609.08144.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
microsoft/BlingFire canonical (classifier label)
classifier basis: census
11 ran · 2 no recorded run
psunlpgroup/xsemplr community
Papers with Code archive
12 ran · 2 no recorded run
ZHANG45/multi_gpu_seq2seq community
Papers with Code archive
5 ran · 1 no recorded run
kh-kim/simple-nmt community
Papers with Code archive
3 ran · 2 no recorded run
Liut2016/stackedResBiLSTM community
Papers with Code archive
1 ran · 4 no recorded run
guillaume-chevalier/HAR-stacked-residual-bidir-LSTMs community (classifier label)
classifier basis not recorded on the link
1 ran · 1 no recorded run
virsagothethird/Korean-English-translator community
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
Attention Ran
ran on a synthesized input
kh-kim/simple-nmt/simple_nmt/models/seq2seq.py
pointer only (licence: NONE) · get_code("efc311adeb93a786")
How it ran

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

AverageSpanExtractor Ran
ran on a synthesized input
psunlpgroup/xsemplr/model/seq2seqPTR/src/ptrbert.py
code served (permissive licence) · get_code("95b1f6bdad5fb67b")
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. 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 torch.nn as nn
import math

def get_range_vector(size: int, device) -> torch.Tensor:
    return torch.arange(0, size, dtype=torch.long).to(device)

class AverageSpanExtractor(nn.Module):

    def __init__(self):
        super(AverageSpanExtractor, self).__init__()

    def forward(self, sequence_tensor: torch.FloatTensor, span_indices: torch.LongTensor, span_indices_mask: torch.LongTensor=None) -> torch.FloatTensor:
        span_starts, span_ends = span_indices.split(1, dim=-1)
        span_ends = span_ends - 1
        span_widths = span_ends - span_starts
        max_batch_span_width = span_widths.max().item() + 1
        global_average_logits = torch.ones(sequence_tensor.size()[:2] + (1,)).float().to(sequence_tensor.device)
        max_span_range_indices = get_range_vector(max_batch_span_width, sequence_tensor.device).view(1, 1, -1)
        span_mask = (max_span_range_indices <= span_widths).float()
        raw_span_indices = span_ends - max_span_range_indices
        span_mask = span_mask * (raw_span_indices >= 0).float()
        span_indices = torch.relu(raw_span_indices.float()).long()
        return span_mask


INIT_ARGS = {}

ARGS = {
    'sequence_tensor': torch.randn(2, 5, 4),
    'span_indices': torch.tensor([[[1, 3], [2, 4]], [[0, 2], [1, 3]]], dtype=torch.long),
    'span_indices_mask': None
}

if __name__ == '__main__':
    model = AverageSpanExtractor(**INIT_ARGS)
    output = model(**ARGS)
    print("Output shape:", output.shape)
    print("Output:", output)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 — 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)
BeamSearchNode Ran
ran on a synthesized input
psunlpgroup/xsemplr/model/seq2seqPTR/src/ptrbert.py
code served (permissive licence) · get_code("229cf6fba4062cd9")
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 float, ndim 0, 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

class BeamSearchNode(object):

    def __init__(self, ys, previousNode, wordId, logProb, length, ys_pointer_mask=None):
        """
        :param hiddenstate:
        :param previousNode:
        :param wordId:
        :param logProb:
        :param length:
        """
        self.ys = ys
        self.prevNode = previousNode
        self.wordid = wordId
        self.logp = logProb
        self.leng = length
        self.ys_pointer_mask = ys_pointer_mask

    def eval(self, alpha=1.0):
        reward = 0
        return self.logp / float(self.leng - 1 + 1e-06) + alpha * reward

    def __lt__(self, other):
        return True


INIT_ARGS = {
    'ys': torch.tensor([[1, 2, 3], [4, 5, 6]], dtype=torch.long),
    'previousNode': None,
    'wordId': 7,
    'logProb': -2.5,
    'length': 4,
    'ys_pointer_mask': torch.tensor([[1, 0, 1], [0, 1, 1]], dtype=torch.float32)
}

ARGS = {
    'alpha': 1.0
}

METHOD = 'eval'

if __name__ == '__main__':
    node = BeamSearchNode(**INIT_ARGS)
    result = node.eval(**ARGS)
    print(f"Result: {result}")
    print(f"Node ys shape: {node.ys.shape}")
    print(f"Node logp: {node.logp}")
    print(f"Node leng: {node.leng}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, 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)
Decoder Ran
ran on a synthesized input · constructed an object; no result was computed
ZHANG45/multi_gpu_seq2seq/seq2seq2.py
pointer only (licence: NONE) · get_code("1657da8312de365d")
How it ran

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

Encoder Ran
ran on a synthesized input · constructed an object; no result was computed
ZHANG45/multi_gpu_seq2seq/seq2seq2.py
pointer only (licence: NONE) · get_code("50db89833b87dbe3")
How it ran

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

Encoder Ran
ran on a synthesized input
kh-kim/simple-nmt/simple_nmt/models/seq2seq.py
pointer only (licence: NONE) · get_code("2662a03f14c86a67")
How it ran

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

Generator Ran
ran on a synthesized input · constructed an object; no result was computed
ZHANG45/multi_gpu_seq2seq/seq2seq2.py
pointer only (licence: NONE) · get_code("0094511a1c6f0800")
How it ran

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

Generator Ran
ran on a synthesized input
psunlpgroup/xsemplr/model/seq2seqPTR/src/ptrbert.py
code served (permissive licence) · get_code("78edbd2119371df3")
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 2, dtype family float, shape (2, 3) 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
from torch import nn

class Generator(nn.Module):
    """Define standard linear + softmax generation step."""

    def __init__(self, d_model, vocab):
        super(Generator, self).__init__()
        self.proj = nn.Linear(d_model, vocab)

    def forward(self, x):
        return self.proj(x)


INIT_ARGS = {
    "d_model": 4,
    "vocab": 3,
}

ARGS = {
    "x": torch.randn(2, 4),
}

if __name__ == "__main__":
    generator = Generator(**INIT_ARGS)
    output = generator(**ARGS)
    print("Output shape:", output.shape)
    print("Output:", output)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 3) — shape (2, 3) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Generator Ran
ran on a synthesized input
kh-kim/simple-nmt/simple_nmt/models/seq2seq.py
pointer only (licence: NONE) · get_code("f7231b6041ba6ab3")
How it ran

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

LabelSmoothing Ran
ran on a synthesized input
psunlpgroup/xsemplr/model/seq2seqPTR/src/ptrbert.py
code served (permissive licence) · get_code("73e4f0852349e7bc")
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 0, dtype family float, shape () 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
from torch import nn
from torch.autograd import Variable

class LabelSmoothing(nn.Module):
    """Implement label smoothing."""

    def __init__(self, size, padding_idx, smoothing=0.0):
        super(LabelSmoothing, self).__init__()
        self.criterion = nn.KLDivLoss(size_average=False)
        self.padding_idx = padding_idx
        self.confidence = 1.0 - smoothing
        self.smoothing = smoothing
        self.size = size
        self.true_dist = None

    def forward(self, x, target):
        assert x.size(1) == self.size
        true_dist = x.data.clone()
        true_dist.fill_(self.smoothing / (self.size - 3))
        true_dist.scatter_(1, target.data.unsqueeze(1), self.confidence)
        true_dist[:, self.padding_idx] = 0
        mask = torch.nonzero(target.data == self.padding_idx)
        if mask.dim() > 0:
            true_dist.index_fill_(0, mask.squeeze(), 0.0)
        self.true_dist = true_dist
        res = self.criterion(x, Variable(true_dist, requires_grad=False))
        return res


INIT_ARGS = {
    "size": 5,
    "padding_idx": 0,
    "smoothing": 0.1,
}

ARGS = {
    "x": torch.randn(2, 5, requires_grad=True),
    "target": torch.tensor([1, 2]),
}

if __name__ == "__main__":
    model = LabelSmoothing(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output: {output}")
    print(f"Output shape: {output.shape}")
    print(f"True dist shape: {model.true_dist.shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 0, dtype family float, shape () — shape () 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Seq2Seq Ran
ran on a synthesized input · constructed an object; no result was computed
ZHANG45/multi_gpu_seq2seq/seq2seq2.py
pointer only (licence: NONE) · get_code("92bf320d3ebcecdb")
How it ran

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

SimpleLossCompute Ran
ran on a synthesized input
psunlpgroup/xsemplr/model/seq2seqPTR/src/ptrbert.py
code served (permissive licence) · get_code("1475ad8d2eb28cde")
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 1, dtype family float, shape (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

INIT_ARGS = {
    "criterion": nn.CrossEntropyLoss(reduction="none"),
    "opt": None,
}

ARGS = {
    "x": torch.randn(2, 3, 4),
    "y": torch.randint(0, 4, (2, 3)),
    "norm": torch.tensor([2.0, 3.0]),
}

METHOD = "__call__"

class SimpleLossCompute:
    """A simple loss compute and train function."""

    def __init__(self, criterion, opt=None):
        self.criterion = criterion
        self.opt = opt

    def __call__(self, x, y, norm):
        norm = norm.data.sum()
        loss = self.criterion(x.contiguous().view(-1, x.size(-1)), y.contiguous().view(-1)) / norm
        return loss

if __name__ == "__main__":
    loss_compute = SimpleLossCompute(**INIT_ARGS)
    result = loss_compute(**ARGS)
    print(f"Loss result: {result}")
    print(f"Loss shape: {result.shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 1, dtype family float, shape (6,) — shape (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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
_inverse_indices Ran
ran, violated the contract we drafted
ZHANG45/multi_gpu_seq2seq/seq2seq2.py
pointer only (licence: NONE) · get_code("b9cb323bd3d025b6")
How it ran

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

attention Ran
ran; our contract draft was wrong, not the code
psunlpgroup/xsemplr/model/seq2seqPTR/src/ptrbert.py
code served (permissive licence) · get_code("51522955ae4c222d")
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. 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
import math

torch.manual_seed(0)

# Create small tensors for query, key, value
# Using distinct dimensions: batch=2, seq_len=3, d_k=4
batch_size = 2
seq_len = 3
d_k = 4

query = torch.randn(batch_size, seq_len, d_k)
key = torch.randn(batch_size, seq_len, d_k)
value = torch.randn(batch_size, seq_len, d_k)

# Create a mask (optional parameter)
# mask should be broadcastable to scores shape (batch_size, seq_len, seq_len)
mask = torch.ones(batch_size, seq_len, seq_len)

# Create a dropout layer (optional parameter)
dropout = nn.Dropout(p=0.1)

ARGS = {
    "query": query,
    "key": key,
    "value": value,
    "mask": mask,
    "dropout": dropout
}
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 — a tuple output has no array shape of its own; none is 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
batched_index_select Ran
ran; our contract draft was wrong, not the code
psunlpgroup/xsemplr/model/seq2seqPTR/src/ptrbert.py
code served (permissive licence) · get_code("a2dd9c360300df18")
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 3, dtype family float, shape (2, 3, 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)

# Define the helper functions that are used
def get_range_vector(size: int, device) -> torch.Tensor:
    return torch.arange(0, size, dtype=torch.long).to(device)

def flatten_and_batch_shift_indices(indices: torch.LongTensor, sequence_length: int) -> torch.Tensor:
    if torch.max(indices) >= sequence_length or torch.min(indices) < 0:
        raise ValueError('All the elements should be in range (0, {}), but found ({}, {})'.format(sequence_length - 1, torch.min(indices).item(), torch.max(indices).item()))
    offsets = get_range_vector(indices.size(0), indices.device) * sequence_length
    for _ in range(len(indices.size()) - 1):
        offsets = offsets.unsqueeze(1)
    offset_indices = indices + offsets
    offset_indices = offset_indices.view(-1)
    return offset_indices

# Create test data
batch_size = 2
sequence_length = 5
embedding_size = 4

# target: (batch_size, sequence_length, embedding_size)
target = torch.randn(batch_size, sequence_length, embedding_size)

# indices: (batch_size, d_1, ..., d_n) where each index is in range [0, sequence_length)
# Using shape (batch_size, 3) for indices
indices = torch.randint(0, sequence_length, (batch_size, 3), dtype=torch.long)

# flattened_indices: can be None (will be computed) or pre-computed
flattened_indices = None

ARGS = {
    "target": target,
    "indices": indices,
    "flattened_indices": flattened_indices,
}
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 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 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
convert_to_unicode Ran
ran; our contract draft was wrong, not the code
microsoft/BlingFire/ldbsrc/bert_base_tok/tokenization.py
pointer only (licence: MIT); the stored copy get_code serves, from huawei-noah/Pretrained-Language-Model, is pointer only (licence: NONE) · get_code("1923fc05163d207d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from huawei-noah/Pretrained-Language-Model, 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.

define_model Ran
ran; our contract draft was wrong, not the code
virsagothethird/Korean-English-translator/src/helpme_spa.py
pointer only (licence: NONE) · get_code("cb8ba397b1c9bfd6")
How it ran

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

flatten_and_batch_shift_indices Ran
ran; our contract draft was wrong, not the code
psunlpgroup/xsemplr/model/seq2seqPTR/src/ptrbert.py
code served (permissive licence) · get_code("aacb87756629bdb1")
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 1, dtype family int, shape (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)

# Create a small batch of indices
# indices should be of shape (batch_size, d_1, ..., d_n) where values are valid indices into sequence_length
batch_size = 2
sequence_length = 5

# Create indices tensor with shape (batch_size, 3) containing valid indices
indices = torch.tensor([
    [0, 1, 2],
    [3, 4, 1]
], dtype=torch.long)

ARGS = {
    "indices": indices,
    "sequence_length": sequence_length
}
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 1, dtype family int, shape (6,) — shape (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
get_range_vector Ran
ran, honoured the contract we drafted
psunlpgroup/xsemplr/model/seq2seqPTR/src/ptrbert.py
code served (permissive licence) · get_code("68cef9d2b09ab819")
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 1, dtype family int, shape (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 torch

torch.manual_seed(0)

ARGS = {
    "size": 5,
    "device": torch.device("cpu"),
}
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 1, dtype family int, shape (5,) — shape (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
is_bert_chinese Ran
ran on a synthesized input
microsoft/BlingFire/ldbsrc/bert_multi_cased/generate_letters_from_vocab.py
code served (permissive licence) · get_code("74356079aa5fa20e")
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 bool, ndim 0, dtype family float, shape () 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

ARGS = {
    "l": "中"
}
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 bool, ndim 0, dtype family float, shape () — shape () 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
is_letter Ran
ran on a synthesized input
microsoft/BlingFire/ldbsrc/bert_multi_cased/generate_letters_from_vocab.py
code served (permissive licence) · get_code("a02d7706aacf6eee")
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 bool, ndim 0, dtype family float, shape () 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 unicodedata

def is_letter(l):
    cat = unicodedata.category(l)
    if cat.startswith('L') or cat.startswith('M') or cat.startswith('N'):
        return True
    return False

ARGS = {
    'l': 'A'
}
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 bool, ndim 0, dtype family float, shape () — shape () 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
masked_softmax Ran
ran; our contract draft was wrong, not the code
psunlpgroup/xsemplr/model/seq2seqPTR/src/ptrbert.py
code served (permissive licence) · get_code("42fb56ded96dd10a")
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)

# Create a small vector tensor (batch_size=2, sequence_length=4)
vector = torch.randn(2, 4)

# Create a mask tensor (batch_size=2, sequence_length=4)
# 1 indicates positions to keep, 0 indicates positions to mask
mask = torch.tensor([[1.0, 1.0, 0.0, 1.0],
                     [1.0, 0.0, 1.0, 1.0]])

# Define the arguments dictionary
ARGS = {
    "vector": vector,
    "mask": mask,
    "dim": -1,
    "mask_fill_value": -1e+32
}
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
my_hex Ran
ran on a synthesized input
microsoft/BlingFire/ldbsrc/bert_multi_cased/generate_letters_from_vocab.py
code served (permissive licence) · get_code("0297d56cefe7364c")
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

def my_hex(i):
    return '\\' + '{0:#0{1}x}'.format(i, 6)[1:]

ARGS = {
    'i': 255
}
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
norm_shape Ran
ran, honoured the contract we drafted
guillaume-chevalier/HAR-stacked-residual-bidir-LSTMs/sliding_window.py
code served (permissive licence) · get_code("2b8a63bd4c5ab5e4")
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 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
import numpy as np

# The function norm_shape takes a shape parameter which can be:
# 1. An int
# 2. A tuple of ints
# 3. Something that can be converted to a tuple

# Test with an integer
ARGS = {
    'shape': 5
}

# Alternative valid arguments (uncomment to test different cases):
# ARGS = {'shape': (3, 4, 5)}
# ARGS = {'shape': [2, 3, 4]}
# ARGS = {'shape': (1,)}
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 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
parse_range Ran
ran on a synthesized input
microsoft/BlingFire/ldbsrc/bert_base_tok/range_minus.py
code served (permissive licence) · get_code("6e673eab8521b6e5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# Analyzing the function parse_range:
# - It takes a single parameter `s` which is a string
# - The string should contain hex numbers in format like \xNN or ranges like \xNN-\xMM
# - The function parses these and returns a list with 1s at positions specified

ARGS = {
    "s": "\\x41\\x42-\\x44"  # Valid hex range: \x41 (A), \x42-\x44 (B-D)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_range Ran
ran on a synthesized input
microsoft/BlingFire/ldbsrc/bert_multi_cased/regexrangeparse.py
code served (permissive licence) · get_code("0ab68692161c1470")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

__max_unicode_char__ = 1114111

def parse_range(s):
    def num_len(s, i):
        j = i
        while j < len(s) and (ord(s[j]) >= ord('0') and ord(s[j]) <= ord('9') or (ord(s[j]) >= ord('a') and ord(s[j]) <= ord('f')) or (ord(s[j]) >= ord('A') and ord(s[j]) <= ord('F'))):
            j += 1
        return j - i
    res = [0] * (__max_unicode_char__ + 1)
    lens = len(s)
    start = -1
    num = -1
    minus = False
    i = 0
    while i < lens:
        if s[i] == '-':
            minus = True
            i += 1
        if i <= lens - 2 and s[i] == '\\' and (s[i + 1] == 'x'):
            numLen = num_len(s, i + 2) + 2
            numStr = s[i + 1:i + numLen]
            num = int('0' + numStr, 16)
            if num < 0 or num > __max_unicode_char__:
                raise ValueError('Cannot parse range, 1: %s' % s)
            if minus:
                if start != -1:
                    for j in range(start, num + 1):
                        res[j] = 1
                start = -1
                minus = False
            else:
                if start != -1:
                    res[start] = 1
                start = num
            i += numLen
        else:
            raise ValueError('Non hex number or range encountered, Cannot parse range, 2: %s' % s)
            i += 1
    if start != -1:
        res[start] = 1
    return res


# Test with a simple hex range string
# The function expects strings with hex escape sequences like \x41 (letter A)
test_string_1 = "\\x41"  # Single character 'A'
test_string_2 = "\\x41-\\x5a"  # Range from 'A' to 'Z'
test_string_3 = "\\x30\\x31\\x32"  # Multiple characters '0', '1', '2'

ARGS = {
    "s": "\\x41-\\x5a"  # Range from hex 41 to 5a (A to Z in ASCII)
}
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 list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
printable_text Ran
ran; our contract draft was wrong, not the code
microsoft/BlingFire/ldbsrc/bert_base_tok/tokenization.py
code served (permissive licence) · get_code("0e5615f8994003cf")
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 six

# The function takes a single parameter 'text' which can be:
# - str (works in both Python 2 and 3)
# - bytes (in Python 3, decoded to utf-8)
# - unicode (in Python 2, encoded to utf-8)

# Since we're running on Python 3, we'll test with a string
text_input = "Hello, World!"

ARGS = {
    "text": text_input
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
six — 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
relu_fc Ran
ran; our contract draft was wrong, not the code
Liut2016/stackedResBiLSTM/lstm_architecture.py
code served (permissive licence) · get_code("c8d5e6a10689e5b6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 3, 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 tensorflow as tf
import numpy as np

# Create a simple config class with the required attributes
class Config:
    def __init__(self):
        self.weights_stddev = 0.1
        self.bias_mean = 0.0

config = Config()

# Create input tensors
# batch_size=2, feature_num=4
input_tensor_1 = tf.constant([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]], dtype=tf.float32)
input_tensor_2 = tf.constant([[0.1, 0.2, 0.3, 0.4], [0.5, 0.6, 0.7, 0.8]], dtype=tf.float32)

input_2D_tensor_list = [input_tensor_1, input_tensor_2]

features_len = 4
new_features_len = 3

ARGS = {
    'input_2D_tensor_list': input_2D_tensor_list,
    'features_len': features_len,
    'new_features_len': new_features_len,
    'config': config
}
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 list, ndim 3, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
serialize_range Ran
ran on a synthesized input
microsoft/BlingFire/ldbsrc/bert_base_tok/range_minus.py
code served (permissive licence) · get_code("4ef5a73a2f158b4e")
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)

max_unicode_char = 1114111

# The function serialize_range takes a parameter 'r' that is indexed like r[i]
# where i ranges from 0 to max_unicode_char (1114111)
# r[i] should be comparable to 1 and 0 (checking equality)
# This suggests r is array-like with integer values

# Create a small test array that represents a unicode character range bitmap
# We need an array that can be indexed up to max_unicode_char
# For practical testing, we'll create a numpy array with some sample ranges marked

r = np.zeros(max_unicode_char + 1, dtype=np.int32)

# Mark some ranges as valid (value = 1)
# Range 1: characters 65-90 (A-Z)
r[65:91] = 1
# Range 2: characters 97-122 (a-z)
r[97:123] = 1
# Range 3: character 48 (just '0')
r[48] = 1

ARGS = {
    'r': r
}
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
serialize_range Ran
ran on a synthesized input
microsoft/BlingFire/ldbsrc/bert_multi_cased/regexrangeparse.py
code served (permissive licence) · get_code("1355f61e60faddd2")
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

__max_unicode_char__ = 1114111

def serialize_range(r):

    def num2hex(i):
        h = hex(i)[2:]
        c = 4 - len(h)
        while c > 0:
            h = '0' + h
            c -= 1
        return '\\x' + h
    res = ''
    start = -1
    for i in range(__max_unicode_char__ + 1):
        if r[i] == 1 and start == -1:
            start = i
        elif r[i] == 0 and start != -1:
            if i - 1 != start:
                res += num2hex(start) + '-' + num2hex(i - 1)
            else:
                res += num2hex(start)
            start = -1
    if start != -1:
        if __max_unicode_char__ != start:
            res += num2hex(start) + '-' + num2hex(__max_unicode_char__)
        else:
            res += num2hex(start)
    return res


# Create a valid argument for r parameter
# r needs to support indexing like r[i] for all i in range(__max_unicode_char__ + 1)
# and comparisons with 0 and 1
# Using a numpy array is efficient and supports these operations
r = np.zeros(__max_unicode_char__ + 1, dtype=np.int32)

# Mark some ranges as 1 to create interesting output
r[65:91] = 1  # A-Z
r[97:123] = 1  # a-z
r[48:58] = 1   # 0-9

ARGS = {
    'r': r
}
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
subsequent_mask Ran
ran, violated the contract we drafted
psunlpgroup/xsemplr/model/seq2seqPTR/src/ptrbert.py
code served (permissive licence) · get_code("2d9b2960c6f86b29")
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 3, dtype family float, shape (2, 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 numpy as np
import torch

torch.manual_seed(0)

ARGS = {
    "size": 4,
    "batch_size": 2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, 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, 4, 4) — shape (2, 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
subtract_range Ran
ran on a synthesized input
microsoft/BlingFire/ldbsrc/bert_base_tok/range_minus.py
code served (permissive licence) · get_code("4293ac7fb9af9f5a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

max_unicode_char = 1114111

# Create two lists representing ranges
# r and minus_r should be lists of length max_unicode_char + 1
# with binary values (0 or 1)

r = [0] * (max_unicode_char + 1)
minus_r = [0] * (max_unicode_char + 1)

# Set some sample values to test the function
# Set a few positions in r to 1
r[65] = 1  # 'A'
r[90] = 1  # 'Z'
r[97] = 1  # 'a'

# Set a few positions in minus_r to 1
minus_r[65] = 1  # Overlap with r
minus_r[100] = 1  # No overlap with r

ARGS = {
    "r": r,
    "minus_r": minus_r,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
subtract_range Ran
ran on a synthesized input
microsoft/BlingFire/ldbsrc/bert_multi_cased/regexrangeparse.py
code served (permissive licence) · get_code("c1e5731a39dcacd5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# The function subtract_range takes two parameters:
# - r: a list/array of length __max_unicode_char__ + 1 (1114112 elements)
# - minus_r: a list/array of length __max_unicode_char__ + 1 (1114112 elements)
# The function treats these as binary arrays (0 or 1 values)

__max_unicode_char__ = 1114111

# Create two binary arrays of the required length
# r[i] = 1 if character i should be in the range
# minus_r[i] = 1 if character i should be subtracted from the range

r = [0] * (__max_unicode_char__ + 1)
minus_r = [0] * (__max_unicode_char__ + 1)

# Set some sample values to make it non-trivial
# For positions where r[i] = 1 and minus_r[i] = 0, result should be 1
r[65] = 1  # 'A'
r[66] = 1  # 'B'
r[90] = 1  # 'Z'

minus_r[65] = 0  # Don't subtract 'A'
minus_r[66] = 1  # Subtract 'B'
minus_r[90] = 0  # Don't subtract 'Z'

ARGS = {
    "r": r,
    "minus_r": minus_r
}
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 list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
weighted_sum Ran
ran; our contract draft was wrong, not the code
psunlpgroup/xsemplr/model/seq2seqPTR/src/ptrbert.py
code served (permissive licence) · get_code("d3a5188111b2f502")
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 as nn

torch.manual_seed(0)

# Test case 1: attention.dim() == 2 and matrix.dim() == 3
matrix_1 = torch.randn(2, 3, 4)  # batch=2, seq_len=3, dim=4
attention_1 = torch.randn(2, 3)  # batch=2, seq_len=3

# Test case 2: attention.dim() == 3 and matrix.dim() == 3
matrix_2 = torch.randn(2, 3, 4)  # batch=2, seq_len=3, dim=4
attention_2 = torch.randn(2, 3, 3)  # batch=2, seq_len=3, seq_len=3

# Use case 1 for ARGS
ARGS = {
    "matrix": matrix_1,
    "attention": attention_1
}
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
Attention Not yet run
unverified (harvested, no recorded run)
ZHANG45/multi_gpu_seq2seq/seq2seq2.py
pointer only (licence: NONE) · get_code("e60bd6d0b1cb5dc5")
How it ran

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

Decoder Not yet run
unverified (harvested, no recorded run)
kh-kim/simple-nmt/simple_nmt/models/seq2seq.py
pointer only (licence: NONE) · get_code("5a04587ca39fc628")
How it ran

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

PtrBART Not yet run
unverified (harvested, no recorded run)
psunlpgroup/xsemplr/model/seq2seqPTR/src/ptrbert.py
code served (permissive licence) · get_code("b896419ba0888f61")
How it ran

no invocation recorded.

Seq2Seq Not yet run
unverified (harvested, no recorded run)
kh-kim/simple-nmt/simple_nmt/models/seq2seq.py
pointer only (licence: NONE) · get_code("14b02b13476db551")
How it ran

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

batch_norm Not yet run
unverified (harvested, no recorded run)
Liut2016/stackedResBiLSTM/lstm_architecture.py
code served (permissive licence) · get_code("a30358b17cf7f25f")
How it ran

no invocation recorded.

beam_decode_spider Not yet run
unverified (harvested, no recorded run)
psunlpgroup/xsemplr/model/seq2seqPTR/src/ptrbert.py
code served (permissive licence) · get_code("9adcd571f14c4937")
How it ran

no invocation recorded.

bi_LSTM_cell Not yet run
unverified (harvested, no recorded run)
Liut2016/stackedResBiLSTM/lstm_architecture.py
code served (permissive licence) · get_code("3847ef05ef574aca")
How it ran

no invocation recorded.

load_vocab Not yet run
unverified (harvested, no recorded run)
microsoft/BlingFire/ldbsrc/bert_base_tok/tokenization.py
code served (permissive licence) · get_code("ff83ccc8b0b6462d")
How it ran

no invocation recorded.

residual_bidirectional_LSTM_layers Not yet run
unverified (harvested, no recorded run)
Liut2016/stackedResBiLSTM/lstm_architecture.py
code served (permissive licence) · get_code("c39c0d4e280c8846")
How it ran

no invocation recorded.

single_LSTM_cell Not yet run
unverified (harvested, no recorded run)
Liut2016/stackedResBiLSTM/lstm_architecture.py
code served (permissive licence) · get_code("317abb01a23f7133")
How it ran

no invocation recorded.

sliding_window Not yet run
unverified (harvested, no recorded run)
guillaume-chevalier/HAR-stacked-residual-bidir-LSTMs/sliding_window.py
code served (permissive licence) · get_code("ffb489e2974384e9")
How it ran

no invocation recorded.

token2regexp Not yet run
unverified (harvested, no recorded run)
microsoft/BlingFire/ldbsrc/bert_base_cased_tok/vocab_to_fa_lex.py
code served (permissive licence) · get_code("ff133510dfb28e8a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 46 samples lifted from this paper's linked repositories, 46 carry a function identity and 0 do not. Of the 46 distinct functions with an identity, 7 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 7 later) and 39 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
convert_to_unicode 36 other papers
36 later
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1901.04085 (2019-01)
Passage Re-ranking with BERT
1901.08746 (2019-01)
BioBERT: a pre-trained biomedical language representation model for biomedical text mining
and 33 more not named here
printable_text 33 other papers
33 later
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1901.04085 (2019-01)
Passage Re-ranking with BERT
1901.08746 (2019-01)
BioBERT: a pre-trained biomedical language representation model for biomedical text mining
and 30 more not named here
attention
brick of this paper's assembly: helper
27 other papers
1 dated earlier, 26 later
1411.4555 (2014-11)
Show and Tell: A Neural Image Caption Generator
1612.00563 (2016-12)
Self-critical Sequence Training for Image Captioning
1706.03762 (2017-06)
Attention Is All You Need
and 24 more not named here
load_vocab 16 other papers
16 later
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1901.08746 (2019-01)
BioBERT: a pre-trained biomedical language representation model for biomedical text mining
1902.01030 (2019-02)
Extracting Multiple-Relations in One-Pass with Pre-Trained Transformers
and 13 more not named here
weighted_sum
brick of this paper's assembly: helper
5 other papers
5 later
1804.07461 (2018-04)
GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understanding
1901.10125 (2019-01)
Glyce: Glyph-vectors for Chinese Character Representations
2010.04762 (2020-10)
Counterfactually-Augmented SNLI Training Data Does Not Yield Better Generalization Than Unaugmented Data
and 2 more not named here
batched_index_select
brick of this paper's assembly: helper
3 other papers
3 later
1804.07461 (2018-04)
GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understanding
2010.04762 (2020-10)
Counterfactually-Augmented SNLI Training Data Does Not Yield Better Generalization Than Unaugmented Data
2112.01753 (2021-12)
Probing Linguistic Information For Logical Inference In Pre-trained Language Models
norm_shape 1 other paper
1 later
2203.14952 (2022-03)
Energy-based Latent Aligner for Incremental 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

Neural Machine Translation (NMT) is an end-to-end learning approach for automated translation, with the potential to overcome many of the weaknesses of conventional phrase-based translation systems. Unfortunately, NMT systems are known to be computationally expensive both in training and in translation inference -sometimes prohibitively so in the case of very large data sets and large models. Several authors have also charged that NMT systems lack robustness, particularly when input sentences contain rare words. These issues have hindered NMT's use in practical deployments and services, where both accuracy and speed are essential. In this work, we present GNMT, Google's Neural Machine Translation system, which attempts to address many of these issues. Our model consists of a deep LSTM network with 8 encoder and 8 decoder layers using residual connections as well as attention connections from the decoder network to the encoder. To improve parallelism and therefore decrease training time, our attention mechanism connects the bottom layer of the decoder to the top layer of the encoder. To accelerate the final translation speed, we employ low-precision arithmetic during inference computations. To improve handling of rare words, we divide words into a limited set of common sub-word units ("wordpieces") for both input and output. This method provides a good balance between the flexibility of "character"-delimited models and the efficiency of "word"-delimited models, naturally handles translation of rare words, and ultimately improves the overall accuracy of the system. Our beam search technique employs a length-normalization procedure and uses a coverage penalty, which encourages generation of an output sentence that is most likely to cover all the words in the source sentence. To directly optimize the translation BLEU scores, we consider refining the models by using reinforcement learning, but we found that the improvement in the BLEU scores did not reflect in the human evaluation. On the WMT'14 English-to-French and English-to-German benchmarks, GNMT achieves competitive results to state-of-the-art. Using a human side-by-side evaluation on a set of isolated simple sentences, it reduces translation errors by an average of 60% compared to Google's phrase-based production system.

For agents

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

get_harvested_code_for_paper("1609.08144")
get_code_for_paper("1609.08144")
have("1609.08144")

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

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

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

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

Connect an agent — have() is free.