CAPHARD: an AI that learns biology it was never taught, and reads the dark matter of genomes

CAPHARD: an AI that learns biology it was never taught, and reads the dark matter of genomes

CAPHARD: an AI that learns biology it was never taught, and reads the dark matter of genomes

Trained on one simple phenotype, our model came back knowing where the microbial world hides its next medicines, opening a path to potential major discoveries.

Phages and bacterial strains in a matrix, each with its family tree, with the model’s top picks highlighted

Most of the genes in the microbial world have no known function. They are the dark matter of biology: sequenced, catalogued, and unreadable. Hidden in them are the molecules we have always mined bacteria and their viruses for, from restriction enzymes to CRISPR, and the next generation of antibacterials and antivirals. Sequencing these genomes is not the hard part anymore. Knowing what their genes do is.

We trained CAPHARD, our patented genome language model, on one of the simplest facts in biology: does this phage infect this bacterium, yes or no. It reads the complete genomes of both, and that single yes-or-no answer, across more than 300,000 pairs, is the only information we ever gave. No gene functions, no protein structures, no clues about what actually drives infection.

It learned the mechanism anyway. On its own, the model learned it had to focus on the proteins that drive infections. Among known determinants of phage-host interaction, it pointed us at a protein no database has ever named, predicted that deleting it would stop infection on one bacterial strain and spare another, and targeted deletion confirmed it.

This brings phage-host infection prediction and the investigation of unknown proteins together: two problems, one model. The same model that helps prioritize phages for a bacterial target, because it could not predict infection without learning which genes drive it, also surfaces those genes directly, including the ones no database can name.

The phage-host arms race is a gold mine of new, exciting biology that researchers around the world have explored intensively. This gold mine is far from exhausted, and the CAPHARD family of models points to a new path for exploring uncharted areas, where discoveries could once again revolutionize medicine and molecular tools.

At Phagos, we took this idea to the bench to test it in a focused case study. Here is what we found.

Phages are the ideal starting point for our exploration

A phage infects one bacterial strain and fails against the next. That specificity is written in the genomes of both, including in genes whose functions remain unknown, and it makes phage-host infection one of the few places in biology where a hard question has a clean answer: does this phage infect this bacterium? It is cheap to measure and sharply host-specific; a phage that clears one strain often does nothing to the next, so every measurement carries real signal. Phages are the most abundant and diverse biological entities on Earth [1], and capturing data on their infectivity can be done at a scale few other observable biological interactions can match.

That diversity is what makes the rest possible. A raw interaction phenotype, measured across enough pairs, is exactly the signal a model can use to learn the machinery of infection without being told what it is, and to map the genes that drive it, including the unannotated ones. Beyond this, phages matter in their own right, as they constitute one of our last lines of defense against emerging antimicrobial resistance [2-4].

Modeling phage-host interactions with CAPHARD

CAPHARD pretraining occurs on a large and diverse corpus of genomic sequences, separately for bacteria and phages. This step allows the model to develop knowledge over these biological entities on their own. CAPHARD extends to whole phage and bacterial genomes the language-modeling approach now reshaping biology, from genome models like Evo [5,6] and protein models like ESM [7,8], built on the transformer attention mechanism [9]; generative versions have even begun to design phages from scratch [10].

Learning about phage-host compatibility occurs in a second phase, when the model is trained to predict infectivity labels. We use over 300,000 labelled interaction records across our internal assays and external datasets (Figure 1), spanning 25 bacterial species.

Treemap of the phage-host interaction records behind CAPHARD by host group: E. coli is the largest tile, followed by Vibrio, Other, Klebsiella, Pseudomonas and Salmonella; a darker inset in each tile shows the share of positive records.

Figure 1. The interactions behind CAPHARD
Each tile is a host taxon in the training set, sized by the number of phage-host interaction records measured against it, positives (actual infections) and negatives (non-interacting phage-bacterium pairs) together. The darker inset inside each tile is the fraction of those records that are positive.

The design is deliberately blind: no species identifiers, no functional annotations. Infections are the minority class, about 22% of our proprietary pairs versus roughly 3% in public data. We benchmark CAPHARD against specialized machine-learning models that use protein-derived features and species-specific information [11-13]. We ask whether CAPHARD could improve as training data grow and transfer knowledge across bacterial species from genomic data only, without hand-engineered features describing the interaction.

