TrajTok: Learning Trajectory Tokens enables better Video Understanding
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.
Tom: We're looking at the paper: "TrajTok: Learning Trajectory Tokens enables better Video Understanding".
Jane: Here's the gist of the paper. The gist: TrajTok, an end-to-end differentiable trajectory tokenizer, learns to implicitly propose trajectory tokens by integrating a unified segmenter and a trajectory encoder that co-train with downstream objectives, offering low token counts, efficiency and adaptability to downstream objectives.
Tom: How it works 1.
Jane: The system consists of two differentiable components: a universal segmenter that partitions the input into semantic groups, and a trajectory encoder that aggregates these groups into compact latent tokens (Page 3).
Tom: 2.
Paper summary: Jane: They are arguing that by organizing visual tokens around object trajectories, it aligns better with how humans actually perceive things in video. But the paper points out a big limitation with previous trajectory-based tokenizers.
Lu: That external pipeline approach, where you use general-purpose segmentation models to generate trajectories, is what they criticize because it makes the tokenizer slow and independent of the actual task you want to perform later on.
Tom: So they want something that’s not a slow preprocessing step but something that learns these groupings directly through training with the model itself.
Meng: And they do this by using a unified segmenter and a trajectory encoder, where the segmenter proposes masks for all objects in a video in one forward pass, and the encoder then aggregates features based on those masks to make those tokens.
Lalam: The system uses a Perceiver layer stack for the segmenter to generate soft segmentation maps, which are then used by the trajectory encoder to produce initial proposal embeddings z init k through weighted aggregation of features using those soft masks.
Jane: And they refine these initial embeddings by using a second Perceiver module and enforcing masked cross-attention with hard segmentation maps, which sharpens those representations.
Tom: A key part is that the adaptive token mechanism is inspired by Matryoshka representations, allowing the encoder to emit n tokens per trajectory based on a compute budget, balancing efficiency and expressivity.
Lu: They specifically mention that they prioritize downstream adaptability over pixel-perfect segmentation fidelity, which makes it lightweight and efficient while still improving video understanding performance.
Meng: What I want to know from that is how they handle the training side because if it's truly end-to-end, the training objective has to be very clever.
Lalam: They achieve this by using a combination of Dice loss and Focal loss for segmentation, which prioritizes finding all object regions over strict pixel-level class accuracy.
Tom: So they train the segmenter jointly with the transformer under an added segmentation supervision during training on TrajViT2. That’s where the real learning happens, right?
Jane: Right, and that training setup allows for pre-training the segmenter and then reusing it for other things later, like probing or vision-language model training by annotating videos with pseudo ground truth masks generated through that TrajViT pipeline.
Lu: It suggests a pathway where you can leverage this learned segmentation structure without needing to re-segment everything from scratch every time.
Conclusion: Tom: So, looking at the paper "TrajTok: Learning Trajectory Tokens enables better Video Understanding", the authors are essentially saying that traditional patchification is inefficient because it creates too much noise.
Jane: They propose TrajTok as a way around that by learning to group visual information into trajectories directly from the video input. This is achieved through an end-to-end differentiable framework with a segmenter and an encoder.
Lu: The implication for research is that we can move away from slow, external pipelines for segmentation and tracking in video understanding if we can design a system that learns the trajectory tokens organically alongside the main model training.
Meng: From an engineering standpoint, it’s exciting because they show performance comparable to existing token-merging methods while maintaining efficiency similar to them. It seems like a practical way to get better representation with less computational overhead at scale.
Lalam: And its versatility is notable; they show it works as a video transformer from scratch for classification, and it can be used as an adapter for probing features or as an alignment connector in vision-language models.
Tom: So, the main point is that trajectory-based tokenization offers a more efficient and semantically aligned alternative to the old patchification methods when you’re dealing with video understanding tasks.
Jane: It's a lot of work to make it end-to-end, but they demonstrate that learning these trajectory tokens can lead to much better performance on long-video reasoning benchmarks, which is where this approach seems strongest.
Chenhao Zheng, Jieyu Zhang, Jianing Zhang, Weikai Huang, Ashutosh Kumar, Quan Kong
University of Washington · Allen Institute for Artificial Intelligence · Apple
cs.CV
Submitted: 2026-02-26
Updated: 2026-10-19
Comments: CVPR 2026
Code: https://github.com/hellomuffin/trajtok
License: http://creativecommons.org/licenses/by/4.0/
Importance score: 82/100
The gist: The gist: TrajTok, an end-to-end differentiable trajectory tokenizer, learns to implicitly propose trajectory tokens by integrating a unified segmenter and a trajectory encoder that co-train with
Key concepts
- Universal Segmenter
- This component partitions the video into semantic groups by extracting frame features and using learnable queries processed through Perceiver layers. It generates soft segmentation masks that group pixels in both space and time, prioritizing robust semantic grouping over pixel-perfect accuracy.
- Trajectory Encoder
- The encoder aggregates the feature maps from the segmenter into compact latent tokens. It refines these representations using hard attention masks derived from the soft masks to recover fine-grained motion details specific to each trajectory region, ensuring disentangled and meaningful token generation.
- Adaptive Token Mechanism
- Inspired by Matryoshka representations, this mechanism allows the encoder to emit a variable number of tokens (n) per trajectory. This balances efficiency and expressivity by setting the token count based on a predefined compute budget while using distinct learnable queries for diversity.
Terminology
Summary
The gist: TrajTok, an end-to-end differentiable trajectory tokenizer, learns to implicitly propose trajectory tokens by integrating a unified segmenter and a trajectory encoder that co-train with downstream objectives, offering low token counts, efficiency and adaptability to downstream objectives.
How it works
-
The system consists of two differentiable components: a universal segmenter that partitions the input into semantic groups, and a trajectory encoder that aggregates these groups into compact latent tokens (Page 3).
-
The universal segmenter performs frame-wise feature extraction using a lightweight patch encoder, extracts multi-scale maps, and uses learnable queries processed through a stack of Perceiver layers to generate soft segmentation masks (Page 3).
-
Soft segmentation is achieved by computing the similarity between processed queries and patch features via softmax over the query dimension to obtain a soft segmentation map Msoft (Page 4).
-
The trajectory encoder aggregates patch-level feature maps into compact tokens, initially generating proposal embeddings z init k through a weighted aggregation of features using the soft masks (Page 4).
-
Trajectory embedding refinement sharpens these representations by employing a second Perceiver module and enforcing masked cross-attention using hard segmentation maps Mhard (Page 4).
-
An adaptive token mechanism inspired by Matryoshka representations allows the encoder to emit n ∈ three tokens per trajectory, balancing efficiency and expressivity based on a predefined compute budget (Page 4).
Tokenization and Segmentation Details
The segmenter is designed to decouple video duration from the final token count, prioritizing robust semantic grouping over pixel-perfect segmentation masks (Page 3). The training of the segmenter can be done either independently or jointly with other objectives (Page 4). The combination of Dice loss and Focal loss yields the best downstream understanding, as it prioritizes the discovery of all object regions over strict pixellevel class accuracy (Page 4).
When training TrajViT2, the segmenter is trained jointly with the transformer under an added segmentation supervision (Page 4). The segmenter can be pre-trained and reused for downstream probing or VLM training by annotating videos with pseudo ground truth masks generated via the TrajViT pipeline (Page 10).
Trajectory Encoder Refinements
The trajectory encoder accepts both soft and hard segmentations to ensure differentiability while maintaining disentangled representations (Page 4). Initial trajectory embeddings z init k are computed as z init k = X t,i,j Msoft k,t,i,j · Ft,i,j (Page 4). To recover fine-grained motion and texture details specific to the trajectory’s region, the encoder uses hard attention masks Mhard obtained by applying an argmax to Msoft and converting it to one-hot binary assignments (Page 4).
The adaptive token mechanism allows for n ∈ three tokens per trajectory, where each copy is associated with a distinct learnable query vector (Page 4). To encourage diversity among sub-tokens, these queries are initialized with Fourier positional embeddings with angular offsets that maximally separate them in feature space (Page 4).
Versatility and Evaluation Scenarios
TrajTok is versatile and can be implemented in three scenarios:
-
TrajViT2, which trains a video transformer encoder from scratch under the CLIP objective, achieving improvements over baselines (Page 6).
-
TrajAdapter, a plug-in feature adapter that aggregates dense feature maps from any pretrained video encoder to enhance probing performance without full fine-tuning (Page 7).
-
TrajVLM, a vision-language model where TrajTok serves as an alignment module between a ViT and an LLM, improving video question-answering performance especially for long-video questioning benchmarks (Page 7).
Performance Results
TrajViT2 achieves the best accuracy at scale across both classification and retrieval benchmarks, showing a large-margin improvement of +4.8% on Kinetics-400 and +4.1% on SSv2 over a standard video ViT (Page 6). TrajViT2 exhibits stronger scaling behavior than TrajViT as the training dataset size increases, possibly because of its segmenter’s flexibility in adapting to downstream tasks (Page 6).
TrajAdapter consistently improves the probing accuracy of pretrained backbone features, and performance further increases with more tokens per trajectory (Page 7). TrajVLM notably outperforms patch pooling baselines on long-video benchmarks, including a notable +8.8% on LongVideoBench and +5.4% on LVBench over PatchVLM with default poolsize=3 (Page 8).
Overall, these results validate TrajTok as an effective connector for VLMs, particularly in long-video understanding (Page 8). The segmenter's lightweight design and low output resolution introduce several expected limitations, such as occasionally missing very small objects (Page 8).
The paper concludes by introducing TrajTok as an end-to-end and efficient tokenizer that learns to group visual trajectories and produce trajectory-level tokens directly from video inputs (Page 9). The results highlight the potential of trajectory-based tokenization as a more efficient and semantically aligned alternative to traditional patchification (Page 9). The project was funded by DSO National Laboratories in Singapore and by Toyota Motor Inc. (Page 10).
Improvements for AI systems
-
TrajTok as an end-to-end differentiable video tokenizer allows for
low token counts, efficiency and adaptability to downstream objectives,
which enables training models like TrajViT2 that achievethe best accuracy at scale across both classification and retrieval benchmarks.
This means AI systems can process long videos with significantly fewer tokens than traditional patchification, leading to reduced memory bottlenecks and better scalability. -
The unified segmenter in TrajTok
performs implicit clustering over pixels in both space and time to directly produce object trajectories in a single forward pass,
which ismuch more efficient than prior work [94]
because it tradespixel-perfect accuracy with end-task performance.
This allows for dynamic token granularity thatadapts its tokenization to the downstream tasks,
meaning the system can generate fine-grained tokens for complex movements (like individual body parts) or coarser tokens for group formations, as demonstrated in Figure 3. -
TrajAdapter enables a
cost-effective way to enhance the probing performance of pretrained encoders in common video classification benchmarks without full fine-tuning.
This allows researchers to efficiently adapt large, pre-trained vision encoders to new tasks by reorganizing their dense feature maps into trajectory tokens, proving thatnaively inserting a Perceiver module does not yield any gain over the attentive probing baseline.
-
TrajVLM can serve as a connector in vision-language models, where it
improves video question-answering performance, especially for long-video questioning benchmarks,
by grouping ViT featuresalong trajectories and passing the grouped trajectory tokens as visual inputs to the language model,
leading to superior performance on long-video reasoning tasks like LongVideoBench. -
The adaptive token mechanism inspired by Matryoshka representations allows for a flexible trade-off between efficiency and expressivity, enabling the encoder to
emit n ∈ 1, 2, 4 tokens per trajectory,
which can be adjusted during inference based onavailable computational resources.
This ensures that complex or articulated motion is represented without resorting to overly compressed or rigid token structures.
Abstract
Tokenization in video models, typically through patchification, generates an excessive and redundant number of tokens. This severely limits video efficiency and scalability. While recent trajectory-based tokenizers offer a promising solution by decoupling video duration from token count, they rely on complex external segmentation and tracking pipelines that are slow and task-agnostic. We propose TrajTok, an end-to-end video tokenizer module that is fully integrated and co-trained with video models for a downstream objective, dynamically adapting its token granularity to semantic complexity, independent of video duration. TrajTok contains a unified segmenter that performs implicit clustering over pixels in both space and time to directly produce object trajectories in a single forward pass. By prioritizing downstream adaptability over pixel-perfect segmentation fidelity, TrajTok is lightweight and efficient, yet empirically improves video understanding performance. With TrajTok, we implement a video CLIP model trained from scratch (TrajViT2). It achieves the best accuracy at scale across both classification and retrieval benchmarks, while maintaining efficiency comparable to the best token-merging methods. TrajTok also proves to be a versatile component beyond its role as a tokenizer. We show that it can be seamlessly integrated as either a probing head for pretrained visual features (TrajAdapter) or an alignment connector in vision-language models (TrajVLM) with especially strong performance in long-video reasoning.
Sources
- V-JEPA 2: Self-Supervised Video Models Enable Understanding, Prediction and Planning
- Revisiting Feature Prediction for Learning Visual Representations from Video
- Token Merging: Your ViT But Faster
- MONet: Unsupervised Scene Decomposition and Representation
- Subobject-level Image Tokenization
- Accelerating Vision Transformers with Adaptive Patch Sizes
- Molmo and PixMo: Open Weights and Open Data for State-of-the-Art Vision-Language Models
- Geometric Fluctuation of Conformal Hilbert Spaces and Multiple Graviton Modes in Fractional Quantum Hall Effect
- Video-MME: The First-Ever Comprehensive Evaluation Benchmark of Multi-modal LLMs in Video Analysis
- PruneVid: Visual Token Pruning for Efficient Video Large Language Models
- Perceiver IO: A General Architecture for Structured Inputs & Outputs
- The Kinetics Human Action Video Dataset
- SAM 2: Segment Anything in Images and Videos
- VASA-1: Lifelike Audio-Driven Talking Faces Generated in Real Time
- Video-XL-Pro: Reconstructive Token Compression for Extremely Long Video Understanding
- VideoEval-Pro: Robust and Realistic Long Video Understanding Evaluation
Related papers
- Loss Knows Best: Detecting Annotation Errors in Videos via Loss Trajectories
- AnchorWeave: World-Consistent Video Generation with Retrieved Local Spatial Memories
- Benchmarking the Robustness of Foundation Models for Mammography under Domain Shift
- MambaX-Net: Dual-Input Mamba-Enhanced Cross-Attention Network for Longitudinal MRI Segmentation
- TeleOCR: Navigating Document Parsing Across Digital and Camera-Captured Documents
- A Survey on Efficient Vision-Language-Action Models