SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1606.02960 · 2016

Sequence-to-Sequence Learning as Beam-Search Optimization

arXiv · PDF · Open in the Atlas

Code that ran

8 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 2 failures of our instrument; 0 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1606.02960.json · badge: /api/ran/1606.02960.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
AndreiMoraru123/ContextCollector community (classifier label)
classifier basis not recorded on the link
6 ran · 0 no recorded run
sgrvinod/a-PyTorch-Tutorial-to-Image-Captioning community (classifier label)
classifier basis not recorded on the link
2 ran · 0 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran; our contract draft was wrong, not the code
sgrvinod/a-PyTorch-Tutorial-to-Image-Captioning/utils.py
code served (permissive licence) · get_code("53daad1d7b99fbdf")
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 float, 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

torch.manual_seed(0)

# Construct small tensors for the function
batch_size = 2
num_classes = 4
k = 2

# scores: model predictions with shape (batch_size, num_classes)
scores = torch.randn(batch_size, num_classes)

# targets: true labels with shape (batch_size,)
targets = torch.randint(0, num_classes, (batch_size,))

ARGS = {
    "scores": scores,
    "targets": targets,
    "k": k,
}
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 float, 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
boxes_iou Ran
ran on a synthesized input
AndreiMoraru123/ContextCollector/YOLO/utils.py
code served (permissive licence) · get_code("0b8377535f19b59a")
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 float, 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
import numpy as np

torch.manual_seed(0)

# Analyzing the function: boxes_iou takes two boxes
# Each box is indexed with [0], [1], [2], [3]
# So box1 and box2 should be array-like with at least 4 elements
# box[0] = x coordinate (center)
# box[1] = y coordinate (center)
# box[2] = width
# box[3] = height

# Create two simple boxes as lists or numpy arrays
box1 = [2.0, 3.0, 4.0, 6.0]  # x, y, width, height
box2 = [3.0, 4.0, 5.0, 7.0]  # x, y, width, height

ARGS = {
    "box1": box1,
    "box2": box2,
}
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 float, 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
detect_objects Ran
ran on a synthesized input
AndreiMoraru123/ContextCollector/YOLO/utils.py
code served (permissive licence) · get_code("5758971f4ecbc2dd")
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 2, 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 numpy as np

torch.manual_seed(0)

class SimpleDetectionModel(nn.Module):
    def __init__(self):
        super(SimpleDetectionModel, self).__init__()
        self.conv1 = nn.Conv2d(3, 16, 3)
        
    def forward(self, img, nms_thresh):
        # img shape: (batch, 3, height, width)
        # Return three lists of boxes, each containing a list of box tensors
        # Each box is [x, y, width, height, confidence]
        batch_size = img.shape[0]
        
        # Create dummy boxes for three detection heads
        boxes_head1 = [torch.tensor([10.0, 10.0, 5.0, 5.0, 0.9]), 
                       torch.tensor([20.0, 20.0, 4.0, 4.0, 0.7])]
        boxes_head2 = [torch.tensor([15.0, 15.0, 6.0, 6.0, 0.8])]
        boxes_head3 = [torch.tensor([25.0, 25.0, 3.0, 3.0, 0.6])]
        
        return [[boxes_head1], [boxes_head2], [boxes_head3]]

model = SimpleDetectionModel()

# Create a small dummy image (height=32, width=32, channels=3)
img = np.random.randint(0, 256, (32, 32, 3), dtype=np.uint8)

iou_thresh = 0.5
nms_thresh = 0.4

ARGS = {
    'model': model,
    'img': img,
    'iou_thresh': iou_thresh,
    'nms_thresh': nms_thresh
}
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 2, 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
load_embeddings Ran
ran; our contract draft was wrong, not the code
sgrvinod/a-PyTorch-Tutorial-to-Image-Captioning/utils.py
code served (permissive licence) · get_code("4cc9097b30b644e0")
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. 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
import tempfile
import os

torch.manual_seed(0)

# Create a temporary embedding file in GloVe format
temp_dir = tempfile.mkdtemp()
emb_file = os.path.join(temp_dir, "embeddings.txt")

# Create a small GloVe-format embedding file
# Format: word dim1 dim2 dim3 dim4
with open(emb_file, 'w') as f:
    f.write("apple 0.1 0.2 0.3 0.4\n")
    f.write("banana 0.5 0.6 0.7 0.8\n")
    f.write("cherry 0.9 1.0 1.1 1.2\n")
    f.write("date 1.3 1.4 1.5 1.6\n")

# Create a word_map that maps words to indices
word_map = {
    "apple": 0,
    "banana": 1,
    "cherry": 2,
    "date": 3,
    "elderberry": 4,
}

ARGS = {
    "emb_file": emb_file,
    "word_map": word_map,
}
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 — 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
nms Ran
ran on a synthesized input
AndreiMoraru123/ContextCollector/YOLO/utils.py
code served (permissive licence) · get_code("87488d598797633f")
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 2, 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

