Recompute Only What the Click Touches: Incremental Re-Encoding for Interactive Vision Transformers

Interactive segmentation tools let a person outline an object by clicking on it. Each click marks a pixel as "object" or "not object," and the model redraws the mask. The most accurate recent systems feed the clicks into the very first layer of a large vision transformer, an image model that splits the picture into patches and lets every patch exchange information with every other patch. They then rerun the entire network after every click. SimpleClick does exactly this and reports 132ms per click with its largest backbone, so a ten-click session spends more than a second waiting. The usual fix is to compute image features once and send later clicks through a small correction head, as EMC-Click and FDRN do. That fix freezes the features before the user has said anything, so the deep layers can never adapt to what the user wants.

We propose a middle path. A new click changes the input in only a small disk of pixels. We therefore rerun the full transformer only for the patches inside a region derived from that click's spatial encoding. Those patches still attend to cached keys and values from every other patch, saved from the previous turn. A coarse token grid that is recomputed in full carries the click's global effect to the patches that were not recomputed. The claim is that intent can still shape the deep features, as in SimpleClick, while each click costs a fraction of a full pass.

Core Claim

In a plain vision transformer that takes the click at its input, most of the change between turn $t-1$ and turn $t$ is spatially concentrated around the new click. That change can be tracked with three ingredients. The first is a geometric active set: tokens selected by a multi-scale encoding of the click, recomputed exactly through all layers. The second is a key–value cache, meaning the stored per-layer attention keys and values of all other tokens from the previous turn. The third is a fully recomputed coarse summary grid that propagates long-range effects to the inactive tokens.

Per layer, full recomputation costs $O(N^2 d)$, where $N$ is the number of patch tokens and $d$ the channel width. The incremental pass costs

$$ C_{\text{inc}} = O\big(|A_t|\,N\,d + |A_t|\,d^2 + N_c^2\,d + N N_c\,d\big), $$

where $A_t$ is the active set at turn $t$ and $N_c \ll N$ is the size of the coarse grid. The first two terms are active tokens attending to all cached keys plus their feed-forward cost. The last two are coarse-grid self-attention and inactive tokens reading from the coarse grid. With $|A_t|$ around a tenth of $N$ and $N_c = N/16$, the expected saving is several-fold per click.

The bet is that click-conditioned deep features recover most of SimpleClick's accuracy at a latency closer to the frozen-feature methods. The gains should be largest late in a session, where frozen features are known to fail.

Research Program

The base model and its interaction encoding. We start from SimpleClick's symmetric patch embedding, which sums disk-encoded click maps with image patches before the first block. That design is itself inherited from the disk-plus-dedicated-convolution encoding that RITM found most stable. This input-level conditioning is what makes incremental recomputation meaningful. A model like EMC-Click, whose backbone never sees clicks, has nothing to recompute.

Choosing the active set from multi-scale click encodings. The active set comes from a stack of encodings at several spatial widths, in the spirit of the multi-scale Gaussians of Interactive Boundary Prediction for Object Selection. A tight disk marks tokens that must be recomputed. A broader Gaussian, like the localized maps of Iteratively Trained Interactive Segmentation, extends the set along the previous mask boundary near the click. Thresholding these maps at a per-layer cutoff gives $A_t$, so the region can widen in deeper layers where receptive fields are larger.

We deliberately use geometry only to decide which tokens to recompute, never to replace attention weights. Hard-Coded Gaussian Attention shows that fixed Gaussian patterns can stand in for self-attention in translation, but replacing cross-attention with them costs 5–10 BLEU. In our setting, the dynamic routing between new click evidence and the rest of the image must stay learned.

The coarse correction path. The coarse correction path is our use of multi-scale fusion. Inactive tokens are stale: their cached state still reflects the previous click set. To limit that error, a $4\times4$-pooled copy of the token grid is recomputed in full at every turn. Each inactive token then receives a gated residual read from it through one cross-attention layer. This mirrors the coarse-to-fine cascade of CSFP, which propagates click information at 1/16 resolution to guide 1/4-resolution attention. The difference is that CSFP reruns its propagation over the whole image every turn, whereas we reuse cached state across turns.

Training for staleness. Training must match inference, or the model will never have seen stale tokens. We train in RITM's iterative regime, simulating click sequences. At each simulated turn we sample an active-set budget and run the incremental pass against the cache from the previous simulated turn, with occasional full refreshes.

A drift detector and when to refresh. We add a small drift detector: a scalar head on the coarse grid that predicts how far the inactive tokens' features have drifted from what a full pass would give. When it fires, a full recomputation is triggered. This turns the method into an anytime scheme with a measurable fallback rate.

Relation to AViTS. AViTS is the closest methodological precedent. Across diffusion denoising steps it recomputes only "active" tokens, chosen by text cross-attention and feature variance over time, and reports up to 6.34x speedup on FLUX.1-dev. We transfer the idea of temporal token reuse to human-in-the-loop refinement. The key difference is that our active set is defined by the user's spatial input, which is known before computation, rather than inferred from the model's own attention.

