Pooled Sentence Vector
A transformer encoder hands back one vector per token, but most practical work — matching a question to a similar question, clustering reviews, retrieving a passage — needs one vector for the whole sentence. A pooled sentence vector is that single vector: the per-token vectors collapsed into one fixed-length representation of the sentence.
How the collapse is done
The recipes are few, and the choice matters more than it looks:
- Mean pooling — average the final-layer token vectors, weighted by the attention mask so padding contributes nothing. The dependable default.
- [CLS] pooling — take the vector sitting above the special classification token. Cheap, but in an untuned BERT that position was trained for next-sentence prediction, not similarity, and comparing raw [CLS] vectors by cosine distance gives weak results.
- Max pooling — keep the largest value in each dimension, letting a few salient words dominate instead of an average.
Why the choice shows up downstream
Pooling is what makes semantic search affordable: every document becomes one point in an embedding space, and a query is answered by nearest-neighbour lookup instead of running the model over every query-document pair. Sentence-BERT exists because pooling alone is not enough — it fine-tunes the encoder with the pooling layer in place, so the resulting vectors are actually arranged for cosine similarity. Pool a model that was never trained for it and you get vectors that are sentence-shaped and useless, with "the flight was delayed" sitting as close to "the flight was on time" as to "our departure ran late". The pooled vector also discards word order, which is why it serves retrieval and clustering well and sentence-pair inference poorly.
A pooled sentence vector is a single fixed-length embedding for a whole sentence, obtained by collapsing a neural encoder's per-token vectors into one — usually by mean pooling over the final layer, sometimes by taking the [CLS] position. It turns a variable-length text into one point in an embedding space, which is what lets semantic search, clustering and deduplication work by comparing vectors instead of running the model over every pair.
Imagine boiling a whole paragraph down to a few scribbles on an index card, so you can file it in a drawer next to cards that say roughly the same thing. A pooled sentence vector is that card — except the scribbles are a long list of numbers. Software first works out what each word means in its context, then blends all those word-by-word readings into one summary for the sentence as a whole. Once every sentence has a card, finding the ones that mean the same thing is just a matter of seeing which cards sit close together. That is how a search box can match "flight delayed" to "our departure ran late".