Differentiable Retrieval-Augmented Generation for Predicting Cellular Responses to Gene Perturbation

Andrea Giuseppe Di Francesco, Andrea Rubbi, Rishabh Jain, Pietro LioNeurIPS 2026

TL;DR

When predicting how a cell will react to having a gene turned on or off, current deep learning models treat every prediction like an isolated multiple-choice question, ignoring related experiments they have already seen. This paper introduces PT-RAG, a plug-and-play module that brings Retrieval-Augmented Generation (RAG) from language models into cell biology. Because biological "relevance" changes drastically depending on whether you are looking at a liver cell or a T-cell, PT-RAG learns how to search—filtering out noisy genetic cousins to dramatically improve how well models predict cellular behavior.

What Problem Does This Paper Address?

Understanding how cells respond to genetic tweaks (perturbations) is the bedrock of modern drug discovery. While lab tech like Perturb-seq lets us measure thousands of these tweaks, the sheer number of possible gene-and-cell combinations makes testing everything physically impossible. We need in silico (computational) models to fill in the blanks.

Existing deep learning models take a baseline "control" cell and the name of a perturbed gene, and try to generate the resulting gene expression profile from scratch. They don't explicitly look up similar perturbations from their training data at test time.

Why not just slap standard NLP-style RAG onto these models? Two reasons:

  1. No universal similarity metric: We don't have an agreed-upon way to measure if two genetic perturbations are "similar." Text descriptions of genes capture what they do on paper, not necessarily how they shock a cell.
  2. Cell-type blindness: Knocking out Gene X might do one thing in a leukemia cell and something completely different in a T-cell. Standard RAG retrieves static information based only on the query, ignoring the cellular environment.

Methods

The authors propose PT-RAG (Perturbation-aware Two-stage Retrieval-Augmented Generation), a modular adapter that attaches to existing cellular generators (tested here on a frozen STATE-style reservoir and a fully trained scGPT transformer).

Architecture comparison between standard Generation, Naïve RAG, and PT-RAG's two-stage differentiable pipeline.

Instead of one-hot encoding genes (which treats every gene as equally unrelated), the authors represent genes using GenePT—embeddings generated by feeding NCBI text descriptions of genes into GPT-3.5. PT-RAG then runs a two-stage pipeline:

  • Stage 1 (Broad Semantic Search): Standard non-differentiable retrieval. Given a query gene, it grabs the top-$K$ closest genes from the database using cosine similarity on GenePT embeddings.
  • Stage 2 (Cell-Aware Filtering): The novel magic. For each candidate, the model forms a triplet combining the control cell state, the query gene, and the candidate gene. A small neural network scores these triplets, and a Straight-Through Gumbel-Softmax trick makes differentiable, binary "include/exclude" decisions for each candidate.

Because Stage 2 is differentiable, the model learns end-to-end which retrieved genes actually help predict the final cell population, penalized slightly by a sparsity loss so it doesn't lazily select everything.

Datasets

The authors evaluate PT-RAG on two Perturb-seq single-cell datasets:

  • Replogle-Nadig dataset: Measures CRISPRi (gene knockdown) across four distinct cell types (Jurkat, K562, RPE1, HepG2) covering ~2,009 perturbations.
  • Norman et al. dataset: Measures CRISPRa (gene activation) in K562 cells across 105 single-gene perturbations, testing if the method transfers to a different biological mechanism.

Crucially, alongside standard cross-cell-type testing, the authors introduce a tough cross-perturbation generalization protocol: 60% of perturbations are completely held out during training, forcing the model to predict responses for genes never experimentally perturbed.

Visualizing the cross-perturbation split, where 60% of genes are completely unseen during training.

Key Insights and Ideas

  • Naïve RAG is worse than nothing: Simply retrieving semantically similar genes and feeding them into a generator via cross-attention actively destroys performance. Without cell-state filtering, retrieved context injects way more biological noise than signal.
  • Context is genuinely cell-specific: When looking at the exact same query gene across four different cell types, PT-RAG's Stage 2 selector only picked the same helper genes ~19% of the time (measured via Jaccard similarity). Yet, its choices remained biologically coherent—for example, consistently pulling from the same enzyme family (aminoacyl-tRNA synthetases), just picking different family members depending on the cell type's protein-synthesis quirks.
  • Geometry over rank: Retrieval primarily acts as a population-level geometric corrector. It shines brightest at getting the overall shape and distribution of the perturbed cell population right, rather than just optimizing individual gene rank correlations.

