Model reference · open weights

hyenadna-medium-450k-seqlen

LLMs LongSafari Text gen 1 build Open weights 87k dl/mo

hyenadna-medium-450k-seqlen is an open-weight language model from LongSafari. hyenadna-medium-450k-seqlen-hf (FP32) weighs 56 MB; the smallest configuration that runs it is RTX 3060 12 GB.

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • HyenaDNA is a long-range genomic foundation model developed by LongSafari for text generation tasks.
  • It features 28 million parameters and supports a context length of 450,002 tokens.
  • The model is released under the bsd-3-clause license.

Summary of the LongSafari/hyenadna-medium-450k-seqlen-hf model card, 2026-10-01

What it is

Released byLongSafari
Released2023-11-03
Parameters28M
VRAM56 MB for the weights

What it runs on

Memory and cards for hyenadna-medium-450k-seqlen-hf (FP32)

56 MBweights, file size
442 MBruntime overhead, at least
450,002 tokenscontext max

How much memory each request adds isn't estimated yet for this architecture. The weights need at least the cards below, plus room for the context.

CardWeights alone
RTX 3060 12 GBfits
RTX 4060 Ti 16 GBfits
RTX 3090 24 GBfits
RTX 4090 24 GBfits
RTX 5090 32 GBfits
L40S 48 GBfits
A100 80 GBfits
H100 80 GBfits
RTX PRO 6000 Blackwell 96 GBfits
DGX Spark (GB10) 128 GB unifiedfits
H200 141 GBfits
B200 180 GBfits

From the model card

What LongSafari says about hyenadna-medium-450k-seqlen

Read the model card

Welcome! HyenaDNA is a long-range genomic foundation model pretrained on context lengths of up to 1 million tokens at single nucleotide resolution.

See below for an overview of the model and training. Better yet, check out these resources.

Resources:

Links to all HuggingFace models:

We've uploaded a collection of all the pretrained HyenaDNA checkpoints.

You'll see models of different sizes and sequence lengths. There are also original weights-only versions of each model in the LongSafari organization, which are designed to be loaded with the original github repo. These models have identical outputs to the models in the collection above, just different interfaces.

See GPU requirements for each model.

Using HyenaDNA

In this brief code sample we demonstrate fine-tuning HyenaDNA on a sequence classification task. This sample uses the medium checkpoint, with a maximum sequence length of 160k nucleotides. Note that training will fail if you use a sequence length longer than the maximum supported length for your chosen checkpoint.

In testing, we have been able to train at a sequence length up to about 250k nucleotides on a Colab T4 GPU (16GB VRAM). For longer sequence lengths, more memory will be required.

from transformers import AutoModelForSequenceClassification, AutoTokenizer
from transformers import TrainingArguments, Trainer, logging
import torch

# instantiate pretrained model
checkpoint = 'LongSafari/hyenadna-medium-160k-seqlen-hf'
max_length = 160_000

# bfloat16 for better speed and reduced memory usage
tokenizer = AutoTokenizer.from_pretrained(checkpoint, trust_remote_code=True)
model = AutoModelForSequenceClassification.from_pretrained(checkpoint, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True)

# Generate some random sequence and labels
# If you're copying this code, replace the sequences and labels
# here with your own data!
sequence = 'ACTG' * int(max_length/4)
sequence = [sequence] * 8  # Create 8 identical samples
tokenized = tokenizer(sequence)["input_ids"]
labels = [0, 1] * 4

# Create a dataset for training
ds = Dataset.from_dict({"input_ids": tokenized, "labels": labels})
ds.set_format("pt")

# Initialize Trainer
# Note that we're using extremely small batch sizes to maximize
# our ability to fit long sequences in memory!
args = {
    "output_dir": "tmp",
    "num_train_epochs": 1,
    "per_device_train_batch_size": 1,
    "gradient_accumulation_steps": 4,
    "gradient_checkpointing": True,
    "learning_rate": 2e-5,
}
training_args = TrainingArguments(**args)

trainer = Trainer(model=model, args=training_args, train_dataset=ds)
result = trainer.train()

print(result)

# Now we can save_pretrained() or push_to_hub() to share the trained model!

You may also find these notebooks useful. Although they're not specific to HyenaDNA, they contain additional examples of training DNA and sequence classification models.

GPU requirements (suggested)

Here are suggestions on the hardware (preferred minimum) we think you can use for each model.

GPU during: Pretrain, fine-tune, inference

Model & Training Overview

HyenaDNA uses a simple stack of Hyena operators, which are a subquadratic drop-in replacement for attention in Transformers. The Hyena operator is able to match quality in language modeling by using modified input projections, implicit convolutions and gating, all subquadratic operations.

This enables HyenaDNA to reach context lengths of up to 500x longer than previous genomic Transformer models using dense attention, and train 160x faster at sequence length 1M (compared to Flash Attention).

We use a single character tokenizer with a primary vocab of 4 nucleotides (plus special tokens), enabling the single nucleotide resolution, a first in genomic foundation models. In addition, the implicit long convolution enables a global receptive field at each layer.

We pretrain using next token (nucleotide) prediction on the human reference genome (HG38).

HyenaDNA sets new SotA on 23 downstream tasks including predicting regulatory elements, chromatin profiles, and species classification. We also explore what new capabilities open up with long context in genomics, including the first use of in-context learning with soft prompt tuneable tokens and instruction fine-tuning.

Check out our blog for more details on HyenaDNA!

Authors

Eric Nguyen*, Michael Poli*, Marjan Faizi*, Armin Thomas, Callum Birch-Sykes, Michael Wornow, Aman Patel, Clayton Rabideau, Stefano Massaroli, Yoshua Bengio, Stefano Ermon, Stephen Baccus, Chris Re.

Contact

Eric Nguyen, etnguyen@stanford.edu Michael Poli, poli@stanford.edu Marjan Faizi, Marjan_Faizi@hms.harvard.edu

Citation

Feel free to cite us :)

@article{nguyen2023hyenadna,
      title={HyenaDNA: Long-Range Genomic Sequence Modeling at Single Nucleotide Resolution},
      author={Eric Nguyen and Michael Poli an

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms