Index Ai Academy
Glossary · Phase 5 · Transformers

Mean pooling

Turning a text's token vectors into one vector for the whole text by averaging them.

An encoder gives back one vector per token. A sentence of 12 tokens gives 12 vectors. Search needs one vector per text, so the model squashes the token vectors into one. This step is called pooling. The most common way is mean pooling: take the average. Add up the vectors number by number, then divide by how many there are.

Try it now

The difference comes down to who can see what.

Learn it properly

Encoders and embedding models · BERT-style models and where they fit. About 30 minutes.

Create a free account See what's in the lesson

Other terms from the same lesson

Never trained an AI?

Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.

Teach it to write