SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2004.09297 · 2020

MPNet: Masked and Permuted Pre-training for Language Understanding

arXiv · PDF · Open in the Atlas

Code that ran

8 of 8 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, 1 violated it and 1 has no contract verdict; 5 failures of our instrument; 0 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, 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/2004.09297.json · badge: /api/ran/2004.09297.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
microsoft/MPNet canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
michael-wzhu/mpnet_zh community (classifier label)
classifier basis not recorded on the link
6 ran · 0 no recorded run
FunctionStatusWhere it lives
whitespace_tokenize Ran
ran; our contract draft was wrong, not the code
michael-wzhu/mpnet_zh/src/tokenization_bert.py
pointer only (licence: MIT) · get_code("cf9ffa02a42184af")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, michael-wzhu/mpnet_zh, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with 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.

accuracy Ran
ran on a synthesized input
michael-wzhu/mpnet_zh/src/masked_permutation_criterion.py
pointer only (licence: MIT) · get_code("d1972efc38e68259")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, michael-wzhu/mpnet_zh, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with 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.

hf_bucket_url Ran
ran; our contract draft was wrong, not the code
michael-wzhu/mpnet_zh/src/file_utils.py
pointer only (licence: MIT) · get_code("b2be6c932ce41084")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, michael-wzhu/mpnet_zh, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with 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.

is_remote_url Ran
ran, violated the contract we drafted
michael-wzhu/mpnet_zh/src/file_utils.py
pointer only (licence: MIT) · get_code("4381d1f588a7f42a")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, michael-wzhu/mpnet_zh, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with 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.

load_vocab Ran
ran; our contract draft was wrong, not the code
michael-wzhu/mpnet_zh/src/tokenization_bert.py
pointer only (licence: MIT) · get_code("e7fbc7a74a3457c7")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, michael-wzhu/mpnet_zh, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with 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.

reverse_tensor Ran
ran, honoured the contract we drafted
microsoft/MPNet/pretraining/fairseq/models/masked_permutation_net.py
code served (permissive licence) · get_code("a427ea7612c6b14f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family float, shape (3, 2) 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

torch.manual_seed(0)

x = torch.randn(2, 3)

ARGS = {
    'x': x
}
Setup block drafted by
a language model, Claude Sonnet 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 Tensor, ndim 2, dtype family float, shape (3, 2) — shape (3, 2) 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
split_tensor Ran
ran; our contract draft was wrong, not the code
microsoft/MPNet/pretraining/fairseq/models/masked_permutation_net.py
code served (permissive licence) · get_code("208f1b5401a10976")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 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 torch

torch.manual_seed(0)

x = torch.randn(10, 4)
split_size = 7

ARGS = {
    'x': x,
    'split_size': split_size
}
Setup block drafted by
a language model, Claude Sonnet 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 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
url_to_filename Ran
ran; our contract draft was wrong, not the code
michael-wzhu/mpnet_zh/src/file_utils.py
pointer only (licence: MIT) · get_code("e827d94caab33f59")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, michael-wzhu/mpnet_zh, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with 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 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 1 the same month, 5 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.

FunctionAlso present inEarliest-datedOthers named
whitespace_tokenize 43 other papers
4 dated earlier, 2 the same month, 37 later
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1906.01698 (2019-06)
Open Sesame: Getting Inside BERT's Linguistic Knowledge
and 40 more not named here
load_vocab 29 other papers
2 dated earlier, 27 later
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1909.11942 (2019-09)
ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
2006.04884 (2020-06)
On the Stability of Fine-tuning BERT: Misconceptions, Explanations, and Strong Baselines
and 26 more not named here
url_to_filename 12 other papers
1 dated earlier, 11 later
1909.11942 (2019-09)
ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
2005.00796 (2020-05)
A Simple Language Model for Task-Oriented Dialogue
2009.06978 (2020-09)
Dialogue Response Ranking Training with Large-Scale Human Feedback Data
and 9 more not named here
hf_bucket_url 8 other papers
1 dated earlier, 7 later
1909.11942 (2019-09)
ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
2005.00796 (2020-05)
A Simple Language Model for Task-Oriented Dialogue
2009.12719 (2020-09)
Stylized Dialogue Response Generation Using Stylized Unpaired Texts
and 5 more not named here
is_remote_url 7 other papers
1 dated earlier, 6 later
1909.11942 (2019-09)
ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
2005.00796 (2020-05)
A Simple Language Model for Task-Oriented Dialogue
2009.12719 (2020-09)
Stylized Dialogue Response Generation Using Stylized Unpaired Texts
and 4 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

BERT adopts masked language modeling (MLM) for pre-training and is one of the most successful pre-training models. Since BERT neglects dependency among predicted tokens, XLNet introduces permuted language modeling (PLM) for pre-training to address this problem. However, XLNet does not leverage the full position information of a sentence and thus suffers from position discrepancy between pre-training and fine-tuning. In this paper, we propose MPNet, a novel pre-training method that inherits the advantages of BERT and XLNet and avoids their limitations. MPNet leverages the dependency among predicted tokens through permuted language modeling (vs. MLM in BERT), and takes auxiliary position information as input to make the model see a full sentence and thus reducing the position discrepancy (vs. PLM in XLNet). We pre-train MPNet on a large-scale dataset (over 160GB text corpora) and fine-tune on a variety of down-streaming tasks (GLUE, SQuAD, etc). Experimental results show that MPNet outperforms MLM and PLM by a large margin, and achieves better results on these tasks compared with previous state-of-the-art pre-trained methods (e.g., BERT, XLNet, RoBERTa) under the same model setting. The code and the pre-trained models are available at: https://github.com/microsoft/MPNet.

For agents

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

get_harvested_code_for_paper("2004.09297")
get_code_for_paper("2004.09297")
have("2004.09297")

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

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

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

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

Connect an agent — have() is free.