As Vision Transformers (ViTs) and Large Vision-Language Models (VLMs) scale to handle higher-resolution images, longer videos, and multi-modal inputs, they face a fundamental computational bottleneck: the quadratic cost of self-attention. Because the attention mechanism compares every token to every other token, doubling the sequence length quadruples the computational workload.
To mitigate this "token explosion," early techniques relied on token pruning—simply discarding less important tokens. While Joakim Bruslund Haurum et al. demonstrated in Which Tokens to Use? Investigating Token Reduction in Vision Transformers that hard pruning serves as a remarkably resilient baseline, it suffers from binary information loss. If a token is pruned, its unique semantic information is gone forever.
Token merging offers an elegant alternative: instead of throwing redundant tokens away, why not combine them? However, finding which tokens to merge presents a paradox. Exhaustive clustering algorithms require all-to-all similarity checks, reintroduced the very $O(N^2)$ bottleneck that token reduction aims to solve.
Bipartite token merging solves this dilemma. By framing token reduction as a bipartite graph matching problem, it allows models to identify and consolidate redundant information at a fraction of the computational cost.
The Core Mechanism: Bipartite Graph Partitioning
The defining insight of bipartite token merging—pioneered by Daniel Bolya et al. in Token Merging: Your ViT But Faster—is that we do not need to compare every token to every other token to find good merge candidates. Instead, the algorithm partitions the initial set of tokens into two disjoint sets, $A$ and $B$.
[ Exhaustive All-to-All ] [ Bipartite Partitioning ]
Token 1 <---> Token 2 Set A Set B
Token 1 <---> Token 3 Token 1 ----> Token 2
Token 2 <---> Token 3 Token 3 ----> Token 4
(O(N²) Comparisons) (O(N²/4) Comparisons)
Rather than evaluating all possible pairs, the model only computes similarities across the partition from Set $A$ to Set $B$. Typically, this similarity is calculated using the cosine similarity of the tokens' internal key representations ($W_k X$). Each token in Set $A$ is then mapped to its most similar counterpart in Set $B$. The top-$r$ most similar pairs are merged using an operation like mean pooling or averaging.
Why Does This Work?
It might seem counterintuitive to artificially restrict the search space by splitting the tokens. Why should the most redundant tokens happen to sit in opposite partitions?
The answer lies in the spatial and temporal continuity of visual data. In an image or video, redundant information is rarely isolated; it spans contiguous regions (such as a uniform background sky or a large texture). As Zhongyu Yang demonstrates in Script, even a simple deterministic partitioning strategy—such as separating tokens by even and odd indices—is highly likely to distribute patches from the same semantic region into both sets.
By breaking the pool into two sets of size $N/2$, the number of similarity calculations drops from $N^2$ to $N^2/4$. This structural constraint transforms a complex clustering problem into a highly parallelizable, single-pass matching operation that can be injected directly into a model without retraining.
Strategic Variations and Hybrid Approaches
While the foundational concept relies on simple partitioning and averaging, recent research has introduced sophisticated variations to handle edge cases and optimize performance.
Handling Unmatched Tokens
A uniform split assumes every token in Set $A$ has a reasonable match in Set $B$. However, unique foreground objects or complex textures might not have a semantic duplicate. To prevent distorting these unique features, Haoyu Wu et al. propose an importance-based soft matching strategy in Importance-Based Token Merging for Efficient Image and Video Generation. Their approach dynamically designates highly unique or prompt-relevant tokens as independent, allowing them to bypass the merge step entirely and preserve fine-grained details.
Graph-Based Voting
Rather than relying purely on local pairs, Ahmadreza Jeddi formalizes this process as a dynamic graph operation in Similarity-Aware Token Pruning: Your VLM but Faster. By treating the partitions as nodes in a bipartite graph and weighting edges via key similarities, the framework uses a consensus "voting" mechanism to determine which nodes represent pure redundancy and can be safely compressed.
Synergistic Pruning and Merging
Is it better to prune or to merge? The consensus has shifted toward hybridization. Minchul Kim et al. discover in Token Fusion: Bridging the Gap between Token Pruning and Token Merging that early transformer layers exhibit highly non-linear behavior, making them ideal for aggressive pruning. Later layers become more linear, meaning they preserve accuracy better when using a norm-preserving bipartite merging technique.
Similarly, Jun Yu develops a synergistic framework in Prune Redundancy, Preserve Essence: Vision Token Compression in VLMs via Synergistic Importance-Diversity, combining semantic clustering with adaptive pruning to eliminate background noise while keeping information-dense regions intact.
Applications Across Domains
Bipartite token merging has expanded far beyond standard image classification, proving vital in multi-modal, temporal, and generative pipelines.
Video Transformers
Videos suffer from severe spatio-temporal redundancy across adjacent frames. Sam Pollard et al. show in Video, How Do Your Tokens Merge? that bipartite matching scales naturally to spatio-temporal patches, offering up to a 2.5x inference speedup with negligible accuracy loss. For long-form video-language tasks, Shuhuai Ren et al. introduce TESTA, which uses the cosine similarity of attention keys across partitioned frames to adaptively pool redundant video structures.
Large Vision-Language Models (VLMs)
In VLMs, high-resolution visual inputs create massive token sequences that overwhelm the downstream Large Language Model (LLM). Qingqing Cao et al. developed PuMer to apply intra-modal bipartite soft matching, consolidating redundant text fragments and image patches before cross-modal alignment.
Furthermore, Lianyu Hu et al. demonstrate in iLLaVA that token reduction shouldn't just happen at the language interface. By implementing a dual-stage reduction strategy that compresses tokens both inside the vision encoder and within the LLM layers, they cut input tokens by over 66% while maintaining high accuracy. This allows information-dense details like small text or complex textures to be preserved, a benefit also leveraged by Greg Heinrich et al. in the RADIOv2.5 foundation framework.
Pre-training, Robustness, and Augmentation
The utility of bipartite merging extends beyond inference acceleration:
- Robustness: Nick Nikzad et al. show in SATA that using bipartite matching to group and merge statistically redundant tokens before the feed-forward network acts as a natural filter, stripping out high-frequency noise and boosting adversarial robustness.
- Pre-training: In Masked Image Modeling, teacher models often provide noisy, spatially inconsistent labels for neighboring patches. Taekyung Kim et al. introduce Dynamic Token Morphing (DTM), utilizing bipartite matching to dynamically aggregate similar tokens into smoother, contextualized training targets with minimal overhead.
- Data Augmentation: Xin Jin et al. present MergeMix, which repurposes bipartite soft matching to construct contextually aware mixed images for preference learning, improving training efficiency and model calibration.
Key Foundational Work
Which Tokens to Use? Investigating Token Reduction in Vision Transformers (2023) — contributed 1 concept elements to this direction.
Token Merging: Your ViT But Faster (2023) — contributed 1 concept elements to this direction.
Token Fusion: Bridging the Gap between Token Pruning and Token Merging (2024) — contributed 1 concept elements to this direction.