Goodfire

LeAnn M Lindsey

Phages, protein language models, and the art of not fooling yourself

Most phage “dark matter” proteins aren’t new

Bacteriophages are the most abundant lifeforms on Earth, and about half of their genes are functional mysteries. We used a protein language model to search for proteins that were genuinely new to science. Instead, we found that most had simply escaped traditional annotation.

Bacteriophages (phages) are viruses that infect bacteria. There are more of them than there are stars in the observable universe by a wide margin, and they run on some of the most fast-evolving genetic code in biology. When researchers sequence a phage genome, roughly half of the genes cannot be assigned functional annotation. Biologists call this the “dark matter” of the phage world.

But unknown does not necessarily mean novel. A protein may lack an annotation because it is genuinely new, or simply because our reference databases are incomplete. Protein language models offer a way to distinguish between those possibilities. A protein language model is a sequence language model trained on hundreds of millions of protein sequences, the way a text model is trained on sentences. It never sees a function label; it simply learns the "grammar" of proteins, allowing its internal representations to capture both evolutionary and structural relationships. That raises a natural question: can such a model identify which phage proteins are truly new?

Before asking what the model could tell us about phage dark matter, we first wanted to understand how it represents proteins internally. Which layer contains the most useful biological information, and how much of the model's representational capacity is devoted to it?

To answer this, we worked with two sizes of the same protein language model, ESM-2 (650 million and 3 billion parameters), using them as frozen feature extractors — no fine-tuning, just reading out the representations they already carry. For a balanced set of 4,274 PHROG phage proteins, we took each protein’s mean-pooled embedding at nine layers spanning the full depth of each network. At every layer we measured two things: how well the embeddings separate PHROG’s functional categories (a homology-aware nearest-neighbor classifier, scored so the model can’t win by memorizing close relatives) and how many independent directions the representation actually uses (its effective dimensionality). Comparing those two curves across depth, and across the two model sizes, is what shows where the useful biology sits and how much of the model’s capacity goes to it.

Classification accuracy and effective dimensionality peak in the same mid-network layers

The model is best at reading these proteins not at its final layer but somewhere in the middle. When we ask each internal layer to sort proteins into broad functional categories, the score climbs through the early layers, peaks around the middle of the network (a macro-F1 of 0.682 at layer 23 for the larger 3B model, and 0.675 at layer 17 for the smaller 650M one), and then slips at the very last layer (down to 0.624 for 3B). The final layer, the one you would grab by default, is not the sharpest.

Why the middle? A natural guess is about how much of its representational space the model actually uses. Each layer has thousands of dimensions available (2,560 for 3B, 1,280 for 650M), but it need not spread information across all of them. A useful summary is a layer’s effective dimensionality: roughly, how many independent directions its activations really occupy, rather than how many it could. If the mid-network sweet spot is simply where the model opens up the most directions, effective dimensionality should trace the same hump as the classification score.

We computed this directly from the layer-sweep representations, with no additional model runs. Select a model and step through the layers to compare the two curves.

Dimensions used per layer
Model
View
Measure
Bars show the effective number of dimensions each layer uses (left axis, linear, starting at zero, the way heights should be). The line is how well that layer sorts proteins into functional categories (right axis). Drag the slider or click a bar to inspect one layer.

The bars and the line move together. Across all nine layers the effective dimensionality climbs to a mid-network maximum and falls at the last layer, in step with the classification score, and the rank correlation between them is high: for the centered measure, a Spearman of 0.85 for the 3B model and 0.73 for 650M. In the 3B model the centered effective rank runs from about 14 independent directions in the first layer up to roughly 306 at the classifying peak, then collapses back to about 66 at the final layer, the same rise-and-fall the accuracy shows.

This was stronger than expected. We anticipated that effective dimensionality would account only for the final-layer dip, where a network compresses its representation into a narrow, anisotropic cone. It does capture that dip, but it also follows the early climb: effective dimensionality tracks the full accuracy curve across depth, not only its final drop.

