CellMSA: Context Modeling for Single-Cell Representation Learning

Suyuan Zhao, Minghao Liu, Yizhen Luo, Zaiqing Nie

TL;DR

CellMSA introduces a novel framework for single-cell representation learning by borrowing the concept of Multiple Sequence Alignment (MSA) from protein modeling. By analyzing a target cell alongside a "context" of similar cells, the model captures fine-grained gene-gene dependencies and biological signals that isolated-cell models often miss, setting new performance benchmarks across batch integration, cell classification, and perturbation prediction tasks.

What Problem Does This Paper Address?

Single-cell RNA sequencing (scRNA-seq) provides a high-resolution window into cellular states, but the data is notoriously difficult to work with. It is characterized by extreme high dimensionality, high sparsity (due to "dropout" where genes are present but not detected), and significant "batch effects"—technical noise introduced by different sequencing runs or platforms.

Existing foundation models for single-cell data typically treat each cell as an isolated island. While some recent models attempt to incorporate multi-cell context, they often compress the data so much that they lose gene-level resolution, or they only look at cells from the same sequencing batch. This limits their ability to distinguish true biological variation from stochastic noise and prevents them from capturing the complex, state-dependent relationships between genes.

Methods

The core innovation of CellMSA is the introduction of an MSA-inspired inductive bias. In protein modeling, MSA allows models like AlphaFold to identify conserved residues and co-evolutionary patterns across homologous sequences. CellMSA applies this logic to transcriptomics.

  1. Context Construction: For every target cell, the model retrieves a set of "neighbor" cells from a massive database. This context includes:
  2. Cells of the same type from the same batch (for local denoising).
  3. Cells of the same type from different batches (to find stable biological signals).
  4. Cells from biologically related but different cell types (to provide a contrastive background).
  5. CellMSA-Module: This module processes the target cell and its context together. It uses an Outer-product Mean operation to aggregate joint variation across the context into a gene-pair representation. This is followed by Pair-weighted Averaging to update the individual gene representations based on these pair-wise relationships.
  6. GenePairformer: The resulting gene-pair representation is injected into a target-cell encoder as an attention bias. This guides the model to focus on specific gene-gene dependencies that are relevant to the cell's specific state.
Figure 2: An overview of CellMSA architecture. For each target cell, we first use the CellMSA- Module to process the target cell together with its cellular context from different batches and biologically related cell types, summarizing cross-cell patterns into a context-dependent gene-pair representation. Then, in the GenePairformer module, the gene-pair representation is incorporated into the encoding of the target cell as an attention bias. Pretraining is conducted through joint optimization of three loss functions: masked gene expression modeling (LMGM), expression reconstruction (LRec) and cell contrastive learning (LCCE).

The model is pretrained using three joint objectives: Masked Gene Modeling (predicting missing expressions), Expression Reconstruction (preserving global profile), and Cell-level Contrastive Learning (improving biological discriminability).

Datasets

  • Pretraining: A massive human single-cell corpus curated from the CELLxGENE database, containing approximately 109 million cell observations (including 65.6 million primary observations) across 818 cell types.
  • Evaluation:
    • Tabula Sapiens: A comprehensive human cell atlas used for batch integration and cell type annotation.
  • Kidney Atlas: Used for fine-grained disease-associated cell state classification.
  • Replogle Dataset: A large-scale CRISPR perturbation dataset used to evaluate the model's ability to predict cellular responses to genetic shifts.

Key Insights and Ideas

  • The MSA Analogy: The authors argue that marker genes in cells are analogous to conserved residues in proteins, and gene co-expression is analogous to residue co-evolution. By aligning cells, the model can "see" the underlying structural constraints of a cell state.
Figure 1: Utilizing MSA context to enhance protein modeling has a natural counterpart in single-cell modeling. Protein models capture conserved residues closely related to structural stability, as well as residue co-evolution, thereby modeling structure-aware residue-pair representations. Similarly, CellMSA learns the marker genes and gene co-expression patterns from context, and in turn models cell-state-dependent gene dependencies.
  • Resolution Matters: Unlike previous context-aware models that might average cell profiles, CellMSA maintains gene-level alignment. This allows it to capture the "fine-grained" dependencies necessary for tasks like perturbation prediction.
  • Cross-Batch Synergy: By explicitly retrieving context from different batches, the model learns to ignore technical noise and focus on the biological signals that remain consistent across different experiments.

Key Results

CellMSA consistently outperformed state-of-the-art baselines (including scGPT, Geneformer, and CellPLM) across multiple benchmarks:

  • Batch Integration: On the Tabula Sapiens dataset, CellMSA achieved the highest total score (0.736), showing superior ability to mix batches while preserving biological identity.
  • Cell Classification: It reached a Macro-F1 of 0.912 for cell type annotation and 0.931 for disease-associated cell state classification, significantly higher than isolated-cell models.
Table 2: Results of cell type and cell state classification. Entries with ± report mean and standard deviation over five runs.
  • Perturbation Prediction: The model improved the Pearson $\Delta$ (a measure of how well it predicts transcriptional shifts) by 8.8% over the strongest baseline.
  • Interpretability: Analysis of the learned gene-pair representations showed that the model successfully captured disease-associated gene networks, such as those involved in kidney injury and fibrosis.

Limitations and Future Work

The authors note that while CellMSA captures informative statistical associations between genes, these do not necessarily represent explicit causal regulatory relationships. The model relies on the quality and diversity of the retrieved context; if the retrieval database is biased or incomplete, performance may suffer.

Future work aims to incorporate prior knowledge of gene regulation (like known transcription factor targets) and causal machine learning methods to move beyond statistical correlation toward true biological grounding.

Summary updated

BibTeX
@inproceedings{zhao2026cellmsa,
  author = {Suyuan Zhao and Minghao Liu and Yizhen Luo and Zaiqing Nie},
  title = {{CellMSA: Context Modeling for Single-Cell Representation Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=aqtv1iusCF},
}
Figure