arXiv:2609.08165q-bio.GNSep 2026

Manuscript Offprint

arXiv:2609.08165

A Transformer-Based Delta Expression Encoder for Psilocybin Transcriptional Response: Architecture, Representations, and Biological Validation

Sai Jayakumar

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Understanding why individuals respond differently to psilocybin requires modeling the drug's transcriptional perturbation signature at the cell-type level. I present a Transformer-based delta expression encoder that learns to classify differential gene expression (DEG) status — upregulated, downregulated, or neutral — from single-nucleus RNA-sequencing data, without supervision from pathway annotations or prior biological knowledge. A fourth label, BASELINE, exists in the architecture to mark the reference timepoint structurally but is excluded from the training loss and is not a class the model is evaluated on predicting. The model is trained on pseudobulk profiles from 623 examples spanning 18 cell types, 2 drug conditions, and 6 timepoints derived from the Liao et al. 2025 dataset, and achieves 69.4% weighted classification accuracy at the final training checkpoint.

Three principal findings are reported, alongside one direct test of a published hypothesis that returned a result inconsistent with that hypothesis. First, per-cell-type classification accuracy ranges from 28.3% (L2/3 IT, a primary HTR2A-expressing psilocybin target) to 99.6% (endothelial cells, a non-neuronal population), a qualitative pattern consistent with known psilocybin response biology. Second, psilocybin-induced transcriptional downregulation is significantly more stereotyped across individuals than upregulation (Mann-Whitney U=18615.0, p<0.0001 pooled across animals), a novel finding consistent across excitatory subtypes with a cortical depth gradient (ratio range 1.07×−1.61×). Third, attention-guided gene co-regulation analysis recovers drug-specific modules without pathway supervision: psilocybin-dominant modules are enriched for serotonin receptor and alkaloid response pathways, while ketamine-dominant modules cluster around NMDA receptor and structural plasticity pathways. Separately, a direct test of whether baseline HTR2A expression predicts drug-response separability across cell types found a significant negative correlation (Spearman ρ = −0.7088, p = 0.0021), the opposite of what a simple HTR2A-gating account would predict; this result and its interpretation are discussed explicitly rather than omitted.

Linear probes on frozen embeddings confirm that drug identity (1.000 ± 0.000), cell type (1.000 ± 0.000), and timepoint (0.974 ± 0.016) are perfectly or near-perfectly linearly decodable, while animal identity is at chance (0.100 ± 0.038) — confirming the model encodes pharmacological structure while discarding individual variation. Two architectural limitations are characterized and explained mechanically: the model does not recover the biphasic temporal structure of psilocybin's transcriptional response, attributable to the between-subjects design of the training data; and its attention priorities show no statistically detectable enrichment for genes with the largest classical DEG fold-changes (hypergeometric test, 0/30 overlap at both 1h and 72h, p=1.0), indicating attention identifies a different set of genes than significance-based differential expression. Together, these results establish a validated, honestly characterized foundation for the delta expression encoder component of a planned multimodal framework for psilocybin therapeutic response prediction.

Keywords: Transformer, psilocybin, single-nucleus RNA-seq, differential gene expression, delta expression, drug response prediction, attention mechanism, precision psychiatry

Introduction

Psilocybin has emerged as a promising therapeutic for major depressive disorder, treatment-resistant depression, and related conditions [Davis 2021; Carhart-Harris 2021; Goodwin 2022; Raison 2023]. Clinical response is heterogeneous, and the biological basis of this variability remains poorly understood [Viljoen 2025]. Bridging the gap between molecular mechanism and individual therapeutic outcome requires models that represent the drug's transcriptional perturbation signature at cell-type resolution, rather than bulk tissue averages.

Genes in a cell rarely express in isolation. Their expression depends heavily on context — on the state of other genes, on cell type, and on time since stimulus — and this dependence is long-range and variable, structurally similar to how language depends on context. Transformer architectures, which have performed well in the language domain through the self-attention mechanism, are a natural candidate for modeling this kind of dependency: each gene's representation can be enriched by attending to every other gene and timepoint simultaneously, rather than relying on a fixed-weight function applied uniformly regardless of context.

Liao et al. 2025 performed single-nucleus RNA sequencing of mouse medial frontal cortex at five timepoints after psilocybin or ketamine administration and identified two temporal phases of response: an acute wave at 1–2 hours involving immediate early genes and synaptic plasticity programs, and a late-phase wave at 72 hours associated with structural plasticity consolidation [Liao 2025]. The response is strongest in excitatory pyramidal neurons expressing the 5-HT₂A receptor (HTR2A), and Shao et al. 2025 demonstrated that these specific cell types are necessary for psilocybin's long-term behavioral effects in mice [Shao 2025]. This paper takes the relationship between HTR2A expression and psilocybin response as a hypothesis to test against the model's learned representations, not an assumption to validate — Results section 3 reports a direct test of this relationship, including a result that runs counter to a simple reading of the HTR2A-gating account.

I present the delta expression encoder, a 4-layer Transformer trained to classify DEG status per gene per timepoint from pseudobulk expression profiles. Three inductive biases motivate the architecture: differential gene expression depends on baseline expression and genotype; it depends on the state of other genes; and it depends on time. A central design challenge is that gene expression can only be measured by sacrificing the animal, so any individual animal contributes a real measurement at exactly one timepoint. The central architectural innovation addressing this is a sentinel-value strategy for unmeasured timepoints, combined with a two-tier training curriculum distinguishing individual-animal examples from population-mean examples. The model is trained and evaluated on the Liao et al. 2025 dataset [Liao 2025].

This paper makes the following contributions:

  • A Transformer architecture for encoding psilocybin transcriptional perturbation signatures from pseudobulk snRNA-seq data, with documented design decisions grounded in explicit inductive biases.

  • A qualitative cell-type accuracy gradient consistent with the known psilocybin response hierarchy, reported alongside a direct quantitative test of HTR2A-gating that returns a result inconsistent with simple HTR2A-dose dependence.

  • A novel finding that psilocybin-induced transcriptional downregulation is more stereotyped across individuals than upregulation, with a cortical depth gradient across excitatory subtypes.

  • Characterization of drug-specific gene co-regulation modules recovered through attention analysis, including serotonin receptor and NMDA receptor pathway segregation.

  • A formal hypergeometric test establishing that attention priorities show no statistically detectable overlap with classical DEG significance, with mechanistic discussion of what this does and does not imply.

  • Honest documentation of architectural limitations — temporal structure failure and the attention-DEG divergence — with mechanistic explanations grounded in the training data design.

The delta expression encoder is designed as one module of a planned larger framework for psilocybin therapeutic response prediction, motivated by the observation that the causal path from drug administration to subjective experience passes through several distinct biological layers — pharmacokinetic exposure, receptor-level neuronal response, the resulting transcriptional change addressed here, and downstream biological and neural processes. This paper addresses the transcriptional layer in isolation; integration with the other layers is left to future work.