CoolFace
Modelpublic

McClain/PlasmidLM-kmer6

sourceHugging Faceapache-2.0updated 7mo agoView on Hugging Face
0likes313downloads
Model Card

PlasmidLM-kmer6

A 19.3M parameter autoregressive language model for plasmid DNA sequence generation, trained on ~100K plasmid sequences from Addgene.

Model Details

PropertyValue
Parameters19.3M
ArchitectureTransformer decoder (dense MLP)
Hidden size384
Layers10
Attention heads8
Intermediate size1,536
Max sequence length16,384 tokens
Tokenizerk-mer (k=6, stride=3)
Vocab size4,208

Training

  • Data: ~100K plasmid sequences from Addgene, tokenized with k-mer (k=6, stride=3)
  • Steps: 65,000
  • Eval loss: 0.129
  • Token accuracy: 97.4%

Usage

python
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("McClain/PlasmidLM-kmer6", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("McClain/PlasmidLM-kmer6", trust_remote_code=True)

# Condition on antibiotic resistance + origin of replication
prompt = "<BOS><AMR_KANAMYCIN><ORI_COLE1><SEP>"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.8, do_sample=True, top_p=0.95)
print(tokenizer.decode(outputs[0].tolist()))

The model generates plasmid DNA sequences conditioned on functional annotations (antibiotic resistance markers, origins of replication) provided as special tokens in the prompt.

Special Tokens

TokenPurpose
<BOS>Beginning of sequence
<EOS>End of sequence
<SEP>Separator between prompt annotations and DNA sequence
<PAD>Padding
<AMR_*>Antibiotic resistance markers (e.g., <AMR_KANAMYCIN>, <AMR_AMPICILLIN>)
<ORI_*>Origins of replication (e.g., <ORI_COLE1>, <ORI_P15A>)

Citation

If you use this model, please cite:

@misc{thiel2026plasmidlm,
  title={PlasmidLM: Language Models for Plasmid DNA Generation},
  author={Thiel, McClain},
  year={2026}
}