We evaluated predictions in two settings: held-out E. coli phage-host pairs, and held-out E. coli strains excluded from interaction training. The first tests unseen pairs; the second mirrors the practical case of finding a phage in an existing collection for a new strain. We then pushed the model’s limit to a species CAPHARD has barely seen: Pseudomonas is about 0.145% of training, a single small external collection of 23 strains and 19 phages [13], and the test pairs share no interaction with the training data [14]. Even there, CAPHARD stays above chance, while GenoPHI, trained on the same external data, does not beat random guessing. A large, diverse training set is what lets one model generalize to a species it was never built for with just a handful of examples; the feature-engineered models cannot. Results are in Table 1.

Table 1. CAPHARD benchmarked against specialized models.
Predictive performance on three tasks, as normalized average precision (APnorm, 0.5 corresponds to random guessing) and area under the ROC curve (AUROC); higher is better, and 0.5 AUROC is random. Held-out E. coli pairs test unseen phage-host combinations. Held-out E. coli strains test transfer to strains absent from interaction training. The Pseudomonas task tests a species that is about 0.145% of training (the Arkin collection [13]: 23 strains, 19 phages), with test pairs distinct from any seen in training [14]. GenoPHI [13] and Gaborieau et al. [12] use protein-derived features and species-specific information, while CAPHARD uses genomic sequence alone. Gaborieau et al. does not support the cross-genus Pseudomonas task.

Model

E. coli held-out pairs
(APnorm/AUROC)

E. coli held-out strains
(APnorm/AUROC)

Pseudomonas
(APnorm/AUROC)

CAPHARD

0.89/0.90

0.80/0.87

0.57/0.56

GenoPHI

0.86/0.87

0.80/0.80

0.49/0.49

Gaborieau et al.

0.84/0.86

0.81/0.84

Not supported

Beyond interactions: CAPHARD learns the underlying biology

CAPHARD was built to predict infection. What makes it matter is what it had to learn in order to.

Trained on nothing but infection outcomes, the model's attention settles on the proteins that actually carry out infection. Across 708 phages, the proteins it attends to most are enriched for tails, baseplates, head and packaging machinery, and anti-defense proteins [15], the exact parts that recognize a host, inject DNA, and evade bacterial immunity. In the E. coli cohort, 13% of the most-attended proteins are tails and 53% carry other annotated functions, while unannotated proteins fall from 58% of the genome to 33% of that set. These categories are enriched several-fold over their genome-wide background (Figure 2).

Ribbon chart comparing the average protein composition of phage genomes with the proteins CAPHARD attends to most: tail 2.1% to 13.9% (+662%), baseplate 2.4% to 7.8% (+325%), other annotated 34% to 53% (+156%), unannotated 58% to 33% (-57%).

Figure 2. What CAPHARD attends to
Left, the average composition of phage genomes by protein category; right, the composition of the proteins CAPHARD attends to most in the E. coli cohort, each column normalized to 100% and linked by ribbons. The center value is the attention enrichment, the attended share relative to the genome share (+ over-represented, - under-represented). Tail and baseplate proteins, the machinery of host recognition, are a few percent of a genome but 14% and 8% of the attended set, while unannotated proteins fall from 58% of genomes to 33% of the attended set yet remain its largest block. The structural, packaging and anti-defense classes are enriched at binomial p-values below 1e-20.

Having withheld protein functional information, CAPHARD does something current annotation tools cannot. A full third of the most attended proteins carry no functional annotation at all. They are not noise: they sit at sharp, reproducible attention peaks, right next to the annotated machinery. The model is pointing to a mechanistic structure that homology and structure search still miss, and it hands us a ranked shortlist of where to look.

Per-gene attention along the genome of phage E021: most genes draw almost none; peaks sit on an Ig-domain protein, an ADP-ribosyltransferase toxin, an exonuclease and CDS_081, a gene of unknown function with the highest peak.

