**A computational framework for predicting immunotherapy response from tumor transcriptomes**
A recent study introduces **COMPASS**, a computational framework that uses tumor transcriptomic data to predict whether patients with cancer will respond to immune checkpoint inhibitor (ICI) therapy. Designed to work across different cancer types and treatment settings, the approach combines self-supervised pretraining on large public datasets with multiple strategies for supervised fine-tuning and interpretation.
From a methodological standpoint, the work relies entirely on deidentified, existing datasets. No new patient data were collected and no institutional review board approval was required. The analysis pipeline includes dataset curation and standardization, model development using a transformer-based gene language model, benchmarking against established methods, and both global and personalized interpretation of results 1.
### Data curation and standardization
The authors compiled multiple public ICI cohorts spanning **16 datasets** and **seven cancer types**, categorized as large, medium, or small based on patient numbers. All RNA‑sequencing data were processed through a shared pipeline based on the **TCGA** workflow. This involved alignment to the **GRCh38/hg38** genome, gene annotation with **GENCODE v36**, normalization by effective gene length, and conversion to transcripts per million (TPM). After filtering for protein‑coding genes and removing normal tissue, pretreatment, and duplicate samples, the final dataset included **10,184 unique patient tumor samples** with consistent cross‑cohort features.
### COMPASS model architecture
COMPASS consists of three main components:
1. **A transformer‑based gene language model (GLM)** that treats genes as tokens and learns contextualized representations using a self‑supervised triplet contrastive learning objective.
2. **A hierarchical concept projector** that maps gene‑level representations into biologically interpretable concepts, such as immune cell types, pathways, and functional modules.
3. **A prediction module** that uses either a parametric MLP or a non‑parametric, prototype‑based classifier to predict immunotherapy response.
The model incorporates cancer type as a learnable token to capture pan‑cancer heterogeneity.
### Self‑supervised pretraining
COMPASS was pretrained on **33 TCGA cancer types** using balanced sampling and data augmentations, including random masking and Gaussian jitter. Training employed a margin‑based triplet loss on normalized embeddings, optimized over multiple runs with early stopping. This step yielded a 44‑dimensional concept space designed to capture tumor microenvironment features relevant to response.
### Fine‑tuning strategies
After pretraining, COMPASS was adapted to ICI response prediction using four modes:
– **COMPASS‑NFT**: non‑parametric, zero‑shot inference using cosine similarity with responder and non‑responder prototypes.
– **COMPASS‑LFT**: linear probing of the classifier only.
– **COMPASS‑PFT**: partial fine‑tuning of projection and classifier layers.
– **COMPASS‑FFT**: full fine‑tuning of all parameters.
Parametric models used standardized concept vectors and a temperature‑scaled softmax output, while the non‑parametric approach avoided additional training by relying on similarity to support set prototypes.
### Benchmarking and evaluation
COMPASS was compared against **22 established ICI response prediction methods**, including gene signatures, immune cell scores, and integrative tools. Logistic regression models were optimized using cross‑validated regularization and evaluated with accuracy, Matthews correlation coefficient (MCC), and area under the precision–recall curve (AUPRC).
Performance was assessed using:
– **Leave‑one‑cohort‑out validation**
– **Cohort‑to‑cohort transfer**
– **Leave‑one‑patient‑out validation**
Success in transfer scenarios was defined as outperforming cohort‑specific baseline accuracy derived from responder prevalence.
### Multi‑stage fine‑tuning (MSFT)
To address drug‑ or cancer‑specific prediction, the authors introduced **MSFT**, a two‑stage approach. First, COMPASS was fine‑tuned on broad ICI cohorts. Then, it was further adapted to drug‑specific or disease‑specific datasets. This strategy improved robustness, particularly when target cohorts were small. Models were evaluated in cross‑cohort settings while avoiding target‑drug contamination in pretraining data.
### Interpretability and feature importance
Using **SHAP analysis**, the authors quantified the contribution of each high‑level concept to predictions. For the COMPASS‑PFT model trained on all cohorts except the test set, concepts such as **Macrophage**, **IFNγ Pathway**, and **Cytotoxic T Cell** were positively associated with response, while **NK Cell**, **Exhausted T Cell**, and **TGFβ Pathway** were linked to non‑response.
### Survival and comparison with existing biomarkers
COMPASS predictions were also linked to overall survival in the **IMvigor210** cohort using Cox proportional hazards models. Risk scores derived from concept features or response probabilities were used to stratify patients. In addition, COMPASS performance was compared with established biomarkers such as TMB, PD‑L1, and immune phenotypes.
### Personalized response maps
The framework supports **personalized response maps** that trace how patient‑specific gene expression flows through COMPASS layers to produce response probabilities. These maps highlight influential genes, granular concepts, and high‑level concepts, offering a transparent view of the model’s biological reasoning.
Overall, the study demonstrates that a self‑supervised, concept‑driven model can effectively predict immunotherapy response across diverse cancer types and treatment contexts, while providing interpretable insights into the underlying tumor biology.
—
**Reference**
1. *Nature Portfolio Reporting Summary and Source Data* — Original study details, datasets, and methods are available in the linked Nature Portfolio materials associated with the article.



