When Genes Speak: A Semantic-Guided Framework for Spatially Resolved Transcriptomics Data Clustering

Jiangkai Long, Yanran Zhu, Chang Tang, Kun Sun, Yuanyuan Liu, Xuesong Yan

In the rapidly evolving field of spatial transcriptomics (SRT), we’ve become very good at measuring how much of a gene is expressed and where. However, most computational models treat gene symbols—like Postn or Actc1—as mere indices in a matrix, ignoring decades of biological knowledge attached to those names. A new paper, "When Genes Speak: A Semantic-Guided Framework for Spatially Resolved Transcriptomics Data Clustering," introduces SemST, a framework that uses Large Language Models (LLMs) to give these numerical features a "voice."

TL;DR

SemST is a deep learning framework that leverages LLMs to transform gene symbols into biologically rich semantic embeddings, which then guide the clustering of spatial transcriptomics data. By using a novel "Fine-grained Semantic Modulation" (FSM) module, it outperforms state-of-the-art methods and can even be "plugged in" to existing models to boost their performance.

What Problem Does This Paper Address?

Identifying "spatial domains"—regions of a tissue with similar functional or anatomical roles—is a fundamental task in biology. While current models use Graph Neural Networks (GNNs) to capture spatial relationships, they suffer from a semantic gap. They treat genes as isolated numerical features, ignoring the rich functional context (pathways, interactions, and roles) encoded in gene symbols.

For instance, a model might see high values for genes A and B but won't "know" that their co-expression specifically indicates cardiac muscle identity. SemST aims to bridge this gap by injecting high-order biological knowledge directly into the spatial modeling process.

Methods

The SemST architecture consists of three main pillars:

  1. Multi-View GNN: The model constructs two distinct graphs. One captures spatial proximity (physical neighbors), while the other captures expression similarity (spots with similar gene profiles, even if they are far apart).
  2. LLM-Based Semantic Extraction: For every spot in the tissue, the model identifies the top $k$ most highly expressed genes. These symbols are formatted into a natural language prompt and fed into a frozen LLM (Qwen3-4B) to generate a "biologically informed" embedding.
  3. Fine-grained Semantic Modulation (FSM): This is the core innovation. Instead of simply concatenating the LLM's knowledge with the GNN's spatial features, the FSM module learns spot-specific affine transformations (scaling and shifting). This allows the biological "prior" to dynamically calibrate and steer the spatial representation.

The model is trained in a self-supervised manner using a combination of ZINB (Zero-Inflated Negative Binomial) loss to handle sparse data, a Correlation Reduction loss to align the two GNN views, and a Spatial Regularization loss to ensure neighboring spots remain coherent.

Datasets

The authors evaluated SemST on nine public datasets across three different platforms:

  • 10X Genomics Visium: Includes the Human Dorsolateral Prefrontal Cortex (DLPFC - 5 slices), Human Breast Cancer (HBC), and Mouse Brain Anterior (MBA).
  • Stereo-seq: Mouse Embryo (ME) dataset.
  • STARmap: Mouse Visual Cortex (MVC) dataset.

These datasets vary significantly in resolution and complexity, providing a robust benchmark for the framework.

Key Insights and Ideas

  • Genes as Language: The most striking idea is treating gene sets as a "sentence" that describes a cell's state. By using LLMs, the model can reason about tissue architecture in a "biologically informed" manner.
  • Modulation over Fusion: The authors found that "naive fusion" (like adding or concatenating features) often dilutes information. The FSM module acts as an active "dialogue" between semantics and space, which proved much more effective.
  • LLM Quality Matters: In ablation studies, replacing the LLM with a generic encoder like BERT or using "unrelated" text prompts led to a significant drop in performance. This suggests that the specific biological knowledge captured by modern LLMs is the key driver of success.
  • Plug-and-Play Versatility: The FSM module isn't just for SemST. The authors demonstrated that integrating FSM into existing baseline models (like STAGATE or GraphST) consistently improved their clustering accuracy.

Key Results

SemST achieved state-of-the-art (SOTA) performance across almost all metrics (ARI, NMI, ACC, and F1-score):

  • DLPFC Slice 151508: SemST surpassed the closest competitor by over 10 ARI points.
  • MBA Dataset: On this highly complex dataset with 52 annotated domains, SemST achieved an ARI improvement of more than 5 points over the next best method.
  • Qualitative Coherence: Visualizations show that SemST produces clusters that align much more closely with manual anatomical annotations compared to traditional numerical-only methods.

Limitations and Future Work

While SemST is powerful, the authors and the architecture suggest a few areas for growth:

  • Computational Overhead: While LLM embeddings are pre-extracted to save time during training, the initial inference on thousands of spots requires significant GPU resources.
  • Prompt Engineering: The performance is tied to how genes are presented to the LLM. Future work could explore more sophisticated prompts, such as including NCBI gene summaries to further reduce the risk of LLM "hallucinations."
  • Multi-modal Integration: The current framework focuses on transcriptomics. A natural next step would be integrating histopathology images (H&E stains) alongside the semantic and spatial data.

Summary updated

BibTeX
@inproceedings{long2026when,
  author = {Jiangkai Long and Yanran Zhu and Chang Tang and Kun Sun and Yuanyuan Liu and Xuesong Yan},
  title = {{When Genes Speak: A Semantic-Guided Framework for Spatially Resolved Transcriptomics Data Clustering}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i1.37047},
}
Figure