Key Results

  • Naïve RAG collapses: On cross-cell-type tasks (STATE backbone), Naïve RAG drops Pearson correlation on differentially expressed genes (DEGs) from 0.624 down to 0.396, and nearly doubles distributional error (2-Wasserstein distance, $W_2$, balloons from 646.1 to 1189.5). PT-RAG recovers and takes the lead across all metrics (0.633 Pearson, 633.7 $W_2$).
  • Plug-and-play with scGPT: Attaching PT-RAG to a fully trained scGPT model reduces reconstruction error ($\text{MSE}_{\text{PCA50}}$) by 7.1% and $W_2$ distance by 5.9% (from 578.6 down to 544.7) compared to scGPT alone, though gene-level Spearman correlation dips slightly (0.950 vs 0.937).
Table 3: Cross-cell-type generalization: Results on scGPT. Mean values across 1,635 test pertur- bations from four cell types. Significance vs. PT-RAG: † (pFDR < 0.01), †† (pFDR < 0.05), † † † (pFDR < 0.1). Bold: best. Results with standard deviations in Table 7.
  • Cold-start genes & new modalities: In the strict 60%-unseen cross-perturbation split, PT-RAG significantly beats the transferable baseline (STATE+GenePT) on reconstruction and all distributional metrics ($W_1$, $W_2$, Energy). On the Norman CRISPRa dataset, PT-RAG sweeps every single metric, boosting Pearson DEG correlation from 0.299 to 0.386.

Limitations and Future Work

  • Stage 1 bottleneck: Because the initial top-$K$ search only looks at static GenePT text embeddings, it is still cell-type agnostic. If a crucial cell-specific helper gene doesn't look similar on Wikipedia/NCBI, Stage 1 misses it, and Stage 2 can never recover it.
  • Single-gene focus & compute: Adding a retrieval-and-scoring network adds computational overhead. Furthermore, the paper only tackles single-gene tweaks; scaling context modeling to combinatorial perturbations (knocking out two or more genes at once) or drug treatments is left for future work, as is testing PT-RAG on a fully trained STATE generator rather than a frozen reservoir.

Summary updated

Abstract

Predicting transcriptional responses to genetic perturbations is fundamental to functional genomics and therapeutic discovery. Recent deep learning models have shown promise in single-cell perturbation response prediction, but they typically generate each response in isolation, without explicitly leveraging related perturbations. We introduce PT-RAG (Perturbation-aware Two-stage Retrieval-Augmented Generation), a plug-in retrieval-and-conditioning module for generative cellular perturbation response. PT-RAG augments an existing perturbation-response backbone with learned access to related perturbation contexts. The key challenge is that relevance is not fixed in this setting: functionally related genes may elicit different effects across cell types. PT-RAG addresses this with a two-stage retrieval mechanism: GenePT-based semantic retrieval first identifies K candidate perturbations, after which a differentiable Gumbel-Softmax selector adaptively selects retrieved contexts conditioned on the control cell state, the query perturbation, and each candidate perturbation. We evaluate PT-RAG on two backbones, a STATE-style generator used as a frozen random reservoir and a fully trained scGPT, across cross-cell-type and cross-perturbation generalization tasks. PT-RAG consistently improves distributional similarity and often overall predictive quality; for example, on scGPT cross-cell-type results, the 2-Wasserstein distance drops by 5.9% relative to scGPT alone. The code to reproduce our experiments is available at https://github.com/difra100/PT-RAG_NIPS.
BibTeX
@inproceedings{francesco2026differentiable,
  author = {Andrea Giuseppe Di Francesco and Andrea Rubbi and Rishabh Jain and Pietro Lio},
  title = {{Differentiable Retrieval-Augmented Generation for Predicting Cellular Responses to Gene Perturbation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=UbCFFQ9TmZ},
}
Figure