Tracking is not explaining. At layer 5 of the 3B model the representation already occupies about 78 effective directions, yet category separability is only 0.371, well below the mid-network peak — many dimensions, weak separation. A high dimension count is necessary but not sufficient for good classification here, and effective dimensionality measures only how many directions are in use, not which of them carry the functional signal. Mid-network layers are both higher-dimensional and more separable, but the higher dimensionality is a correlate of that regime, not evidence that the extra directions are the ones the task uses.

The two views in the explorer make one more point. The centered measure removes the average protein first, and is the fair match to how the classifier actually reads the space. The uncentered measure keeps the raw activations, and there the numbers are startling: the effective rank sits near 1 in the earliest layers, meaning a single shared direction dominates everything, before relaxing mid-network and tightening again at the end. That extreme lopsidedness is real and correlates even more tightly with the accuracy curve (Spearman 0.95 for 3B, 0.92 for 650M), but it is a coarser signal, largely restating how much the representation is pointed one way rather than how many functional distinctions it can support. It is the anisotropic-collapse view; the centered view is the one to trust for “directions the model puts to work.”


Screening ~600 dark matter proteins for novelty

Those mid-network representations are what we applied to the dark matter itself. The question is whether a space that sorts known proteins well can also flag the ones with no known relative, so we took ~600 uncharacterized phage proteins and put every candidate the model raised through two further tests: a sequence search of the whole known protein universe, and a structure search on predicted folds.

The set shrinks at each step. The explorer below runs the three tests in order.

Embedding explorer
600 mystery proteins to start with
Each dot is one protein, placed by how the language model “sees” it: similar proteins sit near each other. Pale grey dots in the background are the proteins whose function is known, for context. Hover any coloured dot for its verdict.

Clicking through all three steps gives the conclusion: a set of ~600 mystery proteins yielded no convincing evidence of genuinely new protein families. Here's how we arrived at that result.

The embedding screen: a promising start

The first encouraging sign is that the model clearly understands something about these proteins, consistent with the mid-network classification scores above. We trained a simple readout, a probe, on the model’s internal representations to sort proteins into broad functional roles (does this look like a tail fibre? a piece of DNA-packaging machinery? a lysis enzyme?). On proteins whose function is known, the probe is right about two-thirds of the time, and, tellingly, it still reaches 60% accuracy on proteins that have no detectable sequence relative at all, where the standard look-it-up methods score near 16%. The model is reading structure straight from the raw sequence.

Turned loose on the 600 mysteries, the probe confidently assigns a role to 61 of them, about one in ten, and does so calibrated so that when it commits, it is right roughly nine times out of ten. That is a real, if modest, win: the model can make partial sense of the dark.

The more exciting signal came from the model’s internal map. If you lay out all the proteins by how the model represents them, most of the mysteries land near familiar territory. But a subset sits off on its own, far from everything the model has ever seen a function for. About 18% of the confident mysteries are strongly “off-manifold” like this, and they don’t scatter randomly, they clump into 31 little islands. Coherent clusters, far from everything known, exactly what you’d expect undiscovered protein families to look like. This is step 1 in the explorer: about 90 candidates that look genuinely new.

Read on its own, that pattern is consistent with undiscovered protein families. It is also consistent with the model simply finding these proteins unusual, so we tested the candidates against sequence and structure evidence.

The sequence test: most unknowns already have near-identical homologs

Distance in the model’s embedding space is a statement about the model, not about biology. The direct test of novelty is older and simpler: take each unknown protein’s amino-acid sequence and search the full set of known proteins for anything similar, rather than only the phage-focused reference the unknowns came from.

94% of the 600 mysteries have a near-identical match already in the databases, at a median of 98% sequence identity. These are not distant relatives; at that identity they are effectively the same protein under a different entry. Only 32 proteins, about 5%, have no sequence relative anywhere.

The embedding distance also barely tracks sequence novelty. The correlation between how off-manifold a protein sits and whether it actually lacks a relative is essentially zero (a coefficient of 0.03). Of the ~90 the map flagged as novel and the 32 the sequence search flagged as novel, only 7 proteins are on both lists. That is the disagreement you can see in the explorer when you flip between step 1 and step 2: the highlighted dots don’t shrink, they jump to a different part of the map. The model’s sense of “unusual” is real, but it is not the same thing as “new.”

