Screening of Biosecurity Features in Metagenomic Data with Evo 2 Probes
By Jeremy Guntoro, Alexander Dack, Dylan Danno, Michaela Jančovičová, Križan Jurinović, Vanessa Smilansky
"Linear/attention probes on frozen Evo 2 embeddings detect AMR (ROC-AUC up to 0.977) and virulence without fine-tuning, enabling fast metagenomic screening."
Abstract
Genomic foundation models such as Evo 2 learn rich sequence representations, but their value for biosecurity screening is largely unexplored. We ask how much biosecurity-relevant signal is linearly accessible in these representations by training minimal linear and attention probes on frozen Evo 2 layer-26 activations, without fine-tuning the underlying model. Across held-out metagenomic test sets, the probes detect antimicrobial resistance (AMR) with strong discrimination: a linear probe reaches a region-level ROC-AUC of 0.888 (mean-pool), rising to 0.977 with a single-head attention probe. The probes resolve finer-grained AMR drug-class subcategories and separate them from unrelated functional genes, providing additional evidence that the learned signal is not explained solely by generic functional-gene status. Bacterial virulence is also decodable, though more weakly (region-level ROC-AUC 0.833). The AMR probe retains comparable ranking performance on simulated short reads without retraining, enabling evaluation before assembly in settings where assembly is computationally costly or unreliable. It achieves a read-level ROC-AUC of 0.898 (mean-pool), comparable to the mean-pooled full-region result. Within SynGenome, AMR-associated prompt labels are only weakly recoverable from Evo 1.5-generated sequences; these prompt-derived labels do not establish the function of the generated response sequences. A complementary sparse-autoencoder analysis recovers interpretable resistance-associated features but proves less consistent than the supervised probes. Together, these results position lightweight embedding-based probes as a fast, inexpensive first-pass detection layer for metagenomic biosurveillance and map both strengths and current limits of the approach. This work was conducted as part of the AIxBio Hackathon 2026 hosted by BlueDot Impact, Apart Research, and Cambridge Biosecurity Hub.
Technical Analysis & Implementation
Technical Breakdown§
This paper evaluates the linear decodability of biosecurity-relevant signals from the frozen representations of the Evo 2 genomic foundation model. The core idea is to train minimal probes (linear classifier or single-head attention) on the layer-26 token embeddings without any fine-tuning of the base model.
Methodology§
Embedding Extraction: For a given DNA sequence of length $L$, we extract the hidden states at layer 26 of Evo 2, producing a sequence of vectors $\mathbf{h}_1, \ldots, \mathbf{h}_L \in \mathbb{R}^d$ ($d=512$ for the 1B-param model). We consider two aggregation strategies:
- Mean Pooling: $\bar{\mathbf{h}} = \frac{1}{L} \sum_{i=1}^L \mathbf{h}_i$
- Attention Pooling: A learned single-head attention that computes $\mathbf{q} = \text{Linear}(\bar{\mathbf{h}})$, then $\alpha_i = \text{softmax}(\mathbf{q}^\top \mathbf{h}_i)$ and $\mathbf{z} = \sum_i \alpha_i \mathbf{h}_i$.
Probe Training:
- Linear Probe: A logistic regression (or linear layer followed by sigmoid) on the pooled embedding: $\hat{y} = \sigma(\mathbf{w}^\top \bar{\mathbf{h}} + b)$.
- Attention Probe: The pooled representation $\mathbf{z}$ is passed through a linear classifier with cross-entropy loss.
Training minimizes binary cross-entropy for each region-level label (e.g., presence/absence of AMR gene family). The probes are trained on a dataset of metagenomic contigs with known functional annotations.
Evaluation: Held-out test sets from the same metagenomic distribution. Performance measured by region-level ROC-AUC. The best linear probe (mean-pool) achieves 0.888, and the attention probe reaches 0.977 for AMR detection. For virulence, region-level AUC is 0.833.
Read-Level Transfer: The same probe, when applied directly to features extracted from simulated short reads (without retraining), yields a read-level ROC-AUC of 0.898 (mean-pool), comparable to full-region results.
Sparse Autoencoder Analysis: To interpret the model, a sparse autoencoder is trained on the layer-26 activations. However, the recovered features are less consistent than the supervised probes.
Code Snippet (PyTorch-style Linear Probe)§
import torch.nn as nn
class LinearProbe(nn.Module):
def __init__(self, d_model=512, num_classes=1):
super().__init__()
self.fc = nn.Linear(d_model, num_classes)
def forward(self, embeddings):
# embeddings: (B, L, d_model) -> (B, d_model)
pooled = embeddings.mean(dim=1) # mean pooling
logits = self.fc(pooled).squeeze(-1)
return logitsKey Equations§
- Mean-pooled representation: $\bar{\mathbf{h}} = \frac{1}{L} \sum_{i=1}^L \mathbf{h}_i$
- Attention-pooled: $\alpha_i = \text{softmax}\left( \mathbf{q}^\top \mathbf{h}_i \right)$, $\mathbf{z} = \sum_i \alpha_i \mathbf{h}_i$, where $\mathbf{q} = \mathbf{W}_q \bar{\mathbf{h}}$
- Binary cross-entropy loss: $\mathcal{L} = -\frac{1}{N} \sum_{i=1}^N [y_i \log(\hat{y}_i) + (1-y_i) \log(1-\hat{y}_i)]$
Conclusions§
Using frozen Evo 2 embeddings with lightweight probes provides a fast, inexpensive first-pass detection layer for metagenomic biosurveillance, achieving strong AMR detection without fine-tuning or assembly. The approach is limited by weaker virulence signal and the need for full-length sequences for optimal performance.
Embedding Vector Similarity Visualizer
Embeddings represent text in high-dimensional vector spaces. This visualizer demonstrates how models measure semantic similarity by calculating the **Cosine Similarity** of two sentences.
Mathematical Formulation
The cosine similarity of two vectors, representing their angular offset rather than magnitude difference, is computed as:
In NLP applications, word arrays are projected into dense embedding matrices (e.g. 1536 dimensions). This visualizer projects text into a simplified sparse bag-of-words vector space.
Accelerate your workflow with Araho
Need help choosing the right model for your product? We build AI-native MVPs.
Get your MVP built in weeks with top-tier AI developers.