QTSplus: Query-Aware Visual Token Selector
- QTSplus is a visual token selection architecture that adaptively routes a minimal, query-relevant subset of tokens, reducing load from ~180,000 to ~20,000 tokens in long videos.
- It employs a cross-attention mechanism and an instance-specific retention budget to compute token relevance, ensuring semantic coverage and precise temporal ordering.
- Integrated within the Qwen2.5-VL pipeline, QTSplus delivers up to 28% speedup and notable improvements in temporal reasoning benchmarks, enhancing long-video MLLM efficiency.
QTSplus (Query-Aware Token Selector with Adaptive Budget) is a visual token selection architecture designed to address the scalability and efficiency bottlenecks in long-video multimodal LLMs (MLLMs). Integrated into the Qwen2.5-VL family, QTSplus dynamically selects a minimal, query-relevant subset of visual tokens between the vision encoder and LLM, dramatically reducing vision token load and computational resources while maintaining or improving accuracy on temporally demanding video reasoning tasks (Li et al., 14 Nov 2025).
1. Motivation and Context
Conventional MLLMs process every vision token extracted from long-form video, incurring computational, memory, and latency costs scaling linearly with video length and quadratically with the number of tokens during transformer attention. For video inputs reaching hundreds of frames and high spatial resolution, the resulting vision token count can easily surpass , overwhelming the LLM’s cache and attention mechanisms.
QTSplus operates as an information gate: given a text query and the full set of video tokens , it adaptively routes only the most relevant to the LLM, with determined per instance and informed by the query and token statistics. This design aims to preserve video understanding accuracy while scaling MLLMs to longer and higher-frame-rate sequences.
2. Integration within Qwen2.5-VL Pipeline
In the Qwen2.5-VL stack, video input comprising frames is encoded by a frozen Vision Transformer (ViT), producing a flattened token sequence: where . Normally, would be directly provided to the LLM. QTSplus is inserted between the ViT and the LLM, replacing with a compressed, query-centric set 0, with 1, that maintains both semantic coverage and temporal information.
The end-to-end sequence consists of:
- Vision encoder → ViT tokens with absolute time encoding
- QTSplus (cross-attention scoring → adaptive budget prediction → token selection → lightweight re-encoding)
- Compressed tokens to LLM decoder
3. Architecture: Core Components and Algorithms
3.1 Cross-Attention Scoring
Relevance of each vision token 2 to the input query sequence 3 is computed by a single-layer, multi-head cross-attention module: 4 For each head 5 and text position 6, the attention is
7
Token relevance 8 is obtained by: 9 yielding a relevance vector 0 reflecting the peak attention incurred by any word-head combination.
3.2 Instance-Specific Retention Budget
QTSplus predicts the retention rate 1 for each instance by aggregating:
- Mean query embedding 2
- 3 (token count scale)
- Max relevance 4
- Relevance entropy 5, with 6
The input 7 feeds a small MLP 8. The logistic-transformed output predicts: 9 with 0, and 1.
3.3 Token Selection
3.3.1 Training (Differentiable Top-n Gate)
During training, to maintain end-to-end differentiability, a soft Top-n gate is implemented using a threshold 2 given by: 3 solved by Newton iterations. For each token, logits 4 are fed through a Gumbel-Softmax sampler (5, hard sampling and straight-through gradients) to yield binary selection indicators 6. Tokens with 7 are retained, and if none are selected, the token with maximal 8 is forced to be kept.
3.3.2 Inference (Hard Top-n Gate)
At inference, tokens are ranked by 9 and the top-0 selected. Temporal ordering is restored post-selection.
3.4 Temporal Order Re-encoding
Absolute time encoding is added to all vision tokens. After selection, a shallow Transformer block (two layers: RMSNorm → MHA → RMSNorm → FFN, FlashAttention enabled, weights initialized from Qwen2.5-VL’s text model) re-encodes the token subset, yielding a stream that preserves both semantic relevance and precise timing, supporting second-level temporal localization.
4. Quantitative and Qualitative Performance
When incorporated into Qwen2.5-VL-3B-Instruct, QTSplus was evaluated on video inputs of up to 600 frames (e.g., 20 seconds at 30 fps):
- Vision-token load reduced from ≈180,000 to ≈20,000 (1 compression)
- End-to-end latency (single NVIDIA A100 GPU) reduced from ≈83 seconds to ≈60 seconds (2 speedup)
Across eight long-video understanding benchmarks (lmms-eval suite), QTSplus-3B matches the teacher model within 33 points on most metrics and improves:
- TempCompass direction accuracy by 4 points (from 5 to 6)
- TempCompass order accuracy by 7 points (from 8 to 9)
- Video-MMMU adaptation by 0 points (from 1 to 2)
A plausible implication is that attention-efficient routing of visual evidence enables temporally focused reasoning performance not accessible to uniform token downsampling approaches.
Fine-tuning the full LM (QTSplus-3B-FT) recovers or exceeds teacher performance on broad-coverage tasks, maintaining token and latency savings.
5. Training Regimes and Implementation Details
QTSplus variants include:
- QTSplus-3B (LLM frozen, 3129 M QTSplus parameters, trained on VSCQ distillation)
- QTSplus-3B-FT (LLM + QTSplus, 43.2 B parameters, VSCQ and VQA distillation)
Critical hyperparameters:
- Cross-attention: 1 layer; Re-encoder: 2 layers
- Gumbel-Softmax temperature 5
- Newton iterations for threshold 6 solving: 7
- Budget head MLP 8: Two hidden layers (width 512, GELU)
- Compute-aware loss with 9, 0
Optimization uses AdamW, learning rate 1, batch size 64, up to 3 epochs. Experiments are conducted on 8× NVIDIA RTX 5090 GPUs and a 200-core Intel Xeon CPU.
6. Significance, Extensions, and Release Plan
QTSplus provides a general, lightweight, and highly efficient mechanism for scaling MLLMs to long-video scenarios with strict compute and memory requirements. Its principal architectural innovation—dynamic, query-aware budget prediction and token selection—enables global context preservation and fine-grained temporal localization without compromising downstream accuracy.
Continuous release of code, data, and weights is planned to facilitate community reproducibility and further development. The modular nature of QTSplus suggests straightforward extension to other large-scale multimodal domains with similar input redundancy and temporal complexity.