Overview
PhaGen is a 150M-parameter model for generating and analyzing bacteriophage DNA. It learns by reconstructing masked DNA and generates sequences by filling masked positions over multiple steps.
The same pretrained model provides sequence embeddings and masked-region scores for downstream prediction. The repository includes model code, usage examples, and training code based on VeOmni.
- 150M
- Parameters
- 131,072
- Token context
- 964
- Embedding dimensions
- 7
- Prediction benchmarks
Model framework
PhaGen uses three hierarchical stages to combine nucleotide-level information with broader sequence context. Figure 1 summarizes the training data, masked-diffusion architecture, and evaluated tasks.
How DNA is generated
Both examples start from the same 4-nucleotide prefix. M denotes a masked position; blank cells are not yet generated.
PhaGen Masked diffusion
Fills multiple masked positions per iteration using bidirectional context.
Evo Autoregressive
Reads the existing prefix and appends one nucleotide at a time, from left to right.
Prediction benchmarks
The pretrained model is evaluated on seven sequence-understanding tasks using sequence scores or embeddings.
| Task | Evaluation |
|---|---|
| Gene essentiality | Zero-shot prediction for lambda and P1 genes. |
| T7 SNP mutability | Predict single-nucleotide mutation patterns across 59 T7 genes. |
| Phage promoter recognition | Classify promoter and non-promoter DNA windows. |
| Virion-protein subtypes | Predict seven subtypes from protein-coding DNA. |
| Host prediction | Predict host species from tail-protein coding DNA. |
| infA mutation fitness | Predict fitness from E. coli infA variant sequences. |
| TEM-1 β-lactamase fitness | Predict fitness from TEM-1 variant coding sequences. |
Quick start
Install PhaGen from the repository root. The examples support a downloaded checkpoint or a local model directory.
Python 3.10+ · PyTorch 2.5 · Transformers 4.54.1
git clone https://github.com/ai4nucleome/PhaGen.git
cd PhaGen
python -m pip install -e .
See the GitHub README for generation and embedding examples.
Resources
- GitHub
- Model implementation, examples, VeOmni training, and evaluation code.
- Hugging Face
- Pretrained weights, model configuration, and tokenizer files.
- Zenodo
- Evaluation data, formal results, plotting code, and figures.