arXiv:2611.11976cs.LGNov 2026

Manuscript Offprint

arXiv:2611.11976

ShiftCache: Fast and Exact Indel Effect Prediction by Reusing Shifted Reference Encodings

Sina Barazandeh, Arth Banka, Jose Lugo-Martinez

Abstract

Sequence-to-function models such as AlphaGenome and Borzoi read up to a megabase of DNA and predict thousands of genomic signals. A genetic variant is scored by comparing a model's predictions for the reference and alternate sequences. Unlike single nucleotide variants, insertions and deletions (indels) are costly to score, because an indel usually shifts the unchanged DNA after it onto a different pooling grid, which prevents direct reuse of the reference's encoder activations. The AlphaGenome Atlas, for example, scored more than 100 million indels with three full model passes each, and every pass encodes the entire window, although the DNA after an indel matches the reference shifted by the indel's length. To avoid this repeated work, we present ShiftCache, an exact reuse system that encodes each shifted reference once and shares it among all variants scored in the same window with the same shift. A planner derives which encoder outputs each variant can copy, and ShiftCache recomputes only the rest in batched tiles. On held-out AlphaGenome windows shared by many indels, in strict fp32 on one A6000, ShiftCache is 3.5 to 6.5× faster than deduplicated dense execution and 1.6 to 2.7× faster than our adaptation of layer-by-layer reuse to indels. It is 3.5 to 4.1× faster than dense reimplementations of two published analyses with Borzoi and AlphaGenome, and it speeds up Enformer scoring by 2.6× over dense execution. Scoring each variant in its own centered 131 kb window makes ShiftCache only 1.36× faster than deduplicated dense execution, and highly diverse insertion lengths or many dispersed edits can make it slower than layer-by-layer reuse or dense execution. For encoders that meet our conditions, ShiftCache computes the same predictions as dense execution in exact arithmetic. On an A6000, every checked output of the default AlphaGenome and Borzoi runs matches dense execution within an absolute and relative tolerance of 10⁻⁵. With larger tile batches, with Enformer or on an H100, a small fraction of values exceeds this tolerance.

1 Introduction

Predicting the effect of a genetic variant is a common use of genomic sequence models. The model runs on the reference sequence and on the edited sequence (the alternate), and the two predictions are compared. Models such as AlphaGenome (Avsec et al., 2026) and Borzoi (Linder et al., 2025) read up to a megabase of DNA. Most of their computation occurs in a convolutional encoder that precedes a transformer, and at 131 kb AlphaGenome spends about 90% of a forward pass in that

*Corresponding author: jlugomar@andrew.cmu.edu encoder (§6.2). An edit changes only a few bases, so most of the alternate's encoding should be reusable from the reference. That holds for substitutions, but for insertions and deletions (indels) reuse is harder.

The AlphaGenome Atlas, a genome-wide catalog of predicted variant effects, scores more than 100 million indels (Cheng et al., 2026), and Borzoi-based fine-mapping, which ranks candidate causal variants, scores about 1.9 million (Srivastava et al., 2025). Besides the reference and the alternate, indel stitching (Korsakova et al., 2025; Google DeepMind, 2026) evaluates a third sequence so that predictions line up on both sides of the edit. For AlphaGenome, this third sequence is a shifted reference for a deletion and a second alternate for an insertion (§3), so the Atlas runs three full passes per indel. Each pass encodes the entire window, although the three sequences differ only near the indel and by a shift.

This repeated work is hard to avoid because the encoder pools its input. AlphaGenome's encoder reduces the input to one output position (bin) per 128 bases with seven stride-2 pools. An indel shifts everything after it, and unless the shift is a multiple of 128, the shifted sequence falls on a different pooling grid. If the indel length is odd, for example, the first stride-2 pool pairs bases differently than in the reference, so even the unchanged sequence after the indel can produce different encoder outputs. The reference's outputs therefore cannot simply be moved by the shift and copied.

Existing reuse methods eliminate only part of this work for indels. Caching outputs per input sequence, which we call deduplicated dense execution, skips sequences that repeat across requests but still encodes every distinct alternate in full. Prefix caching in LLM serving (Zheng et al., 2024) reuses only the input before the edit, so it recomputes everything after the edit, which is half the window for a centered indel. Layer-by-layer reuse for in silico mutagenesis, which scores every possible substitution (Nair et al., 2022), can reuse the reference's activations, moved by the shift, only in layers whose stride divides the shift. We call its adaptation to indels layer-local reuse. Among the 1,953 real 1000 Genomes indels in our held-out 131 kb windows, 57% have odd length. Counting only the pooling levels whose stride divides each indel's length, layer-local reuse can avoid at most about 40% of the convolution work after the edit, averaged over these indels.

In this work, we present ShiftCache, a system that restores the pooling alignment by encoding a shifted reference, the reference moved by the indel's length. After the indel, the alternate matches this shifted reference base for base and lies on the same pooling grid, so the alternate can copy from it every encoder output that depends only on that region. Indels scored in the same window often share a shift, and one shifted reference then serves all of them. A scan of 512 deletions of 1 to 4 bases in one window, for example, needs only four shifted references. The stitched AlphaGenome passes for deletions already include these references, so sharing them adds no encoder pass.

ShiftCache processes a campaign, a set of variant-scoring requests handled together, and encodes each shared shifted reference once as a view. A planner uses the encoder's kernel sizes and pooling strides to compute which bins each request can copy from the reference or a view. ShiftCache recomputes the remaining bins in batched input tiles and runs the transformer and prediction heads unchanged. Its outputs equal those of dense execution in exact arithmetic. ShiftCache builds on local recomputation for edits that keep positions fixed, as in fastISM, and on evaluating one input at every alignment of the pooling grid (§2). It extends these ideas by sharing shifted references across requests.

Sharing helps most when many indels can share one window, as in analyses that group nearby variants (Calico, 2026), deletion scans of promoters (the regulatory DNA at the start of a gene) (Korsakova et al., 2025), and deletions of candidate regulatory sequences and length-matched controls (Liang et al., 2026). On shared-window AlphaGenome campaigns, ShiftCache is 3.5 to 6.5× faster than deduplicated dense execution and 1.6 to 2.7× faster than layer-local reuse adapted to indels. On two reimplemented published analyses with Borzoi and AlphaGenome, it is 3.5 to 4.1× faster than dense runs of these reimplementations. When each indel is scored in its own centered window, as in AlphaGenome's tutorial, less work is shared, and ShiftCache is 1.36×1.36 \times faster than deduplicated dense execution at 131 kb ( §6.4§6.4).

We make three contributions.

  1. Shifted-reference reuse and ShiftCache. We introduce a mechanism and executor for exact computation reuse across requests whose inputs contain shifted segments of a shared reference, with a closed-form planner for one or several encoder outputs ( §4§4).

  2. Correctness guarantees and validation. We prove that every bin ShiftCache copies or recomputes equals the dense encoder output in exact arithmetic ( §4.3§4.3), and we compare full fp32 outputs with dense execution on an RTX A6000 and an H100 ( §6.3§6.3). The small differences we find likely come from cuDNN's shape-dependent choice of convolution algorithm. With a fixed-order convolution kernel, the checked AlphaGenome encoder outputs are bitwise identical to dense execution using the same kernel ( §4.2,§6.3§4.2, §6.3).

  3. Performance and limitations analysis. We evaluate ShiftCache on AlphaGenome, Borzoi and Enformer, including two reimplemented published analyses, and show when it is slower than layer-local reuse or dense execution ( §6§6).

References (60)