liveBook · Manning

Pooling

As explained in AI-Powered Search

Pooling is the aggregation of multiple representation values into a single lower-level or fixed-size representation.

Pooling combines multiple representation values into one lower-level or fixed-size representation. In semantic search, SBERT pools a sentence’s BERT token embeddings into a single vector. section 13.4.3

Mean-token pooling averages the numeric values across a sentence’s token embeddings, producing one 768-dimensional embedding. This fixed-size vector can then support sentence-similarity comparisons. section 13.4.3

Comparing pooled sentence representations

Encode four phrases with a pretrained SentenceTransformer, normalize their embeddings, and calculate pairwise dot products. “It’s raining hard” and “it is wet outside” receive the highest shown similarity score, 0.669060, while unrelated phrases score lower.

How AI-Powered Search covers it

How deep it goes
Explains token-value aggregation and resulting dimensions, then demonstrates normalization and pairwise scoring without detailing pooling internals.
Examples
Compares weather and vehicle phrases, ranks their pairwise similarities, and displays four 768-dimensional embeddings.
What it assumes
Assumes familiarity with token embeddings and teaches how to combine them into sentence-level vectors.
What you can do after
Apply it via sentence_transformers to encode phrases, normalize vectors, and rank semantic similarities.
How it connects
Connects BERT, SBERT, sentence embeddings, dense vectors, tokenization, and semantic similarity.

Also explained in

Compare how 8 books explain pooling →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI-Powered Search. The section links point to the parts of the book it draws on.