Figure 3. Attention profile along phage E021
CAPHARD’s per-gene attention across the E021 genome, one value per protein-coding gene. The signal is sparse: most genes draw almost none, and attention concentrates on a handful (purple). One of the highest peaks, CDS_081 (blue), carries no functional annotation in any database, flagged by the model alongside annotated peaks such as an Ig-domain protein, an ADP-ribosyltransferase toxin, and an exonuclease. CDS_081 is the protein taken forward for in-silico knockout and experimental validation.

From attention maps to verifiable predictions

An attention map alone gives us a hypothesis to investigate, not a proof. To turn it into a prediction we run an in-silico knockout, by simulating gene deletions and predict how each change would affect infection across bacterial strains. The output is a phagogram: predicted infectivity for the wild type and for every single-gene knockout, across every strain.

For our phage E021 the map flagged CDS_081, a hypothetical protein of unknown function, sitting at one of the highest attention peaks, next to annotated genes like an ADP-ribosyltransferase toxin and an exonuclease. The in-silico knockout of CDS_081 made a sharp, falsifiable call: infection should collapse on host PH2503 and hold on others. The predicted infection score on PH2503 fell from 0.874 for the wild type to 0.077 for the knockout. Deleting the annotated toxin gene beside it, CDS_054, barely moved the score, 0.874 to 0.859. The model was pointing at one unnamed protein, on one specific set of hosts (see figure 4).

POC at the bench: the experiment, and the rescue

We built the knockout mutant by Gibson assembly [16]. Then we tested it. Against PH2503, wild-type E021 suppresses bacterial growth across lysate dilutions. The CDS_081 knockout does not. Infection is lost, exactly where the model said it would be. On control strains the knockout still infects, so the effect is host-specific, not a dead phage.

We put CDS_081 back on a plasmid and supplied it to the knockout phage in trans. Suppression of PH2503 returned, and it tracked the inducer dose. Delete the gene and infection fails. Add it back and infection recovers. That is a causal loop closed on a protein no database can name, nominated by an attention map and nothing else.

Phage E021 against hosts PH2503 and PH3734. Left, CAPHARD predicted scores: on PH2503, 0.874 for the wild type and 0.077 for the CDS_081 knockout; on PH3734, 0.57 and 0.63. Right, in vitro outcomes: on PH2503 the knockout loses infection and complementation rescues it; on PH3734 infection holds.

Figure 4. A CAPHARD attention-nominated protein, CDS_081, is a host-specific infection determinant: model prediction and in vitro validation agree.
Left, CAPHARD-predicted infectivity scores (0 no infection, red; 1 full infection, green) for phage E021 against hosts PH2503 and PH3734, for the wild-type phage and a CDS_081 knockout; the complementation column carries no score because restoring the gene returns the genome to wild-type, and complementation was not run for PH3734. Right, the matching in vitro outcome, scored qualitatively from growth and complementation assays as infection (host growth inhibited), no infection (host grows), or rescued. For PH2503, deleting CDS_081 abolishes infection and restoring it recovers infection, a causal and strain-specific role; for PH3734 the same deletion leaves infection intact.

What CAPHARD can't do (yet!)

We are deliberately precise about scope. The decisive result is one gene in one phage: deletion and complementation establish that CDS_081 is required for infection of specific hosts, but they do not tell us what the protein does, and one case does not prove that every attention peak marks a causal gene [17]. Not every per-strain prediction in the phagogram was tested, and for some phages the model predicts no knockout effect at all, which is biologically unrealistic, so there are host-range determinants it has not learned from the data we have. CAPHARD cannot yet be pointed at an arbitrary phage and strain and told to switch off their interaction on demand. Calibration, failure modes, the reproducibility of the attention signal, and how far the predictions generalize are what the upcoming paper characterizes.

It is already in your hands

CAPHARD is live on Hugging Face right now. You can query a bacterial genome and get a ranked list of phages likely to infect it, or score the phages in your own collection. It takes FASTA or FFN files and returns an infectivity score per pair. If you are facing a strain with no phage at hand, it ranks that strain against a large reference collection of phages, so you know quickly whether a candidate is likely to exist, and who holds it. The public version returns infectivity predictions only; the attention maps and candidate genes shown above are part of our research pipeline, not the app.

