Large-Scale Cell Representation Learning via Divide-and-Conquer Contrastive Learning

Suyuan Zhao, Jiahuan Zhang, Zaiqing NiearXiv 2023 · DOI

Abstract

Single-cell RNA sequencing (scRNA-seq) has revolutionized our understanding of cellular heterogeneity, yet applying large-scale language models to this domain faces significant hurdles: embedding anisotropy and the "memory wall" of contrastive learning. We present CellLM, a large-scale cell representation model that utilizes a novel divide-and-conquer contrastive learning approach. By mathematically decomposing large-batch updates, CellLM overcomes GPU memory constraints, enabling training on a massive dataset of ~2 million normal and cancer cells. CellLM achieves state-of-the-art performance across cell type annotation and drug sensitivity prediction tasks.

Introduction

The advent of scRNA-seq allows for high-resolution mapping of biological processes at the individual cell level. Recent efforts to adapt Large Language Models (LLMs) like BERT to transcriptomic data have shown promise but are limited by two primary factors. First, anisotropy: BERT-based models often produce embeddings that cluster in a narrow cone, hindering effective cell type discrimination. Second, the Memory Wall: while contrastive learning (CL) can mitigate anisotropy, it requires large batch sizes that are computationally prohibitive for high-dimensional scRNA-seq data, which often exceeds 20,000 genes per cell.

Methods

CellLM addresses these challenges through a multi-faceted architecture designed for scalability and biological relevance.

Figure 1: Overall architecture of CellLM, illustrating the pre-training tasks and downstream applications.

Divide-and-Conquer Contrastive Learning

The core innovation of CellLM is a divide-and-conquer strategy for contrastive learning. Instead of attempting to process a massive batch in a single gradient-heavy pass, the model splits the batch into smaller mini-batches. It performs an initial "no-gradient" pass to calculate embeddings, followed by sequential gradient updates. This method is mathematically identical to a single large-batch update but drastically reduces the memory footprint, allowing for a batch size of 256 for sequences of 13,000 genes on a single 40GB GPU.

Architecture and Knowledge Integration

To manage long gene expression sequences, CellLM employs the Performer architecture, which utilizes linear attention to reduce computational complexity from $O(N^2)$ to $O(N)$. Furthermore, the model incorporates biological prior knowledge by initializing gene embeddings using a Protein-Protein Interaction (PPI) network via GraphMAE, ensuring that the model starts with a foundation of known gene relationships.

Multi-Task Pre-training

The model is pre-trained on a compendium of ~2 million cells from PanglaoDB and CancerSCEM using three simultaneous tasks:

  1. Masked Language Modeling (MLM): Predicting masked gene expression values to learn general transcriptomic patterns.
  2. Cell Type Discrimination: Classifying cells as normal or cancerous to capture disease-specific features.
  3. Contrastive Learning (CL): Pushing distinct cell representations apart to ensure a uniform embedding space and resolve anisotropy.

Results

CellLM demonstrates superior performance across multiple benchmarks, effectively overcoming the memory constraints that limit traditional end-to-end training.

Figure 3: Comparison of scRNA-seq length and batch size capabilities between end-to-end and divide-and-conquer training.

Cell Type Annotation

On the Zheng68k dataset, CellLM achieved a 71.8 $F_1$-score, representing a 3.0% absolute improvement over the previous state-of-the-art, scBERT. Similar gains were observed on the Baron dataset, confirming the model's robustness across different tissues and cell types.

Drug Sensitivity Prediction

CellLM significantly outperforms specialized models in drug response tasks. It achieved a 93.4 Pearson correlation for cell line drug sensitivity, surpassing DeepCDR by 6.2%. In few-shot scenarios for rare diseases, the model improved $F_1$-scores by an average of 8.3%, highlighting the benefit of including cancer cells in the pre-training phase.

Discussion and Conclusion

CellLM proves that "trading time for space" through gradient decomposition allows for large-scale contrastive learning on standard hardware. The inclusion of cancer-specific data during pre-training is critical for downstream pharmacological applications, as it allows the model to learn the unique transcriptomic signatures of tumor cells. Attention map analysis further reveals that the model focuses on established biological markers (e.g., B2M, ACTB), suggesting it learns meaningful biological representations rather than statistical noise.

Future work will focus on bridging the "modality gap" by incorporating scATAC-seq data and expanding the model's scope to include a broader spectrum of non-cancerous diseases and developmental stages.

Summary updated

BibTeX
@misc{zhao2023large,
  author = {Suyuan Zhao and Jiahuan Zhang and Zaiqing Nie},
  title = {{Large-Scale Cell Representation Learning via Divide-and-Conquer Contrastive Learning}},
  year = {2023},
  eprint = {2306.04371},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.04371},
}
Figure