Why these proteins were unlabelled

If 94% of these “unknown” proteins have a near-identical match in the databases, the question is why they carried no annotation. We inspected the matches.

For 82% of the unknowns with a match, the matching entry is itself labelled “uncharacterized” or “hypothetical.” The annotation was not lost; in most cases none existed. One unannotated protein matches another.

Unknown matches unknown

A perfect match to “Uncharacterized protein 214”

Protein phrog_36599 has a 100% identical relative in the databases, from a Salmonella phage, named “Uncharacterized protein 214.” The match is as close as possible and still yields no function, because the matching entry has none.

Only about 10% of the matches carry a specific, recoverable function that the phage-focused reference had missed. Two reasons account for most of those misses. Half were missed because the true relative is a cellular protein, a bacterial or other host gene outside the phage-only reference’s scope. And 55% were missed on recency: the matching entry was deposited after 2020, later than the reference was built.

A real recovered function

A “mystery” that is a textbook regulator

Protein phrog_18820 is a 100% identical match to FlhD, a flagellar transcriptional regulator from E. coli, a named, well-studied bacterial protein. It was unannotated because the phage reference does not cover bacterial genes. This is what the exercise recovers: not new biology, but functions the standard method missed on scope or timing.

The structure test: no new folds among the 32 sequence-novel proteins

That leaves the 32 proteins with no sequence relative anywhere. Sequence search can miss remote homology: two proteins can share a fold while their sequences have diverged past recognition. We therefore predicted each protein’s 3-D structure and searched those structures against structural databases, which detects relationships sequence cannot.

New folds among the 32: zero.

Six are remote structural homologs of known folds, five of them matching entries in a phage structure database that sequence search had missed. The remaining proteins do not meet the criteria for a new fold: four are too short to form a domain, and the other twenty-two fold only weakly or produce no confident structure, which is the signature of disordered peptides rather than novel domains.

Structure recovers hidden kinship

An endonuclease in disguise

Protein phrog_34398 has no sequence relative anywhere, yet it folds confidently, and its predicted shape matches a known PD-(D/E)XK endonuclease-like fold (an enzyme family that cuts DNA) with high confidence, despite sharing only about 18% of its sequence with that match. It also matches an unnamed structure in the phage database, at moderate structural similarity. Sequence search does not detect the relationship; the predicted structure does. The protein passed the first two tests without being novel.


Conclusion

Phage dark matter in this sample is mostly not novel. Across ~600 unknown proteins, each candidate set for genuine novelty failed the next test, and the three tests disagreed about which proteins to flag. What remains is a narrow result: functions that were recoverable and that the standard method missed, mostly because the true relative was a host gene or was deposited too recently.

The methodological point is that no single test was sufficient. Distance in the embedding space did not track sequence novelty. Sequence search identified relatives the embedding screen missed, and structure search identified relatives sequence missed. “The model cannot place it” is not the same as “it is new,” and separating the two required all three tests.

Limits of these conclusions

Authors

  • LeAnn M. Lindsey (Lawrence Berkeley National Laboratory)
  • Tucker Fross (Goodfire)
  • Archa Jain (Goodfire)
  • Nebojsa Omcikus (Goodfire)
  • Apollo Kaneko (Goodfire)
  • Hari Sundar (Tufts University)

Acknowledgment

This report was produced using Silico, Goodfire’s autonomous research platform, which ran the experiments and drafted the report under the authors’ direction and review.

About the author

LeAnn M. Lindsey is a computational scientist working at the intersection of artificial intelligence, biology, and high-performance computing. She earned a bachelor’s degree in Chemistry from MIT and a Ph.D. in Computer Science from the University of Utah. After postdoctoral research at the National Institutes of Health using protein and genomic language models to study bacteriophages, she joined Lawrence Berkeley National Laboratory, where she develops technologies that accelerate scientific discovery.