Predicting how genetic mutations affect biological functions is a cornerstone of modern genomics, but it’s computationally expensive. Large-scale "sequence-to-function" models like AlphaGenome and Borzoi can process up to a megabase of DNA at a time, but scoring millions of insertions and deletions (indels) often requires re-running these massive models from scratch for every single variant.
ShiftCache is a new system designed to eliminate this redundancy. By cleverly caching and reusing "shifted" versions of reference DNA encodings, it achieves up to a 6.5× speedup over standard methods while maintaining exact numerical accuracy.
TL;DR
ShiftCache accelerates indel effect prediction in large genomic models by reusing internal computations from "shifted" reference sequences. It provides a 3.5× to 6.5× speedup over standard execution while ensuring that predictions remain mathematically identical to running the full model.
What Problem Does This Paper Address?
To understand a mutation's effect, researchers compare a model's prediction for the "reference" DNA sequence against the "alternate" (mutated) sequence. For simple single-base swaps (SNVs), most of the DNA stays in the same place, allowing models to reuse most of their internal calculations.
Indels are much harder. An insertion or deletion shifts every subsequent base in the sequence. Because genomic models use "pooling" layers (which downsample the sequence, e.g., grouping every 128 bases into one "bin"), even a one-base shift can completely change how the DNA is grouped internally. This misalignment prevents the direct reuse of reference data, forcing a full, costly re-computation for every indel. For massive projects like the AlphaGenome Atlas, which scored over 100 million indels, this represents a staggering amount of wasted compute.
Methods
ShiftCache introduces a system for exact computation reuse across requests that share shifted segments of a reference sequence.
- Shifted Reference Views: If multiple variants involve a 2-base deletion, ShiftCache computes the encoding for the reference sequence shifted by 2 bases exactly once. This "view" is then shared among all relevant variants.
- The Planner: A closed-form planner uses the model’s architecture (kernel sizes and pooling strides) to determine which internal "bins" can be safely copied from the reference (the part before the edit) or a shifted view (the part after the edit).
- Tiled Execution: Only the small region around the edit that cannot be copied is recomputed. This is done using "tiles"—small batches of input with a "halo" of extra context to ensure the results are bit-for-bit identical to a full-window run.
- Stitching Integration: It seamlessly integrates with "stitching" protocols, which combine different model passes to ensure predictions are stable on both sides of an edit.
Datasets
The authors evaluated ShiftCache across several models and real-world scenarios:
- Models: AlphaGenome, Borzoi, and Enformer.
- Real Variants: Indels sampled from the 1000 Genomes Project.
- Synthetic Scans: Exhaustive deletion and insertion scans (e.g., every possible 1-4 base deletion in a specific region).
- Published Analyses: Reimplementations of a promoter deletion scan (using Borzoi) and a motif ablation study (using AlphaGenome).
Key Insights and Ideas
- Restoring Alignment: The core "aha" moment is that while an indel breaks alignment with the original reference grid, it aligns perfectly with a shifted version of that grid.
- Exactness is Key: Unlike many acceleration techniques that rely on approximations or gradients, ShiftCache is designed to be exact. Under specific architectural conditions (common in genomic CNNs), it produces the same results as dense execution in exact arithmetic.
- Sharing Efficiency: The system is most effective when many variants share a window and a shift length. For example, a scan of 512 different deletions might only require four shifted reference views.
Key Results
- Speedups: On AlphaGenome, ShiftCache was 3.5× to 6.5× faster than standard deduplicated execution and 1.6× to 2.7× faster than "layer-local" reuse (a state-of-the-art alternative).
- Broad Applicability: It sped up Enformer scoring by 2.6× and Borzoi-based promoter scans by 4.0× to 4.1×.
- Numerical Accuracy: On an NVIDIA A6000, all outputs matched standard execution within a tight tolerance ($10^{-5}$). Using a custom fixed-order kernel, the authors even achieved bitwise identity.
- Memory Efficiency: ShiftCache typically uses less peak GPU memory than standard execution because it avoids processing full-length sequences for every variant.
Limitations and Future Work
- Windowing Strategy: The speedup is significantly lower (~1.36×) if every variant is scored in its own unique centered window, as this reduces the opportunity for sharing views.
- Offset Diversity: If a campaign has many different insertion lengths or highly dispersed edits, the overhead of managing many views can make ShiftCache slower than standard methods.
- Model Scope: ShiftCache currently accelerates the convolutional "trunk" of models. The downstream transformer "tail" remains a bottleneck that is not accelerated by this method.
- Resolution: Supporting 1-base resolution outputs (required for some specific biological scoring functions) would require maintaining views at every encoder level, which is a direction for future work.
Summary updated