torch.manual_seed(0)

# boxes is a list of box tensors, where each box has format [x, y, width, height, confidence]
# The function accesses box[i] for indexing and modifies box[4]
boxes = [
    torch.tensor([10.0, 15.0, 4.0, 6.0, 0.9]),
    torch.tensor([12.0, 16.0, 5.0, 7.0, 0.7]),
]

iou_thresh = 0.5

ARGS = {
    "boxes": boxes,
    "iou_thresh": iou_thresh,
}
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 list, ndim 2, 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
prune_model_l1_structured Ran
ran on a synthesized input
AndreiMoraru123/ContextCollector/pipeline.py
code served (permissive licence) · get_code("8d85fd25730c83cd")
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 Sequential. 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 torch.nn.utils.prune as prune

torch.manual_seed(0)

# Build a small model with Conv2d and Linear layers
model = nn.Sequential(
    nn.Conv2d(3, 4, kernel_size=3, padding=1),
    nn.ReLU(),
    nn.Linear(4, 2)
)

# The function iterates through model.modules() and checks isinstance(module, layer_type)
# It then calls prune.ln_structured on modules matching layer_type
# So layer_type should be a layer class like nn.Conv2d or nn.Linear
layer_type = nn.Conv2d

# proportion is used as the second_order_importance parameter for ln_structured
# It should be a float between 0 and 1 representing the proportion to prune
proportion = 0.5

ARGS = {
    'model': model,
    'layer_type': layer_type,
    'proportion': proportion
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
prune_model_l1_unstructured Ran
ran on a synthesized input
AndreiMoraru123/ContextCollector/pipeline.py
code served (permissive licence) · get_code("05d051969149aebe")
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 Sequential. 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 torch.nn.utils.prune as prune

torch.manual_seed(0)

# Build a simple model with Linear layers
model = nn.Sequential(
    nn.Linear(4, 8),
    nn.ReLU(),
    nn.Linear(8, 3)
)

# The function iterates through model.modules() and checks isinstance(module, layer_type)
# Then calls prune.l1_unstructured(module, 'weight', proportion)
# So layer_type should be a type that matches some modules in the model

layer_type = nn.Linear
proportion = 0.3

ARGS = {
    "model": model,
    "layer_type": layer_type,
    "proportion": proportion
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
prune_model_l2_structured Ran
ran on a synthesized input
AndreiMoraru123/ContextCollector/pipeline.py
code served (permissive licence) · get_code("49254e079390a7e2")
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 Sequential. 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 torch.nn.utils.prune as prune

torch.manual_seed(0)

# Build a minimal model with different layer types
model = nn.Sequential(
    nn.Linear(4, 3),
    nn.ReLU(),
    nn.Linear(3, 2),
    nn.Conv2d(1, 2, kernel_size=3)
)

# The function iterates through model.modules() and checks isinstance(module, layer_type)
# It calls prune.ln_structured on modules matching layer_type
# layer_type should be a layer class that can be pruned
layer_type = nn.Linear

# proportion is passed to prune.ln_structured as the pruning amount
# Valid range is typically 0.0 to 1.0
proportion = 0.3

ARGS = {
    'model': model,
    'layer_type': layer_type,
    'proportion': proportion
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 later) and 6 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
accuracy 8 other papers
1 dated earlier, 7 later
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
2305.11692 (2023-05)
Surgical-VQLA: Transformer with Gated Vision-Language Embedding for Visual Question Localized-Answering in Robotic Surgery
2307.05182 (2023-07)
CAT-ViL: Co-Attention Gated Vision-Language Embedding for Visual Question Localized-Answering in Robotic Surgery
and 5 more not named here
load_embeddings 2 other papers
1 dated earlier, 1 later
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
2311.10774 (2023-11)
MMC: Advancing Multimodal Chart Understanding with Large-scale Instruction Tuning

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

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

Abstract

Sequence-to-Sequence (seq2seq) modeling has rapidly become an important general-purpose NLP tool that has proven effective for many text-generation and sequence-labeling tasks. Seq2seq builds on deep neural language modeling and inherits its remarkable accuracy in estimating local, next-word distributions. In this work, we introduce a model and beam-search training scheme, based on the work of Daume III and Marcu (2005), that extends seq2seq to learn global sequence scores. This structured approach avoids classical biases associated with local training and unifies the training loss with the test-time usage, while preserving the proven model architecture of seq2seq and its efficient training approach. We show that our system outperforms a highly-optimized attention-based seq2seq system and other baselines on three different sequence to sequence tasks: word ordering, parsing, and machine translation.

For agents

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

get_harvested_code_for_paper("1606.02960")
get_code_for_paper("1606.02960")
have("1606.02960")

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

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

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

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

Connect an agent — have() is free.