SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2010.08275 · 2020

It's not Greek to mBERT: Inducing Word-Level Translations from Multilingual BERT

arXiv · PDF · Open in the Atlas

Code that ran

5 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 1 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/2010.08275.json · badge: /api/ran/2010.08275.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
gonenhila/mbert canonical (classifier label)
classifier basis: classifier_2025
5 ran · 1 no recorded run
FunctionStatusWhere it lives
create_repr_per_lang Ran
ran; our contract draft was wrong, not the code
gonenhila/mbert/source/analogies.py
code served (permissive licence) · get_code("6c9282e8ef3e3619")
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 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 numpy as np

# Create small test data
np.random.seed(0)

# vecs: list/array of vectors - the function iterates over it with zip
# Each vector should be a 1D array that can be averaged
vecs = [
    np.array([1.0, 2.0, 3.0, 4.0]),
    np.array([5.0, 6.0, 7.0, 8.0]),
    np.array([9.0, 10.0, 11.0, 12.0]),
    np.array([13.0, 14.0, 15.0, 16.0]),
]

# labels_lang: list of language labels corresponding to each vector
# Must be same length as vecs
labels_lang = ['en', 'fr', 'en', 'de']

ARGS = {
    'vecs': vecs,
    'labels_lang': labels_lang,
}
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 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
extract_lang_mapping Ran
ran; our contract draft was wrong, not the code
gonenhila/mbert/source/translator.py
code served (permissive licence) · get_code("1b63ce3a8e624e66")
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 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 csv
from io import StringIO
from unittest.mock import Mock, patch

class SimpleTokenizer:
    def tokenize(self, text):
        # Split on whitespace and return tokens
        return text.split()

# Create a mock TSV file content
tsv_content = """name	iso	code
English	eng	en
French	fra	fr
German	deu	de
Spanish	spa	es
"""

short_names = {
    'English': 'English',
    'French': 'French',
    'German': 'German',
    'Spanish': 'Spanish'
}

tokenizer = SimpleTokenizer()

# Mock the file opening to return our test data
def mock_open_func(filename):
    return StringIO(tsv_content)

ARGS = {
    'short_names': short_names,
    'tokenizer': tokenizer
}

# Patch the open function during execution
import builtins
original_open = builtins.open
builtins.open = mock_open_func
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 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
extract_repr_random_token_bert_mlm Ran
ran; our contract draft was wrong, not the code
gonenhila/mbert/source/analogies.py
code served (permissive licence) · get_code("d772ecce38adfa72")
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 torch
import random

torch.manual_seed(0)

class MockTokenizer:
    def __init__(self):
        self.vocab_size = 100
    
    def encode(self, text, add_special_tokens=False):
        # Return a list of token IDs for the text
        return [1, 2, 3, 4, 5]
    
    def convert_ids_to_tokens(self, token_ids):
        # Return token strings, some starting with ## to simulate subword tokens
        tokens = []
        for tid in token_ids:
            if tid % 2 == 0:
                tokens.append(f"##token_{tid}")
            else:
                tokens.append(f"token_{tid}")
        return tokens

# Create mock data
data = [
    {'text': 'This is a test sentence.'},
    {'text': 'Another example sentence here.'},
]

# Create mock output embeddings (768-dimensional vectors for each token ID)
output_embeddings = {}
for i in range(100):
    output_embeddings[i] = torch.randn(768).numpy()

# Create tokenizer
tokenizer = MockTokenizer()

ARGS = {
    'tokenizer': tokenizer,
    'data': data,
    'output_embeddings': output_embeddings,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch, tqdm — 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_predictions Ran
ran, honoured the contract we drafted
gonenhila/mbert/source/compare_translator_analogies.py
code served (permissive licence) · get_code("0a6468d8e8c1c616")
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 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 numpy as np

# Create small test data
# repr: representation vector(s) - will be converted to array and transposed
# The function does: np.dot(output_embeddings, np.array(repr).T).T
# So repr should be shape (batch, embedding_dim) or similar

# output_embeddings: shape (vocab_size, embedding_dim)
# scores will be (batch, vocab_size)
# best will be indices sorted in descending order

batch_size = 2
embedding_dim = 4
vocab_size = 3

# repr: batch of representations, shape (batch_size, embedding_dim)
repr_data = np.random.randn(batch_size, embedding_dim).astype(np.float32)

# output_embeddings: vocabulary embeddings, shape (vocab_size, embedding_dim)
output_embeddings = np.random.randn(vocab_size, embedding_dim).astype(np.float32)

ARGS = {
    "repr": repr_data,
    "output_embeddings": output_embeddings,
}
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, 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
get_repr_from_template Ran
ran, honoured the contract we drafted
gonenhila/mbert/source/translator.py
code served (permissive licence) · get_code("7e1e5568bc1ae8da")
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 ndarray, ndim 1, dtype family float, shape (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
import torch.nn as nn

torch.manual_seed(0)

class MockTokenizer:
    def tokenize(self, text):
        return text.split()
    
    def convert_tokens_to_ids(self, tokens):
        token_to_id = {
            '[CLS]': 101,
            '[MASK]': 103,
            '[SEP]': 102,
            'hello': 7592,
            'world': 2088,
            'foo': 3007,
            'bar': 2450,
        }
        return [token_to_id.get(t, 1000) for t in tokens]

class MockPredictions(nn.Module):
    def __init__(self):
        super().__init__()
        self.transform = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.transform(x)

class MockCLS(nn.Module):
    def __init__(self):
        super().__init__()
        self.predictions = MockPredictions()

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.cls = MockCLS()
        self.embedding = nn.Embedding(10000, 4)
    
    def forward(self, input_ids):
        embeddings = self.embedding(input_ids)
        batch_size = input_ids.shape[0]
        seq_len = input_ids.shape[1]
        hidden_state = torch.randn(batch_size, seq_len, 4)
        hidden_states = [hidden_state, hidden_state]
        return (hidden_state, hidden_states)

tokenizer = MockTokenizer()
model = MockModel()
sentence = "hello world***[MASK]***foo bar"

ARGS = {
    "sentence": sentence,
    "tokenizer": tokenizer,
    "model": model,
}
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 ndarray, ndim 1, dtype family float, shape (4,) — shape (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
collect_data_per_lang Not yet run
unverified (harvested, no recorded run)
gonenhila/mbert/source/analogies.py
code served (permissive licence) · get_code("7252364f914f637f")
How it ran

no invocation recorded.

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

Recent works have demonstrated that multilingual BERT (mBERT) learns rich cross-lingual representations, that allow for transfer across languages. We study the word-level translation information embedded in mBERT and present two simple methods that expose remarkable translation capabilities with no fine-tuning. The results suggest that most of this information is encoded in a non-linear way, while some of it can also be recovered with purely linear tools. As part of our analysis, we test the hypothesis that mBERT learns representations which contain both a language-encoding component and an abstract, cross-lingual component, and explicitly identify an empirical language-identity subspace within mBERT representations.

For agents

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

get_harvested_code_for_paper("2010.08275")
get_code_for_paper("2010.08275")
have("2010.08275")

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

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

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

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

Connect an agent — have() is free.