Papers › MathBERT: A Pre-trained Language Model for General NLP Tasks in Mathematics Education

MathBERT: A Pre-trained Language Model for General NLP Tasks in Mathematics Education

2 Jun 2021arXiv:2106.07340archive 2025-07-28

Jia Tracy Shen, Michiharu Yamashita, Ethan Prihar, Neil Heffernan, Xintao Wu, Ben Graff, Dongwon Lee

Since the introduction of the original BERT (i.e., BASE BERT), researchers have developed various customized BERT models with improved performance for specific domains and tasks by exploiting the benefits of transfer learning. Due to the nature of mathematical texts, which often use domain specific vocabulary along with equations and math symbols, we posit that the development of a new BERT model for mathematics would be useful for many mathematical downstream tasks. In this resource paper, we introduce our multi-institutional effort (i.e., two learning platforms and three academic institutions in the US) toward this need: MathBERT, a model created by pre-training the BASE BERT model on a large mathematical corpus ranging from pre-kindergarten (pre-k), to high-school, to college graduate level mathematical content. In addition, we select three general NLP tasks that are often used in mathematics education: prediction of knowledge component, auto-grading open-ended Q&A, and knowledge tracing, to demonstrate the superiority of MathBERT over BASE BERT. Our experiments show that MathBERT outperforms prior best methods by 1.2-22% and BASE BERT by 2-8% on these tasks. In addition, we build a mathematics specific vocabulary 'mathVocab' to train with MathBERT. We discover that MathBERT pre-trained with 'mathVocab' outperforms MathBERT trained with the BASE BERT vocabulary (i.e., 'origVocab'). MathBERT is currently being adopted at the participated leaning platforms: Stride, Inc, a commercial educational resource provider, and ASSISTments.org, a free online educational platform. We release MathBERT for public usage at: https://github.com/tbs17/MathBERT.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2106.07340")

Code

Syntology Ran 3 of 9 code samples harvested from 1 repository linked to this paper; 6 have no recorded run. Of those that ran: 1 ran · honoured contract; 2 ran · our draft was wrong.

By repository: official repository: 9 samples from 1 repository, 3 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

tbs17/MathBERT officialmentioned in papertfMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

9 samples harvested; 3 ran; 1 honoured the contract we drafted; 6 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
2ran · our draft was wrong
6unverified

Licence: 9 of the 9 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from tbs17/MathBERT. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

convert_to_unicode tbs17/MathBERT/mathbert/tokenization.py official repository ran · our draft was wrong fingerprinted MIT recorded; this copy not marked cleared · pointer only · 1923fc05163d207d · report
gelu tbs17/MathBERT/mathbert/modeling.py official repository ran · honoured contract fingerprinted MIT recorded; this copy not marked cleared · pointer only · d08f324f950148de · report
get_activation tbs17/MathBERT/mathbert/modeling.py official repository ran · our draft was wrong MIT recorded; this copy not marked cleared · pointer only · 5842ee67106321d6 · report
create_float_feature tbs17/MathBERT/mathbert/create_pretraining_data.py official repository unverified MIT recorded; this copy not marked cleared · pointer only · b24b3b9c700da839 · report
create_int_feature tbs17/MathBERT/mathbert/create_pretraining_data.py official repository unverified MIT recorded; this copy not marked cleared · pointer only · dd3ef48a15aec0cd · report
file_based_input_fn_builder tbs17/MathBERT/mathbert/run_classifier.py official repository unverified MIT recorded; this copy not marked cleared · pointer only · 1b46c9ce24fc6db3 · report
get_assignment_map_from_checkpoint tbs17/MathBERT/mathbert/modeling.py official repository unverified MIT recorded; this copy not marked cleared · pointer only · 50958618b65e514e · report
load_vocab tbs17/MathBERT/mathbert/tokenization.py official repository unverified MIT recorded; this copy not marked cleared · pointer only · ff83ccc8b0b6462d · report
printable_text tbs17/MathBERT/mathbert/tokenization.py official repository unverified MIT recorded; this copy not marked cleared · pointer only · 0e5615f8994003cf · report

Tasks

Knowledge TracingLanguage ModelingLanguage ModellingMathTransfer Learning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

AdamAttentionAttention DropoutBERTDense ConnectionsDropoutLayer NormalizationLinear LayerLinear Warmup With Linear DecayMulti-Head AttentionResidual ConnectionSoftmaxWeight DecayWordPiece

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections