This is the control condition: same data, same architecture, same two-stage protocol — different pre-training objective. Comparing RTD vs MLM isolates the effect of replaced token detection.
MolE originally used MLM pre-training (predicting radius-2 atom environments at masked positions). Our RTD models replace MLM with replaced token detection. To prove RTD is the improvement (not data scale, not architecture), we need an MLM baseline trained identically.
1import torch
2from collections import OrderedDict
3from huggingface_hub import hf_hub_download
4from DeBERTa.deberta.config import ModelConfig
5from mole.training.models.mole import AtomEnvEmbeddings
6
7DISC_CFG = dict(
8 embedding_size=768, hidden_size=768, intermediate_size=3072,
9 num_hidden_layers=12, num_attention_heads=12, attention_head_size=64,
10 attention_probs_dropout_prob=0.1, hidden_dropout_prob=0.1,
11 hidden_act="gelu", layer_norm_eps=1e-7, max_position_embeddings=0,
12 max_relative_positions=512, position_buckets=0, norm_rel_ebd="layer_norm",
13 pos_att_type="p2c|c2p", position_biased_input=False, relative_attention=True,
14 share_att_key=True, type_vocab_size=0, vocab_size=211,
15)
16
17ckpt = hf_hub_download("caithmac/MolE-MLM-r2-S2", "encoder_weights_mlm_s2.pt")
18encoder = AtomEnvEmbeddings(ModelConfig.from_dict(DISC_CFG))
19encoder.load_state_dict(torch.load(ckpt, map_location="cpu", weights_only=False), strict=False)
20encoder.eval()
1@misc{mole-mlm-r2-s2,
2 author = {caithmac},
3 title = {MolE-MLM-r2-S2: BERT-style MLM molecular encoder (MLM baseline for RTD ablation)},
4 year = {2026},
5 url = {https://huggingface.co/caithmac/MolE-MLM-r2-S2}
6}