Video and Temporal Reasoning › From frames to tokens: the video encoder pipeline
Language AI HandbookAll chapters Once frames are chosen, each frame is encoded, and the encoded frames are stitched into the language model's input. This is the video version of the LLaVA pipeline from Part L, Ch 5: LLaVA Architecture, with the addition of time. There are three main architectural choices.
Frame-as-image, concatenated. Encode selected frames separately and concatenate their visual representations in order. The sequence preserves order. To represent irregular spacing, supply timestamps or time-based positions alongside the frame representations.
Temporal pooling and aggregation. Merge information within a time window. If that operation outputs fewer tokens, the language model receives a shorter sequence. A mean over the whole window can lose fine order unless the feature representation separately encodes it.
Explicit temporal encoding. Add a time feature to the visual representation. An embedding parameterized by elapsed time can distinguish equal frame-index gaps with different durations. Whether the model uses that feature correctly is an evaluation question.
The LLaVA-OneVision paper gives a concrete token-budget example. Its documented video path encodes frames individually and uses spatial interpolation to reduce their visual token count. That compression within each frame is independent of pooling across time. Both choices affect the evidence available further downstream.
The worked example compares the two samplers on the same feature sequence.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!