Self-Guided Masked Autoencoders for Domain-Agnostic Self-Supervised Learning

Johnathan Xie, Yoonho Lee, Annie S. Chen, Chelsea Finn

This paper, presented at ICLR 2024, introduces Self-Guided Masked Autoencoders (SMA), a novel framework designed to make self-supervised learning truly domain-agnostic. By leveraging a model's own internal attention mechanisms to decide what to mask, SMA achieves state-of-the-art results across diverse fields—from protein biology to particle physics—without requiring any domain-specific "tricks" like specialized tokenizers or data augmentations.

TL;DR

SMA is a domain-agnostic self-supervised learning method that uses a model's own attention maps to automatically identify and mask highly correlated input regions. This approach eliminates the need for domain-specific knowledge (like image patches or word tokenizers) and achieves state-of-the-art performance across protein biology, chemistry, and physics benchmarks.

What Problem Does This Paper Address?

Self-supervised learning (SSL) has revolutionized AI by allowing models to learn from massive unlabeled datasets. However, most successful SSL methods are "domain-locked." For example:

  • Computer Vision methods rely on specific image augmentations (like cropping or color jittering) or masking fixed $16 \times 16$ patches.
  • Natural Language Processing relies on sophisticated tokenizers that understand word boundaries.

When researchers want to apply SSL to new scientific domains—like analyzing protein sequences or particle collision data—they often have to manually engineer new augmentations or tokenizers. This process is error-prone, requires deep domain expertise, and limits the generalizability of AI. The authors aim to create a "plug-and-play" SSL algorithm that works on any data modality by treating it simply as a sequence of raw values.

Methods

The core innovation of SMA is Self-Guided Masking. Instead of masking data randomly or using a pre-defined grid, the model learns which parts of the data are most important to hide.

  1. Attention Extraction: The model (either a standard Transformer or a Perceiver IO) processes the input and generates an attention map in its first layer.
  2. Identifying Correlations: The algorithm randomly selects a subset of "queries" and looks at which input tokens they are paying the most attention to. High attention usually indicates that these tokens are semantically related or highly correlated.
  3. Dynamic Masking: SMA masks the tokens with the highest cumulative attention. By hiding these "groups" of related data, the model is forced to perform a non-trivial reconstruction task, learning the underlying structure of the domain.
  4. Reconstruction: The rest of the network tries to predict the masked values from the unmasked ones, similar to a standard Masked Autoencoder (MAE).
The SMA pipeline: (a) computing attention, (b) selecting queries to generate a mask, and (c) the final masked prediction objective.

To ensure the method scales, the authors developed a linear-time approximation of this masking process, preventing the "top-k" selection from becoming a computational bottleneck.

Datasets

The authors evaluated SMA across a wide range of benchmarks to prove its versatility:

  • Protein Biology: The TAPE benchmark (Pfam for pre-training; Remote Homology, Fluorescence, and Stability for downstream tasks).
  • Chemistry: MoleculeNet tasks (using SMILES strings mapped to raw UTF-8 characters) and the guacamol dataset for pre-training.
  • Particle Physics: The HIGGS dataset, involving kinematic values from particle accelerators.
  • Standard Benchmarks: GLUE (Natural Language) and ImageNet-100 (Computer Vision) to compare against domain-specific baselines.

Key Insights and Ideas

  • Attention as a Semantic Map: The most striking insight is that even in early training, a model's attention maps naturally cluster around semantic regions. SMA exploits this "free" information to create a challenging curriculum for itself.
  • Challenging the "Bitter Lesson": The paper aligns with Richard Sutton’s "Bitter Lesson"—that general methods that leverage computation eventually outperform methods relying on human-engineered inductive biases. SMA shows that domain-specific tokenizers are often unnecessary if the masking strategy is smart enough.
  • Contiguity Matters: Randomly masking individual pixels or characters is often too easy because the model can just interpolate from immediate neighbors. By masking "attention-correlated" groups, SMA effectively performs "span masking" or "patch masking" automatically, regardless of the data's shape.

Key Results

SMA consistently outperformed both random masking baselines and specialized domain-specific models:

  • Proteins: SMA achieved higher accuracy in Remote Homology (0.23 vs 0.22) and better Spearman correlation in Stability (0.80 vs 0.76) compared to ProteinBERT, which uses extensive domain knowledge.
  • Chemistry: On the MoleculeNet benchmark, SMA outperformed the SMILES-based ChemBERTa-2 and was competitive with Uni-Mol, a state-of-the-art 3D graph-based model, despite SMA having no knowledge of molecular geometry.
  • Physics: On the HIGGS benchmark, SMA improved classification accuracy by nearly 2% over the previous state-of-the-art supervised methods.
  • Vision/NLP: Even in domains where it wasn't the primary focus, SMA outperformed random masking and was within ~1.5% of specialized word-masking methods in NLP.

Limitations and Future Work

  • Static Queries: The current implementation uses static queries for attention, which might bias the masks toward certain positions. The authors suggest exploring dynamic queries in the future.
  • High-Resolution Vision: While domain-agnostic, the model still requires images to be resized to a manageable resolution (e.g., $192 \times 192$) because processing millions of raw pixels as a flat sequence is currently computationally prohibitive for Transformers.
  • Positional Embeddings: The model still relies on learned positional embeddings. A truly "zero-prior" model might need to learn these relations entirely from scratch without even knowing the sequence order.

Summary updated

Abstract

Self-supervised learning excels in learning representations from large amounts of unlabeled data, demonstrating success across multiple data modalities. Yet, extending self-supervised learning to new modalities is non-trivial because the specifics of existing methods are tailored to each domain, such as domain-specific augmentations which reflect the invariances in the target task. While masked modeling is promising as a domain-agnostic framework for self-supervised learning because it does not rely on input augmentations, its mask sampling procedure remains domain-specific. We present Self-guided Masked Autoencoders (SMA), a fully domain-agnostic masked modeling method. SMA trains an attention based model using a masked modeling objective, by learning masks to sample without any domain-specific assumptions. We evaluate SMA on three self-supervised learning benchmarks in protein biology, chemical property prediction, and particle physics. We find SMA is capable of learning representations without domain-specific knowledge and achieves state-of-the-art performance on these three benchmarks.
BibTeX
@inproceedings{xie2024self,
  author = {Johnathan Xie and Yoonho Lee and Annie S. Chen and Chelsea Finn},
  title = {{Self-Guided Masked Autoencoders for Domain-Agnostic Self-Supervised Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=HiYMiZYwkw},
}
Figure