Embeddings
An embedding turns a text into a list of numbers, so a computer can measure how close two meanings are.
A toy you can read
Imagine an embedding with only three numbers, each with a name.
| Text | money | animals | length |
|---|---|---|---|
| Revenue grew 12% | 0.9 | 0.0 | 0.2 |
| Sales went up | 0.8 | 0.0 | 0.1 |
| My dog sleeps a lot | 0.0 | 0.9 | 0.2 |
“Revenue grew 12%” and “Sales went up” share no word, yet they sit close together. That is how a search by meaning finds “sales” when you typed “revenue”.
The real thing
Real embedders do the same with hundreds or thousands of numbers. No single number has a name like “money”: the meaning is spread over all of them, and only the distances between texts count.
Try it
Type any sentence. Gemini turns it into 3,072 numbers; the short version keeps the first 768. Both still work for search, but one takes four times the storage.

Saved example. Press the button to run your own sentence live.
768 numbers
3 KB per passage
- -0.022
- -0.006
- 0.008
- -0.042
- 0.016
- -0.033
- -0.028
- -0.021
3,072 numbers
12 KB per passage
- -0.013
- -0.004
- 0.005
- -0.024
- 0.009
- -0.019
- -0.016
- -0.012
What a bigger embedder bought
+7 → +2
A bigger embedder found the right page for 7 more questions in 100. Once the search knew which report to open, it added only 2.
FinanceBench: 150 questions over 84 annual reports, right page in the first 10 results. bge-small (384 numbers) against bge-base (768). One run each.
One question to ask your team
Which cheap fixes did we try before paying for a bigger model?
For engineers
What the demo does, in numbers.
- The model is gemini-embedding-2. It returns 3,072 numbers; the 768 shown are the first 768, rescaled to length 1. The model is trained so that a prefix still works (Matryoshka representation learning); Google recommends 768, 1,536 or 3,072.
- Stored as 32-bit floats, a vector costs 4 bytes per number: 3 KB at 768, 12 KB at 3,072. For a million passages, that is about 3 GB against 12 GB, before any index.
- The finding: page hit@10 went from 0.473 to 0.547 with plain search, and from 0.753 to 0.773 with the query planner of lesson 5.
The request the demo sends:
POST /api/embed
{ "text": "Total current assets of 3M in 2018" }
→ { "model": "gemini-embedding-2",
"sizes": [ { "dims": 768, "bytes": 3072, "head": [...] },
{ "dims": 3072, "bytes": 12288, "head": [...] } ] }