SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1910.14659 · 2019

Masked Language Model Scoring

arXiv · PDF · Open in the Atlas

Code that ran

10 of 10 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 5 have no contract verdict; 3 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/1910.14659.json · badge: /api/ran/1910.14659.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
phueb/unmasked community (classifier label)
classifier basis not recorded on the link
5 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
3 ran · 0 no recorded run
soyoung97/mlm-scoring reimplementation (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran, honoured the contract we drafted
this paper's copy was not recorded; identical code first harvested from xuyige/BERT4doc-Classification
pointer only · get_code("eb725d5794b15f6b")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

calc_accuracy_from_scores Ran
ran on a synthesized input
phueb/unmasked/unmasked/utils.py
code served (permissive licence) · get_code("ce3259a298ec3e93")
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 float, ndim 0, dtype family float, shape () 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 numpy as np

torch.manual_seed(0)

# Based on the function signature and body:
# - scores: List[float] - a list of floats representing scores for sentence pairs
# - scoring_method: str - either 'mlm' or 'holistic'
# 
# The function expects:
# - scores to have even length (pairs of sentences)
# - For 'mlm': correct sentence should have higher score than incorrect
# - For 'holistic': correct sentence should have lower score than incorrect

# Create test scores for MLM method (correct > incorrect for each pair)
scores_mlm = [
    0.8, 0.3,  # pair 1: correct (0.8) > incorrect (0.3)
    0.7, 0.2,  # pair 2: correct (0.7) > incorrect (0.2)
    0.9, 0.4,  # pair 3: correct (0.9) > incorrect (0.4)
    0.6, 0.1,  # pair 4: correct (0.6) > incorrect (0.1)
]

# Create test scores for holistic method (correct < incorrect for each pair)
scores_holistic = [
    0.3, 0.8,  # pair 1: correct (0.3) < incorrect (0.8)
    0.2, 0.7,  # pair 2: correct (0.2) < incorrect (0.7)
    0.4, 0.9,  # pair 3: correct (0.4) < incorrect (0.9)
    0.1, 0.6,  # pair 4: correct (0.1) < incorrect (0.6)
]

ARGS = {
    "scores": scores_mlm,
    "scoring_method": "mlm"
}
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 float, ndim 0, dtype family float, shape () — shape () 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
convert_example_to_features Ran
ran; our contract draft was wrong, not the code
soyoung97/mlm-scoring/examples/run_lm_finetuning.py
code served (permissive licence) · get_code("52a1f0891fc0ad6d")
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 InputFeatures. 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 logging

logging.basicConfig(level=logging.INFO)

class SimpleTokenizer:
    """Minimal tokenizer implementation for testing."""
    def __init__(self):
        self.vocab = {
            '[CLS]': 101,
            '[SEP]': 102,
            '[MASK]': 103,
            '[UNK]': 100,
            'hello': 1001,
            'world': 1002,
            'this': 1003,
            'is': 1004,
            'test': 1005,
            'sentence': 1006,
            'another': 1007,
            'example': 1008,
        }
    
    def convert_tokens_to_ids(self, tokens):
        """Convert tokens to their IDs using vocab."""
        ids = []
        for token in tokens:
            if token in self.vocab:
                ids.append(self.vocab[token])
            else:
                ids.append(self.vocab['[UNK]'])
        return ids

class InputExample:
    """Simple input example class."""
    def __init__(self, guid, tokens_a, tokens_b, is_next):
        self.guid = guid
        self.tokens_a = tokens_a
        self.tokens_b = tokens_b
        self.is_next = is_next

# Create test data
tokenizer = SimpleTokenizer()

example = InputExample(
    guid=1,
    tokens_a=['hello', 'world', 'this', 'is'],
    tokens_b=['test', 'sentence', 'another', 'example'],
    is_next=True
)

max_seq_length = 32
idx = 1  # Index of token to mask in tokens_a

ARGS = {
    'example': example,
    'max_seq_length': max_seq_length,
    'tokenizer': tokenizer,
    'idx': idx
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 InputFeatures — a InputFeatures output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a InputFeatures 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
convert_examples_to_features Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from gcunhase/StackedDeBERT
pointer only · get_code("b3feaffc79a790e6")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

get_group_names Ran
ran on a synthesized input
phueb/unmasked/unmasked/utils.py
code served (permissive licence) · get_code("e61b5f8d71122e38")
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 pandas as pd

# Construct a small DataFrame with 'model' and 'corpora' columns
df = pd.DataFrame({
    'model': ['bert', 'gpt2', 'bert', 'roberta'],
    'corpora': ['wiki', 'books', 'wiki', 'news']
})

ARGS = {
    'df': df
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — 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_legend_label Ran
ran on a synthesized input
phueb/unmasked/unmasked/utils.py
code served (permissive licence) · get_code("e2a116c375db5070")
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

torch.manual_seed(0)

ARGS = {
    "model_name": "resnet50"
}
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 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
make_ax_title Ran
ran on a synthesized input
phueb/unmasked/unmasked/visualizer.py
code served (permissive licence) · get_code("b5af14201018f768")
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

torch.manual_seed(0)

ARGS = {
    "phenomenon": "coordinate_structure",
    "paradigm": "prepositional_agreement_determiner"
}
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 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
random_word Ran
ran; our contract draft was wrong, not the code
soyoung97/mlm-scoring/examples/run_lm_finetuning.py
code served (permissive licence) · get_code("fab8efcc34ebd909")
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 2, 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 logging

logger = logging.getLogger(__name__)

class MockTokenizer:
    def __init__(self):
        self.vocab = {
            'hello': 101,
            'world': 102,
            'test': 103,
            'token': 104,
            '[UNK]': 100,
            '[MASK]': 105,
        }

tokens = ['hello', 'world', 'test', 'token']
tokenizer = MockTokenizer()
idx = 1

ARGS = {
    'tokens': tokens,
    'tokenizer': tokenizer,
    'idx': idx,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 tuple, ndim 2, 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
shorten_phenomenon Ran
ran on a synthesized input
phueb/unmasked/unmasked/helpers.py
code served (permissive licence) · get_code("d6af7b5cef80b3a2")
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.

# Setup code for shorten_phenomenon function

ARGS = {
    "phenomenon": "determiner-noun agreement argument coordinate structure attractor licensing"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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
warmup_linear Ran
ran, honoured the contract we drafted
this paper's copy was not recorded; identical code first harvested from gcunhase/StackedDeBERT
pointer only · get_code("c58d57224530d17e")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 3 later) and 7 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
accuracy 21 other papers
15 dated earlier, 1 the same month, 5 later
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1901.08746 (2019-01)
BioBERT: a pre-trained biomedical language representation model for biomedical text mining
1904.03323 (2019-04)
Publicly Available Clinical BERT Embeddings
and 18 more not named here
warmup_linear 19 other papers
9 dated earlier, 10 later
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1803.03376 (2018-03)
Learning Approximate Inference Networks for Structured Prediction
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
and 16 more not named here
convert_examples_to_features 3 other papers
2 dated earlier, 1 later
1905.10033 (2019-05)
Personalizing Dialogue Agents via Meta-Learning
1909.02635 (2019-09)
Effective Use of Transformer Networks for Entity Tracking
2001.00137 (2020-01)
Stacked DeBERT: All Attention in Incomplete Data for Text Classification

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

Pretrained masked language models (MLMs) require finetuning for most NLP tasks. Instead, we evaluate MLMs out of the box via their pseudo-log-likelihood scores (PLLs), which are computed by masking tokens one by one. We show that PLLs outperform scores from autoregressive language models like GPT-2 in a variety of tasks. By rescoring ASR and NMT hypotheses, RoBERTa reduces an end-to-end LibriSpeech model's WER by 30% relative and adds up to +1.7 BLEU on state-of-the-art baselines for low-resource translation pairs, with further gains from domain adaptation. We attribute this success to PLL's unsupervised expression of linguistic acceptability without a left-to-right bias, greatly improving on scores from GPT-2 (+10 points on island effects, NPI licensing in BLiMP). One can finetune MLMs to give scores without masking, enabling computation in a single inference pass. In all, PLLs and their associated pseudo-perplexities (PPPLs) enable plug-and-play use of the growing number of pretrained MLMs; e.g., we use a single cross-lingual model to rescore translations in multiple languages. We release our library for language model scoring at https://github.com/awslabs/mlm-scoring.

For agents

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

get_harvested_code_for_paper("1910.14659")
get_code_for_paper("1910.14659")
have("1910.14659")

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

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

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

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

Connect an agent — have() is free.