Manuscript Offprint

arXiv:2610.26651

The Effectiveness and Durability of Pretraining Data Filtering in Protein Language Models

Aaron Maiwald, Roderick McNeill, Jaeyoung Lee, Matthew A. Clarke, Lennart Justen, Alejandro Acelas, Ivo Andrews, Giles Harper-Donnelly, Adam Moore, Sophie Rose, Oliver M. Crook, Felix Jackson

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Pretraining filtering is one of the most common safeguards for open-weight language models. Here we study its effectiveness, durability and scalability using the ESM-2 family of protein language models. We find that filtering viral proteins from the pretraining data meaningfully degrades masked language modelling, mutation effect prediction and long-range contact prediction on viral proteins, while largely preserving performance on non-viral proteins. These effects are concentrated among proteins from human-infecting viruses, and grow as we scale models from 8M to 3B parameters. As models increase in size, we find that stringent filtering becomes more effective. However, fine-tuning on sequences from the removed viral families restores the lost performance. Although the cost to recover performance increases with model scale, even for the largest models it costs about 80 USD of H100 time. This work establishes pretraining filtering as moderately effective at selectively degrading performance on viral proteins, but not durable against fine-tuning with modest computational resources and access to relevant data.

1 INTRODUCTION

Robustly safeguarding open-weight models is an unsolved problem in AI safety. Given access to a model's weights and inference code, most safeguards become brittle; post-training can often be cheaply undone through fine-tuning (Zhan et al., 2024; Deeb & Roger, 2024; Lucki et al., 2025; Che et al., 2025), and scaffolds using safety classifiers can simply be removed. Absent better safeguards, open-weight models might continue to increase access to the dual-use capabilities of frontier models a few months after their release.

To be effective, open-weight safeguards have to be “tamper-resistant” (Tamirisa et al., 2025; Qi et al., 2025); that is, it has to be costly to remove them. Of the safeguards developed to date, stringent data filtering prior to pretraining has proven the most tamper-resistant, requiring orders of magnitude more fine-tuning compute to undo than post-training interventions (O’Brien et al., 2026; Rathi & Radford, 2026). O’Brien et al. (2026) showed that filtering pretraining data selectively reduces LLM performance on dual-use queries and that it takes up to 10,000 fine-tuning steps, or 305M tokens, to

∗^{*}Joint first authors.

†^{\dagger}Joint senior and corresponding authors, listed alphabetically.

Correspondence: oliver.crook@chem.ox.ac.uk; felix.jackson@dsit.gov.uk.

Figure

Figure 1: Filtering viral proteins from the pretraining data selectively degrades performance on tasks related to viral proteins, and more so for larger models. The cost of performance recovery increases with model size. All panels show the tier-0 filtered model, where we exclude all viral proteins and their homologues from the training data, against the unfiltered model of the same size. Left: Comparison of language-modelling performance on held-out viral and non-viral sequences. Middle: Comparison of mutation effect prediction performance for viral and non-viral sequences, on ProteinGym DMS datasets. Intervals represent one standard error of paired differences across sequences (left; n = 5,161 viral, 3,000 non-viral) or assays (middle; n = 31 viral, 186 non-viral). Right: Estimated fine-tuning cost to recover performance on viral language modelling (solid) or viral mutation effect prediction (mean performance across 45 EVEREST assays (dashed)). Markers show the first recovering checkpoint; bars extend to the preceding checkpoint, and downward arrows mark upper bounds.

recover the lost performance on a 6.9B parameter model. However, even with current algorithmic efficiency and compute cost, it would take less than 100 to reverse this safeguard. 1^{1}

This study aims to understand the tamper resistance of data filtering in the case of biological foundation models, using models based on the protein language model family ESM-2 (Lin et al., 2023). Prior work has focused on general-purpose LLMs, but specialised models, such as protein language models, remain understudied. Specialised biological models are driving rapid advances in biotechnology (Jumper et al., 2021; Watson et al., 2023; Notin et al., 2024) and are typically released as open-weight models. They are smaller than frontier AI systems, which makes them easier to train, share and modify. Importantly, misuse of these models can pose substantial dual-use risk in helping with the design of novel hazardous pathogens (Wei et al., 2025).

Here, we pretrain models ranging in size from 8M to 3B parameters, filtering the pretraining data for different sets of proteins: from excluding all viral proteins and homologues, to merely excluding proteins from human-infecting viruses. We evaluate the models on masked language modelling, mutation effect prediction and long-range contact prediction. We subsequently measure the cost of recovering the capability lost through filtering via fine-tuning on the excluded data.

Our main findings are as follows:

  1. Across models from 35M to 3B parameters, filtering viral proteins from the pretraining data degrades language modelling performance on viral proteins, without damaging performance on non-viral proteins (Figure 1).

  2. Larger models tend to be more strongly affected by filtering across all three of our evaluations.

  3. For the filtered models, performance can be entirely restored by fine-tuning on the removed families, with the amount of compute needed increasing as models grow in size.

1^{1}O'Brien et al. (2026) report roughly 17 hours on two H200 GPUs for their four fine-tuning runs. A single full-parameter adversarial fine-tuning run is then close to 10 H200-hours, or 50 at 5 per H200-hour. This assumes that a suitable dataset for fine-tuning is readily available, which may not always be the case. Some actors may currently also lack the machine learning capability to fine-tune an LLM.

References (44)