SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2007.06943 · IJCAI · 2020

Modeling Voting for System Combination in Machine Translation

Yang Liu, Huanbo Luan, Maosong Sun, Derek Wong, Zhixing Tan, Jiacheng Zhang, Jingfang Xu, Xuancheng Huang

arXiv · PDF · Open in the Atlas

Code that ran

9 of 19 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 0 have no contract verdict; 9 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/2007.06943.json · badge: /api/ran/2007.06943.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
THUNLP-MT/THUMT community
Papers with Code archive
9 ran · 10 no recorded run
FunctionStatusWhere it lives
_gather_2d Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("f031547076b6075c")
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, 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

torch.manual_seed(0)

# params: a 2D tensor of shape [batch_size, feature_dim]
# The function indexes into this with batch_pos and indices
params = torch.randn(2, 4)

# indices: a 2D tensor of shape [batch_size, range_size]
# Contains indices into the feature dimension of params
indices = torch.tensor([[0, 1, 2], [1, 2, 3]], dtype=torch.long)

# name: optional string parameter
name = None

ARGS = {
    "params": params,
    "indices": indices,
    "name": name,
}
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, 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: none by the harness; any seed is in the setup block
_get_inference_fn Ran
ran; our contract draft was wrong, not the code
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("463b3c15e786dbfe")
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 function. 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)

# Define a simple model function that takes features and optional state
class SimpleModel(nn.Module):
    def __init__(self, vocab_size=10):
        super().__init__()
        self.linear = nn.Linear(4, vocab_size)
    
    def forward(self, features, state=None):
        # features['target'] has shape (batch, seq_len)
        # We need to produce logits of shape (batch, seq_len, vocab_size)
        target = features['target']
        batch_size, seq_len = target.shape
        logits = self.linear(torch.randn(batch_size, seq_len, 4))
        
        if state is not None:
            # Return logits and new state
            new_state = {'step': state.get('step', 0) + 1}
            return logits, new_state
        else:
            # Return just logits
            return logits

# Create model functions that can be called with features and optional state
def model_fn_1(features, state=None):
    model = SimpleModel(vocab_size=10)
    if state is not None:
        logits = model(features, state)
        new_state = {'step': state.get('step', 0) + 1}
        return logits, new_state
    else:
        return model(features)

def model_fn_2(features, state=None):
    model = SimpleModel(vocab_size=10)
    if state is not None:
        logits = model(features, state)
        new_state = {'step': state.get('step', 0) + 1}
        return logits, new_state
    else:
        return model(features)

# Create features dict with required keys
features = {
    'source': torch.randn(2, 5),  # batch_size=2, source_seq_len=5
    'source_mask': torch.ones(2, 5)
}

# Create model_fns list
model_fns = [model_fn_1, model_fn_2]

