Spatial Coordinates as a Cell Language: A Multi-Sentence Framework for Imaging Mass Cytometry Analysis

Chi-Jane Chen, Yuhang Chen, Sukwon Yun, Natalie Stanley, Tianlong Chen

Introduction

In single-cell analysis, biological context is paramount. Technologies like Imaging Mass Cytometry (IMC) provide high-dimensional data on both cellular protein expression and spatial positioning. However, existing computational models often struggle to integrate these two modalities effectively. Most current Large Language Models (LLMs) for single-cell data treat cells in isolation, ignoring the critical "neighborhood" interactions that define cellular state and function.

To address these limitations, we present Spatial2Sentence, a novel framework that transforms single-cell protein expression and spatial coordinates into a structured "multi-sentence" language. By providing LLMs with context-rich descriptions of a cell alongside its neighbors, this approach captures essential cell-cell interactions, leading to significant improvements in cell-type classification and disease status prediction.

The Spatial2Sentence Framework

The Spatial2Sentence workflow treats biological data as a narrative, moving beyond simple vector representations to a language-based microenvironment model. The process involves three primary stages:

  1. Cell-to-Sentence Translation: Protein expression levels are rank-ordered for each cell. A cell is represented as a "sentence" where protein names (words) are sorted from highest to lowest expression, effectively encoding the cell's chemical signature into a linguistic format.
  2. Neighborhood Construction: The system calculates two key matrices: an expression similarity matrix (chemical similarity) and a spatial distance matrix (physical proximity). This allows the model to identify which cells are functionally or spatially related.
  3. Contrastive Multi-Sentence Prompting: Instead of processing individual cells, the model is prompted with a "paragraph" containing the target cell and its context.
The Spatial2Sentence workflow integrates protein expression profiles and spatial coordinates to construct comprehensive cellular profiles.

Contrastive Multi-Sentence Prompting

The core innovation of Spatial2Sentence lies in its prompting strategy. By using contrastive pairs, the model learns to distinguish subtle biological differences:

  • Positive Pairs: The prompt includes the target cell protein sentence alongside sentences from its most similar and spatially nearest neighbors.
  • Negative Pairs: The prompt includes the target cell alongside its most dissimilar and spatially distant cells.

This contrastive approach acts as a regularizer, helping the LLM resolve ambiguities in protein expression by anchoring them to the spatial microenvironment.

The multi-sentence prompting strategy uses positive and negative pairs to provide the LLM with comparative context for better classification.

Datasets and Evaluation

The framework was rigorously evaluated on two complex IMC datasets:

  • Diabetes Dataset: Pancreatic tissue profiles from 67 donors across 38 protein markers, categorized into seven cell types and two clinical statuses (diabetic vs. non-diabetic).
  • Brain Tumor Dataset: 118 glioblastoma and 46 brain metastasis samples, utilizing 21 protein markers to identify six distinct cell types.

Key Results and Insights

Spatial2Sentence achieved state-of-the-art (SOTA) performance across multiple benchmarks:

  • Accuracy Improvements: On the Diabetes dataset, the framework improved cell-type classification by 5.98% and clinical status prediction by 4.18% compared to previous methods.
  • Importance of Context: Ablation studies confirmed that removing spatial information or multi-sentence prompting led to significant performance degradation, highlighting the "neighborhood" as the primary driver of success.
  • Model Agnosticity: The framework demonstrated consistent gains across various LLM architectures, including Llama-3.2, GPT-2, and Gemma-2, suggesting that the data representation itself is a powerful tool for biological discovery.
  • Biological Interpretability: The model successfully identified clinical markers, such as the increased prevalence of M1-like macrophages in brain metastasis compared to primary glioblastoma, a finding that aligns with established literature.

Conclusion and Future Directions

Spatial2Sentence represents a significant step toward teaching LLMs the "geography" of biology. By framing spatial coordinates and protein expression as a multi-sentence language, the model gains a deeper understanding of the cellular microenvironment.

Future work will focus on integrating multi-omics data (such as transcriptomics) and scaling the framework to larger LLM architectures (70B+ parameters). Additionally, developing robust strategies to handle data sparsity and noisy spatial coordinates will be essential for translating these findings into real-world clinical applications.

Summary updated

BibTeX
@inproceedings{chen2025spatial,
  author = {Chi-Jane Chen and Yuhang Chen and Sukwon Yun and Natalie Stanley and Tianlong Chen},
  title = {{Spatial Coordinates as a Cell Language: A Multi-Sentence Framework for Imaging Mass Cytometry Analysis}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure