← All IntelClip / EducationHow multimodal models really ingest video: encoders writing into the embedding layer
From Training an LLM from Scratch, Locally — Angelos Perivolaropoulos, ElevenLabs · ≈1:14:26
“instead of having a tokenizer for like video, for example, what they do is they have another transformer that they call a video encoder.”
“You take those those vectors out of this encoder and you're going to input them in the embedding layer of the of the transformer model.”
“the embedding of that video token is going to be overridden by the output of the encoder. So, that's how like this this multimodal models work.”
“They don't care if it's text or if it's audio or if it's or if it's video. It cares about these vectors and that's how you you represent them into the the same dimension as the model the transformer expects.”
What’s in it
- A precise mechanism — a separate encoder transformer turns sampled frames into hidden vectors of the same dimension as text embeddings, so the language model only ever sees vectors.
Clip transcript
So the way multi modal models work usually you don't use tokens in the same sense. Um Like okay this is where like it becomes a little complicated cuz like these models are not really built for this like the GPT model like the bit the newer models they have also like an embedding input which essentially as As As mentioning earlier like you have each token then corresponds to like a vector. But these vectors, they don't have to correspond to specific token. You can take these vectors from other places, too. And what a lot of these labs do is that instead of having a tokenizer for like video, for example, what they do is they have another transformer that they call a video encoder. And they put the video first through that video encoder. And uh this video encoder will be taking let's say you have a a 30-second video, it will take one frame per second of this video. And it will take those frames and then put them through this like new transformer, this encoder transformer, that works quite a bit differently than this one. And what you do is that you take the final layer of this transformer, the hidden values, which are also vectors. You take those those vectors out of this encoder and you're going to input them in the embedding layer of the of the transformer model. So, what the model is going to see is going to usually is is like prefixed. So, you take the you take the video, put it through the encoder, get some vectors, and then put those vectors in the embedding input of your transformer that does text. And the way it would look like if you look at the sequence, it would probably be like a prompt and then it would be probably like a video token representation. And then actually but the embedding of that video token is going to be overridden by the output of the encoder. So, that's how like this this multimodal models work. It produces a vector which is the same length as like a vector for words. Yes, it's exactly the same vector. And that's it for audio. You have an audio encoder and do the same but but for audio. And the but for in in terms of how what the model cares about, it just cares about like these embeddings, right? They don't care if it's text or if it's audio or if it's or if it's video. It cares about these vectors and that's how you you represent them into the the same dimension as the model the transformer expects.
Comments
Checking sign-in…
Loading comments…