ARGS = {
    'model_fns': model_fns,
    'features': features
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
_merge_first_two_dims Ran
ran; our contract draft was wrong, not the code
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("3b4b7a09ba0ee2e6")
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 (8, 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

torch.manual_seed(0)

# The function takes a tensor and merges its first two dimensions
# It accesses tensor.shape, uses list(), indexing, and torch.reshape()
# We need a tensor with at least 2 dimensions

# Create a small tensor with distinct dimensions: batch=2, feature=4, extra=3
tensor = torch.randn(2, 4, 3)

ARGS = {
    "tensor": tensor
}
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 (8, 3) — shape (8, 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: none by the harness; any seed is in the setup block
_sequence_like Ran
ran; our contract draft was wrong, not the code
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("561d5f639961744a")
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 dict. 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 collections
import six
from collections import namedtuple

# Test case 1: dict instance
instance_dict = {'a': 1, 'b': 2, 'c': 3}
args_dict = [10, 20, 30]

# Test case 2: namedtuple instance
TestTuple = namedtuple('TestTuple', ['x', 'y', 'z'])
instance_namedtuple = TestTuple(1, 2, 3)
args_namedtuple = [10, 20, 30]

# Test case 3: regular list instance
instance_list = [1, 2, 3]
args_list = [10, 20, 30]

# Use the dict case as primary test
ARGS = {
    'instance': {'a': 1, 'b': 2, 'c': 3},
    'args': [10, 20, 30]
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
_sorted Ran
ran; our contract draft was wrong, not the code
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("5074d78b4ac1ef24")
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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import six

# The function _sorted takes a dict_ parameter and attempts to sort its keys
# It uses six.iterkeys() to get the keys and sorted() to sort them
# The keys must be sortable (not raise TypeError)

# Create a simple dict with sortable keys (strings)
test_dict = {
    'zebra': 1,
    'apple': 2,
    'monkey': 3,
    'banana': 4
}

ARGS = {
    'dict_': test_dict
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
six — 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 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
_split_first_two_dims Ran
ran; our contract draft was wrong, not the code
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("9f94edc124e9bd63")
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, 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)

# The function takes a tensor and two dimension sizes (dim_0, dim_1)
# It reshapes the tensor so that the first dimension becomes dim_0,
# the second becomes dim_1, and remaining dimensions stay the same.

# Create a small tensor with shape (6, 5) - first dim will be split
tensor = torch.randn(6, 5)

# Define the two dimensions to split the first dimension into
dim_0 = 2
dim_1 = 3

ARGS = {
    "tensor": tensor,
    "dim_0": dim_0,
    "dim_1": dim_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 3, dtype family float, shape (2, 3, 5) — shape (2, 3, 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
_tile_to_beam_size Ran
ran; our contract draft was wrong, not the code
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("cb65bec95376bc21")
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)

# Create a small tensor with batch size 2 and feature dimension 4
tensor = torch.randn(2, 4)

# Define beam size
beam_size = 3

ARGS = {
    "tensor": tensor,
    "beam_size": beam_size,
}
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
_yield_flat_nest Ran
ran; our contract draft was wrong, not the code
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("985919b4b2337dc2")
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 generator. 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 collections
import six

torch_available = False
try:
    import torch
    torch_available = True
    torch.manual_seed(0)
except ImportError:
    pass

def _sorted(dict_):
    try:
        return sorted(six.iterkeys(dict_))
    except TypeError:
        raise TypeError('nest only supports dicts with sortable keys.')

def _yield_value(iterable):
    if isinstance(iterable, dict):
        for key in _sorted(iterable):
            yield iterable[key]
    else:
        for value in iterable:
            yield value

def is_sequence(seq):
    if isinstance(seq, dict):
        return True
    if isinstance(seq, set):
        print('Sets are not currently considered sequences, but this may change in the future, so consider avoiding using them.')
    return isinstance(seq, collections.Sequence) and (not isinstance(seq, six.string_types))

def _yield_flat_nest(nest):
    for n in _yield_value(nest):
        if is_sequence(n):
            for ni in _yield_flat_nest(n):
                yield ni
        else:
            yield n

# Test with various nested structures
nested_dict = {
    'a': 1,
    'b': [2, 3],
    'c': {'d': 4, 'e': [5, 6]}
}

nested_list = [1, [2, 3], {'x': 4, 'y': [5, 6]}]

nested_mixed = {
    'layer1': [10, 20],
    'layer2': {
        'sublayer': [30, 40],
        'value': 50
    }
}

ARGS = {
    'nest': nested_dict
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
six, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type generator — a generator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a generator 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
_yield_value Ran
ran; our contract draft was wrong, not the code
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("b8e5c1ce284001c0")
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 generator. 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 six

torch.manual_seed(0)

# Test case 1: dict with string keys
test_dict = {
    'a': torch.randn(2, 4),
    'b': torch.randn(3, 4),
    'c': torch.randn(2, 5)
}

# Test case 2: list/iterable
test_list = [torch.randn(2, 4), torch.randn(3, 4), torch.randn(2, 5)]

# The function _yield_value takes one parameter: iterable
# It can be either a dict or any other iterable
# We'll test with a dict since that's the more complex case

ARGS = {
    'iterable': test_dict
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
six, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type generator — a generator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a generator 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
BeamSearchState Not yet run
unverified (harvested, no recorded run)
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("038543c35e853013")
How it ran

no invocation recorded.

_beam_search_step Not yet run
unverified (harvested, no recorded run)
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("6554c0535ec778f7")
How it ran

no invocation recorded.

_packed_nest_with_indices Not yet run
unverified (harvested, no recorded run)
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("89854118fa650f7c")
How it ran

no invocation recorded.

_recursive_assert_same_structure Not yet run
unverified (harvested, no recorded run)
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("a743ab7b23275a39")
How it ran

no invocation recorded.

assert_same_structure Not yet run
unverified (harvested, no recorded run)
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("3eb93923026ab511")
How it ran

no invocation recorded.

beam_search Not yet run
unverified (harvested, no recorded run)
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("5ca040d32880306a")
How it ran

no invocation recorded.

flatten Not yet run
unverified (harvested, no recorded run)
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("8144ac299d399dfe")
How it ran

no invocation recorded.

is_sequence Not yet run
unverified (harvested, no recorded run)
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("e98986abba883c3b")
How it ran

no invocation recorded.

map_structure Not yet run
unverified (harvested, no recorded run)
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("de427ed06cf972f2")
How it ran

no invocation recorded.

pack_sequence_as Not yet run
unverified (harvested, no recorded run)
THUNLP-MT/THUMT/thumt/utils/inference.py
code served (permissive licence) · get_code("596ed65af5de1fac")
How it ran

no invocation recorded.

Also present in other papers' code

Of 19 samples lifted from this paper's linked repositories, 19 carry a function identity and 0 do not. Of the 19 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 19 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.

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

System combination is an important technique for combining the hypotheses of different machine translation systems to improve translation performance. Although early statistical approaches to system combination have been proven effective in analyzing the consensus between hypotheses, they suffer from the error propagation problem due to the use of pipelines. While this problem has been alleviated by end-to-end training of multi-source sequence-to-sequence models recently, these neural models do not explicitly analyze the relations between hypotheses and fail to capture their agreement because the attention to a word in a hypothesis is calculated independently, ignoring the fact that the word might occur in multiple hypotheses. In this work, we propose an approach to modeling voting for system combination in machine translation. The basic idea is to enable words in hypotheses from different systems to vote on words that are representative and should get involved in the generation process. This can be done by quantifying the influence of each voter and its preference for each candidate. Our approach combines the advantages of statistical and neural methods since it can not only analyze the relations between hypotheses but also allow for end-to-end training. Experiments show that our approach is capable of better taking advantage of the consensus between hypotheses and achieves significant improvements over state-of-the-art baselines on Chinese-English and English-German machine translation tasks. 1

For agents

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

get_harvested_code_for_paper("2007.06943")
get_code_for_paper("2007.06943")
have("2007.06943")

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

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

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

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

Connect an agent — have() is free.