B1-I3 · Inline explainer · preview in article context
Pooling brings the token representations together into a fixed-length text representation. Our embedding path uses mean pooling and normalization. The output has 512 dimensions regardless of the number of input tokens, within the model's supported limit.
From text to a fixed-length vector Input text passes through GPT-2 tokenization into symbolic token IDs, which look up input representations in the shared embedding table. The contextual encoder, with bidirectional attention and feed-forward computation, builds contextual token states. Mean pooling and normalization produce one 512-dimensional text embedding. A shorter and a longer input both produce outputs of the same 512-dimensional size. token ID (symbolic) representation active stage Conceptual pipeline; planes are groupings, not layer counts. From text to a fixed-length vector Every supported input, short or long, becomes one 512-dimensional text embedding. input text passage: Encode notes and retrieve passages. Tokenize and look up GPT-2 tokenizer → token IDs → shared embedding table lookup a b c d shared embedding table token IDs id_a–id_d → input representations Build context contextual encoder: bidirectional attention + feed-forward computation contextual token states Pool and normalize contextual token states → mean pooling → normalization mean pooling of the token states normalize 512-dimensional text embedding Shorter input 512 dimensions Longer input 512 dimensions Same output size; content differs.
From text to a fixed-length vector Input text passes through GPT-2 tokenization into symbolic token IDs, which look up input representations in the shared embedding table. The contextual encoder, with bidirectional attention and feed-forward computation, builds contextual token states. Mean pooling and normalization produce one 512-dimensional text embedding. A shorter and a longer input both produce outputs of the same 512-dimensional size. token ID (symbolic) representation active stage Conceptual pipeline; planes are groupings, not layer counts. From text to a fixed-length vector Every supported input becomes one 512-dimensional text embedding. input text passage: Encode notes and retrieve passages. Tokenize and look up GPT-2 tokenizer → token IDs → shared embedding table lookup a b c d shared embedding table token IDs id_a–id_d → input representations Build context contextual encoder: bidirectional attention + feed-forward computation contextual token states Pool and normalize contextual token states → mean pooling → normalization mean pooling of the token states normalize 512-dimensional text embedding Shorter input 512 dimensions Longer input 512 dimensions Same output size; content differs.
Figure
Token lookup provides the encoder's input representations. Contextual processing, mean pooling and normalization produce a 512-dimensional text embedding. Output dimensionality stays fixed for supported input lengths.