The Machine That Learned to Read the Immune System
How Harvard’s COMPASS model turns tumor gene activity into a map of cancer immunotherapy response — and why the hardest part of precision oncology may be knowing when the miracle will not arrive.
There is a brutal arithmetic hidden inside the triumph of cancer immunotherapy.
Immune checkpoint inhibitors changed oncology because they proved something once treated as almost mythic: under the right conditions, the human immune system can be persuaded to recognize a tumor, reawaken, and attack. Drugs aimed at PD-1, PD-L1, CTLA-4, and related checkpoints have turned some formerly grim cancers into long remissions. In melanoma, lung cancer, kidney cancer, bladder cancer, and other tumors, they have produced the kind of survival curves that oncologists remember for the rest of their careers.
But the arithmetic is still brutal because most patients do not respond.
A patient may sit in an infusion chair receiving a therapy built around one of the most elegant ideas in modern medicine — remove the molecular brakes from T cells, and let the immune system do what it was built to do — only to learn months later that the tumor kept growing. In the meantime, the patient may have absorbed immune-related toxicity, financial cost, lost time, and the psychological weight of hope spent in the wrong direction.
This is the central problem Harvard Medical School researcher Marinka Zitnik named in unusually plain language when describing a new artificial intelligence model from her group and collaborators: “Understanding who will respond to ICIs is not a minor knowledge gap. It is one of the central unsolved problems in oncology.”
The model is called COMPASS. Published in Nature Medicine, it is designed to predict which patients are likely to benefit from immune checkpoint inhibitors by analyzing gene activity inside the tumor. On paper, the headline number is striking: trained on 10,184 tumors across 33 cancer types and evaluated across 16 independent clinical cohorts, COMPASS outperformed 22 existing methods, improving average accuracy by 8.5 percent and area under the precision-recall curve by 15.7 percent.
But the more interesting claim is not simply that COMPASS scores better. It is that COMPASS tries to explain itself in the biological language oncologists already use: immune cell states, tumor-microenvironment interactions, and signaling pathways. Instead of treating a tumor transcriptome as a black box of gene-expression numbers, it routes the information through 44 human-readable immune concepts.
That design choice matters because oncology is not short on algorithms. It is short on trustworthy ways to know whether an algorithm is seeing a real biological signal or merely winning a benchmark.
The promise and the miss
Checkpoint inhibitors work by blocking signals that normally restrain immune responses. Those restraints are essential in ordinary life; without them, immune cells would attack healthy tissue with too much force. Cancer exploits the same machinery. A tumor expressing PD-L1, for example, can bind PD-1 on T cells and send a molecular “stand down” signal. Anti-PD-1 or anti-PD-L1 drugs interrupt that exchange, giving T cells another chance to kill cancer cells.
That mechanism is beautiful. The clinical reality is messier.
A tumor can look immunologically visible and still resist treatment. Another can appear cold and yet respond. PD-L1 staining can help in some settings and fail in others. Tumor mutational burden, a measure of how many mutations a tumor carries, can hint at how many abnormal targets the immune system might see, but it does not reliably answer the question across cancer types and drugs. Transcriptomic signatures — gene-expression patterns linked to immune activity — can perform well in one study and poorly in another.
The problem is not that any one biomarker is useless. The problem is that immunotherapy response is not a single switch. It is an ecosystem event.
The tumor must present recognizable antigens. T cells must enter the tumor. Antigen-presenting cells must do their work. Interferon signaling may need to be intact. Suppressive myeloid cells, fibroblasts, vasculature, TGF-beta signaling, and exhausted T-cell programs can all tilt the outcome. A patient’s cancer is not merely a mass of malignant cells; it is a contested neighborhood where immune cells, stromal cells, blood vessels, cytokines, and tumor clones are negotiating, sabotaging, and adapting in real time.
COMPASS enters this complexity through RNA sequencing. Specifically, it uses bulk tumor transcriptomes — measurements of which genes are active and how strongly — as its raw material. The model was pretrained on The Cancer Genome Atlas, the landmark National Cancer Institute and National Human Genome Research Institute program that molecularly characterized more than 20,000 primary cancer and matched normal samples across 33 cancer types.
From that resource, the COMPASS team used 10,184 tumor transcriptomes to teach the model a general representation of tumor-immune biology before fine-tuning it on immunotherapy response data. The model then learned from 1,133 patients across 16 clinical cohorts spanning seven cancers and multiple immune checkpoint inhibitor regimens, including anti-PD-1, anti-PD-L1, anti-CTLA-4, and combinations.
This is where the engineering gets quietly important.
Rather than train a model separately for every small cohort, COMPASS uses transfer learning: learn broad tumor-immune structure from large pan-cancer data, then adapt to smaller clinical cohorts where treatment outcomes are known. That is the pragmatic reality of oncology AI. The datasets with the richest clinical outcomes are often too small to train powerful models from scratch. The largest molecular datasets often lack the exact treatment-response labels one wants. COMPASS tries to bridge that gap.
The bottleneck is the point
The phrase “concept bottleneck transformer” sounds like something designed to repel almost everyone outside computational oncology. It is actually the heart of the story.
Featured Partner
Invest in the Infrastructure Behind Modern Medicine
As healthcare expands beyond hospital walls, the buildings and campuses supporting that shift are generating compelling returns for investors who move early. The Healthcare Real Estate Fund offers qualified investors direct access to a curated portfolio of medical office, outpatient, and specialty care facilities.
Learn More →A conventional black-box model might ingest thousands of genes and produce a probability: responder or non-responder. COMPASS forces the model through an intermediate layer of biological concepts before it makes that prediction. Those concepts are derived from immune and stromal gene signatures and grouped into categories such as B-cell programs, T and natural-killer-cell programs, myeloid lineage activity, mesenchymal lineage activity, and pathway/function signals.
In other words, the model is not allowed to jump directly from raw gene expression to answer. It has to pass through a map.
That map includes the tumor immune microenvironment — the ecology of immune and support cells around and within the tumor. It also includes signals such as interferon-gamma activity, TGF-beta-mediated suppression, vascular or endothelial exclusion, B-cell activity, and T-cell dysfunction. The model’s personalized response maps can then connect gene activity to immune concepts and immune concepts to predicted outcomes.
This is not interpretability in the magical sense. It does not mean the model has clinical wisdom. It does not mean the explanation is automatically correct. But it gives researchers something to interrogate. If COMPASS predicts non-response in a tumor that otherwise looks inflamed, the model can point toward a possible resistance program: TGF-beta signaling, endothelial exclusion, CD4-positive T-cell dysfunction, or B-cell deficiency.
That is a more useful failure mode than a silent score.
The team reports that COMPASS generalized across cancer types, treatments, and checkpoint targets. In leave-one-cohort-out testing, it beat 22 baseline approaches. It also stratified survival in the IMvigor210 atezolizumab bladder cancer cohort: COMPASS-predicted responders had substantially longer overall survival, with a reported hazard ratio of 4.7 and p value below 0.0001.
The survival result is attention-grabbing, but it should be read carefully. The authors themselves note a key limitation: because the available cohorts lacked non-ICI comparator arms, COMPASS may be capturing a mixture of predictive and prognostic signals. In plain English, the model may be identifying patients more likely to benefit specifically from immunotherapy, patients with generally better prognosis, or some blend of both. Separating those possibilities requires better-designed prospective studies.
That caveat does not weaken the work. It makes it more credible.
What a doctor needs is not a leaderboard
The history of medical AI is littered with models that did well in retrospective data and then stumbled at the edge of the clinic. The reasons are familiar: different patient populations, different sequencing platforms, missing clinical variables, shifting treatment standards, biased training data, brittle endpoints, and workflows that cannot absorb one more mysterious score.
COMPASS has several of those risks.
It relies on bulk RNA-seq, which gives a useful average signal but lacks spatial resolution. Tumors are not smoothies; where immune cells sit matters. A T cell trapped outside the tumor margin is different from a T cell in direct contact with malignant cells. Rare immune cell populations can be drowned out in bulk measurements. Single-cell and spatial transcriptomics may eventually sharpen this kind of model, but those technologies are not yet routine everywhere.
The model also could not harmonize important clinical covariates such as age, sex, and tumor stage across all cohorts because the source datasets were incompletely and inconsistently annotated. That matters because treatment response lives at the intersection of tumor biology and patient biology. A model that knows the tumor transcriptome but not enough about the patient is powerful, but not complete.
And, most importantly, COMPASS has not yet proven that it changes real-world decisions in a way that improves outcomes. The HMS coverage is appropriately conditional: if validated in future clinical trials, the tool could support better precision medicine, more efficient trial enrollment, and new drug-target discovery.
That “if” is the whole bridge from research to medicine.
Still, the work points toward a different model of cancer AI than the one that dominates public imagination. The future may not be a single omniscient algorithm that tells an oncologist what to do. It may be a set of biologically constrained instruments — models that read pathology slides, genomic alterations, transcriptomic immune states, circulating tumor DNA, prior therapies, and clinical context, then explain what they are seeing in ways clinicians can challenge.
COMPASS is compelling because it belongs to that second category. It is not merely trying to be accurate. It is trying to be legible.
The deeper story: response is a state, not a label
A responder/non-responder label makes sense for a trial endpoint. It is a blunt instrument for biology.
A tumor that shrinks after anti-PD-1 therapy did not respond because the label “responder” was hiding inside its genome. It responded because a chain of events became possible: antigen recognition, immune infiltration, cytotoxic activity, survival of effector cells, failure of suppressive barriers, and enough tumor vulnerability to make the immune attack matter.
A tumor that does not respond may fail anywhere along that chain.
This is where COMPASS becomes more than a prediction model. Its most interesting use may be as a biological searchlight. The model’s personalized immune maps suggest different routes to resistance even among tumors that look superficially similar. An immune-inflamed tumor can still fail because the immune response is blocked, excluded, exhausted, or incomplete. Two patients may both be “non-responders,” but one may be dominated by TGF-beta immunosuppression while another may lack B-cell support or show endothelial barriers that keep immune cells from reaching the malignant core.
That distinction matters for drug development. If non-response is not one thing, then the next generation of immunotherapy combinations should not treat it as one thing. Better maps could help researchers design trials that enroll patients whose tumors show the resistance program a new combination is meant to overcome.
This is one of the least flashy but most important implications of the paper. The authors explicitly frame COMPASS as useful for indication selection and patient stratification in early-phase clinical trials. That may sound technical. It is also where many cancer drugs live or die.
A trial that enrolls the wrong biological population can make a useful therapy look useless. A trial that enriches for the right resistance pattern can reveal a signal that would otherwise disappear in noise.
A compass is not the destination
The name COMPASS is almost too neat. It implies direction, not arrival.
That is the right metaphor. This model does not settle the problem of immunotherapy selection. It gives the field a more sophisticated instrument for asking the question. It suggests that pan-cancer transcriptomic learning can travel across tumor types and checkpoint drugs better than many narrower approaches. It suggests that interpretability can be designed into the architecture rather than patched on after the fact. It suggests that the immune system’s messy, multidimensional conversation with cancer can be compressed into concepts that still retain clinical meaning.
But a compass can point north and still leave a person standing in a storm.
For patients, the next test is not whether COMPASS wins another retrospective benchmark. It is whether the model can be validated prospectively, across real clinical settings, with standardized assays, diverse patient populations, and treatment decisions that are actually changed by its output. It must prove not only that it predicts, but that acting on its prediction helps.
If it does, the implications are large.
An oncologist could one day look at a tumor’s gene-expression profile before treatment and see more than a probability. They could see a map of the tumor’s immune landscape: where the attack is strong, where it is blocked, where the microenvironment is hostile, where a combination strategy might make sense, and where immunotherapy may be the wrong gamble.
For the patient in the infusion chair, that would mean something profoundly practical. Not AI as spectacle. Not AI as a press release. AI as a better answer to the question that matters before treatment begins:
Is this likely to help me?
The honest answer today is still often, “We hope so.”
COMPASS is an attempt to replace some of that hope with measurement.
Source notes
- Shen W, Moon I, Nguyen TH, Li MM, Huang Y, Nair N, Marbach D, Zitnik M. “Generalizable AI predicts immunotherapy outcomes across cancers and treatments.” Nature Medicine. Published July 3, 2026. DOI page: https://www.nature.com/articles/s41591-026-04502-7
- PubMed record: https://pubmed.ncbi.nlm.nih.gov/40385399
- Harvard Medical School coverage: https://hms.harvard.edu/news/ai-tool-improves-prediction-who-will-respond-cancer-immunotherapy-drugs
- COMPASS project/code: https://github.com/mims-harvard/COMPASS and https://www.immuno-compass.com/
- NCI checkpoint inhibitor background: https://www.cancer.gov/about-cancer/treatment/types/immunotherapy/checkpoint-inhibitors
- NCI TCGA background: https://www.cancer.gov/ccg/research/genome-sequencing/tcga
