arXiv:2609.00518cs.LGSep 2026

Manuscript Offprint

arXiv:2609.00518

Learning Task-Specific Antibody Representations via Function-Aware Masking

Ayan Goel, Thomas A. Walton, Amirali Aghazadeh

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

Abstract

Antibody-specific language models pretrained via masked language modeling (MLM) learn representations that are critical for downstream sequence design and property prediction tasks. Yet, the corruption process itself is rarely leveraged as a source of inductive bias during pretraining. While preferentially masking complementarity-determining regions (CDRs) improves binding-related predictions, antibodies possess diverse biological priors over a variety of functions. Herein, we introduce function-aware masking, a family of pretraining algorithms that align mask placement with specific functional priors (e.g., from IMGT annotations or structure predictions) to shape the learned representation space. We show that these specialist masking strategies significantly improve performance on their respective objectives, yielding up to a 14% gain on structure-related tasks and up to a 5.9× improvement on CDR-related tasks. To further improve performance across multiple functional axes, we develop hybrid masking strategies that integrate multiple priors, balancing reconstruction over binding, structural, and biophysical objectives. Our results demonstrate that informed mask placement provides a parameter-free mechanism for imposing functional inductive biases in antibody language model training.

1 Introduction

The development of therapeutic antibodies sits at the forefront of drug discovery, providing targeted treatments for complex oncological, autoimmune, and infectious diseases. Learning expressive sequence representations is central to optimizing these biologics for clinical viability. Antibody-specific language models trained under the masked language modeling (MLM) objective (abLMs), such as AntiBERTa [1, 2] and AbLang [3, 4], encode representations that demonstrate strong generalization across diverse sequence design and optimization tasks.

Improvements to these models have largely stemmed from scaling pretraining data and refining architecture. However, recent work has demonstrated that the corruption process itself serves as an inductive bias that shapes how learned representations generalize across tasks [5–7]. Specifically, preferential masking of antibody complementarity-determining regions (CDRs) increases transfer performance on CDR infilling, binding affinity, and binding specificity tasks.

Masking of CDRs, however, targets only one facet of antibody function. Therapeutic antibodies must also fold stably, resist aggregation, and exhibit mutational robustness to ensure clinical developability. The residues governing these properties often lie outside of CDRs; they are distributed across the framework region that provides the structural scaffold. The success of CDR masking and its variants points to a broader principle and raises a more general question: can antibody masking strategies

Preprint.

Figure

C

Figure

Figure 1: Function-aware masking concentrates representation learning on critical antibody regions. a, The rigid structure of an antibody-antigen complex (PDB ID: 3HFM), illustrating that functional variation is heavily localized to a sparse subset of sequence locations. b, Masked language models (MLMs) trained on hundreds of thousands of antibodies implicitly learn how sequence variation affects function through a corruption (masking) and reconstruction objective. c, Random masking treats all sequence positions as relevant; however, sequence positions most consequential to downstream fitness are localized to few regions. Function-aware masking leverages functional annotations to guide mask placement, focusing the training signal on these relevant regions.

be designed using any arbitrary functional prior to align representations with their corresponding downstream tasks?

To address this question, we introduce function-aware masking (Figure 1), a family of masking strategies that bias mask placement toward the residues most associated with a given functional task. Each strategy scores residues using a functional signal derived from either sequence labels or model predictions (e.g., IMGT labels or IgFold predictions [8]) and preferentially masks those positions during training (Figure 1c). Importantly, function-aware masking shapes only the training objective: resulting models remain sequence-only at inference and incur no additional parameter cost. These masking strategies, hereinafter referred to as specialist strategies, improve performance over random masking on tasks that align with their prior. To consistently drive improvements across multiple functional axes simultaneously, we further introduce hybrid masking strategies that combine functional priors through stochastic mixtures and learning curricula. We evaluate function-aware masking in the pretraining setting and assess performance over five downstream tasks spanning binding, structure, developability, and generative objectives. Our contributions are as follows:

  1. We introduce function-aware antibody masking, a class of masking algorithms that impose functional inductive biases guided by the downstream task of interest. We open-source our implementation here: https://github.com/amirgroup-codes/function-aware-masking.git

  2. We demonstrate that specialized masking strategies, focusing on an individual biological prior, improve performance over random masking on tasks aligning with their prior. Specialist strategies improved performance on structure-related tasks by up to 14% and CDR-related tasks by up to 5.9×5.9\times.

  3. To further improve generalization, we demonstrate that hybrid masking strategies increase representation quality across multiple functional axes, mitigating performance degradation exhibited by specialists on unaligned tasks.

References (26)