Inferensys

Glossary

Enformer Architecture

A hybrid convolutional-transformer neural network that predicts gene expression and epigenomic tracks directly from DNA sequence by combining local motif detection with long-range self-attention.
Architect reviewing LLM integration architecture on laptop, system diagrams visible, modern technical office setup.
GENE EXPRESSION PREDICTION

What is Enformer Architecture?

A hybrid convolutional-transformer neural network that predicts gene expression and epigenomic tracks directly from DNA sequence by combining local motif detection with long-range self-attention.

The Enformer architecture is a deep learning model that predicts gene expression and epigenomic profiles directly from raw DNA sequence. It integrates a convolutional neural network (CNN) stem for detecting local regulatory motifs with a Transformer trunk that uses self-attention to capture long-range interactions between distal enhancers and promoters up to 100,000 base pairs apart.

Enformer's key innovation is its ability to model long-range dependencies that span tens of thousands of nucleotides, dramatically improving accuracy over previous windowed approaches like Basenji2. By processing extended sequence context, the architecture accurately predicts the functional impact of genetic variants on gene expression, making it a foundational tool for regulatory genomics and variant effect prediction.

ARCHITECTURAL COMPONENTS

Key Features of the Enformer Architecture

The Enformer architecture integrates convolutional layers for local motif detection with transformer self-attention for long-range dependencies, enabling accurate gene expression prediction from 200 kb of DNA sequence.

01

Hybrid Convolutional-Transformer Design

Enformer combines a convolutional tower for detecting local regulatory motifs with a transformer trunk for capturing long-range interactions. The convolutional layers first compress the 200 kb input sequence into a sequence of 1,536-channel embeddings at 128 bp resolution, reducing spatial dimensions by a factor of 128. These embeddings then feed into 7 transformer layers with 8 attention heads each, allowing the model to integrate signals from distal enhancers up to 100 kb away from target promoters.

02

Multi-Scale Gradient Flow

Enformer employs skip connections that route gradients from the output heads directly to intermediate convolutional layers, bypassing the transformer trunk. This architectural choice addresses the vanishing gradient problem in deep genomic models and ensures that local motif detectors in the early convolutional layers receive strong training signals. The result is simultaneous learning of both fine-grained sequence patterns (transcription factor binding sites) and global regulatory syntax (enhancer-promoter looping logic).

03

Multi-Task Prediction Heads

The model outputs predictions for 5,313 human genomic tracks and 1,643 mouse tracks simultaneously, covering:

  • CAGE-seq expression data across dozens of tissues
  • DNase-seq chromatin accessibility profiles
  • ChIP-seq tracks for hundreds of transcription factors
  • Histone modification marks (H3K4me3, H3K27ac, etc.) Each track is predicted by a dedicated linear head operating on the final transformer embeddings, enabling shared representation learning across diverse epigenomic assays.
04

200 kb Receptive Field via Attention

Standard convolutional genomic models like Basenji2 are limited to a 40 kb receptive field, missing many distal regulatory elements. Enformer's transformer layers extend the effective receptive field to 200 kb (100 kb in each direction) through self-attention, which computes pairwise interactions between all 1,536 positions in the compressed sequence. This captures enhancer-gene pairs separated by up to 100 kb, dramatically improving expression prediction for genes regulated by distal elements.

05

Human-Mouse Cross-Species Training

Enformer is trained jointly on aligned human and mouse genomes, leveraging synteny and evolutionary conservation. The model processes orthologous 200 kb windows from both species, with separate output heads for human and mouse tracks. This multi-species objective acts as a powerful regularizer, forcing the model to learn evolutionarily conserved regulatory grammar that generalizes better than single-species training. The shared trunk learns features that are functionally important enough to be preserved across 90 million years of divergence.

06

Poisson Regression Loss with Coverage Weighting

Enformer minimizes a Poisson negative log-likelihood loss appropriate for count-based sequencing data, rather than mean squared error. Each track is weighted by its sequencing coverage (total read count), ensuring that high-quality, deeply sequenced experiments contribute more to the gradient than noisy, low-coverage assays. The loss is computed as: loss = mean(coverage * (predicted - target * log(predicted))), which naturally handles the heteroscedastic noise characteristic of genomic count data.

ARCHITECTURAL COMPARISON

Enformer vs. Basenji2 vs. Expecto

A technical comparison of three deep learning models for gene expression prediction from DNA sequence, highlighting differences in architecture, input length, and resolution.

FeatureEnformerBasenji2Expecto

Core Architecture

Hybrid CNN-Transformer

Dilated CNN

L2-regularized linear model on CNN features

Input Sequence Length

200 kb

131 kb

200 kb

Output Resolution

128 bp bins

128 bp bins

200 bp bins

Long-Range Mechanism

Self-attention

Dilated convolutions

Pretraining Objective

Human CAGE prediction

Multi-species CAGE prediction

Pretrained DeepSEA features

Tissue-Specific Prediction

Prediction Tracks

5,313 (human)

4,253 (human)

2,002 (human)

Variant Effect Prediction

ENFORMER ARCHITECTURE

Frequently Asked Questions

Explore the core mechanisms, design principles, and biological motivations behind the Enformer architecture, a hybrid convolutional-transformer model that predicts gene expression and epigenomic tracks directly from DNA sequence.

The Enformer architecture is a deep neural network that predicts gene expression and epigenomic tracks directly from raw DNA sequence by combining convolutional layers for local motif detection with Transformer self-attention for long-range dependency modeling. It processes a 200,000 base-pair input window through a series of convolutional blocks that detect local regulatory motifs, followed by Transformer layers that integrate information across the entire sequence length. The key innovation is the use of factorized attention heads that operate on compressed representations, enabling the model to capture interactions between distal enhancers and promoters up to 100 kilobases apart. Enformer outputs predictions for thousands of genomic tracks simultaneously, including CAGE-seq expression and DNase-seq accessibility, across multiple human and mouse cell types and tissues.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.