LapMerge makes ordered token merging learnable
LapMerge: Differentiable Exact-Budget Token Merging in Linear Time · arXiv:2610.13858

In plain words
Long token sequences can be costly to process, but simply dropping tokens may lose useful information. LapMerge is a method that turns an ordered sequence into an exact, smaller number of tokens by blending nearby tokens according to learned weights.
In questions about objects in images, it was compared with a method that kept selected visual tokens. LapMerge scored higher at the tighter token budget, while the difference at a less tight budget was uncertain. Its preference for nearby tokens may limit it when useful information is far apart.
The research
When a model processes a long ordered sequence, reducing its tokens can lower later processing cost, but hard score-based cuts can make the scorer impossible to train through. Can a method produce an exact smaller sequence while keeping the token weights connected to the result by a learning signal?
LapMerge smooths token positions and blends inputs within equal-mass intervals, producing an exact output budget with differentiable, linear-work merging.
LapMerge addresses a basic compression question: can an ordered sequence be reduced to an exact number of tokens while still allowing token scores to learn? Hard cumulative-weight cuts can jump when scores change, blocking the gradient signal to the scoring component.
The method smooths token positions, divides their mass into equal portions, and blends contributing tokens. On POPE, a test of whether a vision-language model answers object-presence questions correctly, the frozen model scored higher than selection at a 10% visual-token budget. At 30%, the paired uncertainty interval included zero, so the evidence for an advantage is weaker.
These results do not show that LapMerge improves accuracy across all tasks or token orders. Its aggregation favors nearby positions, and the POPE advantage over selection was not clearly separated from zero at the 30% visual-token budget.
What the evidence shows
- The learning problem
LapMerge is a differentiable operator that reduces an ordered token sequence to exactly N outputs. The question it addresses is how to preserve contributions from input tokens while avoiding a hard partition whose boundaries jump when scores change.
Such jumps make downstream gradients zero almost everywhere, which deprives the scoring component of a learning signal.
- A smooth exact budget
LapMerge assigns non-negative routing mass to each token and smooths token positions with a Laplace kernel. It divides the smoothed mass into N equal portions along the supplied order, then forms one weighted blend of input tokens for each portion.
Because the positions are smoothed, the boundaries can change differentiably with the masses; one token may contribute to multiple outputs.
- Why the operator can scale
The construction uses prefix and suffix scans to calculate boundaries and outputs without a dense matrix connecting every input to every output. For M ordered inputs, N outputs, and token dimension d, the paper proves O((M+N)d) work for the operator's forward and gradient computations once routing masses are available. A sorting-based upstream scorer can add cost beyond that bound.
- A bounded image result
The researchers tested a frozen vision-language model on POPE, which uses yes-or-no questions about whether objects appear in images and measures answer performance with F1. Replacing selected-token values with LapMerge blends raised F1 over selection at a 10% visual-token budget; the paired interval at 30% included zero. This gives stronger evidence at the tighter budget, not a general accuracy guarantee.
- Task and order matter
Results across other tasks were mixed. At a 10% output budget, LapMerge led the tested methods on four Long Range Arena tasks, while all methods were near chance on Pathfinder.
On arXiv topic classification, it beat top-token selection but did not consistently outperform learned pooling. Its preference for nearby positions may be a poor fit when useful evidence is far apart.
Deep
- Original paper authors
- Magdalena Trędowicz, Aleksandra Nowak, Tomasz Steifer, Łukasz Struski, Szymon Płotka
- Submitted to arXiv
- License
- CC BY 4.0