DNA Attention & Receptive Field Studio
Layer-by-layer receptive field expansion & self-attention flow · Shorkie 16,384 bp window← Shorkie LabExpressionLanguage ModelGenomePaperDocsInteractive Enhancer-to-TSS Dependency Tracer
Drag either probe along the 16,384 bp sequence track. Probe A (Cyan) simulates a distal regulatory element (enhancer / UAS), while Probe B (Orange) marks the promoter / transcription start site (TSS). Curved bezier arcs visualize real multi-head attention flow connecting distal regions to the promoter.
Layer-by-Layer Receptive Field Ladder
Track how receptive field expands stage by stage through Shorkie's 19 architectural layers. Click any layer to inspect its receptive field diameter and test communication feasibility between Probe A and Probe B.
Transformer Layer 1
Receptive Field: Global (16,384 bp / 100%)First multi-head self-attention layer operating on 128 bottleneck tokens. Instant O(1) communication across entire 16 kb locus.
128 × 128 Multi-Head Attention Heatmap
Precomputed attention matrices decoded from Shorkie's bottleneck weights. Each token spans exactly 128 bp.
Empirical Context Convergence Plot
Altschul-Erikson dinucleotide shuffle experiments: flanking context outside radius is randomized to destroy regulatory motifs while preserving dinucleotide distribution. The curve measures how prediction stabilizes towards the unperturbed baseline.
Cross-Architecture Signal Transmission Sandbox
Simulate how different deep learning paradigms propagate regulatory signal across genomic distance. Adjust the slider to see how long-range enhancer-promoter communication behaves.
ResNet Stem + Transformer Bottleneck
Convolution extracts high-resolution 128 bp motif tokens; multi-head self-attention enables direct O(1) pairwise routing between any two positions up to 16,384 bp.
Exponentially Dilated Convolutions
Information cascades through exponentially dilated residual layers. Signal decays as (0.88)^hops, creating an effective receptive ceiling.
Selective Structured State Space
Linear-time sequence model compressing history into hidden states. Excellent continuous decay, but requires bidirectional scans to prevent upstream bias.
Mathematical Framework & Architectural Principles
1. Convolutional Receptive Field Expansion
For a sequential cascade of convolutional and residual layers, the theoretical receptive field at layer expands according to the recurrence relation:
where is the kernel size (5 bp in Shorkie's residual blocks) and is the cumulative stride up to layer . Because Shorkie performs pooling () at each residual block, the effective stride doubles at every step, causing the receptive field to expand from 11 bp in the stem to 582 bp by Block 7 — the widest reach any purely convolutional stage has before the bottleneck. Both ends are derived from the checkpoint's own kernels rather than the paper's, which gives the stem as 15 bp.
2. Attention Rollout Across Layers
To track how information flows across multiple Transformer layers with residual skip connections, we use Attention Rollout (Abnar & Zuidema, 2020). The effective attention accounting for identity shortcuts is:
Recursive matrix multiplication yields the total end-to-end information flow from input tokens to layer :
3. The Biological Pareto Optimum
Why not use pure Transformers or pure ConvNets?
- Pure Transformers: An attention matrix on raw 16,384 bp sequence requires operations per head per layer, consuming enormous GPU VRAM with poor inductive bias for local DNA motifs.
- Pure Dilated ConvNets: Exponential dilation achieves large receptive fields but suffers from the receptive field lottery and exponential signal attenuation over 5+ kb.
- Shorkie's Hybrid Pareto: Residual CNNs pool 16,384 bp into 128 compact 128 bp tokens. The Transformer then executes attention over a lightweight matrix—providing instant global connectivity with negligible memory overhead.