SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2209.03316 · 2022

On the Complementarity between Pre-Training and Random-Initialization for Resource-Rich Machine Translation

arXiv · PDF · Open in the Atlas

Code that ran

12 of 13 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, 1 violated it and 11 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-21; 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/2209.03316.json · badge: /api/ran/2209.03316.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
zanchangtong/ptvsri canonical (classifier label)
classifier basis not recorded on the link
12 ran · 1 no recorded run
FunctionStatusWhere it lives
Bucket_Sort Ran
ran on a synthesized input
zanchangtong/ptvsri/analysis/lpd.py
code served (permissive licence) · get_code("3432e05d0edb284c")
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. 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)

# Analyze the function:
# - array: needs to support min(), max(), iteration, and indexing with integers
# - bucketsize: an integer divisor
# The function uses: min(array), max(array), iteration, integer division, indexing

# Create a simple numeric array
array = [5, 2, 8, 1, 9, 3, 7]
bucketsize = 3

ARGS = {
    "array": array,
    "bucketsize": bucketsize
}
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 — a list 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
compute_entropy Ran
ran on a synthesized input
zanchangtong/ptvsri/analysis/lpd.py
code served (permissive licence) · get_code("6e072a02b03fd090")
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 float64, 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 numpy as np
from scipy.stats import entropy

torch_seed = 0

# Build a small probability distribution
# entropy expects a 1D array of probabilities (should sum to 1)
probs = np.array([0.5, 0.3, 0.15, 0.05])

ARGS = {
    "probs": probs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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_activation_hook Ran
ran on a synthesized input
zanchangtong/ptvsri/exps/activation_utils.py
code served (permissive licence) · get_code("06100713e91fedb0")
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)

# Create a simple model to attach the hook to
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create the activation hook function
def get_activation_hook(activation, name):
    def hook(model, inputs, output):
        if (type(inputs) == tuple or type(inputs) == list) and len(inputs) > 0:
            inputs = inputs[0].detach()
        if type(output) == torch.Tensor:
            output = output.detach()
        activation[name] = {}
        activation[name]['input'] = inputs
        activation[name]['output'] = output
    return hook

# Set up arguments
activation = {}
name = "layer_output"

ARGS = {
    "activation": activation,
    "name": name
}
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
get_backward_hook Ran
ran on a synthesized input
zanchangtong/ptvsri/exps/activation_utils.py
code served (permissive licence) · get_code("8317d614381abb14")
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)

# The function takes two parameters:
# 1. gradients: a dict to store gradient information
# 2. name: a string identifier for the hook

# Create a simple gradients dictionary to collect gradients
gradients = {}

# Create a string name for the hook
name = "test_layer"

# Now we can define ARGS
ARGS = {
    "gradients": gradients,
    "name": name
}
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
ignore_bn Ran
ran on a synthesized input
zanchangtong/ptvsri/analysis/lls.py
code served (permissive licence) · get_code("95b7af714acdb480")
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 torch

torch.manual_seed(0)

# The function `ignore_bn` takes a dict `ws` mapping keys to tensors.
# It iterates through the dict and:
# - If a tensor has size() with length < 2 (i.e., it's 1D or 0D), replace with zeros
# - Otherwise, keep the tensor as-is
# We need to construct a dict with tensors of varying dimensions

ws = {
    'bias_layer1': torch.randn(4),  # 1D tensor (len(size()) == 1)
    'weight_layer1': torch.randn(4, 3),  # 2D tensor (len(size()) == 2)
    'scale': torch.randn(5),  # 1D tensor
    'weight_layer2': torch.randn(3, 2, 2),  # 3D tensor (len(size()) == 3)
    'bn_weight': torch.randn(6),  # 1D tensor
}

ARGS = {
    'ws': ws
}
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 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
isnan Ran
ran, violated the contract we drafted
zanchangtong/ptvsri/exps/ground_metric.py
pointer only (licence: MIT); the stored copy get_code serves, from sidak/otfusion, is pointer only (licence: NONE) · get_code("5f4f4355be28c01e")
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 sidak/otfusion, 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.

normalize_filter Ran
ran on a synthesized input
zanchangtong/ptvsri/analysis/lls.py
code served (permissive licence) · get_code("8c8e99db77825af5")
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 torch

torch.manual_seed(0)

# Create two dictionaries with tensor values
# The function expects bs and ws to be dicts with tensors as values
# It computes norms along dim=0, so we need tensors with at least 1 dimension

bs = {
    'layer1': torch.randn(2, 4),  # shape (2, 4)
    'layer2': torch.randn(3, 4),  # shape (3, 4) - different first dim
}

ws = {
    'layer1': torch.randn(2, 4),  # shape (2, 4)
    'layer2': torch.randn(3, 4),  # shape (3, 4)
}

ARGS = {
    'bs': bs,
    'ws': ws,
}
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 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
rstrip Ran
ran on a synthesized input
zanchangtong/ptvsri/exps/activation_utils.py
code served (permissive licence) · get_code("da3b5afa5a405deb")
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)

# Analyze the function:
# rstrip(s, tail) takes two parameters:
# - s: a string that will be checked with .endswith() and sliced
# - tail: a string to check if s ends with it

# Create test cases
s = "hello world"
tail = "world"

ARGS = {
    "s": s,
    "tail": tail
}
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
state_2_fairseq_model Ran
ran on a synthesized input
zanchangtong/ptvsri/exps/convert_model.py
code served (permissive licence) · get_code("f50989b03391e732")
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 torch
import os
import tempfile
from pathlib import Path

