SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.06381 · ACL · 2021

Improving Pretrained Cross-Lingual Language Models via Self-Labeled Word Alignment

Furu Wei, Li Dong, Bo Zheng, Zewen Chi, Shaohan Huang, Xian-Ling Mao, Heyan Huang

arXiv · PDF · Open in the Atlas

Code that ran

3 of 3 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 2 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2106.06381.json · badge: /api/ran/2106.06381.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
CZWin32768/XLM-Align marked official in Papers with Code
Papers with Code archive
3 ran · 0 no recorded run
FunctionStatusWhere it lives
_sinkhorn_iter Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
CZWin32768/XLM-Align/word_aligner/xlmalign-ot-aligner.py
code served (permissive licence) · get_code("010980bf6b0dffd6")
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 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

torch.manual_seed(0)

# Construct a small 2D tensor with positive values
# The function expects a 2D tensor and will normalize it through Sinkhorn iterations
S = torch.tensor([
    [0.5, 0.3, 0.2, 0.1],
    [0.2, 0.4, 0.1, 0.3]
], dtype=torch.float32)

# Number of Sinkhorn iterations to perform
num_iter = 2

ARGS = {
    "S": S,
    "num_iter": num_iter
}
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 tuple, ndim 3, dtype family float — 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
extract_wa_from_pi_xi Ran
ran, honoured the contract we drafted
CZWin32768/XLM-Align/word_aligner/xlmalign-ot-aligner.py
code served (permissive licence) · get_code("269578f65f3f34dc")
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 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

torch.manual_seed(0)

# pi should be a tensor of shape (m, n) containing probabilities/logits
# The function calls pi.argmax(dim=1) which returns indices of shape (m,)
# Then it indexes torch.eye(n) with those indices
m, n = 3, 4
pi = torch.randn(m, n)

# xi should be a tensor of shape (m, n) containing probabilities/logits
# The function calls xi.argmax(dim=0) which returns indices of shape (n,)
# Then it indexes torch.eye(m) with those indices
xi = torch.randn(m, n)

ARGS = {
    "pi": pi,
    "xi": xi,
}
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 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
sinkhorn Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
CZWin32768/XLM-Align/word_aligner/xlmalign-ot-aligner.py
code served (permissive licence) · get_code("c5bc5e64bf6f281c")
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. 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)

# Construct arguments for sinkhorn function
# sample: appears to be unused in the function body
sample = None

# batch_sim: list of 2D tensors (similarity matrices)
# Each tensor will be sliced by src_fr/src_to and trg_fr/trg_to
batch_sim = [
    torch.rand(5, 4),  # First batch item: 5x4 matrix
    torch.rand(6, 3),  # Second batch item: 6x3 matrix
]

# src_fr, src_to: source frame indices (start, end) for each batch item
src_fr = [0, 1]
src_to = [4, 5]

# trg_fr, trg_to: target frame indices (start, end) for each batch item
trg_fr = [0, 1]
trg_to = [3, 2]

# num_iter: number of Sinkhorn iterations
num_iter = 2

ARGS = {
    "sample": sample,
    "batch_sim": batch_sim,
    "src_fr": src_fr,
    "src_to": src_to,
    "trg_fr": trg_fr,
    "trg_to": trg_to,
    "num_iter": num_iter,
}
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 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

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 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 3 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

The cross-lingual language models are typically pretrained with masked language modeling on multilingual text or parallel sentences. In this paper, we introduce denoising word alignment as a new cross-lingual pre-training task. Specifically, the model first self-labels word alignments for parallel sentences. Then we randomly mask tokens in a bitext pair. Given a masked token, the model uses a pointer network to predict the aligned token in the other language. We alternately perform the above two steps in an expectationmaximization manner. Experimental results show that our method improves cross-lingual transferability on various datasets, especially on the token-level tasks, such as question answering, and structured prediction. Moreover, the model can serve as a pretrained word aligner, which achieves reasonably low error rates on the alignment benchmarks. The code and pretrained parameters are available at github.com/CZWin32768/XLM-Align.

For agents

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

get_harvested_code_for_paper("2106.06381")
get_code_for_paper("2106.06381")
have("2106.06381")

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

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

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

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

Connect an agent — have() is free.