Figure 1. Keep probabilities in training, a hard mask at inference. Illustrative example with schematic probabilities. During training (bottom), the selector gives each patch a keep probability p t p_t p t , drawn from gray (p t = 0 p_t=0 p t = 0 ) to full color (p t = 1 p_t=1 p t = 1 ), and ProbConv averages each convolution window over the keep decisions. At a high LapSum temperature τ \tau τ many patches are partly kept; as τ \tau τ decreases, few remain. At inference (top right), the top-k k k mask keeps the outlined patches, and later layers process only these.
Introduction
Many image predictions survive the removal of most intermediate patch tokens: a per-image search on frozen Vision Mamba finds small patch subsets that preserve the dense prediction [73 ] (App. 2). Token compaction aims to learn that choice: a selector keeps a subset of tokens for each input, and later layers process the shorter sequence (Fig. 1). The challenge is to learn which tokens remain useful once those layers operate on the selected subset.
Removing a token in Mamba changes two computations. The convolutions read local windows along the token sequence, so closing a gap changes which tokens fall at each offset. The selective scan also skips the update that would have occurred at the removed position [11 , 16 ] . Zero masking illustrates the difference: it leaves a slot in the convolution window and can still update the recurrent state (Fig. 2).
Token selection methods differ in how they choose and train on masks (Fig. 3). DTP uses an inference-time score without a learned selector [49 ] . DyVM moves sampled survivors into a prefix during training and uses top-k k k at inference [64 ] . Its training and inference masks can therefore differ. OCSampler uses reinforcement learning (REINFORCE) on compacted clips, with a clip-level reward shared across frame decisions [35 , 63 ] . Straight-through training with zero masks gives selector gradients through the zero-filled sequence. Can we train the selector by differentiation, exactly recover the compacted forward pass for binary masks, and keep the cost linear in sequence length?
Figure 2. Removing a token changes the convolution window. Top: zero masking leaves the token’s slot in place. Bottom: ProbConv averages the keep and drop windows, and its gradient compares them (Eq. (5)). Step gating skips dropped updates, so the block matches physical compaction for binary decisions (Proposition 2).
Figure 3. Where each approach trains the selector. Keep probabilities with a fixed budget form a hypersimplex (L = 3 L=3 L = 3 , k = 2 k=2 k = 2 shown); its vertices are binary masks. Rules choose a vertex and REINFORCE samples vertices. A zero mask is differentiable in the keep probabilities but computes a different network even at a vertex. ProbConv is differentiable and, with step gating, recovers the compacted Mamba block at each vertex (Proposition 2).
ProbConv tracks the expected contents of a convolution window as tokens are kept or dropped. Its gradient compares the windows produced by the two choices. Step gating lets a dropped position pass the recurrent state through unchanged and gives the selector a second gradient path. At binary keep values, the two operations together reproduce the compacted block (Fig. 1, top right). The same construction supports learned token scores and successive compaction stages (Sec. 2).
ProbConv is strongest under strong compaction, where removing tokens changes the neighborhoods of the remaining ones most. In Vim, Cobra and VideoMamba, its advantage over matched training controls grows as the budget tightens (Fig. 5). In Cobra, it also improves on DTP, FastV and DART adapted to the same backbone at matched inference budgets [7 , 49 , 62 ] , and its lead over learned selectors persists at matched training cost. For X3D frame selection, ProbConv trained on sampled masks matches or exceeds the mean mAP of retrained OCsampler with REINFORCE. In speech, ProbConv improves over matched zero-mask training, while REINFORCE gives similar or lower word error rates. Compaction speeds that keep inference in the measured vision setups. Controls that keep the selector and budget fixed isolate the effect of the training computation, and ablations show how the convolution gradient and step gating affect accuracy across backbones. The supplement covers additional video, genomic and long-context experiments.
Contributions.
Expected compacted convolution. We derive the exact expected convolution under independent keep decisions. For a fixed kernel width and channel count, its computational cost grows linearly with sequence length (§ 2.1 ).
Training through compaction. With step gating, the Mamba forward matches physical compaction for binary masks. Gradients through the convolution and the scan train a budgeted selector (§ 2.2 and § 2.3 ).
Evaluation. We compare against pruning methods and matched controls in image classification, vision–language tasks, video recognition, frame selection and speech recognition. We measure training and inference costs and ablate the convolution gradient and step gating (Sec. 3).
Learning through token compaction
Let x 1 : L ∈ R L × D x_{1:L} \in\mathbb{R}^{L \times D} x 1 : L ∈ R L × D be the projected token sequence and m ∈ { 0 , 1 } L m \in\{0,1\}^{L} m ∈ { 0 , 1 } L a keep mask. Compaction gathers the retained indices i 1 < ⋯ < i n i_1 < \cdots< i_n i 1 < ⋯ < i n in order: Compact ( x ) = ( x i 1 , … , x i n ) \operatorname{Compact}(x)=(x_{i_1},\ldots,x_{i_n}) Compact ( x ) = ( x i 1 , … , x i n ) . A Mamba block [16 ] applies a causal depthwise convolution with K K K taps w r ∈ R D w_r \in\mathbb{R}^{D} w r ∈ R D , bias b b b and SiLU activation σ \sigma σ :
v t = σ ( b + ∑ r = 0 K − 1 w r ⊙ x t − r ) . (1) v_t = \sigma\left(b + \sum_{r=0}^{K-1} w_r \odot x_{t-r}\right). \tag*{(1)} v t = σ ( b + r = 0 ∑ K − 1 w r ⊙ x t − r ) . (1)
The selective scan then updates its state and reads out the result:
h t = exp ( Δ t A ) h t − 1 + Δ t B t v t , y t = C t h t + D v t , (2) h_t = \exp(\Delta_t A)h_{t-1} + \Delta_t B_t v_t,\qquad y_t = C_t h_t + Dv_t, \tag*{(2)} h t = exp ( Δ t A ) h t − 1 + Δ t B t v t , y t = C t h t + D v t , (2)
The selective parameters depend on the block’s input. In Mamba, B t B_t B t and C t C_t C t are projected from v t v_t v t . Mamba-2 applies the convolution jointly to the projected ( x , B , C ) (x,B,C) ( x , B , C ) and uses a scalar A A A per head [11 ] . Compaction changes the window in Eq. (1) and the positions at which Eq. (2) updates.
The expected convolution window
Let p = ( p 1 , … , p L ) p=(p_1,\ldots,p_L) p = ( p 1 , … , p L ) be the selector’s keep values and model the decisions as independent draws m t ∼ Bernoulli ( p t ) m_t\sim\operatorname{Bernoulli}(p_t) m t ∼ Bernoulli ( p t ) . At a kept position t t t , the compacted convolution reads s t ( 0 ) = x t s_t^{(0)}=x_t s t ( 0 ) = x t and the r r r -th preceding kept token s t ( r ) s_t^{(r)} s t ( r ) at offset r > 0 r>0 r > 0 . A missing predecessor contributes zero. With a t ( r ) a_t^{(r)} a t ( r ) the expected r r r -th most recent kept token through position t t t , the window gives
ProbConv ( x , p ) t = E [ ∑ r = 0 K − 1 w r ⊙ s t ( r ) ∣ m t = 1 ] = w 0 ⊙ x t + ∑ r = 1 K − 1 w r ⊙ a t − 1 ( r ) , (3) \operatorname{ProbConv}(x,p)_t=\mathbb{E}\left[\left.\sum_{r=0}^{K-1}w_r\mathbin{\odot}s_t^{(r)}\right|m_t=1\right]
= w_0\mathbin{\odot}x_t+\sum_{r=1}^{K-1}w_r\mathbin{\odot}a_{t-1}^{(r)}, \tag*{(3)} ProbConv ( x , p ) t = E [ r = 0 ∑ K − 1 w r ⊙ s t ( r ) m t = 1 ] = w 0 ⊙ x t + r = 1 ∑ K − 1 w r ⊙ a t − 1 ( r ) , (3)
Independence lets us compute the preceding window without conditioning on the decision at t t t . The same formula extends to p t = 0 p_t=0 p t = 0 by continuity; the compacted convolution requires a readout only at kept positions.
Proposition 1. With a 0 ( r ) = 0 a_0^{(r)}=0 a 0 ( r ) = 0 , the expectations obey the linear recurrence
a t ( 1 ) = p t x t + ( 1 − p t ) a t − 1 ( 1 ) , (4) a_t^{(1)}=p_t x_t+(1-p_t)a_{t-1}^{(1)}, \tag*{(4)} a t ( 1 ) = p t x t + ( 1 − p t ) a t − 1 ( 1 ) , (4) a t ( r ) = p t a t − 1 ( r − 1 ) + ( 1 − p t ) a t − 1 ( r ) , 2 ≤ r ≤ K − 1. (5) a_t^{(r)}=p_t a_{t-1}^{(r-1)}+(1-p_t)a_{t-1}^{(r)},\qquad2\le r\le K-1. \tag*{(5)} a t ( r ) = p t a t − 1 ( r − 1 ) + ( 1 − p t ) a t − 1 ( r ) , 2 ≤ r ≤ K − 1. (5)
Keeping a token inserts it at the front of the window and shifts older entries back one slot. Dropping it leaves the window in place. Averaging these updates gives Eq. (4). Keeping every token (p t = 1 p_t=1 p t = 1 for all t t t ) recovers ordinary convolution. With any binary mask, the window holds the actual kept predecessors, so the output, with bias and activation, equals the compacted convolution at every kept position. At fractional p p p , the expectation in Eq. (3) is exact before activation. A centered convolution, as in X3D-S, is a causal pass plus a causal pass over the reversed sequence, so ProbConv covers it as well (Fig. 4). The derivation is in App. 4.
Stack the window states as a t a_t a t , let S S S shift them down by one slot, and let e 1 x t e_1x_t e 1 x t insert x t x_t x t into the first slot. For the adjoint a ˉ t = ∂ L / ∂ a t \bar{a}_t=\partial\mathcal{L}/\partial a_t a ˉ t = ∂ L / ∂ a t , the probability gradient is
∂ L ∂ p t = ⟨ a ˉ t , ( S a t − 1 + e 1 x t ) − a t − 1 ⟩ , (6) \frac{\partial\mathcal{L}}{\partial p_t}
=\left\langle\bar{a}_t,(Sa_{t-1}+e_1x_t)-a_{t-1}\right\rangle, \tag*{(6)} ∂ p t ∂ L = ⟨ a ˉ t , ( S a t − 1 + e 1 x t ) − a t − 1 ⟩ , (6)
Figure 4. A centered convolution is two causal ones. Taps of a convolution with two taps on each side of the output frame x 4 x_4 x 4 : a causal pass over the clip and a causal pass over the reversed clip, whose centre tap is zero, add up to the centered filter. With ProbConv in both passes the sum is the expected centered convolution of the compacted clip, because the kept frames before and after a kept frame are independent (App. Eq. (15) and App. Fig. 4).
The two terms inside the state difference are the windows obtained by keeping and dropping t t t . The adjoint weights their difference by its effect on the loss.
Skipping recurrent updates
We gate the step in Eq. (2) by replacing Δ t \Delta_t Δ t with p t Δ t p_t\Delta_t p t Δ t . If p t = 0 p_t=0 p t = 0 , the decay is one and the write is zero. If p t = 1 p_t=1 p t = 1 , the scan uses the original step. Differentiating this gate gives the selector a second gradient path. With fractional keep values, step gating is a relaxation of the state update.
Proposition 2. For binary p p p , a Mamba or Mamba-2 block that uses ProbConv in place of its convolution and the gated step p t Δ t p_t\Delta_t p t Δ t produces, at every kept position, the output of the same block applied to Compact m ( x ) \operatorname{Compact}_m(x) Compact m ( x ) .
Bidirectional blocks apply the same construction in both directions and reverse the keep values with the backward sequence. Block equivalence extends through a stack with several cuts if each mask is nested in the previous one, operations between blocks agree on retained tokens, and positional information is treated as in deployment (App. 4).
Training at a token budget
A selector assigns scores s t s_t s t and uses m = TopK k ( s ) m=\operatorname{TopK}_k(s) m = TopK k ( s ) at inference. During training, LapSum [59 ] yields differentiable keep values p = LapSum k ( s / τ ) p=\operatorname{LapSum}_k(s/\tau) p = LapSum k ( s / τ ) with ∑ t p t = k \sum_t p_t=k ∑ t p t = k . At each cut we can use the straight-through values m ~ = m + p − sg ( p ) \tilde{m}=m+p-\operatorname{sg}(p) m ~ = m + p − sg ( p ) , with sg \operatorname{sg} sg the stop-gradient operator. The forward uses the hard mask at the specified budget. The backward differentiates the relaxed convolution and scan at that mask and carries both gradients through p p p to the selector. Across cuts, each new hard decision acts on the previously retained tokens, and the corresponding relaxed keep values multiply across stages. Always-retained tokens have keep value one and are outside the pruning budget (App. 1).
A soft forward feeds the operators fractional keep values. In Cobra, an annealed training schedule encourages these values towards binary decisions, followed by hard top-k k k at inference (App. § 17 ). The sum constraint sets the expected number of kept tokens under the independent model of § 2.1 . The hard top-k k k mask enforces the realized budget. For frame selection, we can use a binary mask sampled from the policy in the forward pass. The backward differentiates the relaxed operator at that mask and passes the gradient through the policy’s marginal keep probabilities (§ 3.4 ).
Figure 5. The lead over zero-mask training grows as budgets tighten. Accuracy of (a) Vim-Tiny, (b) Cobra-3B and (c) VideoMamba-Ti at each budget (compute per budget: App. Tab. 1), for the selector trained with ProbConv or with zero masking and step gating, and for a fixed score with compacted fine-tuning (in Vim, the channel mean of the backward scan output, the unclipped token importance of ToP-ViM [68 ] ; in VideoMamba, the token norm; none in Cobra, whose backbone stays frozen); every arm runs physically compacted at inference. DyVM (adapted): in Vim and VideoMamba, our selector, objective and schedule with DyVM’s training forward; in Cobra, DyVM’s predictor and objective (Secs. 3.1 and 3.2). Mean over three seeds (App. Tabs. 4, 9, 32 and 33).
Numerical equivalence and cost. Under fixed binary masks, Mamba-1 and Mamba-2 block outputs agree with physical compaction to within 3.2 ⋅ 10 − 6 3.2 \cdot10^{-6} 3.2 ⋅ 1 0 − 6 relative error. Cobra’s logits agree to 9.7 ⋅ 10 − 7 9.7 \cdot10^{-7} 9.7 ⋅ 1 0 − 7 (App. Tab. 2). These checks compare the same keep decisions. Each update in Eq. (4) takes O ( K D ) O(KD) O ( K D ) work, so the recurrent evaluation takes O ( L K D ) O(LKD) O ( L K D ) work. The affine updates also admit prefix and reverse scans [3 ] (Apps. 4 and 5). At inference, the model gathers the selected tokens and runs its ordinary blocks on the shorter sequence. § 3.6 reports measured costs separately for the convolution and the backbone.
Experiments
We evaluate patch compaction in Vim-Tiny on ImageNet-1k, visual-token selection in Cobra-3B and spatiotemporal token compaction in VideoMamba-Ti on Kinetics-400 [27 , 32 , 52 , 71 , 73 ] . We also test frame selection for X3D-S and frame dropping in a Mamba speech encoder. At inference, each pruned variant processes the physically compacted sequence. We compare published methods adapted to each setting and controls that share the selector and budget. In Vim and VideoMamba each cut keeps a fraction ρ \rho ρ of the remaining patches, as in DynamicViT and DyVM [50 , 64 ] ; Cobra keeps a fraction of the language-model (LM) FLOPs, as in DTP [49 ] ; X3D and speech keep frames (App. 1).
Image classification with Vim
Matched selector. We train a selector at two cuts in Vim-Tiny, as in ToP-ViM [68 ] , and fine-tune for three epochs on ImageNet-1k. On the official validation set, at ρ = 0.3 \rho= 0.3 ρ = 0.3 (18 of 196 patches remain), ProbConv achieves 71.22% top-1 and the same selector trained with zero-mask convolution and step gating achieves 66.52% (+4.69 ± \pm ± 0.56 points, seed-paired). At ToP-ViM’s ρ = 0.8 \rho= 0.8 ρ = 0.8 they score 74.72% and 74.51%. Across the nine budgets the lead grows from a tie at ρ = 0.9 \rho= 0.9 ρ = 0.9 to 4.7 points at the tightest (Fig. 5a). DyVM [64 ] combines several mechanisms. A ratio loss holds its Gumbel-sampled predictor near the budget, token distillation from the dense model recovers accuracy, and block skipping saves further compute. Its training forward moves the kept tokens ahead of the removed ones, so the scan reads them as at inference. To isolate how DyVM trains token selection, we keep our selector, objective and schedule and take only their forward. It scores 0.5–7.0 points below ProbConv, and the gap grows as budgets tighten (App. Tabs. 3 and 4).
Figure 6 shows the patches that each arm keeps on one validation image.
The per-image search cited in Sec. 1 illustrates what a frozen backbone can preserve on selected inputs. It uses a dense target for each image, whereas the learned selector makes its choice from the current input at inference. We report the search protocol and harder examples in App. 2.
Visual-token selection in Cobra
We train a visual-token selector before the first language-model block of frozen Cobra-3B. Baselines include layer-0 Δ \Delta Δ , adaptations of DTP, FastV and DART, and learned selectors on the same backbone [7 , 49 , 62 ] . As with DTP, FastV and DART, DyVM enters Cobra as a published method: its predictor trains with its own objective, alone and with its rearranged forward. The forward gives no gain at either budget, so Fig. 5b shows the predictor alone. At 10% of LM FLOPs, ProbConv scores 61.1 against 58.6 for layer-0 Δ \Delta Δ , the strongest training-free rule at that budget (Tab. 1). The gap shrinks at the milder budget. We use DTP’s best reachable sites at each budget. DTP leads only at 67% of LM FLOPs in the sweep, where its original pruning sites are reachable.
Figure 6. With 24 patches left, only ProbConv classifies the coyote correctly. Patches kept by the Vim-Tiny networks of Fig. 5a at ρ = 0.35 \rho= 0.35 ρ = 0.35 (69 and 24 of 196 after blocks 10 and 20, seed 0); dimmed patches are dropped. Green and red squares mark correct and wrong predictions; the other arms predict timber wolf . The fixed score keeps mostly background, and DyVM (adapted) keeps more background than ProbConv. The zero mask also keeps patches on the coyote, but it trains on a forward that differs from the deployed network (Tab. 6). More images: App. Fig. 1.
Against zero masking with step gating, ProbConv ties at 67% of LM FLOPs and leads by 0.3, 0.9, 1.3, 1.9 and 2.7 points at 48, 35, 25, 15 and 10% (Fig. 5b). The gains on GQA, VQAv2 and POPE are significant in every seed pair at both main budgets (per-question tests, Holm correction across benchmarks). VSR and VizWiz stay near their floors across rules and show no consistent gain.
At 10% of LM FLOPs, ProbConv leads when learned baselines receive enough updates to match either its PyTorch GPU-hours or its CUDA training time. With the same LoRA setup [21], ProbConv scores 61.7 against 60.1 for layer-0 Δ \Delta Δ , the strongest competing rule in that setting. Appendix Table 32 gives the full comparisons. Appendix § 17 also shows the tokens kept by each rule on 19 fixed examples.
Video recognition with VideoMamba
We fine-tune the released VideoMamba-Ti checkpoint for three epochs on Kinetics-400, compacting tokens at three cuts. At the mildest budget, ProbConv and compacted fine-tuning with token-norm selection give similar accuracy. At ρ = 0.5 \rho= 0.5 ρ = 0.5 , ProbConv retains 75.35% top-1, 1.30 points below the dense model and 2.10 points above fine-tuning with the fixed norm rule (Tab. 2). The advantage over the matched learned zero-mask control also increases across these budgets (Fig. 5c). As in speech, the zero-mask selector keeps runs of consecutive tokens along the scan (Fig. 7). On HMDB51, both methods start from a dense checkpoint fine-tuned on each split. Averaged over the three splits, ProbConv leads the matched zero-mask control by 1.06 and 1.08 points at ρ = 0.5 \rho= 0.5 ρ = 0.5 and 0.7, in 17 of 18 seed pairs (App. 3.1).
As published context, R-MeeTo reports 76.5% top-1 at 18% fewer FLOPs, and DyVM reports 74.3% at 38% fewer FLOPs [57 , 64 ] . Both use 30 epochs and their own FLOP conventions, and DyVM also skips blocks. The full table gives both cost measures and the HMDB51 results (App. Tab. 9).
Figure 7. ProbConv keeps the tokens around the moving person. VideoMamba-Ti at ρ = 0.5 \rho= 0.5 ρ = 0.5 on a Kinetics-400 validation clip (cartwheeling , correct for all three rules), six of its eight frames. Colored tokens reach the last block; gray ones are dropped. The cuts after blocks 6, 12 and 18 drop 784, 392 and 196 of the 1,568 patch tokens. The zero mask often keeps neighboring tokens along the scan, and the token norm keeps many sky tokens. More clips: App. Fig. 3.
Table 3. Zero-filled clips fall below uniform sampling. ActivityNet-v1.3 validation mAP (%) with a frozen X3D-S per budget. Learned policies share the skim network architecture and head and deploy their top N N N (mean ± standard deviation over three seeds). OCSampler reproduction: its REINFORCE training, reimplemented in our code. The all-frame row feeds all ten candidates to the classifier for that column. Bold: the best selection in each column. The released OCSampler policy was trained for six frames. We use its top N N N with our classifier. Full results: App. Tab. 11.
Frame selection for a video CNN
We follow OCSampler on ActivityNet-v1.3 and keep N N N of ten candidate frames for X3D-S [5 , 12 , 35 ] . At each budget, learned selectors share the skim architecture, policy head and frozen classifier. Selection compacts the clip, so the temporal convolutions of X3D-S read only the kept frames. ProbConv replaces each of them with its centered variant (Fig. 4). At inference, each learned policy keeps its top-scoring frames.
Zero-mask training scores below uniform selection at two and four frames (Tab. 3). ProbConv trained on policy-sampled masks gains 0.44 mAP points over the OCSampler reproduction at two frames and leads in all three seeds.
Figure 8. ProbConv keeps frames like REINFORCE. Four of ten candidates kept by each rule (framed) on one ActivityNet-v1.3 validation video, Removing ice from car , which every rule classifies correctly. ProbConv and REINFORCE share three frames, the zero-mask policy at most one with either. The video is fixed by a rule that ignores the predictions: the most motion (MGSampler’s measure) among the single-label videos on which the four rules keep different frames.
Mean gains at four and six frames are 0.47 and 0.05 points, with mixed results across seeds. Deterministic top-N N N training trails the reproduction in every seed. At six frames, the released OCSampler sampler leads all our trained rules. ProbConv keeps nearly the same frames as the reproduction: per validation video, the two share 3.4 of four frames and the top-1 class in 89% of videos, as much as two of its seeds. The zero-mask policy shares 1.8 frames with either, close to random selection (Fig. 8 and App. Tab. 12). Estimator variants and joint training are in App. 3.2.
Frame dropping in a speech encoder
We train Mamba-based HuBERT with character CTC on LibriSpeech train-clean-100 [14 , 36 , 47 ] . After layer 6, the last six Mamba layers process only the kept half of the frames. Removing frames changes which neighbors the temporal convolutions read. Before final CTC decoding, we restore dropped frames using their layer-6 representations [74 ] . We train causal and bidirectional encoders from scratch and also adapt a dense causal encoder. The learned selector refines intermediate CTC scores [31 ] . Baselines include uniform subsampling and Soundwave’s CTC-peak rule [70 ] .
Table 4 . ProbConv reduces WER relative to zero-mask training. LibriSpeech test-clean WER (%, lower is better) for Mamba-based HuBERT with greedy character CTC and no language model. Half the frames survive layer 6. The final CTC head sees the restored sequence. Learned rows share selector architecture, initialization and budget. Mean ± \pm ± standard deviation over five seeds for causal scratch and three for the other columns. Bold: the lowest WER among the selection rules. Full results: App. § 12 .
Table 4.
Table 5 . Physical compaction speeds up batched inference. Tightest measured budgets: Vim, ρ = 0.35 \rho= 0.35 ρ = 0.35 (fp32); VideoMamba, ρ = 0.5 \rho= 0.5 ρ = 0.5 (bf16); Cobra, 10% of LM FLOPs (bf16). Cobra measures prefill from the input image through the language model. VideoMamba and Cobra use synthetic inputs. Speedups are relative to the dense runs.
Table 5.
With frame recovery, zero-mask training raises WER by 7.0–19.7 points over CTC top-k k k . The seed-paired differences between ProbConv and CTC top-k k k range from −0.3 to +0.8 WER points across the encoders. ProbConv beats uniform subsampling in each encoder. REINFORCE also trains on compacted sequences and gives similar or slightly lower WER (Tab. 4 and App. § 12 ). Without recovery, uniform subsampling gives the lowest subword WER. In the subword example, the zero-mask selector keeps long runs of frames and misses many character emissions. The selectors trained on compacted sequences keep more frames near emissions (Fig. 9). Frame dropping saves no encoder time here because the convolutional front end dominates runtime (App. § 12 ).
Training and inference cost
Physical compaction speeds up batched inference in Vim and VideoMamba and batched prefill in Cobra (Tab. 5). At batch size one, kernel launches offset savings in Vim and VideoMamba. Cobra’s prefill savings depend on the GPU and protocol (Apps. 2, 3.1 and § 17 ). Selectors with the same budget deploy sequences of the same length.
Training evaluates the operators on the full-length sequence. For a Mamba-130M block shape on RTX 4090, our fused operator takes 0.61 ms for the convolution forward and backward, matching dense causal-conv1d while also differentiating the keep probabilities. On RTX 4090, Vim training throughput is 2–3% lower than with zero masking. Training costs vary by implementation and backbone (Apps. 2, 5 and § 17 ).
Understanding the gains
In Vim at ρ = 0.35 \rho= 0.35 ρ = 0.35 , removing step gating costs 7.17 top-1 points, while stopping the convolution gradient barely changes accuracy. In Cobra at 10% of LM FLOPs, stopping that gradient costs 5.8 points with the same forward pass. Removing step gating has little effect in Cobra (Tab. 6).
In Vim, both variants with a forward that matches compaction score within 0.1 points of their deployed counterparts. For zero masking with step gating, soft training and ProbConv without step gating, validation with soft keep values scores 1.98–5.60 points above compacted inference. On a small set of POPE questions, ProbConv gradients rank measured single-token loss changes better than zero-mask gradients (App. § 18 ).
Numerical agreement alone does not train a selector. Fixed-score compaction in Vim runs the deployed computation during fine-tuning but gives no gradient to a learned selector. REINFORCE on the compacted network scores 65.38 against 71.59 for ProbConv in Vim at ρ = 0.35 \rho= 0.35 ρ = 0.35 , below the zero mask, and 60.1 against 61.1 in Cobra at 10% of LM FLOPs. REINFORCE gives similar or lower WER in speech. In X3D, ProbConv reaches REINFORCE’s mean mAP with sampled masks, while deterministic top-N N N training trails it (§ 3.4 and § 3.5 ).
Further hosts. The supplement covers frame selection in Uni-AdaFocus, dynamic chunking in H-Net and LDARNet, and long-context token selection in ReMamba. ProbConv improves on the reproduced LDARNet fine-tuning and ReMamba selector. H-Net and Uni-AdaFocus give mixed results across training signals (Apps. 3.3, § 13 and § 16 ).
Token reduction. Vision transformers shorten sequences by pruning or merging tokens [4 , 8 , 50 ] . In vision state space models, ToP-ViM aligns hidden states for retained tokens, DyVM trains a selector by rearranging retained tokens, and R-MeeTo merges tokens [57 , 64 , 68 ] . Other approaches combine pruning with merging [22 , 69 ] or pool and fuse tokens [26 , 48 , 56 , 61 ] . MTR reduces tokens without training, and STORM preserves the scan’s spatial structure [40 , 41 , 42 ] . FastV, DART and VTW prune inside the language model, while DTP scores visual tokens with Mamba’s step size [7 , 37 , 49 , 62 ] . ProbConv gives a selector access to the change in the convolution window and, with step gating, recovers the compacted block for binary decisions. As a control, we also train the same selector with DyVM’s rearranged forward (Sec. 3.1).
Figure 9. The zero-mask selector misses character emissions. Frames kept by each rule on one LibriSpeech test-clean utterance, below its log-mel spectrogram and its words, when subword units are decoded from a quarter of the frames without recovery. The zero-mask selector keeps long runs of frames. Statistics over 400 utterances: App. Fig. 5.
Table 6. The useful gradient path depends on the backbone. Vim-Tiny: ImageNet validation top-1 and the gap in points (top-1 with soft keep values minus top-1 with physical compaction) at ρ = 0.35 \rho= 0.35 ρ = 0.35 . Cobra-3B: six-benchmark mean at 10% of LM FLOPs. Scores are percentages, mean ± standard deviation over three seeds. Dashes: fixed-score compaction and REINFORCE have no soft keep values, hence no gap; fixed-score compaction fine-tunes the backbone, which Cobra keeps frozen. †In Cobra, ProbConv itself trains with an annealed soft forward (straight-through: 60.6 ± 0.2). Full ablations: App. Tabs. 7 and 35.
Learning discrete selectors. Straight-through estimators, continuous relaxations and score-function estimators provide training signals for discrete choices [2 , 25 , 43 , 63 ] . Differentiable top-k k k methods supply keep values at a specified budget [53 , 59 , 65 ] . Given those keep values, ProbConv specifies the convolution as an expectation over the changing neighborhoods. Our scan gate applies the state-skipping principle of Skip RNN [6 ] to Mamba’s selective step.
Frame selection and dynamic chunking
OCSampler trains a frame selector with REINFORCE on compacted clips [35 ] . On masks sampled from the same policy, we use the compacted forward and differentiate the ProbConv relaxation. It also supplies a control variate for REINFORCE (App. 3.2). The learned routers in H-Net and LDARNet keep chunk boundaries for processing by the main network [24 , 30 ] . The expectation of the causal smoothing dechunker follows the same rank-one recurrence as the convolution window (App. Proposition 1).
Conclusion
Removing tokens changes what each convolution reads and which steps the recurrent state takes. ProbConv follows this change exactly in expectation at linear cost. With step gating it reproduces the compacted Mamba block for binary decisions, so a selector learns on the network it will deploy. This matters most at tight budgets. There the advantage over zero-mask training widens in Vim, Cobra and Video-Mamba. In Cobra, ProbConv also outperforms adapted pruning methods and keeps its lead when learned selectors train for the same time. X3D frame selection and speech frame dropping show the same advantage over zero masking, and every gain keeps the inference savings of compaction.
Limitations. The equivalence with compaction holds only for binary decisions. ProbConv treats keep decisions as independent, although a fixed budget couples them, and a joint model could sharpen the training signal. Training keeps every token in the sequence, so it runs at the dense length and the savings appear at deployment. Our image and video experiments use short fine-tuning schedules, and the speed-up depends on batch size and hardware (App. § 6.1 ).
LLM Usage Statement
Anthropic Claude, used through Claude Code, and OpenAI Codex assisted with code implementation and debugging, experiment planning, result analysis, and manuscript drafting and revision. OpenAI ChatGPT assisted with editing and reviewing the manuscript. The research question and the idea of the probabilistic convolution came from the authors, without the use of LLMs. The authors are responsible for the final manuscript, software, experimental protocols and reported results.
Removing tokens changes which inputs a convolution reads at each offset. We examine when this change matters for learning a selector. In Vim, VideoMamba and Cobra, the gap between ProbConv and zero-mask training is largest when few tokens survive (Tabs. 4, 9 and 33). Two diagnostics describe the selections: in VideoMamba, zero-mask training keeps runs of consecutive tokens along the scan, and in Cobra, the three predecessors of a retained token can span several rows of the image grid (Fig. 23). We also examine how the same operator compares with established selection and routing methods for video, speech, genomic sequences and long prompts.
For comparisons between ProbConv and zero-mask training, we use the same selector architecture and inference budget. Comparisons with existing methods follow the protocol specified for each host. In tables and figures, “reported” denotes the original authors’ result, “reproduced” denotes our run of their method, and “(ours)” marks ProbConv and its variants. Where we use a published component or adapt a pruning rule to another backbone, we name the component or adaptation explicitly.
Experimental protocols
Budgets. In Vim and VideoMamba, each cut retains a fraction ρ \rho ρ of the available patch tokens, as in DynamicViT and DyVM [50 , 64 ] . After successive cuts, approximately ρ \rho ρ , ρ 2 \rho^2 ρ 2 , … of the original patches remain. We round each count to a whole token and always retain the class token. VideoMamba uses DyVM’s three cuts, after blocks 6, 12 and 18, with ρ ∈ { 0.5 , 0.6 , 0.7 , 0.8 , 0.85 } \rho\in\{0.5, 0.6, 0.7, 0.8, 0.85\} ρ ∈ { 0.5 , 0.6 , 0.7 , 0.8 , 0.85 } (0.7 is DyVM’s published budget). The short Vim protocol cuts twice, after blocks 10 and 20 as in ToP-ViM [68 ] , with ρ ∈ { 0.9 , 0.8 , 0.75 , 0.7 , 0.6 , 0.5 , 0.4 , 0.35 , 0.3 } \rho\in\{0.9, 0.8, 0.75, 0.7, 0.6, 0.5, 0.4, 0.35, 0.3\} ρ ∈ { 0.9 , 0.8 , 0.75 , 0.7 , 0.6 , 0.5 , 0.4 , 0.35 , 0.3 } (0.8 is ToP-ViM’s setting; 147/111 keeps one patch more at the second cut than ρ = 0.75 \rho= 0.75 ρ = 0.75 gives). Following DTP [49 ] , we express Cobra’s budgets as fractions of the dense language model’s FLOPs: 67%, 48%, 35%, 25%, 15% and 10% for a 30-token text prompt. Each budget fixes the number of retained visual tokens. For example, the 25% and 10% budgets retain 160 and 46 of 729 visual tokens, respectively. The benchmarks use longer prompts, so the LM FLOP shares measured on them are 67.5, 48.7, 36.0, 26.1, 16.2 and 11.3%.
Compute at each budget. Table 1 lists, for every budget, the tokens kept after each cut, multiply-accumulates counted analytically and FLOPs in the convention of the compared papers. For Vim and VideoMamba, the analytic MACs include projections, convolutions, selective scans in both directions, patch embedding and the head. They exclude the selector. The Cobra count adds the language-model prefill with 30 text tokens to the vision backbone and projector, whose cost is measured with PyTorch’s FLOP counter. The published FLOP figures for Vim and VideoMamba use the R-MeeTo counter as used by DyVM, which counts one scan direction per block and includes our selector. For Cobra, DTP’s convention counts the language model’s prefill MACs with 30 text tokens. At a fixed ρ \rho ρ the cost does not depend on the method that selects the tokens: the learned rules (ProbConv, the zero mask, the straight-through variants) deploy the same network and cost the same; fixed scores save only the selector, 0.3% of Vim-Tiny’s FLOPs. Rules that prune inside the network, such as DTP and FastV in Cobra, keep more tokens in early layers at the same FLOPs, so Cobra’s budgets are matched in FLOPs. In Cobra the vision backbone and the projector cost 617 GMACs at every budget, against 2,011 GMACs for the dense language model, so 10% of the language-model FLOPs is 31% of the cost of the whole model.
Speech: frame dropping in Mamba-based HuBERT. We use the Mamba block and convolutional front end of Mamba-based HuBERT [36 ] (12 layers of width 384, 17.2M parameters, 50 frames per second), either causal or with ExtBiMamba layers. The authors released no self-supervised checkpoints, so we train character CTC [14 ] from scratch on LibriSpeech train-clean-100 [47 ] and decode without a language model. The absolute error rates reflect this 100-hour training setup without pre-training. All selection rules share the encoder architecture, training data, optimizer and frame budget. After layer 6 the encoder keeps a fraction ρ \rho ρ of the frames, and layers 7–12 run on the compacted sequence at inference. An intermediate CTC head at layer 6 (weight 0.3, [31 ] ) provides blank posteriors, and dropped frames re-enter the final CTC with their layer-6 representation (Main Sec. 2.3). Baselines select frames with the same budget: uniform subsampling, C T C CTC C T C top-k k k (lowest intermediate blank posterior), and the C T C CTC C T C -peak rule of Soundwave [70 ] (CTC spikes first, then the lowest blank posterior). The selector starts from the intermediate CTC non-blank log-odds and adds the output of a two-layer MLP on detached layer-6 features. We initialize the MLP’s last layer at zero, so all learned configurations start from the CTC top-k k k ranking. We train the selector with a zero mask,
Table 1. | | Tokens kept | | GMACs, analytic | | GFLOPs, published convention |
Table 1 (PDF p. 14). With common cut locations, the token budget fixes the cost of the compacted backbone. The table gives retained tokens (of 196 patches in Vim-Tiny, 1,568 in VideoMamba-Ti and 729 visual tokens in Cobra-3B) and compute per image or video view. Analytic MACs cover the backbone, and the published FLOP columns use the conventions of the compared methods (Sec. 1). Cobra’s nominal budgets use a 30-token text prompt. Parentheses give the LM FLOP shares measured on the six benchmarks.
ProbConv without step gating, full ProbConv, or ProbConv without the convolution gradient. Models train for 80k steps (AdamW, peak learning rate 5 ⋅ 10 − 4 5 \cdot10^{-4} 5 ⋅ 1 0 − 4 , batches of 87.5 s of audio). In the retrofit scenario of dynamic Vision Mamba pruning [64 ] , we instead fine-tune the trained dense or CTC top-k k k model of the same seed for 20k steps with every selection rule. In a third scenario the dropped frames do not return: the final CTC reads the compacted sequence and predicts 300 BPE units [55 ] learned on the training transcripts. Trained from scratch, most of these models stayed on the all-blank plateau of CTC, so we fine-tune the dense character model of the same seed for 40k steps (peak learning rate 10 − 4 10^{-4} 1 0 − 4 ) with a new output head, keeping the character intermediates’ CTC that provides the selection prior. We report greedy-decoding WER on test-clean and test-other.
Genomics: dynamic chunking in H-Net. We train a one-stage H-Net [24 ] for DNA language modeling on hg38 with the train/validation split of Basenji [28 ] : an encoder and a decoder of two Mamba-2 layers (width 256) around a main network of six Mamba-2 layers (width 384); 14.8M parameters, contexts of 4096 bases, 20k steps. The published training (“H-Net routing”) uses straight-through boundaries, the smoothing dechunker and a ratio loss (weight 0.03) towards a target of N N N bases per chunk. In our arms the router is trained through ProbConv and step gating in the main network and the expected dechunker (Proposition 1); all models are evaluated with the published hard forward pass in bits per base on 512 validation windows. To compare at matched compression we sweep N ∈ { 2 , 3 , 4 , 6 , 8 , 10 } N \in\{2, 3, 4, 6, 8, 10\} N ∈ { 2 , 3 , 4 , 6 , 8 , 10 } for the published routing and N ∈ { 2 , 3 , 4 , 6 , 8 , 10 , 12 } N \in\{2, 3, 4, 6, 8, 10, 12\} N ∈ { 2 , 3 , 4 , 6 , 8 , 10 , 12 } for our arms, whose routers compress less than the target, and include an anisotropic model of eight Mamba-2 layers without chunking.
Genomics: LDARNet on the Nucleotide Transformer benchmark. LDARNet-110M [30 ] applies bidirectional dynamic chunking in front of a BiMamba-2 main network. We fine-tune the released checkpoint on the 18 downstream tasks of the Nucleotide Transformer benchmark [10 ] and reproduce the authors’ published protocol in full. We run ten-fold cross-validation on the training split, select the epoch with the best validation MCC and report its MCC on the fixed test set. We use the published learning-rate schedule and task-specific learning rates, a batch size of 64, and weight decay of 0.1 on all parameters except biases and norms. We train for up to 100 epochs and stop after five epochs without an improvement in validation MCC. The baseline fine-tunes the router with the published mechanism; our arms train it through ProbConv and step gating in both directions of the main network and the expected bidirectional dechunker. This amounts to 540 fine-tuning runs (six H100 GPUs for 36 hours). As controls we fine-tune with the router frozen, add the ratio loss of pre-training (α = 0.03 \alpha=0.03 α = 0.03 , N = 4 N=4 N = 4 ) to the fine-tuning objective, and continue the masked language model pre-training of the released checkpoint on hg38 for 1000 steps of 512 sequences of 4096 bases, with either routing, before the full fine-tuning protocol.
Images: patch compaction in Vim-Tiny. We start from the released ImageNet-1k Vim-Tiny checkpoint [73 ] (BiMamba-v2, 24 blocks of width 192, patch size 16, 224 × 224 224 \times224 224 × 224 inputs, 196 patches and one class token; 76.1% reported top-1). Reductions follow blocks 10 and 20, as in ToP-ViM, with patch budgets ( k 1 , k 2 ) (k_1, k_2) ( k 1 , k 2 ) set by ρ \rho ρ (Sec. 1) that exclude the class token, which always survives and keeps its relative order, so that its index in the compacted sequence varies per image. The selector adds a learned residual (LayerNorm–Linear(192,64)–GELU–Linear(64,1), last layer initialized at zero) to a detached, normalized score of the backward-direction mixer mapped back to the original token order. Nested exact-budget LapSum gives p ( 2 ) = p ( 1 ) ⊙ q ( 2 ) p^{(2)}=p^{(1)}\odot q^{(2)} p ( 2 ) = p ( 1 ) ⊙ q ( 2 ) with ∑ i p i ( 2 ) = k 2 \sum_i p_i^{(2)}=k_2 ∑ i p i ( 2 ) = k 2 ; the hard second-stage selection is restricted to the hard first-stage survivors, and the straight-through mask is m = TopK k ( r ) + p − sg ( p ) m=\operatorname{TopK}_{k}(r)+p-\operatorname{sg}(p) m = TopK k ( r ) + p − sg ( p ) . The selective scan uses Δ i = m i softplus ( d i + b ) \Delta_i=m_i\operatorname{softplus}(d_i+b) Δ i = m i softplus ( d i + b ) , so a removed position leaves the state unchanged. In the ProbConv arm all 28 convolutions after block 10 (both directions) use the expected compacted convolution on the full grid; the zero-mask arm runs ordinary convolutions on probability-weighted inputs and shares the gated scan; the compaction arm has no learned residual and gathers the survivors of the score in training. Each arm fine-tunes backbone and selector for three epochs over 1,271,167 ImageNet-1k training images (micro-batch 64, effective batch 128, fp32 with TF32 disabled). The first epoch uses the soft forward pass with the LapSum temperature decreasing linearly from 1 to 0.25, the next two the straight-through forward at 0.25. The loss is cross-entropy plus 0.5 times the distillation loss from the frozen dense model (KL divergence at temperature 2, scaled by 4). AdamW (β = ( 0.9 , 0.999 ) \beta=(0.9,0.999) β = ( 0.9 , 0.999 ) , weight decay 10 − 4 10^{-4} 1 0 − 4 on weight matrices only) uses learning rates 3 ⋅ 10 − 5 3\cdot10^{-5} 3 ⋅ 1 0 − 5 for the backbone and 3 ⋅ 10 − 4 3\cdot10^{-4} 3 ⋅ 1 0 − 4 for the selector with a linear warm-up over the first epoch and the cosine decay of a 30-epoch schedule, stopped after three epochs, and gradients are clipped at norm 1. Ten images per class, chosen by a fixed filename hash, are held out from fine-tuning as the development set (10,000 images); the dense model scores
Table 2 (PDF p. 15). ProbConv with step gating matches physical compaction at fixed binary decisions. Entries give relative errors in the stated precision. Italic rows show discrepancies for the alternative computations. For DyVM, the fixed-mask row tests forward equivalence, while the sampled-mask row compares the training selection with the deployed top-k k k selection.
83.25% top-1 on it and 76.07% on the 50,000 images of the official validation set. Every cell of Tab. 3 uses three seeds and one code base in one container (PyTorch 2.6). In the tables, “pruned, no fine-tuning” compacts the released checkpoint with the base score of the selector before any fine-tuning.
Numerical agreement and evaluation scope
Interpreting forward agreement. With fixed binary keep decisions, Mamba-1 and Mamba-2 block outputs agree with compaction to within 3.2 ⋅ 10 − 6 3.2\cdot10^{-6} 3.2 ⋅ 1 0 − 6 relative error. At the retained positions, the zero-mask block outputs differ from physical compaction by 53–57% in relative error. With the same binary mask, DyVM’s rearranged forward also agrees with physical compaction. Its 27% relative error compares outputs under two masks, one sampled during training and one selected by top-k k k at deployment (Tab. 2).
Optimization and hardware. The short Vim and Kinetics-400 protocols test readaptation of released checkpoints. ToP-ViM’s published hidden-state alignment result is reported for context. Our experiments with its released score evaluate that score with compaction (Tab. 4). For Cobra, the DyVM adaptations learn on a frozen backbone, and ProbConv uses an annealed soft forward, 0.5 points above straight-through training at 10% of LM FLOPs. We document these adaptations and cost-matched comparisons in § 17 .
Keep distributions and runtime. A fixed-size subset couples the keep decisions, whereas ProbConv models them as independent. The fractional step gate also relaxes the state update. Training uses the full sequence length. Runtime depends on the operator implementation, host, batch size and hardware. The inference measurements follow backbone-specific protocols (Secs. 2, 3.1, 5 and § 17 ). The speech and genomics protocols have additional task-specific constraints (§ 12 and § 13 ).
Images: Vim-Tiny
Additional comparisons with a matched selector. At 12.2% retention, using DyVM’s rearrangement in the short matched-selector experiment gives 71.50% on the development split, 6.31 ± 0.81 points below ProbConv (5.59 ± 0.84 on validation). The “DyVM forward” configuration keeps our selector, objective and schedule and uses DyVM’s rearranged training forward. It moves the retained patches ahead of the dropped patches and masks the dropped patches. On the development split, top-1 with soft keep values minus top-1 after compaction is −0.07 points for the rearranged variant, +0.10 for ProbConv and +1.57 for zero masking (lower block of Tabs. 3 and 4). This comparison uses a common selector architecture and short schedule. Across the nine budgets the rearranged variant stays 0.5–7.0 points below ProbConv on validation; it falls below compaction in training at ρ ≤ 0.5 \rho\le0.5 ρ ≤ 0.5 and stays within 0.6 points of it at the milder budgets, and its soft-to-deployed difference stays within 0.15 points. Figure 1 shows the patches that each arm of Main Fig. 5a keeps at ρ = 0.35 \rho= 0.35 ρ = 0.35 on ten validation images. With DyVM’s own selector and recipe, Tab. 6 trains every arm for 30 epochs with DyVM’s recipe and three cuts after blocks 6, 12 and 18. As in DyVM, the cuts keep the fractions ρ \rho ρ , ρ 2 \rho^{2} ρ 2 and ρ 3 \rho^{3} ρ 3 of the 196 patches (78/31/12, 98/49/24 and 137/96/67 at ρ = 0.4 \rho= 0.4 ρ = 0.4 , 0.5 and 0.7). The recipe uses Mixup, CutMix and RandAugment, along with distillation from the dense model through prediction KL and token MSE. The backbone learning rate is 3 ⋅ 10 − 5 3 \cdot10^{-5} 3 ⋅ 1 0 − 5 . The selector learning rate is 3 ⋅ 10 − 6 3 \cdot10^{-6} 3 ⋅ 1 0 − 6 at ρ = 0.4 \rho= 0.4 ρ = 0.4 and 0.5, and 10 − 5 10^{-5} 1 0 − 5 at ρ = 0.7 \rho= 0.7 ρ = 0.7 . The DyVM configuration keeps its predictor, Gumbel-softmax decisions, ratio loss and rearranged training forward, and omits block selection. ProbConv and the zero mask with step gating use our selector and LapSum with a temperature schedule. For these methods, the budgets fall from (195, 194, 193) to the target by epoch 12. “Without budget schedule” uses the target from the first step. DyVM “with our budget schedule” uses that schedule as the target of its ratio loss. “Without token MSE” retains only the KL term. At ρ = 0.4 \rho= 0.4 ρ = 0.4 (12 of 196 patches after the last cut) ProbConv reaches 68.40 ± 0.23%, against 67.01 ± 0.23% for DyVM and 63.76 ± 0.42% for the zero mask; at ρ = 0.5 \rho= 0.5 ρ = 0.5 it leads DyVM by 0.46 points, and at ρ = 0.7 \rho= 0.7 ρ = 0.7 DyVM is 0.18 points ahead. The parts of the recipe that differ between the arms do not explain these differences: without its budget schedule ProbConv changes by 0.00, +0.34 and +0.15 points at ρ = 0.4 \rho= 0.4 ρ = 0.4 , 0.5 and 0.7, DyVM does not gain from our schedule (−0.21, −0.41, +0.07), and dropping the token-MSE distillation helps the zero mask more than ProbConv at ρ = 0.4 \rho= 0.4 ρ = 0.4 and 0.5 (+1.91 and +1.37 against +0.28 and −0.05) and both at ρ = 0.7 \rho= 0.7 ρ = 0.7 (+0.42 and +0.69). Without the token MSE, ProbConv is the best arm at ρ = 0.7 \rho= 0.7 ρ = 0.7 (74.28), ahead of DyVM with either schedule (73.77 and 73.84).
Official validation set. Table 4 evaluates the networks of Tab. 3 on the 50,000 images of the official ImageNet-1k validation set, which the dense model did not see. Relative to the held-out training images, top-1 accuracy on the official validation set is 5.2–6.5 points lower for the fine-tuned networks and 7.2 points lower for the dense model. The relative performance of the training rules follows the same pattern. ProbConv and zero-mask training are level at the mildest cut (−0.11 ± 0.18 at ρ = 0.9 \rho= 0.9 ρ = 0.9 ), and ProbConv leads by 4.69 points with 18 of 196 patches left (Tab. 4). The spread over seeds is smaller than on the development set at eight of the nine budgets, and compaction in training stays below the zero mask at every budget. Fine-tuned for the whole 30-epoch schedule at ToP-ViM’s setting (157/126), ProbConv reaches 76.35 ± 0.18%, above the dense model (76.07%) and the 75.1% that ToP-ViM reports for 30 epochs from the same checkpoint (three seeds; ToP-ViM’s number averages several runs with pruning after blocks 10 and 20, which removes 13.6% of the FLOPs in ToP-ViM’s convention with our selector counted). Compaction in training with ToP-ViM’s score stays 0.1–4.5 points below ProbConv at every budget. The “ToP-ViM score” ranks tokens by the mean of the clipped SSM output, as in ToP-ViM’s released code. During training, physical compaction uses this score in place of our base score and omits the learned residual. Each budget uses three seeds. At 69/24 patches, extending fine-tuning to 30 epochs narrows ProbConv’s lead from 3.7–4.0 to 1.9–2.0 points. ProbConv reaches 74.78 ± 0.03%, compared with 72.81 ± 0.12% for the zero mask and 72.88 ± 0.03% for compaction with ToP-ViM’s score. It leads both methods in every seed. At 69/24, we use one seed to vary the selector learning rate (10 − 4 10^{-4} 1 0 − 4 or 10 − 3 10^{-3} 1 0 − 3 instead of 3 ⋅ 10 − 4 3 \cdot10^{-4} 3 ⋅ 1 0 − 4 ) and the final LapSum temperature (0.1 or 0.5 instead of 0.25) separately for both training methods. The best final temperature is 0.5 for both. Over three seeds at that temperature, ProbConv reaches 72.31 ± 0.04% and the zero mask 69.55 ± 0.22% (last block of Tab. 4). Tuning improves top-1 accuracy by 0.7 points for ProbConv and 1.7 points for the zero mask. ProbConv still leads by 2.77 points on average, with paired gains of 2.56–3.04 points across seeds. The lead with the default settings is 3.72 points. With this setting at all nine budgets, ProbConv leads the zero mask in every seed at every budget, by 2.93 to 0.18 points from the strongest to the mildest budget, by 0.00, +0.34 and +0.15 points at ρ = 0.4 \rho= 0.4 ρ = 0.4 , 0.5 and 0.7, DyVM does not gain from our schedule (−0.21, −0.41, +0.07), and dropping the token-MSE distillation helps the zero mask more than ProbConv at ρ = 0.4 \rho= 0.4 ρ = 0.4 and 0.5 (+1.91 and +1.37 against +0.28 and −0.05) and both at ρ = 0.7 \rho= 0.7 ρ = 0.7 (+0.42 and +0.69). Without the token MSE, ProbConv is the best arm at ρ = 0.7 \rho= 0.7 ρ = 0.7 (74.28), ahead of DyVM with either schedule (73.77 and 73.84).
Figure 1 (PDF p. 17). Different training rules retain different patches at the same budget. The ten evenly spaced ImageNet validation images use the Vim-Tiny models from Main Fig. 5a with 69 and 24 patches after the two cuts (seed 0). Dimmed patches are dropped. Green and red frames mark correct and incorrect predictions after the last cut. From the top: lorikeet, Bedlington terrier, coyote (Main Fig. 6), armadillo, bookshop, electric fan, mailbag, planetarium, spotlight and wok.
Table 3 (PDF p. 18). The top-1 gap between ProbConv and zero masking widens at tight patch budgets. Results are for Vim-Tiny on 10,000 held-out ImageNet-1k training images after three epochs of fine-tuning. All methods use physical compaction at inference. Values with ± \pm ± give the mean and standard deviation over three seeds. Table 4 evaluates the same models on the official validation set.
including + 0.25 +0.25 + 0.25 at ρ = 0.9 \rho= 0.9 ρ = 0.9 , where the default settings tie (− 0.11 -0.11 − 0.11 ); tuning helps the zero mask most where it is weakest (+ 2.25 +2.25 + 2.25 at 59/18, against + 0.49 +0.49 + 0.49 for ProbConv).
A larger backbone. Table 5 repeats the comparison on Vim-Small [73 ] with the same short protocol, selector and cuts, three seeds, at four budgets: 59/18, 69/24 and 98/49 patches (9.2, 12.2 and 25.0%, as for Vim-Tiny) and 109/61, which removes 29.3% of the FLOPs with our selector counted, against 29.4% for the Vim-S result of ToP-ViM [68 ] . The advantage carries over to Vim-Small. At all four tested budgets and in every seed, ProbConv improves on zero-mask training, by 1.74 ± 0.25 1.74 \pm0.25 1.74 ± 0.25 , 1.70 ± 0.27 1.70 \pm0.27 1.70 ± 0.27 , 1.46 ± 0.58 1.46 \pm0.58 1.46 ± 0.58 and 0.79 ± 0.47 0.79 \pm0.47 0.79 ± 0.47 points from the strongest to the mildest budget. As on Vim-Tiny, the lead grows with compression, the zero mask scores 0.6–1.5 points higher with soft keep values than after compaction, and ProbConv does not. At 12.2% the larger network loses less against its dense model than Vim-Tiny (3.45 points against 4.48). We report the validation set only: the Vim-S checkpoint has seen the development images in training (93.02% dense top-1 on them).
Training trajectory. The paired development-set gap at 69/24 is 2.00 ± 0.29 2.00 \pm0.29 2.00 ± 0.29 points after the first, soft-forward epoch and 3.77 ± 0.23 3.77 \pm0.23 3.77 ± 0.23 after the second, when training switches to binary masks. It is 3.71 ± 0.38 3.71 \pm0.38 3.71 ± 0.38 points after the final epoch. After the soft epoch, both methods score 1.9–2.9 points higher with the soft forward pass than with the deployed network. Once training switches to a binary forward pass, this gap falls to 0.06–0.10 points for ProbConv and remains at 1.3–1.6 points for the zero mask.
Ablations. Table 7 changes one part of the training signal at a time, with the protocol of Tab. 3 at all four budgets. Its first three columns state whether training runs the deployed compacted computation (binary keep values in the forward pass), which operator carries the gradient to the selector through the convolution taps (ProbConv, the zero mask or none), and whether the selector also receives a gradient through the step gate. The “soft forward” configuration uses the soft forward pass in all three epochs. “Compaction in training” uses the fixed score and omits the learned residual. Both DyVM configurations train our selector with DyVM’s rearranged forward, which moves retained patches ahead of the masked, dropped patches. Only the step-gated configuration also uses our step gating. Step gating matters most. Without it, ProbConv loses 0.20, 0.95, 2.12 and 7.18 points on the validation set from the mildest to the strongest budget (seed-paired), and the zero mask loses a further 0.68–6.25 points. Both deployed networks then fall up to 5.60 and 7.84 points below their training forward. Stopping the gradient through the convolution leaves the forward pass unchanged. On Vim, the resulting top-1 differences range from −0.01 to +0.13 points on validation and from −0.24 to +0.24 on development. Training straight-through from the first step, without the soft epoch, costs 0.22 to 1.19 points against ProbConv (seed-paired means at the four budgets). With the convolution gradient also blocked, the expectation enters neither the forward pass nor the gradient: this variant is level with ProbConv at 69/24 (71.55 ± 0.16 against 71.59 ± 0.12) but loses 1.23 ± 1.10, 1.19 ± 0.34 and 0.15 ± 0.09 points at 98/49, 118/71 and 147/111, in every seed at the last two. On Vim the expectation in the convolution therefore helps through the soft epoch, while the gradient through the taps adds nothing once that epoch has run. How the selector receives its gradient matters, however. DyVM’s rearranged forward also trains the deployed computation but passes the gradient through masked convolution taps; it stays 5.6 and 4.6 points below ProbConv at 69/24 and 98/49, and adding step gating to it lowers it further at every budget (63.73, 67.15, 69.39 and 72.28 at the four budgets of Table 7 ; also 62.70 against 64.26 at 59/18 and 73.06 against 73.44 at 157/126). A soft forward pass in all three epochs, never straight-through, is 0.33 and 0.34 points ahead of ProbConv at 147/111 and 118/71, level at 98/49 and 1.20 points behind at 69/24, where its deployed network falls 2.46 points below its training forward. The cost of training on a computation other than the deployed one thus grows with compression, as for the zero mask. In summary, ProbConv and its variant without the convolution gradient differ by at most 0.13 points at every budget; the variant adds a stop-gradient inside the operator, so we keep the full operator as the default. ProbConv and its variant without the convolution gradient lead the comparison at the two tightest budgets, 69/24 and 98/49 patches, the regime that compaction targets. At 69/24, the other variants with step gating trail full ProbConv by 0.04 to 1.19 points, and the remaining training signals by 3.72 to 9.97 points.
Table 7. At the two tightest budgets, no training signal exceeds ProbConv and its variant without the convolution gradient. Results give validation top-1 on ImageNet-1k after three epochs, with mean and standard deviation over three seeds. The lower block subtracts physically compacted accuracy from accuracy with soft keep values. All rows use physical compaction at inference, except for the soft evaluations used to compute the differences. Dashes mark omitted training components. The fixed-score row also uses physical compaction during fine-tuning. The lower block leaves the training-signal columns empty.
Table 4 (PDF p. 19). At tight budgets, ProbConv’s advantage over zero-mask training carries over to the official validation set. We evaluate Vim-Tiny with physical compaction on 50,000 ImageNet-1k validation images and report top-1 accuracy as mean ± standard deviation over three seeds. The final block uses a final LapSum temperature of 0.5 in place of 0.25, the best value at 69/24 patches. ProbConv leads at every tested budget with this temperature. Bold marks the best fine-tuned result in each column of the main block.
Table 5 (PDF p. 19). ProbConv improves Vim-Small top-1 over zero-mask training at all four tested budgets. Results on the official ImageNet-1k validation set give the mean and standard deviation over three seeds after three epochs of fine-tuning. Inference uses physical compaction. “Soft − compacted” subtracts compacted accuracy from accuracy with soft keep values.
Software stacks. The dense model and the model pruned to 69/24 without fine-tuning score the same on every software stack we used (83.25% and 31.41%). Training results
Table 6 (PDF p. 19). ProbConv leads the adapted DyVM selector at the two tighter budgets. Vim-Tiny top-1 is measured on the official ImageNet validation set after 30 epochs using the DyVM training recipe. The three cuts follow blocks 6, 12 and 18. Values give the mean and standard deviation over three seeds. Bold marks the highest score in each column. Each indented row changes one component of its parent configuration (see Sec. 2).
vary slightly with the convolution and scan implementations, so the numbers of Tabs. 3 and 4 come from one code base in one container.
Cost
On an RTX 4090 at 69/24 (micro-batch 64), training through ProbConv processes 447.5 images per second with the soft forward pass and 445.7 with straight-through, against 457.0 and 458.5 for the zero mask, an overhead of 2.1% and 2.8%. The GH200 port of the pilot, with a pure-PyTorch scan and micro-batch 32, had an overhead of 8.2% and 11.6% (230.4 and 208.3 against 249.2 and 232.4 images per second). At inference both arms run the same compacted network. On an RTX 4090 in fp32, compacted Vim-Tiny processes a batch of 128 images in 28.5 ms, versus 45.9 ms for dense Vim-Tiny (1.61×, Main Tab. 5). At batch sizes 1 and 16, launch overhead dominates and the compacked model is 10–14% slower. The three cuts after blocks 6, 12 and 18 leave 98, 49 and 24 patches, respectively. The two-cut configuration below also ends with 24 of the original 196 patches. The two-cut network of Main Fig. 5a at ρ = 0.35 \rho= 0.35 ρ = 0.35 (69 and 24 patches after blocks 10 and 20) needs 31.5 ms against 46.7 ms for the dense model in the same measurement (1.48×; in bf16 23.9 against 32.1 ms, 1.34×), and at batch size 1 it is 8% slower than the dense model (19.5 against 18.0 ms).
share of the 196 patches. The learned budget averages 25.7 patches and preserves the class in nine of ten images; the smallest prefixes have a median of 13.5 patches, but one hard image needs 162, so a small fixed count is no universal guarantee. The normalized representation distance is 0.199 at the learned budgets and 0.676 at the smallest same-class prefixes: class agreement is a much weaker target than the representation. Figure 2 shows the masks of four of these images.
Per-image oracle
The oracle uses the frozen Vim-Tiny with the class token in the middle of the sequence and a single reduction after block 12 of 24; both directions of every later block use ProbConv, and the class token is always kept. For each image, free patch logits and a continuous budget k k k are optimized jointly with
L o r a c l e = ∥ h p r u n e d − h f u l l ∥ 2 2 ∥ h f u l l ∥ 2 2 + k 196 , (7) \mathcal{L}_{\mathrm{oracle}} = \frac{\lVert h_{\mathrm{pruned}} - h_{\mathrm{full}}\rVert_2^2}{\lVert h_{\mathrm{full}}\rVert_2^2} + \frac{k}{196}, \tag*{(7)} L oracle = ∥ h full ∥ 2 2 ∥ h pruned − h full ∥ 2 2 + 196 k , (7)
where h h h is the final representation, with exact-budget probabilities and a final straight-through phase. We evaluate hard top-k k k selections by physically compacting the sequence for each integer budget k k k , starting at 1. Table 8 reports the jointly learned k k k and the shortest prefix of the learned ranking that preserves the dense model’s top-1 class. “Agrees” states whether the network compacted to the learned k k k keeps that class, and “retention” is the smallest k k k as a share of the 196 patches.
Table 8. Small per-image selections can preserve the dense Vim-Tiny prediction. For ten evenly spaced ImageNet images and the frozen Vim-Tiny, “smallest k k k ” is the shortest prefix of the learned ranking that preserves the dense model’s top-1 class under physical compaction. “Agrees” records whether the learned budget preserves that class.
Figure 2 (PDF p. 21). Four per-image selections preserve the dense prediction with 4–22 patches. Panels show images 0, 2, 3 and 4 from Table 8 , using 22, 13, 7 and 4 of 196 patches, respectively.
Video
We apply ProbConv to video in three hosts: token compaction inside the bidirectional Mamba blocks of VideoMamba (Sec. 3.1), frame selection in front of a convolutional network (Sec. 3.2), and frame selection for the local network of Uni-AdaFocus (Sec. 3.3).
Token compaction in VideoMamba
Host. VideoMamba-Ti [32 ] (7M parameters) splits an 8-frame 224×224 clip into 14×14 patches per frame, orders the 1568 patch tokens frame by frame after a class token, and processes them with 24 bidirectional Mamba blocks, whose forward and backward scans each have their own causal convolution of width 4. We start from the released Kinetics-400 checkpoint (8 frames, 76.9 top-1 reported).
Compaction. As in DynamicViT and DyVM [50 , 64 ] , selection happens in three stages: after blocks 6, 12 and 18 the network keeps the fractions ρ \rho ρ , ρ 2 \rho^{2} ρ 2 and ρ 3 \rho^{3} ρ 3 of the patch tokens, and the class token is always kept. With ρ ∈ { 0.85 , 0.7 , 0.5 } \rho\in\{0.85, 0.7, 0.5\} ρ ∈ { 0.85 , 0.7 , 0.5 } this removes 20%, 36% and 52% of the multiply-accumulates of a view. At inference every arm gathers the kept tokens, so the deployed network is the unmodified VideoMamba on a shorter sequence; at ρ = 0.7 \rho= 0.7 ρ = 0.7 , blocks 7–12, 13–18 and 19–24 run on 1099, 769 and 539 tokens. The token norm rule scores tokens by the norm of the residual stream; we evaluate it without training and after fine-tuning with physical compaction, where only the backbone learns. The learned selector adds the output of a two-layer MLP, whose last layer starts at zero, to the standardized token norm. It is trained with a straight-through estimator and nested, exact-budget LapSum probabilities at temperature 0.25 (Main Sec. 2.3). It is trained either through a zero mask in the convolutions together with step gating, or through ProbConv with step gating in both scan directions, the backward one on the reversed sequence (Main Sec. 2.2). At binary p p p the latter computes exactly the compacted network (Main Proposition 2).
Training and evaluation. All arms share the optimizer: AdamW with learning rates 3 ⋅ 10 − 5 3\cdot10^{-5} 3 ⋅ 1 0 − 5 for the backbone and 3 ⋅ 10 − 4 3\cdot10^{-4} 3 ⋅ 1 0 − 4 for the selector, weight decay 10 − 4 10^{-4} 1 0 − 4 , a cosine schedule to 0.1× after warm-up, batch 32, drop path 0.1, label smoothing 0.1, and bfloat16 with ProbConv in float32. A training clip takes one random frame from each of 8 segments of 32 stored, uniformly spaced frames, with a random resized crop (area 25–100%) and a horizontal flip. On Kinetics-400 [27 ] we fine-tune for 3 epochs (warm-up 0.3 epochs) on the 239,789 training clips available from the CVDF mirror, with three seeds. We evaluate on 19,877 of the 19,906 validation videos with VideoMamba’s 4 temporal × 3 spatial views and averaged softmax, where the released model scores 76.65. On each of the three official splits of HMDB51 [29 ] (3570 training and 1530 test videos) we first fine-tune the dense model with a new head for 10 epochs, then each arm from it for 5 epochs (warm-up 1 epoch) with three seeds. The seeds share the test set of a split, whose binomial standard error is about 1.1 points. MACs are counted analytically per view (projections, convolutions and scans of both directions, patch embedding and head); the dense model has 12.15 GMACs. The FLOP counter of R-MeeTo [57 ] hooks the projections, the convolution and the scan (as 9 L E N + 2 L E 9LEN + 2LE 9 L E N + 2 L E ) but counts only one of the two scan directions of a block. On our forward pass, selector included, it gives 11.54 GFLOPs for the dense model (11.31 without the patch embedding, against 11.34 reported by DyVM [64 ] ) and reductions of 19.5, 35.5 and 51.7% at ρ = 0.85 \rho= 0.85 ρ = 0.85 , 0.7 and 0.5, within 0.5 points of our MAC count.
Inference time. We time the deployed networks (selectors, top-k k k , gather and the unchanged blocks) on one RTX 4090 with bf16 autocast, on random clips already on the GPU. After warm-up, we time forward passes with CUDA events and report the median of 200 passes at batch size 1 and of 50 at each of batch sizes 32 and 64. At batch 32 the dense model processes 555 clips per second and the networks at ρ = 0.85 \rho= 0.85 ρ = 0.85 , 0.7 and 0.5 process 651, 783 and 1,133 (1.17, 1.41 and 2.04×, close to the MAC reduction); batch 64 gives 535, 621, 755 and 1,093. At batch 1 the latency is 18.7 ms for the dense model and 19.8, 19.6 and 21.0 ms for the compacted ones: the forward pass is bound by kernel launches, and the three selectors and gathers add kernels.
Results. Table 9 gives the full results; see Main Sec. 3.3 for the Kinetics-400 comparison. Averaged over the three HMDB51 splits, ProbConv reaches 72.72% top-1 with 36% fewer MACs and 71.47% with 52% fewer MACs, 0.05 and 1.30 points below the dense models. The seed-paired gains over zero-mask convolution and step gating are 1.08 ± 0.33 and 1.06 ± 0.26 points, positive in 17 of the 18 pairs of seed and split (the exception: −0.07 on split 2 at ρ = 0.7 \rho= 0.7 ρ = 0.7 ). The gain varies across splits at ρ = 0.7 \rho= 0.7 ρ = 0.7 (+2.00, +0.41 and +0.83 on splits 1, 2 and 3) and is stable at ρ = 0.5 \rho= 0.5 ρ = 0.5 (+1.15, +1.07, +0.96). The DyVM forward with our selector reaches 69.67 ± 0.35 and 71.87 ± 0.32 on HMDB51, 1.80 and 0.85 points below ProbConv at ρ = 0.5 \rho= 0.5 ρ = 0.5 and 0.7. At ρ = 0.7 \rho= 0.7 ρ = 0.7 , compacted fine-tuning of the token norm is close to the zero mask (71.42 against 71.64). On Kinetics-400 at ρ = 0.4 \rho= 0.4 ρ = 0.4 (58% fewer MACs), ProbConv reaches 74.66±0.22. It leads the DyVM forward by 0.80 points, the zero mask by 2.59 and compacted fine-tuning by 3.33. The untuned token norm scores 58.16. At ρ = 0.9 \rho= 0.9 ρ = 0.9 (14% fewer MACs), the gap over the zero mask narrows to 0.45 points. Fine-tuned methods score 75.79–76.30, and the untuned token norm reaches 76.33. Changing the selector learning rate of the zero mask by a factor of three in either direction (10 − 4 10^{-4} 1 0 − 4 or 10 − 3 10^{-3} 1 0 − 3 , one seed) does not help it: 72.94 and 72.91 at ρ = 0.5 \rho= 0.5 ρ = 0.5 (default 73.15) and 75.43 and 75.58 at ρ = 0.85 \rho= 0.85 ρ = 0.85 (default 75.49).
Table 9. Table 9. VideoMamba gains most over zero masking at the tightest Kinetics-400 budgets. VideoMamba-Ti top-1 uses four temporal views and three spatial views per clip with physical compaction. Fine-tuned results give the mean and standard deviation over three seeds. HMDB51 first averages over its three official splits. Two Kinetics columns match published FLOP budgets, and dashes indicate budgets that the original studies did not report. Bold marks the best score among our runs. Rules without fine-tuning are deterministic and have no ±.
Matched to the reported FLOPs. R-MeeTo and DyVM report results at 18% and 38% fewer FLOPs by their own counters. With ρ = 0.861 \rho= 0.861 ρ = 0.861 and 0.681, R-MeeTo’s counter on our network gives 9.44 and 7.23 GFLOPs (−18.2 and −37.3%; in DyVM’s convention, without the patch embedding, −18.5 and −38.1%, against 7.02 of 11.34 GFLOPs reported by DyVM). At ρ = 0.4 \rho= 0.4 ρ = 0.4 , 0.6, 0.8 and 0.9, we use the analytic form of the counter to obtain identical GFLOPs. It agrees with the original counter to within 0.01 GFLOPs at the other six points. The reported rows use the authors’ FLOP counts and 30-epoch schedules. DyVM also skips blocks. At the FLOP budget reported by DyVM, all fine-tuned configurations exceed DyVM’s reported top-1 of 74.3 after 30 epochs. After three epochs, zero masking reaches Table 10 . In VideoMamba, both components contribute to accuracy, with the larger effect coming from step gating. Results give mean ± \pm ± standard deviation over three seeds for top-1 accuracy on HMDB51 split 1 after five epochs, with 4 temporal × \times × 3 spatial views. Δ \Delta Δ compares each variant with ProbConv at the same selection granularity, pairing seeds. A dash marks the ProbConv reference row. Whole frames are n/a at ρ = 0.7 \rho= 0.7 ρ = 0.7 , where 0.7, 0.49 and 0.343 of the 8 frames are not whole frames. The indented rows change one ProbConv component. The compaction baseline fine-tunes with the fixed token-norm rule.
Table 10. In VideoMamba, both components contribute to accuracy, with the larger effect coming from step gating. Results give mean ± \pm ± standard deviation over three seeds for top-1 accuracy on HMDB51 split 1 after five epochs, with 4 temporal × \times × 3 spatial views. Δ \Delta Δ compares each variant with ProbConv at the same selection granularity, pairing seeds. A dash marks the ProbConv reference row. Whole frames are n/a at ρ = 0.7 \rho= 0.7 ρ = 0.7 , where 0.7, 0.49 and 0.343 of the 8 frames are not whole frames. The indented rows change one ProbConv component. The compaction baseline fine-tunes with the fixed token-norm rule.
74.66, compacted fine-tuning reaches 75.08 and ProbConv leads with 76.00 ± 0.06 76.00 \pm0.06 76.00 ± 0.06 . At R-MeeTo’s FLOPs, ProbConv reaches 76.22 ± 0.06 76.22 \pm0.06 76.22 ± 0.06 against 76.5 reported by R-MeeTo after 30 epochs; the token norm without any training already gives 75.99 and compacted fine-tuning 76.13, so at this mild budget training the selector adds little and token merging is 0.3 points better. With DyVM’s rearranged forward our selector reaches 75.85 ± 0.06 75.85 \pm0.06 75.85 ± 0.06 at DyVM’s FLOPs and 76.26 ± 0.08 76.26 \pm0.08 76.26 ± 0.08 at R-MeeTo’s, within 0.15 points of ProbConv at both.
Ablations. Table 10 changes one part of the training signal of ProbConv at a time on HMDB51 split 1, with the same three seeds. As in Vim, step gating matters most, and more so under stronger compression: without it ProbConv loses 2.20 points at ρ = 0.7 \rho= 0.7 ρ = 0.7 and 5.01 at ρ = 0.5 \rho= 0.5 ρ = 0.5 , on every seed (1.83–2.75 and 4.64–5.42), and falls below the zero mask with step gating. Blocking the gradient through the convolution taps, with the forward pass unchanged, costs 1.00 points at ρ = 0.7 \rho= 0.7 ρ = 0.7 and 1.07 at ρ = 0.5 \rho= 0.5 ρ = 0.5 (0.52–1.24 and 0.52–1.50 on every seed).
A replicate set of runs with the same seeds gives the same picture: ProbConv ahead of every other arm at both budgets, by 1.44 and 0.68 over the zero mask, and step gating worth 1.57 and 4.55 points. Only the effect of the convolution gradient is smaller in the replicate set (0.46 and 0.24 ± 0.42 \pm0.42 ± 0.42 points). The same seed of the same arm differs between the two sets by up to 1.18 points (median 0.33), as much as the spread over seeds and about the binomial standard error of the test set, so we read the differences between the sets as run-to-run variation.
Whole frames. Keeping whole frames (4, 2 and 1 of 8 at ρ = 0.5 \rho= 0.5 ρ = 0.5 , the same cost as tokens) gives 63.64 ± 1.11 63.64 \pm1.11 63.64 ± 1.11 with ProbConv and 62.16 ± 1.26 62.16 \pm1.26 62.16 ± 1.26 with the zero mask on HMDB51 (three seeds, replicate set), 9.0 and 9.3 points below token selection (Table 10 ). Because VideoMamba orders tokens frame by frame, removing whole frames changes the convolution neighborhood only of the three tokens next to each boundary between kept frames, so we expected the two arms to agree. The seed-paired difference, + 1.48 ± 1.78 +1.48 \pm1.78 + 1.48 ± 1.78 (2.88, 2.09 and − 0.52 -0.52 − 0.52 ), is within the variation across seeds.
Tokens kept. Main Figure 7 and Fig. 3 show when each token is dropped by ProbConv, zero masking with step gating and compacted fine-tuning with token-norm selection. For each clip, we show the center crop of the second temporal view from the Kinetics-400 runs at ρ = 0.5 \rho= 0.5 ρ = 0.5 (seed 1). The eight clips of Fig. 3 are drawn with Python’s random.Random().sample from the validation list in annotation order. The clip of Main Fig. 7 was picked for legibility from 48 clips of every 50th validation clip (the 16 with the most motion, the 16 on which ProbConv and the zero mask keep the most different tokens and 16 evenly spaced). We analyze every 50th validation clip (398 clips). For tokens that survive all cuts, the preceding token in scan order, corresponding to the left neighbor, also survives in 57% of cases with zero masking, 37% with ProbConv and 41% with token-norm compaction. For the neighbor above, the corresponding rates are 40%, 35% and 33%. With the zero mask, the convolution of a kept token reads its raw neighbors, so its input is informative only when they are kept too. Seed 2 gives the same shares, and at ρ = 0.7 \rho= 0.7 ρ = 0.7 the left neighbor is kept for 74% with the zero mask and 58% with ProbConv (above: 64 and 57%). Across the 398 clips, the intersection over union between the top-k k k training masks (LapSum at the training temperature) and the masks used for physically compacted inference is 0.985 for ProbConv. For the zero mask, it is 0.725 because the second and third cuts compute scores on a different network during training.
Frame selection in a convolutional video network
Host. OCSampler [35 ] selects N N N of T T T candidate frames in one step: a skim network, MobileNetV2 [54 ] with temporal shift [34 ] at 128 2 128^2 12 8 2 , scores every candidate with a linear head, and a classifier runs on the N N N selected frames in temporal order. We use X3D-S [12 ] (Kinetics-400 weights, 160 2 160^2 16 0 2 ) as the classifier, with T = 10 T=10 T = 10 and N = 4 N=4 N = 4 , on ActivityNet-v1.3 [5 ] (10,014 of the 10,024 training and 4,916 of the 4,926 validation videos), with the split files and the candidate sampling of OCSampler: the video is cut into T T T equal segments, and a candidate is a random frame of its segment in training and the middle frame at test time. X3D-S has no temporal stride, and its temporal convolutions are depthwise, 5 × 1 × 1 5 \times1 \times1 5 × 1 × 1 in the stem and 3 × 3 × 3 3 \times3 \times3 3 × 3 × 3 in every block. The selected frames form a compacted clip, so each temporal convolution of the deployed classifier sees the neighbors that survive selection, not the neighbors in the video.
ProbConv in X3D-S. We apply the centered ProbConv of Eq. (15) to every temporal convolution, with two taps on each side in the stem and one in every block. In the squeeze-and-excitation units and the global pool, we weight each frame by its keep probability. At binary keep probabilities the outputs at the kept frames equal X3D-S on the compacted clip, which we check numerically; at p ≡ 1 p \equiv1 p ≡ 1 the network is the dense X3D-S. BatchNorm uses its running statistics, so the dropped frames never enter batch statistics. The zero-mask control multiplies the input of every temporal convolution by the keep probabilities instead, so a kept frame sees zeros where its neighbors were dropped.
Learning signals. Let S ∼ π θ S \sim\pi_\theta S ∼ π θ be a selected set of N N N candidates, m ∈ { 0 , 1 } T m \in\{0,1\}^{T} m ∈ { 0 , 1 } T its mask, p = E π [ m ] p = \mathbb{E}_{\pi}[m] p = E π [ m ] the exact marginals of the policy (differentiable in θ \theta θ ), and r ( S ) r(S) r ( S ) the OCSampler reward of the classifier on the compacted clip: the probability of the true class, minus the largest probability when the prediction is wrong. Let g ( p ) g(p) g ( p ) be the same reward of the ProbConv network at keep probabilities p p p ; at binary keep probabilities it computes the compacted clip, so g ( m S ) = r ( S ) g(m_S) = r(S) g ( m S ) = r ( S ) . All arms share the skim network, the policy head, the data and the optimizer, and differ only in the gradient:
REINFORCE (OCSampler, our reimplementation): ( r ( S ) − r ( S T S N ) ) ∇ log π ( S ) + ξ ∇ H (r(S) - r(S_{\mathrm{TSN}})) \nabla\log\pi(S) + \xi\nabla H ( r ( S ) − r ( S TSN )) ∇ log π ( S ) + ξ ∇ H , with the reward of the uniformly sampled clip as baseline, the entropy H H H of the scores and ξ = 0.1 \xi=0.1 ξ = 0.1 ; π \pi π draws N N N candidates without replacement from the softmax of the scores, as in OCSampler.
ProbConv, top-N N N : the cross-entropy of the ProbConv network at TopK N ( s ) + p − sg ( p ) \operatorname{TopK}_{N}(s) + p - \operatorname{sg}(p) TopK N ( s ) + p − sg ( p ) , with exact-budget LapSum probabilities p p p [59 ] (Main Sec. 2.3); λ = 0 \lambda=0 λ = 0 : the same with the gradient to p p p only through the weighted means; soft: the ProbConv network at the LapSum probabilities, without straight-through.
ProbConv, sampled: the same cross-entropy at m + p − sg ( p ) m + p - \operatorname{sg}(p) m + p − sg ( p ) with m ∼ π m \sim\pi m ∼ π and p p p the marginals of π \pi π , i.e., the gradient of ProbConv on the masks the policy draws.
ProbConv baseline: REINFORCE with g ( p ) g(p) g ( p ) in place of the uniform clip.
MuProp [17 ] with the ProbConv network as the model of the reward: the control variate c ( m ) = g ( p ) + a ⊤ ( m − p ) c(m) = g(p) + a^{\top}(m-p) c ( m ) = g ( p ) + a ⊤ ( m − p ) , a = ∂ g / ∂ p a = \partial g/\partial p a = ∂ g / ∂ p , gives ( r ( S ) − η c ( m ) ) ∇ log π ( S ) + η a ⊤ ∇ p + ξ ∇ H (r(S)-\eta\,c(m)) \nabla\log\pi(S) + \eta\,a^{\top}\nabla p + \xi\nabla H ( r ( S ) − η c ( m )) ∇ log π ( S ) + η a ⊤ ∇ p + ξ ∇ H . Since c c c is linear in m m m and E π [ m ] = p \mathbb{E}_{\pi}[m] = p E π [ m ] = p exactly, the estimator is unbiased for every η \eta η ; we use η = 1 \eta=1 η = 1 and the variance-minimizing η ∗ = − E [ g s f , g c v ] / E [ ∥ g c v ∥ 2 ] \eta^{*} = -\mathbb{E}[\mathit{g}_{\mathrm{sf}},\mathit{g}_{\mathrm{cv}}]/\mathbb{E}[\|\mathit{g}_{\mathrm{cv}}\|^{2}] η ∗ = − E [ g sf , g cv ] / E [ ∥ g cv ∥ 2 ] , estimated from the previous minibatches and clipped to [ 0 , 2 ] [0,2] [ 0 , 2 ] .
REINFORCE + λ +\lambda + λ ProbConv: the sum of the REINFORCE loss and λ \lambda λ times the top-N N N ProbConv loss.
Besides the sampler of OCSampler, we use conditional Poisson sampling [20 ] , π ( S ) ∝ ∏ t ∈ S e s t \pi(S) \propto\prod_{t \in S} e^{s_t} π ( S ) ∝ ∏ t ∈ S e s t , and systematic sampling [44 ] with LapSum marginals. The marginals of sampling without replacement come from a dynamic program over the 2 T 2^T 2 T subsets. On a toy problem with all sets enumerated (T = 6 T=6 T = 6 , N = 2 N=2 N = 2 , float64), the expectations of REINFORCE, of the ProbConv baseline and of MuProp at η ∈ { 0 , 1 2 , 1 , 2 } \eta\in\{0,\frac{1}{2},1,2\} η ∈ { 0 , 2 1 , 1 , 2 } equal the exact gradient up to a relative error of 2 ⋅ 10 − 15 2 \cdot10^{-15} 2 ⋅ 1 0 − 15 .
Protocol. We follow the two stages of OCSampler. Stage I trains X3D-S on N N N random candidates in temporal order, i.e., on the compacted clips it will run, and the skim network on all T T T candidates (SGD with Nesterov momentum, batch 64, cosine schedule, 50 epochs, learning rates 0.005 and 0.01). Stage II freezes the classifier and trains the skim network and the policy head for 50 epochs with the same optimizer. Every learned rule is evaluated by the top-N N N scores of its policy, with the classifier run dense on the compacted clip and one center crop per video, and we report mAP of the final checkpoint on the validation set. Hyperparameters are chosen on a fixed subset of 1000 training videos, with both stages retrained on the remaining ones: for every arm the learning rate in { 3 , 10 , 30 } ⋅ 10 − 4 \{3,10,30\}\cdot10^{-4} { 3 , 10 , 30 } ⋅ 1 0 − 4 , and additionally τ ∈ { 0.3 , 1 , 3 } \tau\in\{0.3,1,3\} τ ∈ { 0.3 , 1 , 3 } for top-N N N ProbConv, η ∈ { 1 , η ∗ } \eta\in\{1,\eta^{*}\} η ∈ { 1 , η ∗ } for MuProp, and λ ∈ { 0.1 , 0.3 , 1 } \lambda\in\{0.1,0.3,1\} λ ∈ { 0.1 , 0.3 , 1 } with the policy or LapSum marginals for the sum. We then retrain each selected configuration on the full training set with three seeds, and use the validation set only to report mAP. Per video, X3D-S costs 0.31, 0.63 and 0.94 GFLOPs on 2, 4 and 6 frames and 1.56 on 10, and the skim network 1.02 GFLOPs on 10 frames at 128 2 128^{2} 12 8 2 (f vcore).
Results. Training through ProbConv on the masks that the policy samples gives the best selection, 76.06 mAP against 75.59 for the REINFORCE of OCSampler (Table 11 ), and matches the released OCSampler sampler on our classifier (75.98; with its own classifier and 6 frames, the released sampler reaches 75.74). Its lead over REINFORCE appears at every learning rate (+0.47, +0.39 and +1.67 at 3, 10 and 30 ⋅ 10 − 4 \cdot10^{-4} ⋅ 1 0 − 4 , with the same seeds), in all three seeds at the two larger rates and in two of three at the smallest. Sampled ProbConv gives 76.06–76.18 mAP across the tested learning rates and 75.87–76.09 across the samplers at the learning rate of Table 13 . The same ProbConv gradient at the top-N N N mask is 0.99 points below REINFORCE, below it in every seed and at every learning rate and temperature: the gradient through the compacted network helps when it is taken on the masks the policy draws, and a deterministic top-N N N mask in training costs about 1.5 points. With deterministic top-N N N selection in both training runs, ProbConv scores 74.60 mAP, 2.73 points above the zero mask at 71.87. Selecting with a zero-filled clip is 3.72 points below REINFORCE and below the uniform rule, the largest gap in the table, so in this host the mismatch between the trained and the deployed network matters more than the estimator. The other learned rules gain 2.4–3.8 points over the uniform rule, against the 7.1 points that separate it from all ten frames.
Table 11. ProbConv trained on sampled masks reaches the mAP of retrained OCSampler. Results give ActivityNet-v1.3 validation mAP for X3D-S with N N N of ten frames. Learned policies use top-N N N selection at inference. Δ \Delta Δ gives the mean and range of paired differences from REINFORCE across three seeds. The released six-frame OCSampler policy also supplies its top N N N candidates to our classifier. Δ \Delta Δ is not given for the training-free rules, which have no seeds, and for REINFORCE itself.
Table 13. Sampled ProbConv gives similar mAP across the tested learning rates and samplers. The left block gives mean validation mAP over three seeds for four of ten X3D-S frames (standard deviation at most 0.38, and 0.50 for the score-function estimators with systematic sampling). The right block measures gradient variance during training and at fixed policy weights. At fixed weights, “cos” compares the mean estimate with the exact gradient of its own objective. Parentheses mark cross-entropy training variances. Dashes mark sampler settings that do not apply to deterministic top-N N N .
Which frames are kept. Table 12 compares the frames kept at N = 4 N=4 N = 4 by the rules of Main Tab. 3 on all 4,916 validation videos, for the three seeds (Main Fig. 8 shows seed 0). ProbConv on sampled masks keeps nearly the same frames as REINFORCE: per video the two share 3.37 of the four frames and the top-1 class in 88.8% of the videos, as much as two REINFORCE runs with different seeds (3.37 and 89.0%). Both spread the four frames over the clip and keep the first or the last candidate in 42–44% of the videos. The zero-mask policy shares 1.75–1.80 frames with either, close to the 1.60 of a random choice, keeps the first or the last candidate in 10.6% of the videos and three consecutive candidates more often (37.7% against 33.1–33.9%). Of the frames kept by the zero-mask policy, 73.6% fall inside annotated action instances, compared with 73.4% for both REINFORCE and ProbConv, 69.9% for the uniform rule and 65.6% for a random choice. Its lower mAP therefore does not come from missing the action.
Table 12. Sampled ProbConv shares about as many frames with REINFORCE as two REINFORCE runs share with each other. Each policy of Main Tab. 3 keeps four of ten candidates on the 4,916 ActivityNet-v1.3 validation videos. The columns give the share of videos with runs of at least two, three or four adjacent candidates, the share that retain either endpoint, and the share of retained frames inside annotated action intervals. The final columns give shared frames and top-1 agreement with REINFORCE, paired by seed. REINFORCE’s own row compares different seeds. Values with ± give mean and standard deviation over three seeds. The uniform rule is deterministic. The random row gives exact values for a uniformly random subset of four candidates, which no classifier evaluates (dash).
Estimators. Table 13 isolates the gradient. “train. tr Cov” is the trace of the minibatch gradient covariance measured during training with OCSampler’s sampler at 10 − 3 10^{-3} 1 0 − 3 over epochs 0–9. This measurement includes data noise. For the fixed-weight columns, we use the REINFORCE policy and score all 210 sets for each of 128 training videos with test-time transforms. This gives the exact gradient g ∗ g^* g ∗ of the estimator’s objective: expected reward, or expected cross-entropy for ProbConv. We draw each estimate 32 times, resampling only the set. At fixed weights, “tr Cov” is relative to ∥ g ∗ ∥ 2 \lVert g^*\rVert^2 ∥ g ∗ ∥ 2 , and “cos” is the cosine similarity between the mean estimate and g ∗ g^* g ∗ . The entries for MuProp with η = 1 \eta=1 η = 1 and for REINFORCE + 0.3 ProbConv with the two other samplers come from a separate run, as do the fixed-weight results for the latter; in that run, the remaining estimators differ from the tabulated values by at most 1.1 in “tr Cov” and 0.06 in “cos”. The ProbConv network is a good model of the reward: at fixed policy weights, MuProp with η ∗ \eta^* η ∗ (0.77–0.90) reduces the gradient variance by 1.3–2.4× \times × relative to REINFORCE with the baseline of OCSampler, across the initial policy, six trained policies and both transforms. During training, the reduction is 1.6–2.2× \times × . The reduction does not raise accuracy at the learning rates chosen on held-out data (75.56–75.85 against 75.59), but it removes the sensitivity to a large step: at 3 ⋅ 10 − 3 3\cdot10^{-3} 3 ⋅ 1 0 − 3 REINFORCE drops to 74.51 and the unbiased hybrids keep 75.29–75.65 (+0.78 to +1.14 in paired seeds). ProbConv on sampled masks has a fixed-weight variance of 2.5–3.4 relative to its gradient, an order of magnitude below the unbiased estimators, and its mean is within 0.87–0.95 in cosine of the gradient of the expected loss, against 0.26–0.52 for the top-N N N straight-through. The score-function estimators are the most sensitive to the sampler. Under systematic sampling, at most T T T of the 210 sets have positive probability for a given score vector, so their training variance rises to 300–550 and their mAP falls to 71.97–72.63, close to the uniform rule’s 72.22. Sampled ProbConv keeps 76.02 mAP with the same sampler.
Joint training. OCSampler freezes the classifier in stage II because REINFORCE needs a stationary reward. Training the classifier from the Kinetics-400 weights together with the selection gives, over three seeds (sharing the stage-I skim network) and without tuning, 73.55 ± \pm ± 0.08 for top-N N N ProbConv, 69.46 ± \pm ± 0.17 for a classifier trained on the uniform clip and 69.09 ± \pm ± 0.30 for the zero mask, 4.46 points below ProbConv on every seed (4.09–4.84). The joint mode of OCSampler (REINFORCE and cross-entropy on the sampled clip) reaches 73.17 ± \pm ± 0.80 (72.26–73.76), within noise of top-N N N ProbConv (paired difference 0.39 ± \pm ± 0.84); it runs with the policy log-probabilities in double precision, without which its scores became non-finite in the third epoch (no step was skipped in any reported run). All joint arms stay below the two-stage protocol, which remains the reference for the frame-selection comparisons.
FORCE + 0.3 ProbConv (69.52, 75.71 and 78.68 against 69.45, 75.60 and 78.74). The zero mask costs most when few frames survive: at N = 2 N=2 N = 2 it is 8.92 points below REINFORCE and 1.25 below the uniform rule, at N = 6 N=6 N = 6 1.67 below REINFORCE and above uniform. At its own budget, N = 6 N=6 N = 6 , the released OCSampler sampler is better than every rule we learn (79.09 against 78.79); at N = 2 N=2 N = 2 it is below REINFORCE (68.99 against 69.45).
Frame selection in Uni-AdaFocus
Host. Uni-AdaFocus [60 ] runs a cheap glance network on a coarse view of the whole video, and a learned policy uses its features to choose the frames, and within them the patches, that a large local network processes; the prediction is the sum of the logits of both networks. We keep the temporal part of its X3D variant [12 ] and remove the spatial policy, the patches and the early exit. From T 0 = 48 T_0=48 T 0 = 48 candidate frames per video (ActivityNet-v1.3, the splits and candidate sampling of Sec. 3.2, 160 2 160^2 16 0 2 ), the glance X3D-S sees T G = 16 T_G=16 T G = 16 , one per bin of three candidate frames. A temporal convolution over its detached frame features scores the bins, and the selector of Uni-AdaFocus turns the scores into K = 16 K=16 K = 16 of the 48 candidates: it reads the inverse of the cumulative distribution of the scores at K K K stratified thresholds, interpolating linearly within bins (centered thresholds at test time). The local X3D-L runs on the selected frames in temporal order, i.e. , on a compacted clip. Per video the glance network costs 2.50 and the local network 4.82 GFLOPs (fvc- core, without the policy network).
What the policy learns from. The policy loss of Uni-AdaFocus, L t e m p o r a l L_{\mathrm{temporal}} L temporal , is a Monte Carlo proxy on the frame logits of the glance network: it weights them by draws from the softmax of the scores and applies the cross-entropy. The local network, which runs on the selected frames, gives the policy no signal. We add one: a policy pass of X3D-L with ProbConv in every temporal convolution (as in Sec. 3.2) on Other budgets and a second classifier. At two and six frames, we train a separate stage-I classifier for each budget and reuse the skim network from the four-frame setting. Held-out data are used to choose the learning rate from { 3 , 10 } ⋅ 10 − 4 \{3, 10\}\cdot10^{-4} { 3 , 10 } ⋅ 1 0 − 4 and, for top-N N N ProbConv, τ \tau τ from { 0.3 , 1 , 3 } \{0.3, 1, 3\} { 0.3 , 1 , 3 } . For the second stage-I classifier at N = 4 N=4 N = 4 , trained with a different seed, we reuse the settings chosen with the first classifier (Tab. 11). REINFORCE + 0.3 ProbConv also uses its N = 4 N=4 N = 4 configuration at N = 2 N=2 N = 2 and 6. The order of the three main signals holds in every setting. ProbConv on sampled masks is above or level with REINFORCE in paired seeds, by +0.44 [+0.22, +0.67] at N = 2 N=2 N = 2 , +0.32 [+0.00, +0.54] with the second classifier at $N=0.27, +0.43] at N = 6 N=6 N = 6 , and top-N N N ProbConv is below REINFORCE in every seed (−2.07, −1.20, −1.17). The lead of sampled ProbConv shrinks as N N N grows: at N = 6 N=6 N = 6 the score-function rules, soft ProbConv and sampled ProbConv are within 0.24 points of each other. MuProp with η ∗ \eta^* η ∗ again stays close to REINFORCE (+0.11, +0.30, −0.19), and so does REINall 48 candidates at keep values m + p − sg ( p ) m+p-\operatorname{sg}(p) m + p − sg ( p ) , where m m m is the mask the selector drew and p p p its marginals. At binary keep values the pass computes X3D-L on the compacted clip (Main Proposition 2), so its forward is the deployed network and only the gradient flows to p p p . The loss is the cross-entropy of the pass logits plus the detached glance logits. The pass runs the local network in evaluation mode with frozen parameters, so the dropped candidates never enter batch statistics and the networks train identically in every arm. To limit memory use, the policy pass processes 8 of the 32 videos in each batch. The linear interpolation of the selector equals a piecewise constant density over the glance bins, which gives the marginals over the 48 candidates; with collisions between thresholds they are only approximately min ( 1 , K q ) \min(1,Kq) min ( 1 , K q ) (error up to 0.075 for a mild policy and 0.75 for a peaked one), so we also use exact-budget LapSum marginals [59 ] with systematic sampling, whose marginals are exact. Table 14 compares L t e m p o r a l L_{\mathrm{temporal}} L temporal alone, REINFORCE with the reward of OCSampler and the uniform clip as its baseline, and several ways to train through ProbConv. The policy pass is used either alone or with L t e m p o r a l L_{\mathrm{temporal}} L temporal . With L t e m p o r a l L_{\mathrm{temporal}} L temporal , we test ProbConv, ProbConv at λ = 0 \lambda=0 λ = 0 and a soft forward pass at p p p without straight-through. The glance-only variant leaves out X3D-L and replaces L t e m p o r a l L_{\mathrm{temporal}} L temporal with the cross-entropy of X3D-S on its 16 frames, at keep values of 5 sampled frames. L t e m p o r a l L_{\mathrm{temporal}} L temporal alone; REINFORCE with the reward of OCSampler and the uniform clip as baseline; L t e m p o r a l L_{\mathrm{temporal}} L temporal plus the policy pass with ProbConv, with ProbConv at λ = 0 \lambda=0 λ = 0 , or at p p p without straight-through (soft); the policy pass alone; and, without X3D-L, ProbConv in the glance network: the cross-entropy of X3D-S on its 16 frames at keep values of 5 sampled frames replaces L t e m p o r a l L_{\mathrm{temporal}} L temporal . As hybrids (cf. Sec. 3.2) we add the policy pass to the glance ProbConv loss, weight the policy pass by 0.1 or 0.3 next to L t e m p o r a l L_{\mathrm{temporal}} L temporal , add REINFORCE to L t e m p o r a l L_{\mathrm{temporal}} L temporal , and use MuProp [17 ] with the ProbConv X3D-L at p = min ( 1 , K q ) p=\min(1,Kq) p = min ( 1 , K q ) as the model of the reward. Its control variate is linear in the numbers n t n_t n t of thresholds that hit each candidate before collisions are resolved; the strata cover [ 0 , 1 ) [0,1) [ 0 , 1 ) once, so E [ n ] = K q E[n]=Kq E [ n ] = K q exactly and the estimator is unbiased for every η \eta η although the reward reads the mask after collisions (enumerating all hits for K = 4 K=4 K = 4 of 6 candidates with collisions: relative error below 10 − 14 10^{-14} 1 0 − 14 ). We use the variance-minimizing η ∗ \eta^* η ∗ of Sec. 3.2.
Table 14. Training the glance policy with ProbConv improves local X3D-L mAP over the native temporal loss. Uni-AdaFocus uses 16 of 48 frames for X3D-L and 16 glance frames for X3D-S on ActivityNet-v1.3, with spatial selection disabled. “Uniform rule” evaluates the trained networks with a flat policy. “Local only” uses X3D-L logits alone. Validation mAP gives the mean and standard deviation over three seeds. “No policy” has no learning-rate ratio or separate flat-policy evaluation. The “dev” column gives mAP for one seed on the 1,000 held-out training videos used to select the policy learning-rate ratio. The quantile selector is that of Uni-AdaFocus; the policy-pass arms other than the quantile row use LapSum.
Training and evaluation
All networks train together from the Kinetics-400 weights with the losses of Uni-AdaFocus on the drawn compacted clip: the cross-entropy of the summed logits and of the mean frame logits of each network. We use the optimizer of the official Kinetics script, SGD with momentum 0.9, learning rate 0.0025 at batch 32 (0.005 at 64), scaled by 0.5 for the glance network and 0.4 for the policy, weight decay 5 ⋅ 10 − 5 5\cdot10^{-5} 5 ⋅ 1 0 − 5 , gradient clipping at 20, dropout 0.5, a cosine schedule over 50 epochs with one warm-up epoch, and bfloat16. We report the mAP of the final checkpoint with centered thresholds and one center crop, and the same networks with a flat policy (“uniform rule”), which separates what the policy adds at test time from what training with it does to the networks. The ratio of the policy learning rate is chosen per arm on the 1000 held-out training videos of Sec. 3.2, from { 0.12 , 0.4 , 1.2 } \{0.12,0.4,1.2\} { 0.12 , 0.4 , 1.2 } ; the hybrids keep the official 0.4, and the weights of the policy pass are chosen on the same videos. The chosen configuration is trained on the full training set with three seeds. The setting costs 7.32 GFLOPs per video.
Results. L t e m p o r a l L_{\mathrm{temporal}} L temporal is a strong baseline in this host: it is the policy loss that Uni-AdaFocus and its convolutional networks were designed and tuned with, so it is not obvious which ProbConv signal should replace or complement it. We therefore train several (Table 14 ) and select on dev. The two best configurations on dev are both ProbConv variants: the policy pass with the quantile selector (86.89) and ProbConv in the glance network with the policy pass (86.61), against 86.39 for L t e m p o r a l L_{\mathrm{temporal}} L temporal . Both hold up on the validation set (three seeds). The first is level with L t e m p o r a l L_{\mathrm{temporal}} L temporal at K = 16 K=16 K = 16 (83.90 against 83.93) and ahead of it at the smaller budgets (+0.26 at K = 8 K=8 K = 8 and +0.21±0.07, on every seed, at K = 4 K=4 K = 4 ; Table 15 ); the second reaches 84.33, 0.40 points above L t e m p o r a l L_{\mathrm{temporal}} L temporal . Both are ahead of REINFORCE (83.58). All learned signals lie within 83.58–84.33 mAP. Within each run, the policy adds 0.35–1.77 points at test time over a flat policy with the same networks. Trained without a policy, the same networks reach 82.73, 0.85–1.60 points below the learned signals and within the range of the learned networks under a flat policy (82.39–83.49).
Table 15. The glance-trained ProbConv policy improves the local classifier at every tested budget. The local Uni-AdaFocus classifier reads K K K of 48 ActivityNet-v1.3 frames. The glance network reads 16 frames throughout. The table gives validation mAP over three seeds, with standard deviations for fused predictions. “Local only” evaluates X3D-L alone. The no-policy row has no policy learning-rate ratio. The K = 16 K=16 K = 16 columns repeat Table 14 .
The most consistent result, on dev and on validation, is which frames the policy gives to the local network. We keep X3D-L’s weights fixed within each run when comparing its learned and flat policies. ProbConv in the glance network improves local-only mAP by 2.19 points, or 2.49 points with the policy pass (2.05–2.70 across seeds). The corresponding differences are 1.27 for L t e m p o r a l L_{\mathrm{temporal}} L temporal , −1.07 for REINFORCE, 0.53 for L t e m p o r a l L_{\mathrm{temporal}} L temporal plus REINFORCE, and −0.37 for MuProp. REINFORCE is 3.5 points below the flat policy in one seed. ProbConv in the glance network computes X3D-S on the deployable 5-frame clip instead of averaging the logits of independent frames as L t e m p o r a l L_{\mathrm{temporal}} L temporal does. Combined with the policy pass it gives the best local network and the best fused accuracy among the ProbConv arms (84.33), 0.40 points above L t e m p o r a l L_{\mathrm{temporal}} L temporal .
The policy pass through X3D-L with ProbConv does not improve on L t e m p o r a l L_{\mathrm{temporal}} L temporal (83.63–83.93, also at weight 0.3 and with a soft forward pass), and dropping the convolution term of the gradient (λ = 0 \lambda=0 λ = 0 , 83.78) changes nothing against λ = 1 \lambda=1 λ = 1 (83.74): in this host the signal reaches p p p through the weighted pooling, not through the compacted convolutions. MuProp with the ProbConv reward model matches REINFORCE (83.84 against 83.58), and adding REINFORCE to L t e m p o r a l L_{\mathrm{temporal}} L temporal does not raise it (83.69). On dev, at the official learning rate, all learned rules except REINFORCE almost never select the first or last candidate (at most 5% of the videos against 33–39% in the middle; REINFORCE 17% and 11%).
Frame budget. We repeat the main arms with K = 4 K=4 K = 4 and K = 8 K=8 K = 8 of the 48 candidates for X3D-L (Table 15 ), three seeds each, at the learning-rate ratios chosen at K = 16 K=16 K = 16 . The local network costs roughly K / 16 K/16 K /16 of its 4.82 GFLOPs, the glance network stays at 2.50. The local X3D-L branch benefits from the glance-trained ProbConv policy at every budget: 67.43, 76.32 and 80.34 mAP at K = 4 K=4 K = 4 , 8 and 16, against 64.43, 73.33 and 79.52 with L t e m p o r a l L_{\mathrm{temporal}} L temporal and 61.57, 71.80 and 78.04 without a policy. At K = 4 K=4 K = 4 , fused mAP ranges from 82.51 to 82.75 across all configurations, including the networks trained without a policy, because X3D-L alone reaches only 61.6–67.4 mAP and the summed logits largely follow the glance network. At K = 8 K=8 K = 8 , ProbConv in the glance network reaches 83.50 fused mAP. It improves on L t e m p o r a l L_{\mathrm{temporal}} L temporal in every seed, with a paired gain of 0.76±0.38 points, whereas L t e m p o r a l L_{\mathrm{temporal}} L temporal and the networks trained without a policy both score 82.74. ProbConv in the policy pass is level with or slightly ahead of L t e m p o r a l L_{\mathrm{temporal}} L temporal at the two smaller budgets (+0.15 to +0.26; quantile selector at K = 4 K=4 K = 4 : +0.21 ± 0.07, every seed) and slightly behind it at K = 16 K=16 K = 16 (−0.19 to −0.03).
Figure 3 (PDF p. 29). The three selection rules retain different subsets at each cut. VideoMamba-Ti uses ρ = 0.5 \rho= 0.5 ρ = 0.5 on eight randomly drawn Kinetics-400 validation clips. Yellow, pink and blue mark tokens dropped after blocks 6, 12 and 18, respectively. Tokens in their original colors survive all three cuts. Each clip shows the ground-truth class and each rule’s prediction.
Derivations and variants of ProbConv
We derive the expected convolution window and its backward pass, extend the operator to centered kernels, and relate step gating to the expected decay of the scan. At a retained position, the causal convolution reads the most recent surviving tokens. Under independent keep decisions, their expected values give the exact expected pre-activation. Throughout, c t = ProbConv ( x , p ) t c_t = \operatorname{ProbConv}(x,p)_t c t = ProbConv ( x , p ) t denotes the output of Main Eq. (3), before σ ( b + ⋅ ) \sigma(b+\cdot) σ ( b + ⋅ ) , and q t = 1 − p t q_t = 1-p_t q t = 1 − p t .
Equivalence of a block and a stack. Fix a binary mask and let i j i_j i j be the j j j -th kept position. By Main Eq. (4), the convolution at i j i_j i j reads the same projected tokens as the convolution at compacted index j j j . Its bias and activation therefore also agree. For Mamba-2 this applies to every convolved input. Between i j − 1 i_{j-1} i j − 1 and i j i_j i j , every dropped step is the identity by Main Eq. (2) with Δ t \Delta_t Δ t gated to zero. Given equal initial states, induction over the retained positions gives identical scan updates and states at i j i_j i j and j j j . The pointwise readout and residual operations agree at these positions. The reverse direction follows by applying the same argument to the reversed sequence and mask. For a stack, induct over blocks, restricting the statement to the new subset after each nested cut. The argument assumes that intervening operations agree at corresponding retained positions, including any position-dependent inputs.
A worked example. Take K = 3 K=3 K = 3 taps and the output at position t = 4 t=4 t = 4 , conditioned on m 4 = 1 m_4=1 m 4 = 1 . The taps w 1 , w 2 w_1,w_2 w 1 , w 2 read the two most recent survivors among x 1 , x 2 , x 3 x_1,x_2,x_3 x 1 , x 2 , x 3 , which depend on the eight masks of the prefix (0 marks a missing survivor):
Table 1 (PDF p. 30).
Collecting the coefficient of every x j x_j x j gives
c 4 = w 0 ⊙ x 4 + w 1 ⊙ ( p 3 x 3 + q 3 p 2 x 2 + q 3 q 2 p 1 x 1 ) + w 2 ⊙ ( p 3 p 2 x 2 + ( p 3 q 2 + q 3 p 2 ) p 1 x 1 ) . (8) c_4 = w_0 \odot x_4 + w_1 \odot\left(p_3x_3 + q_3p_2x_2 + q_3q_2p_1x_1\right) + w_2 \odot\left(p_3p_2x_2 + (p_3q_2 + q_3p_2)p_1x_1\right). \tag*{(8)} c 4 = w 0 ⊙ x 4 + w 1 ⊙ ( p 3 x 3 + q 3 p 2 x 2 + q 3 q 2 p 1 x 1 ) + w 2 ⊙ ( p 3 p 2 x 2 + ( p 3 q 2 + q 3 p 2 ) p 1 x 1 ) . (8)
The first two masks differ but give the same computation: a kernel with K K K taps reads only which tokens are the K − 1 K-1 K − 1 most recent survivors, and this collapses the 2 t − 1 2^{t-1} 2 t − 1 masks of a prefix into K − 1 K-1 K − 1 expectations. Three steps of Main Eq. (4), a 1 = ( p 1 x 1 , 0 ) a_1=(p_1x_1,0) a 1 = ( p 1 x 1 , 0 ) , a 2 = ( p 2 x 2 + q 2 p 1 x 1 , p 2 p 1 x 1 ) a_2=(p_2x_2+q_2p_1x_1,p_2p_1x_1) a 2 = ( p 2 x 2 + q 2 p 1 x 1 , p 2 p 1 x 1 ) and a 3 = ( p 3 x 3 + q 3 a 2 ( 1 ) , p 3 a 2 ( 1 ) + q 3 a 2 ( 2 ) ) a_3=(p_3x_3+q_3a_2^{(1)},p_3a_2^{(1)}+q_3a_2^{(2)}) a 3 = ( p 3 x 3 + q 3 a 2 ( 1 ) , p 3 a 2 ( 1 ) + q 3 a 2 ( 2 ) ) , give the two brackets of Eq. (2) as a 3 ( 1 ) a_3^{(1)} a 3 ( 1 ) and a 3 ( 2 ) a_3^{(2)} a 3 ( 2 ) .
Proof of Main Proposition 1 and of Main Eq. (3). Let a ^ t = ( s t + 1 ( 1 ) , … , s t + 1 ( K − 1 ) ) \hat{a}_t=(s_{t+1}^{(1)},\ldots,s_{t+1}^{(K-1)}) a ^ t = ( s t + 1 ( 1 ) , … , s t + 1 ( K − 1 ) ) collect the K − 1 K-1 K − 1 most recent survivors among positions ≤ t \le t ≤ t (zero where fewer survive), so that a ^ t = E [ A ^ t ] \hat{a}_t=\mathbb{E}[\hat{A}_t] a ^ t = E [ A ^ t ] . A kept token becomes the most recent survivor and moves the older ones down a rank, and a dropped token changes nothing:
a ^ t = a ^ t − 1 + m t ( S a ^ t − 1 + e 1 x t − a ^ t − 1 ) . (9) \hat{a}_t=\hat{a}_{t-1}+m_t\left(S\hat{a}_{t-1}+e_1x_t-\hat{a}_{t-1}\right). \tag*{(9)} a ^ t = a ^ t − 1 + m t ( S a ^ t − 1 + e 1 x t − a ^ t − 1 ) . (9)
The state a ^ t − 1 \hat{a}_{t-1} a ^ t − 1 is a function of m < t m_{<t} m < t and hence independent of m t m_t m t , so the expectation of Eq. (3) is a t = M t a t − 1 + p t e 1 x t a_t=M_ta_{t-1}+p_te_1x_t a t = M t a t − 1 + p t e 1 x t , which is Main Eq. (4); a ^ 0 = 0 \hat{a}_0=0 a ^ 0 = 0 encodes the zero for missing survivors. At a kept position t t t , the tap w r w_r w r of the compacted convolution multiplies s t ( r ) = a ^ t − 1 ( r ) s_t^{(r)}=\hat{a}_{t-1}^{(r)} s t ( r ) = a ^ t − 1 ( r ) , which does not depend on m t m_t m t , so E [ s t ( r ) ∣ m t = 1 ] = a t − 1 ( r ) \mathbb{E}[s_t^{(r)}\mid m_t=1]=a_{t-1}^{(r)} E [ s t ( r ) ∣ m t = 1 ] = a t − 1 ( r ) , and linearity gives the second equality of Main Eq. (3). At p t = 0 p_t=0 p t = 0 the conditioning event is null, and the right-hand side of Main Eq. (3) defines c t c_t c t by continuity.
Closed form. Unrolling the recurrence gives a t = ∑ j ≤ t M ( j , t ] p j e 1 x j a_t=\sum_{j\le t}M_{(j,t]}p_je_1x_j a t = ∑ j ≤ t M ( j , t ] p j e 1 x j with M ( j , t ] = M t ⋯ M j + 1 M_{(j,t]}=M_t\cdots M_{j+1} M ( j , t ] = M t ⋯ M j + 1 . Each factor is M ℓ = q ℓ I + p ℓ S = E [ S m ℓ ] M_\ell=q_\ell I+p_\ell S=\mathbb{E}[S^{m_\ell}] M ℓ = q ℓ I + p ℓ S = E [ S m ℓ ] , and the factors commute and are independent decisions, so their product is the probability generating function of the number N j , t = ∑ ℓ = j + 1 t m ℓ N_{j,t}=\sum_{\ell=j+1}^{t}m_\ell N j , t = ∑ ℓ = j + 1 t m ℓ of survivors in ( j , t ] (j,t] ( j , t ] , evaluated at the shift:
M ( j , t ] = E [ S N j , t ] = ∑ n = 0 K − 2 P ( N j , t = n ) S n , (10) M_{(j,t]}=\mathbb{E}[S^{N_{j,t}}]=\sum_{n=0}^{K-2}\mathbb{P}(N_{j,t}=n)S^n, \tag*{(10)} M ( j , t ] = E [ S N j , t ] = n = 0 ∑ K − 2 P ( N j , t = n ) S n , (10)
truncated because S K − 1 = 0 S^{K-1}=0 S K − 1 = 0 . With S n e 1 = e n + 1 S^ne_1=e_{n+1} S n e 1 = e n + 1 ,
a t ( r ) = ∑ j ≤ t p j P ( N j , t = r − 1 ) x j , (11) a_t^{(r)}=\sum_{j\le t}p_j\mathbb{P}(N_{j,t}=r-1)x_j, \tag*{(11)} a t ( r ) = j ≤ t ∑ p j P ( N j , t = r − 1 ) x j , (11)
where p j P ( N j , t = r − 1 ) p_j\mathbb{P}(N_{j,t}=r-1) p j P ( N j , t = r − 1 ) is the probability that x j x_j x j survives and is followed by exactly r − 1 r-1 r − 1 survivors up to t t t , i.e., that it is the r r r -th most recent survivor. In the example, a 3 ( 2 ) a_3^{(2)} a 3 ( 2 ) weighs x 2 x_2 x 2 by p 2 P ( m 3 = 1 ) = p 2 p 3 p_2\mathbb{P}(m_3=1)=p_2p_3 p 2 P ( m 3 = 1 ) = p 2 p 3 and x 1 x_1 x 1 by p 1 P ( m 2 + m 3 = 1 ) = p 1 ( p 2 q 3 + q 2 p 3 ) p_1\mathbb{P}(m_2+m_3=1)=p_1(p_2q_3+q_2p_3) p 1 P ( m 2 + m 3 = 1 ) = p 1 ( p 2 q 3 + q 2 p 3 ) . The coefficients are Poisson–binomial probabilities that depend on every p ℓ p_\ell p ℓ between j j j and t t t ; evaluated pair by pair, they cost O ( L 2 ) O(L^2) O ( L 2 ) per rank, whereas the recurrence costs O ( L K D ) O(LKD) O ( L K D ) time and O ( K D ) O(KD) O ( K D ) memory.
Backward pass. Let g t = ∂ L / ∂ c t g_t=\partial\mathcal{L}/\partial c_t g t = ∂ L / ∂ c t ; with the fused epilogue, it is the gradient with respect to σ ( b + c t ) \sigma(b+c_t) σ ( b + c t ) times σ ′ ( b + c t ) \sigma'(b+c_t) σ ′ ( b + c t ) . The state a t a_t a t enters c t + 1 c_{t+1} c t + 1 through the taps and a t + 1 a_{t+1} a t + 1 through M t + 1 M_{t+1} M t + 1 , so its adjoint a ˉ t \bar{a}_t a ˉ t obeys, from a ˉ L = 0 \bar{a}_L=0 a ˉ L = 0 , the reverse recurrence
a ˉ t = M t + 1 T a ˉ t + 1 + ( w 1 ⊙ g t + 1 , … , w K − 1 ⊙ g t + 1 ) , (12) \bar{a}_t=M_{t+1}^{\mathsf{T}}\bar{a}_{t+1}+(w_1\odot g_{t+1},\ldots,w_{K-1}\odot g_{t+1}), \tag*{(12)} a ˉ t = M t + 1 T a ˉ t + 1 + ( w 1 ⊙ g t + 1 , … , w K − 1 ⊙ g t + 1 ) , (12)
an affine scan in reverse order whose maps M t T = q t I + p t S T M_t^{\mathsf{T}}=q_tI+p_tS^{\mathsf{T}} M t T = q t I + p t S T are polynomials in the up-shift. Besides Main Eq. (5), whose inner product runs over ranks and channels, the gradients are
∂ L ∂ x t = w 0 ⊙ g t + p t a ˉ t ( 1 ) , ∂ L ∂ b = ∑ t g t , \frac{\partial\mathcal{L}}{\partial x_t}=w_0\odot g_t+p_t\bar{a}_t^{(1)},\qquad\frac{\partial\mathcal{L}}{\partial b}=\sum_t g_t, ∂ x t ∂ L = w 0 ⊙ g t + p t a ˉ t ( 1 ) , ∂ b ∂ L = t ∑ g t ,
∂ L ∂ w 0 = ∑ t g t ⊙ x t , ∂ L ∂ w r = ∑ t g t ⊙ a t − 1 ( r ) (13) \frac{\partial\mathcal{L}}{\partial w_0}=\sum_t g_t\odot x_t,\qquad\frac{\partial\mathcal{L}}{\partial w_r}=\sum_t g_t\odot a_{t-1}^{(r)} \tag*{(13)} ∂ w 0 ∂ L = t ∑ g t ⊙ x t , ∂ w r ∂ L = t ∑ g t ⊙ a t − 1 ( r ) (13)
with the sums also running over the batch.
Multilinearity and continuity. Under independent keep decisions, c t c_t c t is a polynomial of degree at most one in each p j p_j p j , j < t j<t j < t . It is the unique multilinear extension of the compacted convolution from the vertices. ProbConv is therefore smooth on the closed cube [ 0 , 1 ] L [0,1]^L [ 0 , 1 ] L , and as p → m p\to m p → m it approaches the compacted convolution at first order in ∥ p − m ∥ \lVert p-m\rVert ∥ p − m ∥ . Its derivative in one coordinate is an exact difference,
∂ c t ′ ∂ p t = c t ′ ∣ p t = 1 − c t ′ ∣ p t = 0 , t < t ′ (14) \frac{\partial c_{t'}}{\partial p_t}=c_{t'}\big|_{p_t=1}-c_{t'}\big|_{p_t=0},\qquad t<t' \tag*{(14)} ∂ p t ∂ c t ′ = c t ′ p t = 1 − c t ′ p t = 0 , t < t ′ (14)
the effect of keeping token t t t rather than dropping it, averaged over the other decisions; Main Eq. (5) propagates this difference through the adjoint. At a vertex, where the straight-through estimator evaluates the gradient, the other decisions are fixed, and Eq. (14) is the exact change of the layer’s compacted output when the decision on token t t t alone is flipped. The exact difference applies to the convolution before the activation. After the activation and the rest of the network, the gradient gives a first-order approximation to the change in loss, which we test in Figure 19 .
Figure 19. At 10% of LM FLOPs, ProbConv’s gradient ranks the measured loss changes of single-token flips better than the gradients of the two zero-mask computations. For one POPE question, the first three panels compare predicted and measured loss changes for 729 token additions or removals on symmetric log axes. Colored points mark removals, and gray points mark additions. The fourth panel gives rank correlations over 48 questions, with bars at the medians. The right panel gives the absolute loss gap to physical compaction at the same mask. The example question is the one with the median ProbConv correlation. Only the training forward pass of ProbConv is the deployed network.
Reference algorithm and scan. The sequential reference reads the state before it writes it:
a ← 0 ∈ R ( K − 1 ) × D f o r t = 1 , … , L : c t ← w 0 ⊙ x t + ∑ r = 1 K − 1 w r ⊙ a ( r ) f o r r = K − 1 , … , 2 : a ( r ) ← p t a ( r − 1 ) + q t a ( r ) a ( 1 ) ← p t x t + q t a ( 1 ) r e t u r n σ ( b + c 1 : L ) \begin{aligned}
a&\gets0\in\mathbb{R}^{(K-1)\times D}\\
\mathbf{for}\ t&=1,\ldots,L:\\
c_t&\gets w_0\odot x_t+\sum_{r=1}^{K-1}w_r\odot a^{(r)}\\
\mathbf{for}\ r&=K-1,\ldots,2:\quad a^{(r)}\gets p_ta^{(r-1)}+q_ta^{(r)}\\
a^{(1)}&\gets p_tx_t+q_ta^{(1)}\\
\mathbf{return}\ &\sigma(b+c_{1:L})
\end{aligned} a for t c t for r a ( 1 ) return ← 0 ∈ R ( K − 1 ) × D = 1 , … , L : ← w 0 ⊙ x t + r = 1 ∑ K − 1 w r ⊙ a ( r ) = K − 1 , … , 2 : a ( r ) ← p t a ( r − 1 ) + q t a ( r ) ← p t x t + q t a ( 1 ) σ ( b + c 1 : L )
Updating the ranks in place from r = K − 1 r=K-1 r = K − 1 downwards keeps the new token from being counted twice. The algorithm runs in O ( L K D ) O(LKD) O ( L K D ) time and O ( K D ) O(KD) O ( K D ) memory and is the float64 reference of our tests. The parallel forms compose the affine maps ( M , β ) (M,\beta) ( M , β ) of Main Eq. (4), ( M 2 , β 2 ) ∘ ( M 1 , β 1 ) = ( M 2 M 1 , M 2 β 1 + β 2 ) (M_2,\beta_2)\circ(M_1,\beta_1)=(M_2M_1,M_2\beta_1+\beta_2) ( M 2 , β 2 ) ∘ ( M 1 , β 1 ) = ( M 2 M 1 , M 2 β 1 + β 2 ) , which is associative; by Eq. (4), a composed map is a polynomial of degree K − 2 K-2 K − 2 in S S S , stored with K − 1 K-1 K − 1 coefficients, plus a ( K − 1 ) × D (K-1)\times D ( K − 1 ) × D offset, and an exclusive scan returns every a t − 1 a_{t-1} a t − 1 . The backward pass scans Eq. (12) in the same algebra with S T S^\mathsf{T} S T .
Numerical check
Table 2 checks whole blocks (Main Proposition 2); here we check the operator against the enumeration of all 2 14 − 1 2^{14}-1 2 14 − 1 keep patterns of six random sequences (L = 14 L=14 L = 14 , K = 4 K=4 K = 4 , D = 8 D=8 D = 8 , some p t ∈ { 0 , 1 } p_t\in\{0,1\} p t ∈ { 0 , 1 } ). In float64, the algorithm above matches it to 2 ⋅ 10 − 15 2\cdot10^{-15} 2 ⋅ 1 0 − 15 in the output and 2.5 ⋅ 10 − 14 2.5\cdot10^{-14} 2.5 ⋅ 1 0 − 14 in the gradients with respect to x x x , p p p , w w w and b b b (relative ℓ 2 \ell_2 ℓ 2 error ≤ 1.2 ⋅ 10 − 15 \le1.2\cdot10^{-15} ≤ 1.2 ⋅ 1 0 − 15 ). The float32 CUDA kernel (Sec. 5), with and without the fused bias and SiLU, has relative ℓ 2 \ell_2 ℓ 2 errors ≤ 7.4 ⋅ 10 − 8 \le7.4\cdot10^{-8} ≤ 7.4 ⋅ 1 0 − 8 in the output and ≤ 1.8 ⋅ 10 − 7 \le1.8\cdot10^{-7} ≤ 1.8 ⋅ 1 0 − 7 in the gradients against the enumeration, and ≤ 7.4 ⋅ 10 − 8 \le7.4\cdot10^{-8} ≤ 7.4 ⋅ 1 0 − 8 and ≤ 2.0 ⋅ 10 − 7 \le2.0\cdot10^{-7} ≤ 2.0 ⋅ 1 0 − 7 against the float64 algorithm at the size of a Mamba-130M block (B = 8 B=8 B = 8 , L = 2048 L=2048 L = 2048 , D = 1536 D=1536 D = 1536 ): float32 rounding (2 − 24 ≈ 6 ⋅ 10 − 8 2^{-24}\approx6\cdot10^{-8} 2 − 24 ≈ 6 ⋅ 1 0 − 8 ). Its unit tests also check binary p p p against explicit compaction, p ≡ 1 p\equiv1 p ≡ 1 against conv1d, first-order convergence to the compacted convolution as p p p approaches a vertex (log–log slope 0.93), half precision and bitwise determinism.
The lead over the matched control grows as ρ \rho ρ decreases. VideoMamba-Ti top-1 (%) on Kinetics-400 with 4×3 views and physical compaction at inference (dense: 76.65%). Fine-tuned rows use three epochs (mean ± standard deviation over three seeds). Token-norm fine-tuning compacts the sequence during training. DyVM forward: our selector trained with DyVM’s training forward (Sec. 3.1). Further results: App. Tab. 9.
Table 2.
Bidirectional blocks and centered kernels
In our bidirectional hosts, the backward block applies the causal operator to the reversed sequence and probabilities (Main § 2.2 ); since reversal commutes with compaction, Main Propositions 1 and 2 hold in each direction. A convolution with R − R_- R − taps before and R + R_+ R + taps after the output token, as in non-causal models, needs a second set of states: a ~ t = M t a ~ t + 1 + p t e 1 x t \tilde{a}_t=M_t\tilde{a}_{t+1}+p_te_{1}x_t a ~ t = M t a ~ t + 1 + p t e 1 x t , run from a ~ L + 1 = 0 \tilde{a}_{L+1}=0 a ~ L + 1 = 0 down to t t t , holds the expected nearest survivors among positions ≥ t \ge t ≥ t . The survivors before t t t depend on m < t m_{<t} m < t and those after it on m > t m_{>t} m > t , so conditioning on m t = 1 m_t=1 m t = 1 changes neither, and by linearity
c t = w 0 ⊙ x t + ∑ r = 1 R − w − r ⊙ a t − 1 ( r ) + ∑ r = 1 R + w + r ⊙ a ~ t + 1 ( r ) (15) c_t=w_0\odot x_t+\sum_{r=1}^{R_-}w_{-r}\odot a_{t-1}^{(r)}+\sum_{r=1}^{R_+}w_{+r}\odot\tilde{a}_{t+1}^{(r)} \tag*{(15)} c t = w 0 ⊙ x t + r = 1 ∑ R − w − r ⊙ a t − 1 ( r ) + r = 1 ∑ R + w + r ⊙ a ~ t + 1 ( r ) (15)
requires no joint law of the two neighborhoods: the centered ProbConv is the causal one on the sequence plus the causal one on the reversed sequence, with the centre tap counted once (Fig. 4). A centered kernel has taps on both sides of the output position; the weights on the two sides may differ. The two scans are independent and together take O ( L ( R − + R + ) D ) O(L(R_-+R_+)D) O ( L ( R − + R + ) D ) work, and the backward pass adds the contributions of the two adjoint scans to x t x_t x t and p t p_t p t . At binary p p p , Eq. (15) is the non-causal convolution of the compacted sequence with zero padding, and at p ≡ 1 p\equiv1 p ≡ 1 the dense one. The Mamba hosts need only the causal form, and our CUDA kernel implements only that, for K = 4 K=4 K = 4 . The frame selectors in X3D-S and Uni-AdaFocus use the centered form (Secs. 3.2 and 3.3) through a PyTorch implementation that builds the operators of Eq. (15) as matrices over the frames.
Figure 4 (PDF p. 32). Two causal passes give the centered ProbConv window. One pass tracks the expected retained predecessors and the reverse pass tracks the expected successors. The center tap and bias enter once. With a binary mask, these inputs are exactly those of the centered convolution on the compacted clip. X3D-S and Uni-AdaFocus use this form in their temporal convolutions.
Step gating and the expected decay. Hold the inputs Δ t \Delta_t Δ t , B t B_t B t , v t v_t v t of the scan in Main Eq. (2) fixed. The compacted scan leaves the state unchanged at a dropped step, h t = h t − 1 + m t ( ( e Δ t A − 1 ) h t − 1 + Δ t B t v t ) h_t = h_{t-1} + m_t\left((e^{\Delta_t A}-1)h_{t-1}+\Delta_tB_tv_t\right) h t = h t − 1 + m t ( ( e Δ t A − 1 ) h t − 1 + Δ t B t v t ) , and since h t − 1 h_{t-1} h t − 1 depends only on m < t m_{<t} m < t ,
E h t = ( q t + p t e Δ t A ) E h t − 1 + p t Δ t B t v t . (16) \mathbb{E}h_t = (q_t+p_te^{\Delta_t A})\mathbb{E}h_{t-1}+p_t\Delta_tB_tv_t. \tag*{(16)} E h t = ( q t + p t e Δ t A ) E h t − 1 + p t Δ t B t v t . (16)
The expected decay accumulated over ( j , t ] (j,t] ( j , t ] is ∏ ℓ = j + 1 t ( q ℓ + p ℓ e Δ ℓ A ) = E [ e A ∑ ℓ m ℓ Δ ℓ ] \prod_{\ell=j+1}^{t}(q_\ell+p_\ell e^{\Delta_\ell A})=\mathbb{E}\left[e^{A\sum_\ell m_\ell\Delta_\ell}\right] ∏ ℓ = j + 1 t ( q ℓ + p ℓ e Δ ℓ A ) = E [ e A ∑ ℓ m ℓ Δ ℓ ] , a product of the same form as Eq. (4) with the decay e Δ ℓ A e^{\Delta_\ell A} e Δ ℓ A in place of the shift. Step gating, Δ t ↦ p t Δ t \Delta_t\mapsto p_t\Delta_t Δ t ↦ p t Δ t , writes the same expected input p t Δ t B t v t p_t\Delta_tB_tv_t p t Δ t B t v t but decays by e p t Δ t A e^{p_t\Delta_t A} e p t Δ t A , so it accumulates e A ∑ ℓ p ℓ Δ ℓ e^{A\sum_\ell p_\ell\Delta_\ell} e A ∑ ℓ p ℓ Δ ℓ : the decay of the expected elapsed time instead of the expected decay. The two agree at the vertices. Between the vertices, convexity of the exponential gives e p t Δ t A ≤ q t + p t e Δ t A e^{p_t\Delta_t A}\le q_t+p_te^{\Delta_t A} e p t Δ t A ≤ q t + p t e Δ t A elementwise. The step-gated decay factor is therefore at most the expected decay factor. With a large step and p t = 1 2 p_t=\frac{1}{2} p t = 2 1 , step gating nearly erases the previous state, while the expected decay factor retains about half. Equation (10) is the expectation of the scan only if its inputs do not depend on the mask; inside a block they do, through the convolution, so neither form is the expectation of the block, and both are exact at the vertices (Main Proposition 2). Step gating needs only a rescaled step, which the selective-scan kernels accept. The expected decay of Mamba-1, whose state dimensions decay at different rates under one step per channel, is not a rescaled step; we have not evaluated it.
The operator: implementation, cost and dechunking
Implementation. In our CUDA kernel, each warp processes one (batch, channel) row in tiles of 256 positions, eight per lane. The forward pass stores the rank-( K − 1 ) (K-1) ( K − 1 ) state at the start of each tile. The backward pass recomputes the state inside each tile while running the reverse scan of (12) . Tap gradients are reduced deterministically, inputs may be fp16 or bf16 with fp32 accumulation, and the bias and SiLU are fused into the epilogue. The rank-one state also implements the dechunker of Proposition 1 in fp32.
Table 16 reports the cost of the forward pass alone (fwd) and of the forward and backward pass together (fwd+bwd). We time a Vim-Ti block (B = 64 B=64 B = 64 , D = 384 D=384 D = 384 , L = 197 L=197 L = 197 ), a Mamba-130M block (B = 8 B=8 B = 8 , D = 1536 D=1536 D = 1536 , L = 2048 L=2048 L = 2048 ) and a long sequence (B = 1 B=1 B = 1 , D = 1536 D=1536 D = 1536 , L = 32768 L=32768 L = 32768 ), all with K = 4 K=4 K = 4 taps. The dense causal-conv1d baseline is v1.4.0 of Mamba’s fused path, which fuses bias and SiLU. Our fused kernel computes the forward and backward pass of ProbConv for a Mamba-130M block in 0.61 ms, the time of the dense causal-conv1d kernel of Mamba’s fused path (0.61 ms), although that kernel ignores the probabilities and computes no gradient with respect to them. On the Vim-Ti shape our kernel takes 0.79× \times × its time, at L = 32 K L=32K L = 32 K 1.04× \times × . It is 3.1× \times × faster than cuDNN’s dense depthwise convolution with the same epilogue and 6.8× \times × faster than our earlier CUDA prototype, an advantage that grows to 30× \times × at L = 32 L=32 L = 32 k. Both dense kernels agree with each other to 5 ⋅ 10 − 8 5\cdot10^{-8} 5 ⋅ 1 0 − 8 , and the three implementations of ProbConv agree to 9 ⋅ 10 − 7 9\cdot10^{-7} 9 ⋅ 1 0 − 7 in the output and the gradients. In bf16 on the Mamba-130M shape, our kernel takes 0.12 ms for the forward pass and 0.34 ms for forward plus backward. The corresponding times are 0.45 and 1.19 ms for cuDNN, and 0.15 and 0.36 ms for causal-conv1d.
Expected dechunking
The recurrence for the most recent retained token also gives the expected smoothing dechunker used in our routing experiments. In H-Net [24 ] , the main network processes only the boundary tokens, and a dechunker expands its outputs to the original length. The router computes p t = 1 2 ( 1 − cos ( q t − 1 , k t ) ) p_t=\frac{1}{2}(1-\cos(q_{t-1},k_t)) p t = 2 1 ( 1 − cos ( q t − 1 , k t )) and places a boundary where b t = [ p t ≥ 1 2 ] b_t=[p_t\ge\frac{1}{2}] b t = [ p t ≥ 2 1 ] . At a boundary s s s , the dechunker smooths the output z s z_s z s using e s = w s z s + ( 1 − w s ) e s ′ e_s=w_sz_s+(1-w_s)e_{s'} e s = w s z s + ( 1 − w s ) e s ′ , where s ′ s' s ′ is the previous boundary and w w w is a clipped copy of p p p . Each position t t t copies e e e from the last boundary ≤ t \le t ≤ t .
Proposition 1. If b t ∼ Bernoulli ( p t ) b_t\sim\operatorname{Bernoulli}(p_t) b t ∼ Bernoulli ( p t ) independently, the expected dechunker output is u ˉ t = p t w t z t + ( 1 − p t w t ) u ˉ t − 1 \bar{u}_t=p_tw_tz_t+(1-p_tw_t)\bar{u}_{t-1} u ˉ t = p t w t z t + ( 1 − p t w t ) u ˉ t − 1 , the rank-one state of ProbConv with keep probability p t w t p_tw_t p t w t .
Proof. At a boundary, the output is u t = w t z t + ( 1 − w t ) u t − 1 u_t=w_tz_t+(1-w_t)u_{t-1} u t = w t z t + ( 1 − w t ) u t − 1 . Between boundaries, u t = u t − 1 u_t=u_{t-1} u t = u t − 1 . Averaging the two updates over b t b_t b t gives the recurrence.
Table 16. The fused ProbConv kernel matches dense causal-conv1d for the Mamba-130M block shape. Entries give median forward and forward-plus-backward times in milliseconds over 100 fp32 runs on RTX 4090, including bias and SiLU. The dense kernels omit keep probabilities. The three blocks use Vim-Ti, Mamba-130M and a length-32,768 input.
The same construction factorizes LDARNet’s bidirectional dechunker [30 ] into forward and backward rank-one recurrences (§ 11.1 ). Straight-through boundaries reproduce the hard dechunker in the forward pass. The router receives gradients through both the main network (ProbConv and step gating) and the expected dechunker.
Expected bidirectional dechunker. LDARNet [30 ] averages the output of the forward smoothing dechunker (Proposition 1) with a reverse smoothing value evaluated at the same chunk, w c z c + ( 1 − w c ) r t + 1 w_c z_c + (1-w_c)r_{t+1} w c z c + ( 1 − w c ) r t + 1 , where c c c is the last boundary ≤ t \le t ≤ t and r t + 1 r_{t+1} r t + 1 the reverse smoothed value at the first boundary after t t t . The two factors depend on disjoint sets of boundaries, so the expectation factorizes into E [ w c z c ] + ( 1 − E [ w c ] ) F t + 1 \mathbb{E}[w_c z_c] + (1-\mathbb{E}[w_c])F_{t+1} E [ w c z c ] + ( 1 − E [ w c ]) F t + 1 ; both expectations are forward rank-one recurrences with weight p t p_t p t , and F F F is a backward recurrence of z z z with weight p t w t p_t w_t p t w t . With straight-through boundaries the training forward equals the published hard dechunker, while the router receives gradients through the main network (ProbConv and step gating) and through the exact expected dechunker.
Speech: learned frame dropping
We evaluate frame dropping for CTC recognition both with recovery at the original frame rate and with decoding on the compacted sequence. Soundwave and FastLongSpeech use CTC scores for frame selection and merging, respectively [18 , 70 ] . We adapt Soundwave’s CTC-peak rule and initialize the selector from intermediate CTC scores [31 ] .
With frame recovery, the character CTC head runs at the input frame rate, so it needs a full-length sequence. We restore dropped positions with their representations at the selection layer, o t = m ~ t y t + ( 1 − m ~ t ) x t c u t o_t=\tilde{m}_t y_t+(1-\tilde{m}_t)x_t^{\mathrm{cut}} o t = m ~ t y t + ( 1 − m ~ t ) x t cut , as in skip-and-recover encoders [74 ] . In the setting without recovery, the output layer reads the compacted sequence directly.
Setup and main results
Setup. We use the convolutional front end and Mamba blocks of Mamba-based HuBERT [36 ] (12 layers of width 384, 17.2M parameters, 50 frames per second), with either causal or ExtBiMamba layers. We train the character CTC models [14 ] from scratch on LibriSpeech train-clean-100 [47 ] . After layer 6, the encoder retains a fraction ρ \rho ρ of the frames. Layers 7–12 process the compacted sequence at inference.
At the same frame budget, we compare uniform subsampling, CTC top-k k k and Soundwave’s CTC-peak rule [70 ] . CTC top-k k k keeps frames with the lowest blank posteriors from an intermediate CTC head at layer 6 [31 ] . The learned selector adds a two-layer MLP to the CTC top-k k k score. Its last layer starts at zero. We train it with a zero mask, with ProbConv or with REINFORCE. We also adapt trained dense models to frame dropping, as in DyVPM [64 ] . In a separate setting, we use a vocabulary of 300 BPE units [55 ] and decode directly from the compacted sequence. We report WER with greedy decoding.
Decoding with frame recovery. Compared with CTC top-k k k , zero-mask training raises WER by 9.3 points in the causal encoder trained from scratch, 7.0 in the bidirectional encoder and 19.7 when adapting a trained dense model (Table 17 ). The mask leaves gaps in the sequence processed during training, which the deployed encoder closes when it gathers the kept frames. With ProbConv, the seed-paired WER differences from CTC top-k k k range from − 0.3 -0.3 − 0.3 to + 0.8 +0.8 + 0.8 points. The Soundwave rule gives similar WER to CTC top-k k k . Removing step gating increases WER in every setting, by 0.3 to 2.4 points against ProbConv (Table 20 ), indicating that the state update also matters in this setting. At ρ = 0.3 \rho=0.3 ρ = 0.3 , the variant without the convolution gradient gives the lowest WER (27.1% against 28.9% for CTC top-k k k ). This setting uses a tenfold lower selector learning rate to prevent divergence in one of five seeds (Table 21 ).
Table 17. ProbConv gives lower WER than zero-mask training in both decoding setups. Results give LibriSpeech test-clean WER with greedy CTC decoding and no language model. The left block restores dropped frames for character CTC. The right block decodes BPE units from retained frames. Values give the mean and standard deviation over five seeds, or three for fine-tuning from dense and bidirectional training.
Table 20.
Table 21.
Decoding from the compacted sequence. Without frame recovery, the final CTC head decodes subwords from the kept frames. At ρ = 0.25 \rho=0.25 ρ = 0.25 , zero-mask training yields 80.4% WER, and CTC top-k k k raises test-clean WER by 8.3 points relative to the dense model; the CTC-peak rule is similar (Table 17 ). The selector trained without the convolution gradient reduces WER by 4.7 ± 0.4 4.7 \pm0.4 4.7 ± 0.4 points relative to CTC top-k k k , with an improvement in every seed. Full ProbConv increases it by 1.6 ± 1.8 1.6 \pm1.8 1.6 ± 1.8 points. Uniform subsampling gives the lowest test-clean WER at both budgets. At ρ = 0.5 \rho=0.5 ρ = 0.5 , it also improves on the dense model (23.0 against 24.2%). Removing step gating raises WER to 57.2% at ρ = 0.25 \rho=0.25 ρ = 0.25 , compared with 34.2% for ProbConv. At ρ = 0.5 \rho=0.5 ρ = 0.5 the increase is 1.0 point (Table 17 ).
Figure 5 (PDF p. 34). ProbConv retains more frames near character emissions than zero-mask training. Over 400 randomly sampled LibriSpeech test-clean utterances, the curves show the retained share of frames at each offset from the nearest character emission of the dense model’s intermediate CTC head. The plotted run decodes BPE from a quarter of the frames (seed 0).
Main Figure 9 shows how the selectors cover one utterance, and Fig. 5 where their frames fall around character emissions. CTC top-k k k and the learned selectors favor frames at or near character emissions, with 3–5% of selections in silence compared with 13% for uniform subsampling. Their longest gap in speech averages 0.36–0.43 s, compared with 60 ms for uniform subsampling. At quarter-rate decoding, the zero-mask selector keeps runs of 4.0 consecutive frames on average. For this selector, 57% of the character emissions have no kept frame within 20 ms, which is consistent with its high WER. Full ProbConv keeps longer runs and covers fewer emissions than the variant without the convolution gradient (70% against 78%).
Limitations. The speech encoders train without self-supervised pre-training and have substantially higher WERs than the state of the art. Dropping frames does not reduce wall-clock time in this small encoder (§ 12.2 , Encoder time ). Uniform subsampling gives lower WER than the learned and CTC-based rules when decoding from the compacted sequence.
Additional results
Tables 18 and 19 give test-clean and test-other for the settings of Table 17 ; test-other follows test-clean in every setting.
Seed-paired comparisons and the convolution gradient. Seed-paired differences between ProbConv and CTC top-k k k range from − 0.3 -0.3 − 0.3 to + 0.8 +0.8 + 0.8 WER points; initialized from the CTC top-k k k model the learned selector keeps its accuracy (− 0.0 ± 0.3 -0.0 \pm0.3 − 0.0 ± 0.3 ), as does REINFORCE (− 0.1 ± 0.0 -0.1 \pm0.0 − 0.1 ± 0.0 ). The zero mask and uniform subsampling increase WER relative to CTC top-k k k by 1.9 ± 0.2 1.9 \pm0.2 1.9 ± 0.2 and 3.0 ± 0.4 3.0 \pm0.4 3.0 ± 0.4 points, respectively. The Soundwave rule is indistinguishable from CTC top-k k k (∣ Δ ∣ ≤ 0.1 | \Delta| \le0.1 ∣Δ∣ ≤ 0.1 ). Without the convolution gradient the selector is slightly better in the causal encoder (− 0.9 ± 1.5 -0.9 \pm1.5 − 0.9 ± 1.5 , better on four of five seeds) and worse in the bidirectional one (+ 2.3 ± 0.6 +2.3 \pm0.6 + 2.3 ± 0.6 , against + 0.8 ± 1.2 +0.8 \pm1.2 + 0.8 ± 1.2 for full ProbConv). Scaling that gradient by λ \lambda λ (Table 21 ) shows a monotone trend in the bidirectional encoder (+ 0.8 +0.8 + 0.8 , + 1.5 +1.5 + 1.5 , + 2.1 +2.1 + 2.1 and + 2.3 +2.3 + 2.3 for λ = 1 \lambda=1 λ = 1 , 0.3 0.3 0.3 , 0.1 0.1 0.1 and 0 0 0 ), while in the causal encoder every value lies within the seed noise (− 0.9 -0.9 − 0.9 to + 0.9 +0.9 + 0.9 ); at ρ = 0.3 \rho=0.3 ρ = 0.3 the values for λ = 0.3 \lambda=0.3 λ = 0.3 and 0.1 0.1 0.1 are dominated by one diverging seed (below). With a bidirectional encoder, dropping half of the frames costs only 0.5 points with CTC top-k k k , against 3.7 in the causal encoder.
Table 19. Without frame recovery, training on the compacted network yields substantially lower WER than zero-mask training. The final CTC head reads only the kept sequence. LibriSpeech WER gives the mean and standard deviation over five seeds. Δ \Delta Δ gives the paired test-clean difference from CTC top-k k k for other selection rules. The dense reference retains all frames.
Score-function training. The selector can also learn on the compacted network without a pathwise gradient: REINFORCE [63 ] compacts a Bernoulli sample of the exact-budget probabilities and weights its log-probability by its loss minus the loss of the top-k k k network [51 ] . With one reward per utterance and a few hundred decisions, training on the exact compacted network is what matters for frame selection, and a score-function estimator suffices.
Score-function results. On LibriSpeech test-clean, REINFORCE gives the lowest WER among learned selectors in eight of the nine settings of Table 18 to Table 21 . At ρ = 0.5 \rho=0.5 ρ = 0.5 , it reaches 26.2% WER, a paired difference of −1.3 ± 1.6 points from CTC top-k k k , with lower WER in every seed. At ρ = 0.3 \rho=0.3 ρ = 0.3 , it reaches 28.3% without divergence. It reaches 14.2% in the bidirectional encoder and 27.9% when retrofitted from the dense model. Without frame recovery at ρ = 0.25 \rho=0.25 ρ = 0.25 , it reaches 26.3%, close to uniform subsampling at 26.1%. Its paired differences from CTC top-k k k are −0.8 ± 0.3 at ρ = 0.7 \rho=0.7 ρ = 0.7 and −0.1 ± 0.0 when fine-tuning from CTC top-k k k . Only with the smaller selector learning rate at ρ = 0.3 \rho=0.3 ρ = 0.3 is ProbConv without the convolution gradient better (27.1 against 29.1%).
Table 18. With frame recovery, ProbConv gives lower WER than zero masking on both test splits. The Mamba-based HuBERT encoder retains half of the frames after layer 6 and restores dropped positions before greedy character CTC decoding. Results give LibriSpeech WER without a language model, as means and standard deviations over five seeds for causal training from scratch and three otherwise. “Fine-tuned from dense” adapts the trained dense model of the same seed for 20k steps.
Encoder time. In this 17M-parameter encoder, the convolutional front end takes 88% (causal) and 76% (bidirectional) of the encoder time on an RTX 4090, and the Mamba layers of width 384 are bound by kernel launches rather than by the sequence length: keeping 25 or 50% of the frames after layer 2, 3, 4 or 6 changes the encoder time by −4 to +1%, selection included.
Aggressive budgets. At ρ = 0.7 \rho=0.7 ρ = 0.7 REINFORCE is the best selection rule on average (−0.8 ± 0.3), ahead of ProbConv (−0.3 ± 1.4). At ρ = 0.3 \rho=0.3 ρ = 0.3 seed 0 diverged for the zero mask and for every ProbConv variant, early in training at the peak learning rate, while the other four seeds match CTC top-k k k ; the instability comes from learning the selector at a high pruning rate and not from the operator. We reduce the selector learning rate by a factor of ten (Table 21 , sel. LR×0.1). At the lower selector learning rate, all seeds converge for λ = 0 \lambda=0 λ = 0 and λ = 1 \lambda=1 λ = 1 . The variant without the convolution graTable 20. ProbConv stays close to CTC top-k k k in the half-rate speech comparisons. The first row gives LibriSpeech test-clean WER for CTC top-k k k . Other rows give WER differences in points to CTC top-k k k with the same seed (same initialization and data order), with negative values indicating lower WER. Values summarize five seeds for causal training from scratch at ρ = 0.3 \rho=0.3 ρ = 0.3 and 0.5 0.5 0.5 , and three otherwise. At ρ = 0.3 \rho=0.3 ρ = 0.3 , seed 0 diverged for the zero mask and both ProbConv variants, and at ρ = 0.5 \rho=0.5 ρ = 0.5 the mask degraded on seed 3 (Fig. 6); a smaller selector learning rate prevents the divergence (Table 21 ).
Table 21 . The effect of the convolution gradient depends on the speech encoder and training setting. The first row gives LibriSpeech test-clean WER for CTC top-k k k . Other rows show paired differences in points. λ \lambda λ scales the convolution gradient. At ρ = 0.3 \rho=0.3 ρ = 0.3 , the two columns compare the default selector learning rate, where one seed diverged for the zero mask and every ProbConv variant, with one tenth of that rate. Values summarize five seeds, or three for intermediate λ \lambda λ settings and the bidirectional encoder.
dient gives the lowest mean WER at this budget (27.1%), compared with 28.9% for CTC top-k k k and 29.0% for uniform subsampling. Its paired difference from CTC top-k k k is − 1.7 ± 1.5 -1.7 \pm1.5 − 1.7 ± 1.5 points, with lower WER in four of five seeds. Full ProbConv and the mask stay within the noise of CTC top-k k k (+ 1.3 ± 2.5 +1.3 \pm2.5 + 1.3 ± 2.5 and + 0.8 ± 1.3 +0.8 \pm1.3 + 0.8 ± 1.3 ). At the lower learning rate, seed 0 still diverges for λ = 0.3 \lambda=0.3 λ = 0.3 and 0.1 0.1 0.1 , reaching 40.8% and 39.7% WER, respectively. In the other four seeds, WER is 1.2 to 2.1 points below CTC top-k k k , similar to the variant without the convolution gradient.
Figure 6 (PDF p. 36). Among the runs included in the medians, both ProbConv variants stay at the level of CTC top-k k k at every frame budget, and the zero mask stays above it. Points give median WER for the causal encoder trained from scratch, over five seeds except at ρ = 0.7 \rho=0.7 ρ = 0.7 , where we use three. Bars span the range of the plotted runs. Arrows mark the additional runs above 45% WER, which are excluded from the medians. These are seed 0 of the zero mask and both ProbConv variants at ρ = 0.3 \rho=0.3 ρ = 0.3 (52.5–55.0) and seed 3 of the zero mask at ρ = 0.5 \rho=0.5 ρ = 0.5 (51.2).
Genomics: dynamic chunking in H-Net and LDARNet
We train a one-stage H-Net [[24 ] ] DNA language model on hg38 (14.8M parameters, 4096-base contexts, 20k steps) with the published routing, dechunker and ratio loss towards N N N bases per chunk, and sweep N N N to compare at matched compression. We fine-tune the released LDARNet-110M [[30 ] ] on the 18 Nucleotide Transformer tasks [[10 ] ] with the authors’ full protocol (ten folds, per-task learning rates, early stopping; 540 runs) and on the nine Genomic Benchmarks [15 ] . In both hosts the baseline trains the router with the published mechanism; our arms train it through ProbConv and step gating in the main network and through the expected dechunker. Protocols are in Sec. 1.
Figure 7 (PDF p. 37). At comparable compression, both ProbConv routers reach or improve on the bits per base of the published routing from about three bases per chunk onward. The curves show validation bits per base on hg38 against realized bases per chunk. Points and error bars give means and standard deviations over three seeds. Table 22 gives the target ratios and interpolated differences. Target ratios N N N run from 2 to 10 for the published routing, to 12 for ProbConv and over { 3 , 4 , 6 } \{3, 4, 6\} { 3 , 4 , 6 } for REINFORCE.
Dynamic chunking in H-Net
Routers trained through expected compaction place more boundaries than the ratio loss asks for (2.54 and 2.71 bases per chunk at N = 3 N=3 N = 3 , against 2.95 for the published routing), so we compare the arms along the curves of Fig. 7 (values in Table 22 ). At matched compression, ProbConv without the convolution gradient improves on the published routing by 0.0031 bits per base at 2.95 bases per chunk, 0.0052 at 3.95, 0.0058 at 5.86 and 0.0066 at 7.71; from three bases per chunk on, the gain exceeds the seed standard deviations of both arms. Full ProbConv is on par up to four bases per chunk and 0.0018 better at 5.86. With a stronger ratio loss (α = 0.3 \alpha=0.3 α = 0.3 ) the routers meet the target, and the variant without the convolution gradient gains 0.0029 and 0.0054 directly; with three times the training budget the advantage remains (0.0038 at 3.91 bases per chunk with every seed better, and 0.0075 at N = 8 N=8 N = 8 ; § 14 ). A router trained by REINFORCE, with the threshold boundaries as the self-critical baseline, meets the target compression but is 0.018–0.021 bits per base worse than the published routing, with one reward per window of 4096 bases for about a thousand boundary decisions.
Table 22. At matched compression, both ProbConv routers match or improve on the validation loss of the published routing from about three bases per chunk onward. Loss is measured in validation bits per base with hard routing and summarized over three seeds as mean ± standard deviation. Parentheses give realized bases per chunk. The last three columns interpolate differences relative to the published routing. Negative differences favor the compared method. “Out of range” means the matching compression falls outside the measured curve. REINFORCE ran at N = 3 N=3 N = 3 , 4 and 6 only.
Figure 8 (PDF p. 37). ProbConv improves most Nucleotide Transformer tasks, with the clearest gains on splice sites and enhancers. The mean gain persists at matched compression. The plot gives change in test MCC× 100 \times100 × 100 relative to reproduced routing on 18 Nucleotide Transformer tasks, with 95% confidence intervals. Intervals use ten folds for individual tasks and variation across tasks for the overall means. For the matched-compression comparison, both methods use the pretraining ratio loss. Table 26 and Table 27 give the task and group results.
LDARNet on the Nucleotide Transformer benchmark
Our run of the published fine-tuning reproduces the reported results (74.03 against 73.81 mean MCC), so we compare against the authors’ method at its strength. Training the router through expected compaction raises the mean MCC to 74.34 and improves 14 of the 18 tasks (p = 0.009 p=0.009 p = 0.009 over folds; Fig. 8), mostly splice sites and enhancers, while histone marks and promoters change by at most 0.15; the variant without the convolution gradient performs the same. Both ProbConv routers place more boundaries than the published one, but the gain does not come from the extra chunks: with the pre-training ratio loss applied to both routers, compression is similar (4.08 against 4.85 bases per chunk) and ProbConv remains 0.25 points better (p = 0.02 p=0.02 p = 0.02 over folds), while the ratio loss itself changes neither routing (+0.09 and +0.02). The extra chunks leave inference time within 54–59 ms per batch of 64 on an H100 for any compression between 3 and 6 bases per chunk. Controls with a frozen router and with continued pre-training are in § 15 . On the nine Genomic Benchmarks, where our published-routing runs reproduce the reported accuracies (88.30 against 88.48), the gains are small: +0.21 for ProbConv (p = 0.22 p=0.22 p = 0.22 over folds) and +0.14 with more chunks without the convolution gradient (p = 0.01 p=0.01 p = 0.01 ).
Figure 9 (PDF p. 38). Straight-through ProbConv with step gating agrees across H-Net’s two evaluations. Open markers show validation bits per base using the training computation, and filled markers show the deployed hard forward. The horizontal axis gives realized bases per chunk at target N = 3 N=3 N = 3 . Points are means over three seeds. Values in Table 23 .
Ablations: what must be exact
The training forward must be the deployed computation. In H-Net (Fig. 9), the deployed network raises validation loss by 0.16 bits per base for zero masking and by 0.09 for ProbConv without step gating, relative to their respective training computations. Using the expectation in the forward pass gives gaps of 0.33–0.47 bits per base. Straight-through ProbConv with step gating gives 1.5159 bits per base in both evaluations at N = 3 N=3 N = 3 . Straight-through evaluation at the vertices, where ProbConv is exact, removes the gap by construction. In Table 23 , STE denotes this straight-through training, SOFT the soft forward pass throughout and ANNEAL the annealed probabilities.
Table 23. Among the relaxations, only straight-through ProbConv with step gating gives the same validation loss under the training computation and after hard routing. The table compares validation bits per base at target N = 3 N=3 N = 3 using the training computation and deployed hard routing. “STE,” “SOFT” and “ANNEAL” indicate a binary, soft or annealed training forward, respectively. Values give means and standard deviations over three seeds. The isotropic model has no router and retains every base. “relax.” is n/a for the published routing, which trains its router as in H-Net, and for the isotropic model.
Annealing does not reach the vertices. A soft forward pass sharpened as σ ( logit ( p ) / T ) \sigma(\operatorname{logit}(p)/T) σ ( logit ( p ) / T ) to T = 0.01 T=0.01 T = 0.01 again gives 1.515–1.518 bits per base under the training computation, but after hard routing full ProbConv reaches 1.721 bits per base, and the variant without the convolution gradient and the zero mask lose most of their compression. T T T decays log-linearly from 1 to 0.01 over the first 80% of training. The annealed routers of full ProbConv and of the mask keep the boundary probabilities near the threshold (mean 0.50, against 0.32 under straight-through training), where even a low temperature leaves the relaxation soft. In ReMamba and Cobra the soft forward pass does reach the vertices (§ 16 and § 17 ): a learned temperature or a growing penalty on p i ( 1 − p i ) p_i(1-p_i) p i ( 1 − p i ) drives the selection there.
Which gradients matter. With the forward pass fixed, the router or selector receives gradients through the convolution taps, the step gate and the dechunker. Stopping the convolution gradient changes little on LDARNet and Vim and costs about one point in VideoMamba (0.2–0.5 in the replicate set; Table 7 and Table 10 ). It improves H-Net at matched compression. In speech, the effect depends on the encoder and decoding setup. For the causal encoder, stopping the gradient changes WER by − 0.9 ± 1.5 -0.9 \pm1.5 − 0.9 ± 1.5 points, within the variation across seeds. It raises WER in the bidirectional encoder. At the tighter budget without frame recovery, stopping the gradient lowers WER by 6.3 points. Scaling the convolution gradient by λ \lambda λ produces monotone trends on H-Net and in the bidirectional encoder (Table 21 and Table 24 ). In the genomics and causal speech hosts the benefit thus comes from the exact compacted forward pass and the gradients through the gated scan and the expected dechunker. Cobra is the opposite case: without the convolution gradient its selector falls 5.8 points below ProbConv, and without step gating it loses nothing (Table 35 ). The convolution gradient is therefore host-dependent, from harmful on H-Net to decisive in Cobra. REINFORCE on the exactly compacted network gives the best learned speech selector and the weakest H-Net router in these comparisons. It trails ProbConv by 1.0 point in Cobra. This pattern is consistent with a greater role for the pathwise gradient when many decisions share a sequence-level reward.
Table 24. A larger ratio-loss weight brings ProbConv closer to H-Net’s target compression. Values give mean and standard deviation over three seeds for validation bits per base after hard routing. Parentheses give realized bases per chunk. α \alpha α weights the ratio loss, and λ \lambda λ scales the convolution gradient.
Table 35. Cobra’s useful gradient paths depend on the training forward. The default ProbConv uses an annealed soft forward, and straight-through training uses hard top-k k k . “Deployed forward” indicates whether a binary mask reproduces physical compaction. Results use 2,000 steps on frozen Cobra-3B. Benchmark scores average three seeds, and Avg. gives the mean and standard deviation. Dashes mark absent training components.
Limitations of the genomics experiments. Our H-Net is small and trained for 20k steps, and its ProbConv routers need a stronger ratio loss to reach the target compression. The gains on LDARNet are consistent but small, close to zero on histone marks and promoters and on the nearly saturated Genomic Benchmarks.
Additional H-Net results
Compression and the curves. Table 22 lists the values behind Fig. 7. The routers achieve different compression at the same target N N N : those trained through expected compaction place more boundaries than the ratio loss asks for. At N = 3 N=3 N = 3 , they reach 2.54 and 2.71 bases per chunk, compared with 2.95 for the published routing. At N = 6 N=6 N = 6 , the corresponding values are 4.21 and 4.80, compared with 5.86. We therefore compare the validation loss at the compression each router achieves, and Table 22 interpolates each loss curve at the compression achieved by the published router. Full ProbConv is on par up to four bases per chunk (− 0.0003 -0.0003 − 0.0003 and − 0.0012 -0.0012 − 0.0012 ), 0.0018 better at 5.86, and does not reach 7.71 even at N = 12 N=12 N = 12 . With about two bases per chunk the arms coincide. The published routing stays below the isotropic baseline (1.5244) up to four bases per chunk and the variant without the convolution gradient up to 4.8. At N = 10 N=10 N = 10 the published routing varies strongly across seeds (1.545–1.569). The router trained by REINFORCE meets the target compression (2.99, 3.99 and 6.03 bases per chunk at N = 3 , 4 , 6 N=3,4,6 N = 3 , 4 , 6 ).
Annealing. Annealed to T = 0.01 T=0.01 T = 0.01 , the variant without the convolution gradient and the zero mask lose most of the compression (1.68 and 1.02 bases per chunk at N = 3 N=3 N = 3 ) and end above the isotropic model (1.526 and 1.530). The same pattern appears at N = 4 N=4 N = 4 , where full ProbConv gives 1.714 bits per base and the two other annealed configurations give 1.526 and 1.532.
Calibrated compression. A stronger ratio loss makes the ProbConv routers meet the target, so the comparison needs no interpolation (Table 24 ). With α = 0.3 \alpha=0.3 α = 0.3 the variant without the convolution gradient realizes 2.97 and 3.92 bases per chunk and reaches 1.5143 and 1.5168 bits per base, against 1.5172 and 1.5222 for the published routing at 2.95 and 3.95: direct gains of 0.0029 and 0.0054, which agree with the interpolated ones. Full ProbConv with α = 0.3 \alpha=0.3 α = 0.3 remains on par (1.5168 at 2.91 bases per chunk). Scaling the gradient through the convolution taps moves full ProbConv towards the variant without it: interpolated at 2.95 bases per chunk, the gain is 0.0003, 0.0020, 0.0022 and 0.0031 for λ = 1 \lambda=1 λ = 1 , 0.3, 0.1 and 0.
Longer training. With three times the training budget both routings gain about 0.04 bits per base, and the advantage remains (Table 25 ; its last row is our router minus the published routing). At N = 4 N=4 N = 4 both reach 3.91 bases per chunk, and ProbConv without the convolution gradient is 0.0038 better, with every seed below every seed of the published routing. At N = 8 N=8 N = 8 it is 0.0075 better at a slightly lower compression (7.46 against 7.59 bases per chunk), and its results vary much less across seeds (0.0012 against 0.0066).
Table 25. The stopped-gradient ProbConv router retains its advantage after longer training at matched compression. Results compare H-Net’s published routing and the calibrated ProbConv variant without the convolution gradient at 20k and 60k steps. Validation bits per base give means and standard deviations over three seeds. Parentheses give realized bases per chunk. The N = 4 N=4 N = 4 routers both achieve 3.91 bases per chunk after 60k steps.
Additional LDARNet results
Per-task results. Table 26 gives the per-task results from Fig. 8. Table 27 groups the results by task family and gives tests across tasks and folds. On each task, our reproduction falls within or near the reported interval. ProbConv’s largest gains are on splice sites (up to +1.7, or +1.9 without the convolution gradient), H3 and enhancers. Its largest loss is on H3K79me3 (−0.7). The variant without the convolution gradient improves 14 of 18 tasks (+0.28; 105 of 180 folds, p = 0.011 p=0.011 p = 0.011 ), and both variants stop early at the same epoch as the baseline (about 14 epochs). Without the ratio loss, the gain of ProbConv is larger on the folds where it compresses at least as much as the baseline (+0.65 against +0.19).
Table 26. ProbConv improves on reproduced LDARNet routing on most of the 18 tasks. Entries give test MCC×100 with 95% confidence intervals over ten folds. The Δ \Delta Δ columns give differences relative to the reproduced router, paired by fold. Bold differences have intervals excluding zero. The Wilcoxon tests use either task means or paired task–fold results. “Reported” refers to the original results, and “reproduced” identifies our run of the published routing. The counts and tests refer to the differences only (empty cells elsewhere).
Table 27. ProbConv’s mean MCC gain on LDARNet persists at comparable compression. The upper block groups the 18 Nucleotide Transformer tasks by family and averages test MCC×100 over tasks after averaging each task over ten folds. The lower block compares the reproduced router and ProbConv with the pre-training ratio loss applied to both. Tests compare ProbConv with reproduced routing at the task or task–fold level. Bases per chunk are available for the reproduced and ProbConv configurations. Empty cells: the authors report no bases per chunk, and the second block has only the reproduced routing and ProbConv.
Controls. Table 28 tests other explanations of the gain. “Tasks better” counts the tasks on which a configuration scores higher than the reference row of its block. Each row in the last block identifies the starting checkpoint and the routing method used for fine-tuning. For a continued checkpoint, the routing used during continued pre-training appears in parentheses. With the router frozen at its pre-trained parameters, fine-tuning is worse than with the published routing on five of six tasks (−0.39, p = 0.16 p=0.16 p = 0.16 ). The frozen router keeps 3.56 bases per chunk on these tasks, so the ProbConv routers (3.72 and 3.89) stay close to the compression of pre-training, from which the published fine-tuning drifts to coarser chunks (4.41). On the five histone tasks on which the ProbConv routers drifted furthest from that compression, the ratio loss moves the variant without the convolution gradient from −0.39 to −0.13, which is still a tie with the published routing.
On all 18 tasks, ProbConv improves significantly with and without the ratio loss, and the ratio loss alone does not. Each block reports mean test MCC× 100 \times100 × 100 . Δ \Delta Δ pairs folds against the first row in the block, which serves as the reference (dashes). The p p p -values use a Wilcoxon signed-rank test over task–fold pairs. “Cont.” identifies the released checkpoint after 1,000 additional masked language modeling steps on hg38 with the specified router.
Table 28.
Continued pre-training. Continuing the pre-training of the released checkpoint for 1000 steps lowers the validation MLM loss from 0.911 to 0.899 with the published routing and to 0.898 with ProbConv. With the published routing it gives a small gain after fine-tuning (+0.21, 11 of 18 tasks, p = 0.064 p=0.064 p = 0.064 ). The router pre-trained through ProbConv, however, drifts to 5.79 bases per chunk under the published fine-tuning (4.66 from the released checkpoint), and the fine-tuned model loses 0.49 MCC (p = 0.006 p=0.006 p = 0.006 ). Fine-tuning the continued checkpoint with ProbConv gives 74.14 MCC×100 (+0.11, p = 0.21 p=0.21 p = 0.21 ). This is 0.60 points above the published fine-tuning of the same checkpoint (p < 10 − 5 p<10^{-5} p < 1 0 − 5 ) and 0.20 points below fine-tuning the released checkpoint directly with ProbConv (74.34, p = 0.15 p=0.15 p = 0.15 ). A short continued pre-training thus does not add to the gain of ProbConv, which comes from training the router during fine-tuning.
Genomic Benchmarks. LDARNet is also evaluated on the nine Genomic Benchmarks tasks [15 ] , for which no fine-tuning code is released. We follow its description: the protocol above with top-1 accuracy for model selection and early stopping, its learning rates and batch sizes, and sequences of up to 4096 bases (Table 29 ). Our published-routing runs reproduce the reported accuracies (88.30 against 88.48 on average; within 0.4 points on eight tasks and 1.8 below on the smallest, mouse enhancers with 242 test sequences). The gains here are small. The variant without the convolution gradient improves 7 of 9 tasks (+0.14; Wilcoxon p = 0.04 p=0.04 p = 0.04 over tasks, p = 0.01 p=0.01 p = 0.01 over 90 folds), but it also keeps more chunks (3.27 against 3.88 bases per chunk). Full ProbConv compresses like the published routing (3.74) and improves 5 of 9 tasks (+0.21, p = 0.22 p=0.22 p = 0.22 over folds). Its mean rests on the noisiest task (+2.2 on mouse enhancers), and it is significantly better on open chromatin (+0.36, at 3.94 against 3.53 bases per chunk) and on coding sequences (+0.09). Three tasks are close to saturation (above 95%). With the learning rate of 10 − 3 10^{-3} 1 0 − 3 of the regulatory task, the compression varies widely across folds (published routing 1.5–23 bases per chunk, ProbConv 1.0–3.5), while the mean accuracies of the three routings differ by at most 0.06.
On the nine Genomic Benchmarks, ProbConv matches the reproduced routing on average, and its paired gain has a 95% CI excluding zero on two tasks. LDARNet-110M test accuracy is reported with 95% confidence intervals over ten folds for each of the nine Genomic Benchmarks tasks [15 ] . Δ \Delta Δ pairs folds against the reproduced router, and bold differences have intervals excluding zero. Bases per chunk are medians across 90 runs per routing method. Wilcoxon tests use task means or task–fold pairs. “Reported”: [30 ] . Empty cells: the authors report no bases per chunk, the Δ \Delta Δ columns give no bases per chunk, and the counts and tests refer to the Δ \Delta Δ columns only.
Table 29.
Long-context language modeling: token selection in ReMamba
Host. ReMamba [66 ] adapts a Mamba-2.8B language model [16 ] to long prompts by selective compression. A first pass over the prompt yields last-layer hidden states; the leading fraction ϕ \phi ϕ of the prompt (p p p in [66 ] ) forms a region of n n n candidates, each scored by the cosine similarity between a learned key of the candidate and a learned query of the last prompt token, and the k = ⌈ ρ n ⌉ k = \lceil\rho n \rceil k = ⌈ ρ n ⌉ highest-scoring candidates are kept. A second pass reads projections of the kept states in place of the region, followed by the rest of the prompt, and scales the step Δ \Delta Δ of the kept states by their scores. The second pass thus runs on a compacted sequence, and the selector learns only through the scores of the candidates it already keeps. We follow the published fine-tuning: LoRA of rank 32 for one epoch on 300k OpenOrca instructions [45 ] and 209k long instructions from OpenOrca and LongAlpaca-12k [9 ] , truncated to 6000 tokens, with an effective batch of 128 and a learning rate of 2 ⋅ 10 − 5 2 \cdot10^{-5} 2 ⋅ 1 0 − 5 . Prompts longer than 1600 tokens draw ϕ ∼ U ( 0.1 , 0.3 ) \phi\sim U(0.1, 0.3) ϕ ∼ U ( 0.1 , 0.3 ) and ρ ∼ U ( 0.05 , 0.2 ) \rho\sim U(0.05, 0.2) ρ ∼ U ( 0.05 , 0.2 ) per example, with the same draw in every arm.
ProbConv in ReMamba. We keep the first pass, the region, the scores and the budget, and run the second pass on the uncompacted sequence with keep probability p i p_i p i for candidate i i i and one elsewhere. Every Mamba block of the second pass uses ProbConv in place of its convolution and gates its step by p p p (Main Sec. 2.2), so that at binary p p p the second pass is ReMamba’s compacted one (Main Proposition 2), and every candidate, kept or not, receives a gradient. We train the selector with the soft forward pass (Main Sec. 2.3): the second pass uses the exact-budget LapSum probabilities, with a learned temperature. A second series with the single cosine schedule trains ProbConv straight-through: the temperature decays log-linearly from 1 to 10 − 3 10^{-3} 1 0 − 3 in units of the score range of each example, and the straight-through gradient is scaled by it, which keeps the gradient bounded as the selection sharpens. This series includes a zero mask, with the same step gate and straight-through training but ordinary convolutions on the masked inputs in place of ProbConv. All arms are evaluated with ReMamba’s published compacted inference.
Evaluation. We use the English LongBench-E [1 ] (13 tasks, 3668 examples) with the authors’ evaluation code: greedy decoding, prompts truncated to 5500 tokens, ϕ = 0.18 \phi= 0.18 ϕ = 0.18 and ρ = 0.009 \rho= 0.009 ρ = 0.009 . Rescoring the authors’ released predictions reproduces their reported average of 27.86 exactly. The ReMamba paper specifies a cosine learning-rate schedule for its single epoch [66 ] . The released multi-GPU script advances the scheduler once per process at each optimizer step. The cosine length is set in optimizer steps, so the learning rate completes a cycle every 1,989 of our 3,977 steps, or every 994 steps on the authors’ eight GPUs. Our run ends at the peak learning rate. We read this as a side effect of multi-GPU training, not as the intended schedule, and evaluate both versions. The published schedule uses the released script as written, which lets us compare our reproduction with the released adapter. The other setting uses the single cosine over the epoch described in the paper. Each arm is trained once; re-evaluating the same adapters in float32 changes the average by at most 0.2 points. The task families are question answering (Qasper, MultiFieldQA, HotpotQA, 2WikiMQA), summarization (GovReport, MultiNews), few-shot learning (TREC, TriviaQA, SAMSum), synthetic tasks (PassageCount, PassageRetrieval), and code completion (LCC, RepoBench-P). As in LongBench-E, length buckets are based on word counts.
Results. With the published schedule, our reproduction scores 27.48. The released adapter scores 27.62 in our evaluation, and the authors report 27.86 (Table 30 ). Training the selector through the soft forward pass of ProbConv improves on the reproduced selection with both schedules: by 0.50 with the published schedule (paired interval over examples [0.08, 0.94]; three further runs with 2.5 and 5 times the initial temperature and with an MLP selector gain 0.68–0.83, each with an interval that excludes zero) and by 0.92 with the single cosine schedule ([0.50, 1.35]; Table 31 ). In the second series, the zero mask scores 0.36 below its reproduced selection ([−0.90, 0.14]), and straight-through ProbConv, which differs from it only in the convolution, scores 27.12, 1.21 above the zero mask ([0.72, 1.73]). The single cosine schedule gives lower scores than the published one (the reproduced selection drops from 27.48 to 26.13).
Table 30. Soft-forward ProbConv improves on reproduced ReMamba under both training schedules. The table gives LongBench-E scores for compacted ReMamba (Mamba-2.8B) at ϕ = 0.18 \phi=0.18 ϕ = 0.18 and ρ = 0.009 \rho=0.009 ρ = 0.009 . Δ \Delta Δ uses the reproduction from the same schedule and series as its reference. The straight-through series includes the zero-mask run and its reference, which scores 26.27 (Table 31 ). “Reproduced” is our run of the published selection and “ours” the selector trained through the soft forward pass of ProbConv. Δ \Delta Δ is empty for the published rows and for the reproduced selection itself.
Table 31. Few-shot and code tasks show gains under both ReMamba schedules. LongBench-E differences use the reproduced selection in the same block as the reference. Confidence intervals use 2,000 paired bootstrap resamples of examples stratified by task and length bucket. Bold differences have intervals excluding zero. The zero mask belongs to the second series and is shown with the reproduced selection of that series.
Where the gain comes from. The gains lie in the few-shot tasks (+1.4 and +1.7 with the published and the single cosine schedule; TriviaQA +1.8 and +3.4, code completion (+1.5 and +2.4; LCC +3.8 and +4.3) and summarization (+0.4 and +0.3). The intervals exclude zero for the few-shot tasks and code completion with both schedules, and for summarization with the published one. Document question answering does not improve (−0.5 and 0.0), and the two synthetic tasks stay near chance. ReMamba itself shows the same profile against Mamba fine-tuned without compression in the reported results (QA 21.2 against 21.8, few-shot 46.7 against 37.9). The zero mask gains only in summarization (+1.1 over its reproduced selection) and loses in code completion (−1.6).
What matters. The convolution matters in this host: with the same step gate and straight-through training, a zero mask in place of ProbConv loses 1.21 points (27.12 to 25.91). The soft forward pass works in this setting because training drives the keep probabilities to the vertices. The keys and queries spread the cosine scores about twentyfold, with little change in the learned temperature. By the end of training, 97% of the keep mass lies on the top-k k k candidates, so the soft forward pass uses a selection close to the hard mask at inference.
Vision–language: visual tokens in Cobra
Host. Cobra-3B [71 ] encodes a 384 × 384 384\times384 384 × 384 image with DINOv2 and SigLIP [46 , 67 ] into a 27 × 27 27\times27 27 × 27 grid of 14-pixel patches, projects the 729 tokens into the embedding space of a Mamba-2.8B language model and places them before the text. We evaluate with Cobra’s harness on GQA, VQAv2 (the subsampled split), TextVQA, POPE, VSR and VizWiz [13 , 19 , 23 , 33 , 38 , 58 ] and report their average. Our dense model matches the published numbers within 0.16 points; DTP [49 ] at its native site (layers 16 and 45) reproduces its published 65.8 and 64.9 at r = 0.9 r = 0.9 r = 0.9 and 0.5. Budgets are stated as the fraction of the language model’s FLOPs that remains.
ProbConv in Cobra. The selector, a three-layer MLP on each projected token concatenated with the mean of the tokens, scores the visual tokens at the projector. In training, every Mamba block runs on the full sequence; its causal convolution (K = 4 K = 4 K = 4 ) on the 729-token span is replaced by ProbConv and its step Δ i \Delta_i Δ i multiplied by p i p_i p i (Main Sec. 2.2), so that at binary the network is the compacted one (Main Proposition 2). Weighted LapSum [59 ] gives the keep probabilities at exact budget k k k (measured fp32 budget error 4.6 ⋅ 10 − 5 4.6 \cdot10^{-5} 4.6 ⋅ 1 0 − 5 to 1.2 ⋅ 10 − 4 1.2 \cdot10^{-4} 1.2 ⋅ 1 0 − 4 tokens). Here we use the soft forward pass of Main Sec. 2.3: the LapSum temperature is annealed from 1.5 to 0.2, and a penalty λ ∑ i p i ( 1 − p i ) \lambda\sum_i p_i(1-p_i) λ ∑ i p i ( 1 − p i ) grows from λ = 0.01 \lambda= 0.01 λ = 0.01 to 0.5. Unlike the annealed H-Net routers (Sec. 7.3), this training reaches the vertices: at 25%, the held-out loss is 0.722 with the soft forward pass and 0.722 with the hard mask. Training with the straight-through estimator of Main Sec. 2.3 instead (hard top-k k k forward) gives 60.6 ± 0.2 60.6 \pm0.2 60.6 ± 0.2 at 10% and 64.2 ± 0.1 64.2 \pm0.1 64.2 ± 0.1 at 25%, against 61.1 ± 0.2 61.1 \pm0.2 61.1 ± 0.2 and 64.3 ± 0.1 64.3 \pm0.1 64.3 ± 0.1 (Tab. 35). Inference gathers the hard top-k k k tokens at the projector and runs Cobra’s fused kernels on the shorter sequence. Training uses batch size 1, learning rate 10 − 4 10^{-4} 1 0 − 4 and 2,000 steps on the LLaVA-1.5 mix-
ture [39 ] without any image of the evaluation sets. The in-network variant of Tab. 33 places the same selector after layer 2 to 15, the early site of DTP’s schedule at the same budget.
CUDA kernel. The reference implementation is a PyTorch scan. The CUDA kernel used here is an earlier, unfused version, not the kernel of Sec. 5. On Cobra’s shapes (B = 1 B = 1 B = 1 , d i n n e r = 5120 d_{\mathrm{inner}} = 5120 d inner = 5120 , L = 732 L = 732 L = 732 ) it agrees with the scan to 1.0 ⋅ 10 − 6 1.0 \cdot10^{-6} 1.0 ⋅ 1 0 − 6 relative error in the output and in the gradients with respect to x x x , p p p , the taps and the bias, for fractional and binary p p p . Forward and backward of one layer take 22.4 ms with the scan and 1.09 ms with the kernel, against 0.28 ms for a plain depthwise convolution; a training step takes 1.79–1.89 s and 0.27–0.28 s. Because this unfused kernel is slower than the kernel of Sec. 5, the peers matched to its time receive more steps than our final kernel would give them, so the kernel-matched comparison is conservative for ProbConv.
LoRA. Cobra’s Mamba blocks read in_proj.weight, dt_proj.weight and out_proj.weight directly, bypassing the forward of a wrapper. Our LoRA module (rank 16) therefore exposes the merged weight W + ( α / r ) B A W + (\alpha/ r)BA W + ( α / r ) B A as its weight, so that every call site and fused kernels see the adapters. Every rule of the LoRA setting trains the same adapters for 2,000 steps; “tune the dense model, then prune” applies the training-free rules to the dense model with LoRA. With LoRA, REINFORCE and RLOO train the adapters with the ordinary gradient of the loss of the sampled compacted network (RLOO: the mean over its four samples), while the selector keeps its score-function gradient.
Baselines. Both zero-mask variants share our selector and the LapSum settings, schedule and penalty. The “Zero-mask conv. + step gating” row retains step gating and replaces ProbConv with a plain convolution of x ⊙ p x \odot p x ⊙ p . The “zero mask” row uses the plain Mamba block with a hard top-k k k mask in the forward pass and the LapSum gradient in the backward pass. We floor the mask at 10 − 2 10^{-2} 1 0 − 2 as in DyVM because exact zeros give non-finite gradients in the fused kernels. DyVM [64 ] trains its predictor with its own objective on the frozen backbone, with plain masking (“DyVM predictor”) and with its token rearrangement (“DyVM predictor + forward”). The training-free rules are uniform and random selection, the Δ \Delta Δ score of layer 0 at our site, DTP at its best reachable site and the adaptations of FastV, DART and VTW [7 , 37 , 62 ] to Cobra by the authors of DTP. Table 42 lists how each rule deviates from its own regime.
Table 42. The Cobra comparisons use each baseline under the conditions listed here. The table gives the original setting, the implementation evaluated on Cobra and the additional comparisons for each method.
ProbConv leads at the tight budget, also at equal training time. Cobra-3B mean score (%) on GQA, VQAv2, TextVQA, POPE, VSR and VizWiz [13 , 19 , 23 , 33 , 38 , 58 ] . Percentages in the headers denote remaining LM FLOPs (dense: 65.8% mean score). The upper block uses training-free rules. Lower rows train the selector on a frozen backbone (three seeds, mean ± standard deviation). DyVM predictor: DyVM’s predictor and objective, without or with its rearranged forward. Equal time gives learned baselines 1.4–1.8× as many updates as our CUDA run. Training-free rules have no training time to match. LoRA and GPU-hour comparisons: App. Tab. 32.
Table 1.
Ablations of ProbConv. The three ablations share the selector, LapSum settings, schedule, penalty, 2,000 steps, three seeds and the CUDA kernel. Each changes a single component of ProbConv. No convolution gradient detaches p p p at the input of ProbConv (Main § 2.3 ): the forward pass is identical, and the selector learns only through the step gate. Without step gating keeps ProbConv but not Δ i ↦ p i Δ i \Delta_i \mapsto p_i\Delta_i Δ i ↦ p i Δ i , so even at binary p p p a dropped token decays and writes the scan state and the training network is not the compacted one. REINFORCE runs the stock Cobra with its fused kernels on the physically compacted tokens of a sample m ∼ Bernoulli ( p ) m \sim\operatorname{Bernoulli}(p) m ∼ Bernoulli ( p ) and on the greedy top-k k k tokens, both without a graph, and weights log P ( m ) \log P(m) log P ( m ) by the difference of their losses, the self-critical estimator of the speech experiments (§ 12 ); it takes 0.19 s per step against 0.29 s for ProbConv. Straight-through without the convolution gradient and straight-through without step gating make the first two changes to the straight-through variant of ProbConv. REINFORCE-RLOO draws four samples per step and uses, for each, the mean loss of the other three as its baseline. All arms are evaluated with the same hard top-k k k gather at the projector. With the soft forward pass the selector learns through the convolution taps, and step gating can be removed (61.2 against 61.1). With the straight-through forward, removing either path costs 7 to 10 points (50.3 without the convolution gradient and 50.4 without step gating against 60.6 at 10%, 57.3 and 54.0 at 25%). REINFORCE-RLOO comes within 0.3 points of ProbConv at 10% (60.8) and 0.1 at 25% (64.2).
Matched cost. In the GPU-hour comparison, the other learned methods receive the time of 2,000 ProbConv steps with the PyTorch scan: 4,532 s at 10% and 5,080 s at 25%, including validation. This gives them 4.7–8× as many steps (Table 36 ). In the CUDA comparison, they receive the measured ProbConv runtime of 1,025 s, or 1.1–1.9× as many steps (Table 38 ). We timed RLOO on A100 GPUs only. To estimate its matched step count (9,324 for the scan and 2,110 for the kernel), we use the ratio of REINFORCE runtimes on the two machines. Table 40 lists the costs.
Table 36. Matching the PyTorch-scan budget leaves ProbConv ahead of the listed selectors. Entries give Cobra-3B’s six-benchmark mean over three seeds with a frozen backbone. Each budget compares 2,000 steps with the reference-scan GPU-hour setting. Parentheses give step counts.
With the CUDA kernel, ProbConv reaches the same six-benchmark mean as with the PyTorch scan (seed 0), and peers given its measured time stay below it. At 10% of LM FLOPs, the two ProbConv rows show seed 0. Other rows average three seeds. The measured CUDA time budget is 1,025 s including validation. Rows marked “first pass” use a preliminary budget of 691 s.
Table 38.
CUDA shortens a 2,000-step ProbConv run relative to the PyTorch scan. Training costs are per run on one GH200 at a nominal 10% of LM FLOPs and include validation. The table gives optimizer steps, elapsed seconds and GPU-hours.
Table 40.
More training does not close the gap. At 10% of the language model’s FLOPs, ProbConv has the highest six-benchmark mean under both training-time comparisons. With the GPU-hours of our PyTorch scan, 4.7–8× more steps, the zero-mask arm and DyVM reach only 56.1 and 56.5, zero-mask convolution with step gating 58.7, REINFORCE 60.5 and RLOO 60.9, all below ProbConv (61.1), and the DyVM predictor with rearrangement scores 47.6, with POPE at 51.5–51.9 (Figure 10 ). Our CUDA kernel matches the scan to 10 − 6 10^{-6} 1 0 − 6 in the output and all gradients and makes a training step 6.6–6.9× faster; retrained with it, the selector again scores 61.1, with no benchmark significantly different. Given its measured time, the zero-mask arms reach 58.4 and 57.9 and rearranged DyVM 54.7; REINFORCE, given the same time (3,777 steps), reaches 60.4 and RLOO 60.5. Across all six time-matched comparisons, the gains on GQA, VQAv2 and POPE remain significant in all three seed pairs. The six comparisons include three at the scan budget and three at the measured kernel time (Table 41 ). The TextVQA gain is significant in 17 of the 18 pairs. Figure 12 shows per-benchmark differences for four further comparison pairs. The scores of ProbConv change little after 500 steps (Table 37 ).
Figure 10. ProbConv leads the plotted training-time comparisons at the tight Cobra budget. The figure gives the six-benchmark mean at 10% of LM FLOPs against the cost of one GH200 run. Labels give optimizer steps, and bars span three seeds. The dotted line marks the cost of ProbConv with the CUDA kernel.
Figure 12. ProbConv scores higher on GQA and VQAv2 in every seed pair across the four comparisons shown. The plot gives ProbConv’s score minus the comparison score at a nominal 10% of LM FLOPs (11.3% for the benchmark prompts). Dots give the mean, and bars span the three paired differences.
Table 37. Scores on the three tracked Cobra benchmarks change little after 500 steps. Entries give ProbConv’s mean over three seeds at each training checkpoint for the two LM FLOP budgets.
Table 41. Against the matched zero-mask convolution with step gating, ProbConv’s gains on GQA, VQAv2 and POPE are significant in every seed pair at both budgets. Entries give ProbConv minus the comparison method in points for seed pairs 0, 1 and 2. Unless indicated, the backbone is frozen and the nominal budget is 10% of LM FLOPs. Asterisks mark p < 0.05 p < 0.05 p < 0.05 after Holm correction across the six benchmarks within each seed pair. “n.s.” indicates zero significant pairs. “Mixed” indicates significant differences in both directions.
Evaluation. Learned rules use three seeds. For each pair of runs with the same seed index, we compare the two methods on the same questions: an exact McNemar test for the binary GQA, POPE and VSR, and a paired z z z -test for the soft scores of VQAv2, TextVQA and VizWiz. We apply the Holm correction over the six benchmarks within each seed pair (Table 41 ). The harness scores POPE by arg max over “yes” and “no”; exact bf16 ties, scored as “yes”, occur in 0.6–1.2% of the POPE questions for every rule and do not favor ProbConv.
Results. Table 33 and Figure 11 give the whole budget range: ProbConv at the projector leads every rule below 67% of the FLOPs, and the in-network variant is 1.7–2.9 points behind it up to 25%. At 10% the gain over the zero-mask arm with step gating comes from GQA (+4.2), VQAv2 (+6.3) and POPE (+5.8) (Table 34 ). At 10%, under both cost matchings, the zero-mask and DyVM peers stay below the untrained Δ \Delta Δ score of layer 0 (58.6; Table 36 and Table 38 ), while REINFORCE and RLOO reach 60.4–60.9, still below ProbConv, and the CUDA kernel reproduces the scan-trained selector on every benchmark (largest difference 0.5, none significant; Table 41 ). With LoRA, each training-free rule run both ways (uniform, DTP and the Δ \Delta Δ score) is better tuned for pruning than tuned densely and pruned afterwards, by 1.5–2.8 points at 10% (Table 39 ; its dense row lists the three seeds in parentheses). Tuned for pruning, random selection, FastV and DART reach 59.6, 57.9 and 57.8 at 10%, the learned DyVM predictor and zero mask 58.7 and 56.6, and REINFORCE and RLOO 59.7 and 61.5, all below ProbConv (61.7); at 25% RLOO comes within 0.1 points (64.1 against 64.2).
Figure 11. The gap over zero masking increases as the language-model budget falls. The curves show the six-benchmark mean for frozen Cobra-3B. Solid curves show learned selectors, dashed curves show training-free rules, and diamonds identify zero-mask training of the matched selector. Learned scores average three seeds. Values in Table 33 .
Table 33. ProbConv’s lead over matched zero-mask training grows as the Cobra budget tightens. The table reports the six-benchmark mean for a frozen Cobra-3B backbone. Budgets give the share of LM FLOPs retained. Dense: 65.8. Below 50% of the FLOPs DTP’s native site (16,45) is unreachable, and we report the best of the sites (2,45), (5,45) and (16,45). The in-network ProbConv variant uses the first cut in that schedule. Learned entries average three seeds.
Table 34. The largest gains over the matched zero-mask control occur on GQA, VQAv2 and POPE. The table reports six benchmark scores for frozen Cobra-3B at a nominal 10% of LM FLOPs. Learned rows average three seeds. The dense row provides the all-token reference.
With the same LoRA for every rule, ProbConv keeps the highest mean at both budgets. The table reports Cobra-3B’s six-benchmark mean over three seeds at each LM FLOP budget. Parentheses give the individual dense scores or the observed range where shown. Bold marks the highest score within a block. At 25% one seed of the zero-mask arm has VizWiz 38.8.
Table 39.
Which part of ProbConv matters. Table 35 separates the parts of the training signal; its two gradient columns state, as in Table 7 , which operator carries the gradient through the convolution taps and whether the step gate carries one. Without the gradient through the convolution taps the forward pass is unchanged and reaches the vertices (soft and hard held-out losses 0.773–0.806 and 0.772–0.806 at 10%, against 0.731–0.734 for ProbConv), but the selector is worse than the zero mask and unstable: 54.2, 53.7 and 58.1 at 10%, 62.9, 61.6 and 58.7 at 25%, with the losses on VQAv2 (−13.2), POPE (−11.0) and GQA (−7.9), significant in all three seed pairs at both budgets (Table 41 ). The step gate alone thus carries little information about which tokens to keep. Without step gating the selector matches ProbConv (61.1, 61.1, 61.3 and 64.2, 64.5, 64.6; within 1.2 points on every benchmark), although its training forward differs from the deployed network (held-out loss 0.756–0.758 soft against 0.735–0.746 hard at 10%). With the compacted network, REINFORCE is below ProbConv on every seed: it scores 59.8–60.3 at 10%, compared with 61.0–61.3 for ProbConv, and 63.1–64.2 at 25%, compared with 64.2–64.4. The largest deficits are on POPE (−2.4) and VQAv2 (−2.2), both significant in all three seed pairs at 10%. It is above every other learned peer of Table 32 except its four-sample variant RLOO. In Cobra the selector therefore learns from the gradient of the expected compacted convolution; training on the deployed network is not sufficient, and the exact scan is not necessary.
Table 32. ProbConv retains the highest mean at 10% of LM FLOPs after matching training time. Entries average the percentage scores on GQA, VQAv2, TextVQA, POPE, VSR and VizWiz. Values with ± \pm ± give the mean and standard deviation over three seeds. The fixed scoring rules are deterministic and have no ± \pm ± . The matched-cost columns give competing learned selectors the GPU-hours of the reference scan or the runtime of the CUDA kernel. In the LoRA block, the upper rows keep the scoring rule fixed while training the adapters. Dashes: the training-free rules have no training cost to match, and “Dense + LoRA, then Δ \Delta Δ ” is defined only with LoRA. REINFORCE-RLOO draws four samples per step with a leave-one-out baseline.
What is kept. Figure 13 shows two examples in detail. In the left example, none of the 46 retained patches overlaps the logo. The vision encoder mixes information across the image before token selection. The 19 examples of Figure 15 to Figure 18 are fixed in advance: we take every 97th distinct image of POPE, TextVQA and GQA in index order, at most eight per benchmark, with one question per image. For the 36 projector-level examples, the retained tokens extracted from the language-model inputs match the displayed sets exactly, and the harness reproduces the shown POPE probabilities within 0.016. For DTP, five of six examples match. An occlusion test confirms the patch geometry (the bottom 6-pixel strip of the image changes no token). Figure 14 counts how often each position is kept: ProbConv spreads its budget over the image, the zero-mask arm concentrates on the last raster positions, the Δ \Delta Δ score and DTP always keep the first token, and DyVM keeps a fixed cluster at the bottom left, a SigLIP artifact (Sec. 12). § 18 also tests why the selector of ProbConv works: its gradient, its training dynamics and what its tokens cover.
Figure 13. In the left example, ProbConv is the only one of the seven visualized selection rules to read the logo correctly. The left example asks about the logo, and the right asks about a stop sign. ProbConv retains 46 of 729 tokens, and dimmed patches are dropped. Each panel shows the answers from dense Cobra and ProbConv at a nominal 10% of LM FLOPs; on the left, the zero-mask arms answer “Ctas” and “Gcts” and DTP “Gcts”. Both examples belong to the 19 fixed examples shown with every rule in Figure 15 to Figure 18 .
Figure 14. Cobra selectors differ in how strongly they favor fixed positions. The heat maps give the fraction of images in which each 27 × 27 27 \times27 27 × 27 grid position is retained at 10% of LM FLOPs. Frequencies use 500 POPE, 1,000 TextVQA and 398 GQA images. Brighter positions are selected more often.
Figure 15. The same seven POPE questions reveal different selections and answers across rules. These are examples 1–7 of the 19 fixed Cobra examples. The nominal 10% LM FLOP budget retains 46 of 729 tokens at the projector, or 34 after layer 2 for DTP. Dimmed patches are dropped. Panel titles give each rule’s answer and p ( y e s ) p(\mathrm{yes}) p ( yes ) . Incorrect answers appear in red. The evaluation harness scores an exact bf16 tie as “yes,” marked “tie” here.
Figure 18. The full gallery pairs dense Cobra’s answers with ProbConv’s compacted answers. All 19 fixed examples show the original image beside the selection at a nominal 10% of LM FLOPs. The two labels give the model answers. Dimmed patches are dropped.
What matters. As in ReMamba (Sec. 10), the soft forward pass works here because training drives it to the vertices, where it is the deployed compacted network. With the annealed soft forward at 10% of the language model’s FLOPs, stopping the convolution gradient lowers the mean from 61.1 to 55.3, while removing step gating gives 61.2.
With a straight-through forward, both paths matter: the full model scores 60.6, compared with 50.3 and 50.4 when the convolution gradient or the step gate is removed (Table 35 ). Relative to matched zero-mask training at 10%, the largest gains are on VQAv2 (+6.3), POPE (+5.8) and GQA (+4.2). TextVQA gains 0.7 points against this control and 7.7 against the Δ \Delta Δ score of layer 0. VSR and VizWiz show little consistent benefit. With the same LoRA setup for every rule, ProbConv gives the highest mean at both budgets (61.7 and 64.2). Four-sample RLOO is within 0.2 points (61.5 and 64.1). The layer-0 Δ \Delta Δ score gives 60.1 and 63.2. At batch size 1 on a GH200 the end-to-end time is dominated by the vision encoder and kernel launches (prefill 82–
90 ms for every rule), so pruning the visual span saves little wall-clock time there. On an H100 (bf16 prefill of the vision encoder, projector, selector and language model, synthetic images), the prefill takes 66.0 ms for the dense model and 35.5 and 34.8 ms at 25% and 10% of the language model’s FLOPs at batch size 1. At batch size 32 the compacted networks process 111.9 and 140.9 images per second against 49.5 for the dense model (2.26× and 2.84×), and the selector costs no more than the Δ \Delta Δ rule (110.0 and 137.7 images per second).
Figure 16. The six fixed TextVQA examples compare retained patches and answers across Cobra selectors at a nominal 10% of LM FLOPs. Dimmed patches are dropped, and incorrect answers appear in red. These are examples 8–13 of the gallery introduced in Figure 15 .
Figure 17. The remaining TextVQA and GQA examples compare Cobra selectors at a nominal 10% of LM FLOPs. Dimmed patches are dropped, and incorrect answers appear in red. These are examples 14–19 of the gallery introduced in Figure 15 .
Vision–language: what the Cobra selectors learn
The short convolution in Cobra mixes a retained token with the three preceding survivors. At 46 of 729 visual tokens, these neighbors can be far apart in raster order. Across 500 POPE images, the deployed distance distribution has a peak at 27 positions, one image row. ProbConv already approximates this distribution after 500 training steps, while the zero-mask convolution reads only the three original predecessor offsets (Figure 23 ). We also examine the gradients of the training computations, the evolution of the keep probabilities and what the kept tokens cover. Unless noted otherwise, the diagnostics use seed 0 of the frozen-backbone rules at 10% of the FLOPs (k = 46 k = 46 k = 46 of 729 tokens) and the first 500 distinct POPE images; each diagnostic states the number of questions or images it uses. The learned rules are read at their checkpoints after 500, 1,000, 1,500 and 2,000 steps. Because the visual tokens precede the text, every selector score depends on the image only.
Figure 23. After compaction, the short convolution reads beyond the three original predecessor offsets. ProbConv follows the observed distribution of these distances during training. At left, the white square marks a retained token. The rows show the ProbConv training window after 500 steps, the physically compacted window and the zero-mask training window. At right, curves give predecessor distances in raster positions over 500 POPE images. The solid curve shows deployment, the dashed curve shows training with ProbConv, and shading marks the zero-mask offsets.
ProbConv’s gradient tracks loss changes when tokens are added or removed. We take the 46 tokens kept by the trained ProbConv selector as the reference set S 0 S_0 S 0 . For each of the 729 tokens we flip its membership (drop it if kept, add it if dropped), physically compact the sequence, run the deployed network and record the change of the POPE loss − log softmax { y e s , n o } -\log\operatorname{softmax}_{\{\mathrm{yes},\mathrm{no}\}} − log softmax { yes , no } at the answer position, the readout of the harness. We compare this true change with the first-order change predicted by the gradient ∂ L / ∂ p i \partial L/\partial p_i ∂ L / ∂ p i of each relaxation at p = 1 [ S 0 ] p = \mathbb{1}[S_0] p = 1 [ S 0 ] (held 10 − 6 10^{-6} 1 0 − 6 inside [ 0 , 1 ] [0,1] [ 0 , 1 ] ): ProbConv, the zero-mask convolution with step gating, and the straight-through zero mask, i.e. exactly the gradients the three rules of Table 34 train with. Everything runs in fp32 without autocast; the spread of the base loss over batch compositions is at most 6.1 ⋅ 10 − 5 6.1 \cdot10^{-5} 6.1 ⋅ 1 0 − 5 , below the one-token effects. Over 48 POPE questions (Figure 19 ), the rank correlation between prediction and truth has median +0.20 for ProbConv and is positive for 92% of the questions; for the zero-mask convolution it is +0.03 (positive for 65%) and for the straight-through mask +0.01 (58%). On the ten tokens with the largest true effect the predicted sign is right in 62% of the cases for ProbConv and at chance for the two masks (50% and 52%). The right panel compares each training computation with the deployed network at the same kept set. For ProbConv, the training forward pass computes the deployed network (median loss difference 1.5 ⋅ 10 − 6 1.5 \cdot10^{-6} 1.5 ⋅ 1 0 − 6 , the fp32 floor; Main Proposition 2). The zero-mask convolution and the straight-through mask compute different networks, with median loss differences of 0.66 and 0.03, respectively, so their gradients describe those networks and not the deployed one. A correlation of +0.2 is modest in absolute terms, since a one-token flip is a discrete change that a first-order term captures only in part, but it is the only one of the three that is clearly above zero.
The keep probabilities of ProbConv reach the vertices early. Over training the LapSum probabilities of ProbConv become binary (Figure 20 ): the mean of p i ( 1 − p i ) p_i(1-p_i) p i ( 1 − p i ) falls from 1.1 ⋅ 10 − 2 1.1 \cdot10^{-2} 1.1 ⋅ 1 0 − 2 after 500 steps to 1.4 ⋅ 10 − 3 1.4 \cdot10^{-3} 1.4 ⋅ 1 0 − 3 after 2,000, and the share of tokens with 0.1 < p i < 0.9 0.1 < p_i < 0.9 0.1 < p i < 0.9 from 4.6% to 0.6%. The two zero-mask arms, with the same LapSum, temperature schedule and penalty, stay further from the vertices (2.0 ⋅ 10 − 2 2.0 \cdot10^{-2} 2.0 ⋅ 1 0 − 2 and 3.4 ⋅ 10 − 2 3.4 \cdot10^{-2} 3.4 ⋅ 1 0 − 2 at the end, with 8.6% and 13.1% of the tokens undecided). The selection of ProbConv is also settled early: 69% of its final 46 tokens are already among its top 46 after 500 steps, against 25% for the zero-mask convolution, 43% for the zero mask and 55% for DyVM. This matches the learning curve of Table 37 , which is flat from 500 steps on, and it is what makes the soft forward pass a good proxy here: near the vertices it is the compacted network.
Figure 20. ProbConv’s keep probabilities sharpen over training. At 10% of LM FLOPs, the upper panels show one POPE image and its LapSum temperatures at four checkpoints. Below, the left panel gives mean p i ( 1 − p i ) p_i(1-p_i) p i ( 1 − p i ) over 500 images, the middle panel tracks overlap with the final 46 tokens, and the right panel shows the probability histograms. The left panel includes only the three LapSum-trained rules; DyVM’s sigmoid probabilities carry no budget and are omitted.
One score vector, every budget. Each rule selects its top-k k k tokens by score. For a given token, its rank at the 10% checkpoint equals the smallest k k k at which that ranking retains it (Figure 21 ). On individual images the learned rules follow the content. Averaged over 500 images, the rank map of ProbConv is close to flat with a mild preference for the centre, while the zero-mask convolution ranks the last raster positions (right and bottom of the image) first at every budget, the positional bias already visible in Figure 14 . DyVM ranks a fixed cluster at the bottom left first, and the Δ \Delta Δ score and DTP the first token.
Figure 21. ProbConv’s geometric-mean rank map is nearly flat, while the zero-mask convolution ranks the last raster positions first. The top rows show two POPE images. Bright positions enter the top-k k k set at smaller budgets. The bottom row gives the geometric mean of these ranks over 500 images.
Keeping more of the object does not mean answering better. For each of the 4,053 POPE questions whose answer is “yes” we rasterize all COCO instances of the asked category onto the 27 × 27 27 \times27 27 × 27 token grid, as Cobra sees the image, and measure which share of the object area each rule keeps (Figure 22 ). At 46 tokens DyVM keeps the most (27.1%), followed by the zero-mask convolution (20.6%), ProbConv (17.3%), the zero mask (16.9%), DTP (15.8%), the Δ \Delta Δ score (13.4%) and uniform selection (5.9%; random 6.3%). Coverage alone thus does not explain the ranking of Table 34 . What differs is how useful the kept part is to the language model: when at least one kept token lies mostly (≥ 50 % \geq50\% ≥ 50% ) on the object, ProbConv answers 83.3% of these questions correctly, against 74.8% for DyVM, 77.4% for the zero-mask convolution, 66.6% for the zero mask, 78.8% for the Δ \Delta Δ score, 75.7% for DTP and 74.1% for uniform selection; when no kept token does, every rule is at 15–23%. This is consistent with a selector that is trained through the network it is deployed in and therefore picks the tokens that network can use, rather than the largest share of the object. We measure this association on the “yes” half of POPE for one seed. The questions that satisfy the overlap condition vary across rules.
Figure 22. Object coverage and conditional accuracy rank the selectors differently. The left panel shows retained object area across budgets on 4,053 POPE “yes” questions. The vertical line marks 46 tokens (10% of LM FLOPs), also shown in the middle panel with random selection as a dotted reference. The right panel shows accuracy with at least one retained token whose area is at least half covered by the queried object (solid), and without such a token (light). Objects come from COCO annotations rasterized onto the token grid.
Where the convolution reads from. Each Mamba block of Cobra has a causal convolution with K = 4 K = 4 K = 4 , so a kept token mixes with the three tokens before it in the compacted sequence, which can lie far back in raster order. During training, ProbConv replaces the convolution by its expectation over the compactions: the m m m -th tap reads token j j j with the probability that j j j is the m m m -th kept token before t t t . The zero-mask convolution instead reads the raw neighbours t − 1 , … , t − 3 t - 1, \ldots, t - 3 t − 1 , … , t − 3 , most of them zeroed (Figure 23 ). Over all 500 images and the kept tokens of the final selector, the distance at which the deployed network reads extends far beyond the three raw neighbours, with a peak at 27, the token directly above in the image. The expected window of ProbConv already matches this distribution after 500 steps,
while the zero-mask convolution trains only on distances 1–3.
The fixed cluster of DyVM sits on a high-norm SigLIP token. The bright cells of Figure 14 at the bottom left at grid position (21,2), where SigLIP produces a high-norm token in every image: on 300 POPE images its feature norm is the largest of the grid in all 300 and 3.3 times the median, and its features are nearly the same across images (cosine 0.74, median over positions 0.15; Figure 24 ). DyVM keeps this token in every image and five of its neighbours in 60–100% of them, spending about six of its 46 tokens on positions that carry little image-specific content. ProbConv keeps the token itself in 68% of the images and each of its neighbors in at most 10%, and the Δ \Delta Δ score of layer 0 keeps it in 4%. Across these images, the clearest difference between the training rules is which predecessors the convolution reads after selection (Figure 23 ).
Figure 24. DyVM’s recurring selection cluster overlaps the SigLIP outlier token at grid position (21,2), marked by the dotted square. The first two maps summarize feature norm relative to the median and cross-image cosine similarity over 300 POPE images. The remaining maps show selection frequencies at 10% of LM FLOPs for ProbConv, adapted DyVM and the layer-0 Δ \Delta Δ score on the images used in Figure 14 .