SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.14782 · 2021

When is BERT Multilingual? Isolating Crucial Ingredients for Cross-lingual Transfer

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 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; 6 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/2110.14782.json · badge: /api/ran/2110.14782.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
princeton-nlp/MultilingualAnalysis canonical (classifier label)
classifier basis: classifier_2025
5 ran · 0 no recorded run
princeton-nlp/align-mlm extension (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
add_hyperparams_get_command Ran
ran; our contract draft was wrong, not the code
princeton-nlp/MultilingualAnalysis/run_experiments.py
code served (permissive licence) · get_code("9a2d9f4b00fd2506")
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 os
from argparse import Namespace

# Create mock args object
args = Namespace(
    tpu=False,
    task='mlm'
)

# Create arg_dict with required keys
arg_dict = {
    'output_dir': '/tmp/output',
    'run_name': 'test_run',
    'model_name_or_path': 'bert-base-uncased'
}

# Create default_hyperparams dict
default_hyperparams = {
    'do_train': True,
    'do_eval': True,
    'num_train_epochs': 3,
    'per_device_train_batch_size': 8,
    'learning_rate': 5e-5,
    'seed': 42,
    'overwrite_output_dir': True
}

# Create tpu_hyperparams dict
tpu_hyperparams = {
    'tpu_num_cores': 8,
    'tpu_metrics_debug': False
}

# Create tpu_files dict
tpu_files = {
    'train_file': '/path/to/train.txt',
    'validation_file': '/path/to/val.txt'
}

# Create debug_hyperparams dict
debug_hyperparams = {
    'max_steps': 100,
    'logging_steps': 10,
    'save_steps': 50
}

# Create debug_files dict
debug_files = {
    'train_file': '/tmp/train.txt',
    'validation_file': '/tmp/val.txt'
}

ARGS = {
    'default_hyperparams': default_hyperparams,
    'tpu_hyperparams': tpu_hyperparams,
    'tpu_files': tpu_files,
    'debug_hyperparams': debug_hyperparams,
    'debug_files': debug_files,
    'args': args,
    'arg_dict': arg_dict
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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
construct_command Ran
ran; our contract draft was wrong, not the code
princeton-nlp/MultilingualAnalysis/run_experiments.py
code served (permissive licence) · get_code("a2d02277323f02b3")
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 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 os
import torch
import torch.nn as nn

torch.manual_seed(0)

# Create minimal stand-in objects for the function parameters

class Args:
    def __init__(self):
        self.tpu = False

args = Args()

arg_dict = {
    'output_dir': '/tmp/output',
    'run_name': 'test_run'
}

default_hyperparams = {
    'model_name_or_path': 'bert-base-uncased',
    'dataset_name': 'wikitext',
    'max_seq_length': 128,
    'per_device_train_batch_size': 8,
    'learning_rate': 5e-5,
    'num_train_epochs': 3,
    'overwrite_output_dir': True,
    'do_train': True,
    'do_eval': False
}

task = 'mlm'

ARGS = {
    'args': args,
    'arg_dict': arg_dict,
    'default_hyperparams': default_hyperparams,
    'task': task
}
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 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
get_mlm_command Ran
ran; our contract draft was wrong, not the code
princeton-nlp/MultilingualAnalysis/run_experiments.py
code served (permissive licence) · get_code("48576e423c05dd22")
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 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 os
from argparse import Namespace

# Create a minimal args object with required attributes
args = Namespace(
    tpu=False,
    language='en'
)

# Create arg_dict with required keys
arg_dict = {
    'output_dir': '/tmp/output',
    'run_name': 'test_run'
}

# ARGS dict mapping all parameters of get_mlm_command
ARGS = {
    'args': args,
    'arg_dict': arg_dict
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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
get_normalized_embeddings Ran
ran; our contract draft was wrong, not the code
princeton-nlp/align-mlm/analysis/alignedmlm_paper_analysis/compute_alignment_with_lang_ids.py
code served (permissive licence) · get_code("52dc9cb4e8c95988")
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 numpy as np

# Create embeddings: list of 2 numpy arrays
# Each array should have shape (batch_size, embedding_dim)
embeddings = [
    np.random.randn(2, 4).astype(np.float32),
    np.random.randn(3, 4).astype(np.float32)
]

# Create a simple args object (can be a dict or class)
args = {
    "some_param": "value"
}

# train is a boolean flag
train = True

ARGS = {
    "embeddings": embeddings,
    "args": args,
    "train": train
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — 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
get_orthogonal_mapping Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
princeton-nlp/MultilingualAnalysis/analysis/learn_orthogonal_mapping_one_one.py
code served (permissive licence) · get_code("86d49a2d45aea79c")
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 numpy as np

# Create embeddings: list of 2 numpy arrays
# Each array should have shape (n_samples, embedding_dim)
# Using distinct sizes: 5 samples, 4 dimensions
embeddings = [
    np.random.randn(5, 4).astype(np.float32),
    np.random.randn(5, 4).astype(np.float32)
]

# Create train indices - boolean mask or indices for training set
# Using 3 samples for training
train = np.array([True, True, True, False, False])

# Create args dict - the function doesn't seem to use args, but it's a parameter
args = {}

ARGS = {
    "embeddings": embeddings,
    "args": args,
    "train": train
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — 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
get_train_validation_indices Ran
ran; our contract draft was wrong, not the code
princeton-nlp/MultilingualAnalysis/analysis/learn_orthogonal_mapping_one_one.py
code served (permissive licence) · get_code("1cea4fd97708b2a8")
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 numpy as np
import torch

torch.manual_seed(0)
np.random.seed(0)

# The function expects:
# - embeddings: a list/sequence where embeddings[0] has a .shape attribute
#   The function accesses embeddings[0].shape[0] to get vocab_size
# - args: an object with attributes train_fraction and valid_fraction

# Create a small embedding tensor (vocab_size=5, embedding_dim=4)
embedding_tensor = torch.randn(5, 4)
embeddings = [embedding_tensor]

# Create args object with required attributes
class Args:
    def __init__(self, train_fraction, valid_fraction):
        self.train_fraction = train_fraction
        self.valid_fraction = valid_fraction

args = Args(train_fraction=0.7, valid_fraction=0.3)

ARGS = {
    "embeddings": embeddings,
    "args": args
}
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 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

Also present in other papers' code

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

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

While recent work on multilingual language models has demonstrated their capacity for cross-lingual zero-shot transfer on downstream tasks, there is a lack of consensus in the community as to what shared properties between languages enable such transfer. Analyses involving pairs of natural languages are often inconclusive and contradictory since languages simultaneously differ in many linguistic aspects. In this paper, we perform a large-scale empirical study to isolate the effects of various linguistic properties by measuring zero-shot transfer between four diverse natural languages and their counterparts constructed by modifying aspects such as the script, word order, and syntax. Among other things, our experiments show that the absence of sub-word overlap significantly affects zero-shot transfer when languages differ in their word order, and there is a strong correlation between transfer performance and word embedding alignment between languages (e.g., R=0.94 on the task of NLI). Our results call for focus in multilingual models on explicitly improving word embedding alignment between languages rather than relying on its implicit emergence.

For agents

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

get_harvested_code_for_paper("2110.14782")
get_code_for_paper("2110.14782")
have("2110.14782")

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

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

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

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

Connect an agent — have() is free.