And it is private by design. The genomes you query are not sent to us, stored, or reused. Nothing leaves your hands unless you choose to share it.

CAPHARD prioritizes, the lab confirms. The predictions cut down how many pairs you have to test. They do not replace the bench.

What's next

The Hugging Face release is the first version, and the scientific paper is close behind. It lays out the architecture, the benchmarks, and the full account of how a model trained on nothing but infection outcomes came to localize a causal gene that no annotation could name.

This is bigger than phage prediction. The loop we just ran, attend, delete in silico, predict the host-specific effect, confirm at the bench, is not specific to this gene, or even to phages. It turns a measurable phenotype into a causal hypothesis about the genes behind it.

Bacterial and phage genomes are full of genes nothing can annotate yet, the dark matter of the microbial world, and that is where the useful molecules hide. The antimicrobials bacteria use against each other, the antivirals and anti-phage defenses they deploy, and the molecular tools that came out of exactly these systems, from restriction enzymes to CRISPR [18], were all found there, slowly and by hand. CAPHARD searches that space directly: a model that learns causal function from phenotype alone, and points straight at the unannotated genes that matter, is a search engine for genomic dark matter, for the genomes we have sequenced but cannot yet interpret.

The direction is clear: from predicting which phage infects which strain to systematically mining bacterial and viral genomes for the next generation of antibacterials, antivirals, and molecular tools.

References

  1. Mushegian, A. R. Are there 10^31 virus particles on Earth, or more, or fewer? J. Bacteriol. 202, e00052-20 (2020).

  2. GBD 2021 Antimicrobial Resistance Collaborators. Global burden of bacterial antimicrobial resistance 1990–2021... Lancet 404, 1199–1226 (2024).

  3. Dedrick, R. M. et al. Engineered bacteriophages for treatment of a patient with a disseminated drug-resistant Mycobacterium abscessus. Nat. Med. 25, 730–733 (2019).

  4. Kim, P. et al. Safety, pharmacokinetics and pharmacodynamics of LBP-EC01... (ELIMINATE). Lancet Infect. Dis. (2024). PMID 39134085.

  5. Nguyen, E. et al. Sequence modeling and design from molecular to genome scale with Evo. Science 386, eado9336 (2024).

  6. Brixi, G. et al. Genome modeling and design across all domains of life with Evo 2. bioRxiv (2025).

  7. Lin, Z. et al. Evolutionary-scale prediction of atomic-level protein structure with a language model. Science 379, 1123–1130 (2023).

  8. Hayes, T. et al. Simulating 500 million years of evolution with a language model. Science 387 (2025).

  9. Vaswani, A. et al. Attention is all you need. Advances in Neural Information Processing Systems 30 (2017).

  10. King, S. H. et al. Generative design of bacteriophages with genome language models. Science 393, eaec2657 (2026).

  11. Boeckaerts, D. et al. Prediction of Klebsiella phage-host specificity at the strain level. Nat. Commun. 15, 4355 (2024).

  12. Gaborieau, B. et al. Prediction of strain-level phage-host interactions across the Escherichia genus using only genomic information. Nat. Microbiol. 9, 2847–2861 (2024).

  13. Noonan, A. J. C. et al. Phylogeny-agnostic strain-level prediction of phage-host interactions from genomes using machine learning. Nat. Microbiol. (2026).

  14. Piya, D. et al. Comprehensive interaction profiling and machine learning prediction of bacteriophage infectivity across clinically diverse Pseudomonas aeruginosa. bioRxiv 2026.05.19.726084.

  15. Bernheim, A. & Sorek, R. The pan-immune system of bacteria: antiviral defence as a community resource. Nat. Rev. Microbiol. 18, 113–119 (2020).

  16. Gibson, D. G. et al. Enzymatic assembly of DNA molecules up to several hundred kilobases. Nat. Methods 6, 343–345 (2009).

  17. Jain, S. & Wallace, B. C. Attention is not Explanation. NAACL-HLT 2019, 3543–3556 (2019).

  18. Barrangou, R. et al. CRISPR provides acquired resistance against viruses in prokaryotes. Science 315, 1709–1712 (2007).