What this does not fix. This program does not fix first-click latency. The first click still requires a full pass, as in EMC-Click. We report it separately rather than hide it.

Baselines

Full recomputation. The naive reference is SimpleClick run at full cost on every click, with ViT-B, ViT-L, and ViT-H backbones. It sets the accuracy ceiling our method tries to match. For accuracy, SimpleClick reports 4.15 NoC@90 on SBD, where NoC@90 is the number of clicks needed to reach 90% intersection-over-union. For latency, it reports 132ms per click on ViT-H. We rerun released checkpoints on our own hardware so that latency is measured identically for all methods.

Frozen features with a light correction head. This is the strongest competitor on the latency question. EMC-Click runs its base network once at 32.3 GFLOPs, handles later clicks with a 2.25 GFLOPs correction network, and reaches 90% IoU on SBD in 20 minutes of total evaluation versus 34 for FocalClick. No per-dataset NoC numbers for EMC-Click were found on Lacuna. For a fair comparison, we also build an EMC-style variant on our own ViT. It uses the same backbone, the same COCO+LVIS training data, and the same epochs and tuning sweeps, and it pairs frozen click-free features with a correction head whose per-click FLOPs are matched to our incremental pass. Matching FLOPs isolates whether click-conditioned deep features matter.

Cropping. The cropping competitor is FocalClick, which reports 40–60ms per click on CPU. We also run a FLOP-matched "SimpleClick-on-a-crop" that runs the full ViT on the active region alone with no global cache.

Ablations. These isolate our key ingredients. We replace geometric active sets with learned-importance pruning in the style of DEFA, and separately with random sets of equal size. We also remove the coarse correction path, and remove staleness-aware training.

What counts as winning. Beating the baselines means matching full SimpleClick within 0.15 NoC@90 on SBD and DAVIS at no less than 3x lower mean latency over clicks 2–20. It also means beating the FLOP-matched frozen-feature variant on NoC@90, with the largest margin in clicks 5–20.

Why not just…?

Why not just encode the image once and use a light decoder, as EMC-Click and FDRN do? This is the real threat. If the frozen-feature variant matches our accuracy at equal per-click FLOPs, then click-conditioned deep features are not worth the cache, and the proposal fails. The evidence that it may not match comes from two sources. The file reports that EMC-Click and FDRN must push all intent adaptation into a shallow head. And Structured Click Control documents "stalling," where models stop responding as clicks accumulate; it reduced SimpleClick-ViT-B's NoC@90 on SBD from 5.62 to 4.88 by adding relational modeling. Our FLOP-matched comparison, broken down by click index and run on the hard DAVIS-585 correction split, settles the question directly.

Why not just run the full model on a crop around the click? That is FocalClick's design, and our crop baseline tests it at matched cost. The file notes that FocalClick struggles when a click needs context from disconnected parts of the object. In our design, active tokens attend to the full cached image, which a crop cannot do. If the crop baseline ties us, the global cache is not earning its memory cost.

Why not just use a smaller backbone? Running ViT-B everywhere is cheaper than incremental ViT-H. The fair comparison is a latency–NoC frontier. We plot full ViT-B/L/H against incremental ViT-L/H, and we only claim a win if the incremental points dominate the curve rather than merely beat ViT-H.

Why not just use learned token pruning? DEFA's probability-based pruning skips about 84% of sampling points in detection at a cost of roughly 0.8 mAP. Our ablation that swaps in learned importance tests whether the user's click geometry is a better selection signal for free. We expect it to be, because the location of the change is known before computation.

Proposed Experiments

Data and metrics. Training follows RITM on COCO+LVIS, which has 104k images and 1.6M masks. Evaluation uses GrabCut, Berkeley, SBD, DAVIS and DAVIS-585, plus the medical sets ssTEM and BraTS as an out-of-domain stress test, where staleness may behave differently. We report NoC@85 and NoC@90, IoU-versus-click curves up to 20 clicks, and per-click latency on GPU and CPU, with first-click latency listed separately. We also report fallback rate and peak cache memory.

First decisive check: fidelity. Fidelity is how close the incremental pass is to a full pass. For each turn we compute the IoU between the mask from the incremental pass and the mask from a full recomputation on identical inputs, as a function of active-set size. If fidelity falls below about 0.97 at the budgets that give 3x speedup, the core approximation is wrong.

Second decisive check: the frozen-feature comparison by click index. We compare against the FLOP-matched frozen-feature variant, separated by click index. Our hypothesis predicts parity on clicks 1–3 and a growing advantage afterward. A flat or reversed gap falsifies it.

Third decisive check: what selects the active set. The pruning ablation must show geometric selection beating both random and learned-importance sets at equal size. Otherwise the spatial interaction encoding contributes nothing beyond generic sparsity.

Fourth decisive check: the coarse path. Removing the coarse correction path should mostly hurt clicks that fix distant or disconnected object parts. We identify these by the distance from the click to the largest mask change. Seeing that pattern would confirm that the multi-scale summary, not luck, carries global intent.