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 vectorInput 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)representationactive stageConceptual pipeline; planes are groupings, not layer counts.From text to a fixed-length vectorEvery supported input, short or long, becomes one 512-dimensional text embedding.input textpassage:Encode notes and retrieve passages.Tokenize and look upGPT-2 tokenizer → token IDs→ shared embedding table lookupabcdshared embedding tabletoken IDs id_a–id_d → input representationsBuild contextcontextual encoder: bidirectionalattention + feed-forward computationcontextual token statesPool and normalizecontextual token states→ mean pooling → normalizationmean pooling of the token statesnormalize512-dimensional text embeddingShorter input512 dimensionsLonger input512 dimensionsSame output size; content differs. From text to a fixed-length vectorInput 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)representationactive stageConceptual pipeline; planes are groupings,not layer counts.From text to a fixed-length vectorEvery supported input becomes one512-dimensional text embedding.input textpassage:Encode notes and retrieve passages.Tokenize and look upGPT-2 tokenizer → token IDs→ shared embedding table lookupabcdshared embedding tabletoken IDs id_a–id_d → input representationsBuild contextcontextual encoder: bidirectionalattention + feed-forward computationcontextual token statesPool and normalizecontextual token states→ mean pooling → normalizationmean pooling of the token statesnormalize512-dimensional text embeddingShorter input512 dimensionsLonger input512 dimensionsSame 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.