torch.manual_seed(0)

# Create a temporary directory for checkpoints
temp_dir = tempfile.mkdtemp()

# Create minimal fairseq checkpoint structure
base_model_state = {
    'model': {
        'encoder.embed_tokens.weight': torch.randn(10, 4),
        'encoder.embed_positions.weight': torch.randn(5, 4),
        'encoder.layer1.weight': torch.randn(4, 4),
        'encoder.layer1.bias': torch.randn(4),
        'decoder.embed_tokens.weight': torch.randn(10, 4),
        'decoder.embed_positions.weight': torch.randn(5, 4),
        'decoder.output_projection.weight': torch.randn(10, 4),
        'decoder.layer1.weight': torch.randn(4, 4),
        'decoder.layer1.bias': torch.randn(4),
    }
}

# Create fused state dictionary with matching keys
fused_state = {
    'encoder.embed_tokens.weight': torch.randn(10, 4),
    'encoder.embed_positions.weight': torch.randn(5, 4),
    'encoder.layer1.weight': torch.randn(4, 4),
    'encoder.layer1.bias': torch.randn(4),
    'decoder.embed_tokens.weight': torch.randn(10, 4),
    'decoder.embed_positions.weight': torch.randn(5, 4),
    'decoder.output_projection.weight': torch.randn(10, 4),
    'decoder.layer1.weight': torch.randn(4, 4),
    'decoder.layer1.bias': torch.randn(4),
}

# Save checkpoint files
base_model_path = os.path.join(temp_dir, 'base_fairseq_model.pt')
fused_state_path = os.path.join(temp_dir, 'fused_state.pt')

torch.save(base_model_state, base_model_path)
torch.save(fused_state, fused_state_path)

# Create args object
class Args:
    def __init__(self, checkpoints_dir):
        self.checkpoints_dir = checkpoints_dir

args = Args(checkpoints_dir=temp_dir)

ARGS = {
    'args': args,
    'state_file': 'fused_state.pt',
    'base_fairseq_model': 'base_fairseq_model.pt',
    'ignore_embedding': False,
}
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 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
word_blank Ran
ran on a synthesized input
zanchangtong/ptvsri/analysis/DuA/robust_add_noisy.py
code served (permissive licence) · get_code("6ec22691050b4140")
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 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)

# The function takes:
# - s: a string (iterable of characters)
# - wb: a float (probability threshold for blanking)

s = "hello"
wb = 0.5

ARGS = {
    "s": s,
    "wb": wb,
}
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 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
word_dropout Ran
ran on a synthesized input
zanchangtong/ptvsri/analysis/DuA/robust_add_noisy.py
code served (permissive licence) · get_code("f00dcacce93a5ba4")
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 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 random
import torch

torch.manual_seed(0)

# s: a sequence (list) that we iterate over with len() and enumerate()
# wd: a dropout probability (float between 0 and 1)

s = ["word1", "word2", "word3", "word4"]
wd = 0.3

ARGS = {
    "s": s,
    "wd": wd,
}
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 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
word_shuffle Ran
ran on a synthesized input
zanchangtong/ptvsri/analysis/DuA/robust_add_noisy.py
code served (permissive licence) · get_code("9e5e05535c1d55a3")
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 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)

# Analyze the function:
# - s: needs to support len(s) and indexing with integers (list-like)
# - sk: needs to be a scalar that can be used with torch.rand().mul_()

# s should be a list of items (strings, tokens, etc.)
s = ['hello', 'world', 'foo', 'bar']

# sk is a scalar noise parameter
sk = 0.5

ARGS = {
    's': s,
    'sk': sk
}
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 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
get_histogram Not yet run
unverified (harvested, no recorded run)
zanchangtong/ptvsri/exps/utils.py
code served (permissive licence) · get_code("f6f3a6dc7ddac11e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 12 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
isnan 16 other papers
5 dated earlier, 11 later · 2 only as an assembly brick
1505.04597 (2015-05)
U-Net: Convolutional Networks for Biomedical Image Segmentation
1910.05653 (2019-10)
Model Fusion via Optimal Transport
2008.07043 (2020-08)
Oriented Object Detection in Aerial Images with Box Boundary-Aware Vectors
and 13 more not named here

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-21.

Repositories linked to this paper

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

Abstract

Pre-Training (PT) of text representations has been successfully applied to low-resource Neural Machine Translation (NMT). However, it usually fails to achieve notable gains (sometimes, even worse) on resource-rich NMT on par with its Random-Initialization (RI) counterpart. We take the first step to investigate the complementarity between PT and RI in resource-rich scenarios via two probing analyses, and find that: 1) PT improves NOT the accuracy, but the generalization by achieving flatter loss landscapes than that of RI; 2) PT improves NOT the confidence of lexical choice, but the negative diversity by assigning smoother lexical probability distributions than that of RI. Based on these insights, we propose to combine their complementarities with a model fusion algorithm that utilizes optimal transport to align neurons between PT and RI. Experiments on two resource-rich translation benchmarks, WMT'17 English-Chinese (20M) and WMT'19 English-German (36M), show that PT and RI could be nicely complementary to each other, achieving substantial improvements considering both translation accuracy, generalization, and negative diversity. Probing tools and code are released at: https://github.com/zanchangtong/PTvsRI.

For agents

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

get_harvested_code_for_paper("2209.03316")
get_code_for_paper("2209.03316")
have("2209.03316")

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

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

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

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

Connect an agent — have() is free.