Lab / Explainer / 5 steps

No. 01Explainer7 min

Meaning as a place

How embeddings turn text into points on a map, why nearby means similar, and where that breaks.

Short version

An embedding turns a piece of text into a position. Search then means finding the nearest positions. Close usually means similar, but close is not the same as correct.

Every "chat with your documents" feature, every smart search box and most recommendation lists use the same trick underneath. This page lets you poke at that trick with a tiny model built for this page. The model is honest but simplified: it uses 8 readable scores per phrase, where a real model learns hundreds or thousands of unreadable ones. The behaviour is the same.

01 · The idea

Words become coordinates.

An embedding model reads a piece of text and returns a list of numbers. Each number is a position on one axis, so together they place the text somewhere in a space with many directions. Squash those numbers down to two and you can draw the text as a dot. Pick a customer message and watch it travel.

The text

"Boiler makes a banging noise"

8 numbers, 0 to 1

  1. roof 0.00
  2. plumbing 0.20
  3. kitchen 0.00
  4. garden 0.00
  5. heating 0.90
  6. floors 0.00
  7. urgent 0.35
  8. other 0.00

One place on the map

RoofPipesKitchenGardenHeatingFloors

Lands near: Heating

a real model makes about 1,536 numbers, and none of them has a name

Show as text
TextThe 8 numbersLands near
Boiler makes a banging noiseroof 0.00, plumbing 0.20, kitchen 0.00, garden 0.00, heating 0.90, floors 0.00, urgent 0.35, other 0.00Heating
Lay a new lawnroof 0.00, plumbing 0.00, kitchen 0.00, garden 0.90, heating 0.00, floors 0.00, urgent 0.00, other 0.00Garden
Dripping kitchen taproof 0.00, plumbing 0.85, kitchen 0.35, garden 0.00, heating 0.00, floors 0.00, urgent 0.10, other 0.00Pipes and taps
fig. 1 The text becomes a list of numbers, and the numbers become a place. The numbers mean little on their own; the distance between two places is what search uses.

You cannot read the numbers. You can measure the distance between them, and that is all search needs.

02 · The map

Similar meaning lands close together.

Here are 40 invented household jobs, each placed by its numbers. Watch them find their spots: the groups form on their own, and the circles and names are drawn on afterwards. Pick a job, or point at any dot, to see its three nearest neighbours.

Picked job

"Toilet keeps running"

Sits in: Pipes and taps

RoofPipesKitchenGardenHeatingFloors no topic

Its 3 nearest

  1. Shower drains very slowly0.97
  2. Low water pressure upstairs0.97
  3. Dripping kitchen tap0.92

squeezing 8 numbers onto flat paper bends a few distances; the lines follow the real score

Show all 40 jobs as a table
JobSits inThree nearest
Roof tiles blew off in the stormRoof and guttersLeak in the attic after heavy rain (0.95); Flat roof needs a new coating (0.88); Downpipe came loose from the wall (0.88)
Gutter is full of leavesRoof and guttersMoss growing all over the roof (0.99); Flat roof needs a new coating (0.90); Chimney needs repointing (0.87)
Flat roof needs a new coatingRoof and guttersChimney needs repointing (0.97); Moss growing all over the roof (0.94); Gutter is full of leaves (0.90)
Leak in the attic after heavy rainRoof and guttersDownpipe came loose from the wall (0.97); Roof tiles blew off in the storm (0.95); Water dripping from the ceiling (0.87)
Chimney needs repointingRoof and guttersFlat roof needs a new coating (0.97); Moss growing all over the roof (0.90); Gutter is full of leaves (0.87)
Moss growing all over the roofRoof and guttersGutter is full of leaves (0.99); Flat roof needs a new coating (0.94); Chimney needs repointing (0.90)
Downpipe came loose from the wallRoof and guttersLeak in the attic after heavy rain (0.97); Roof tiles blew off in the storm (0.88); Flat roof needs a new coating (0.87)
Dripping kitchen tapPipes and tapsWashing machine hose leaks (0.98); Toilet keeps running (0.92); Shower drains very slowly (0.91)
Toilet keeps runningPipes and tapsShower drains very slowly (0.97); Low water pressure upstairs (0.97); Dripping kitchen tap (0.92)
Burst pipe under the sinkPipes and tapsWater dripping from the ceiling (0.86); Washing machine hose leaks (0.85); Toilet keeps running (0.80)
Shower drains very slowlyPipes and tapsToilet keeps running (0.97); Low water pressure upstairs (0.97); Dripping kitchen tap (0.91)
Water dripping from the ceilingPipes and tapsLeak in the attic after heavy rain (0.87); Burst pipe under the sink (0.86); Downpipe came loose from the wall (0.85)
Low water pressure upstairsPipes and tapsToilet keeps running (0.97); Shower drains very slowly (0.97); Dripping kitchen tap (0.90)
Washing machine hose leaksPipes and tapsDripping kitchen tap (0.98); Toilet keeps running (0.92); Shower drains very slowly (0.90)
New kitchen worktopKitchenReplace all kitchen cabinet doors (1.00); Fit a new oven and hob (0.99); Complete kitchen renovation (0.97)
Replace all kitchen cabinet doorsKitchenNew kitchen worktop (1.00); Fit a new oven and hob (0.99); Complete kitchen renovation (0.97)
Fit a new oven and hobKitchenReplace all kitchen cabinet doors (0.99); New kitchen worktop (0.99); Complete kitchen renovation (0.97)
Tiles behind the stove are crackedbetween Kitchen and Floors and tilesComplete kitchen renovation (0.83); Squeaky floorboards on the landing (0.71); New kitchen worktop (0.71)
Install a dishwasherKitchenComplete kitchen renovation (0.93); Fit a new oven and hob (0.93); New kitchen worktop (0.92)
Complete kitchen renovationKitchenNew kitchen worktop (0.97); Replace all kitchen cabinet doors (0.97); Fit a new oven and hob (0.97)
Hedge needs trimmingGardenBuild a wooden fence (1.00); Lay a new lawn (1.00); Tidy the garden before summer (0.99)
Lay a new lawnGardenHedge needs trimming (1.00); Build a wooden fence (1.00); Tidy the garden before summer (0.99)
Build a wooden fenceGardenHedge needs trimming (1.00); Lay a new lawn (1.00); Tidy the garden before summer (0.99)
Tidy the garden before summerGardenBuild a wooden fence (0.99); Hedge needs trimming (0.99); Lay a new lawn (0.99)
Patio stones are looseGardenHedge needs trimming (0.81); Lay a new lawn (0.81); Build a wooden fence (0.81)
Cut down a dead treeGardenTidy the garden before summer (0.97); Hedge needs trimming (0.94); Lay a new lawn (0.94)
Boiler makes a banging noiseHeatingRadiators stay cold (1.00); Thermostat shows the wrong temperature (0.95); Bleed the radiators (0.93)
Radiators stay coldHeatingBoiler makes a banging noise (1.00); Thermostat shows the wrong temperature (0.97); Bleed the radiators (0.95)
Yearly boiler serviceHeatingBleed the radiators (1.00); Thermostat shows the wrong temperature (0.99); Radiators stay cold (0.95)
Install underfloor heatingbetween Heating and Floors and tilesYearly boiler service (0.76); Bleed the radiators (0.76); Thermostat shows the wrong temperature (0.75)
Thermostat shows the wrong temperatureHeatingYearly boiler service (0.99); Bleed the radiators (0.98); Radiators stay cold (0.97)
No hot water since this morningHeatingBoiler makes a banging noise (0.88); Radiators stay cold (0.84); Not urgent, any time this year is fine (0.78)
Bleed the radiatorsHeatingYearly boiler service (1.00); Thermostat shows the wrong temperature (0.98); Radiators stay cold (0.95)
Sand and varnish the wooden floorFloors and tilesSqueaky floorboards on the landing (1.00); Lay laminate in the bedroom (1.00); Cracked tiles on the bathroom floor (0.96)
Cracked tiles on the bathroom floorFloors and tilesRegrout the shower walls (0.99); Sand and varnish the wooden floor (0.96); Lay laminate in the bedroom (0.96)
Lay laminate in the bedroomFloors and tilesSand and varnish the wooden floor (1.00); Squeaky floorboards on the landing (1.00); Cracked tiles on the bathroom floor (0.96)
Squeaky floorboards on the landingFloors and tilesSand and varnish the wooden floor (1.00); Lay laminate in the bedroom (1.00); Cracked tiles on the bathroom floor (0.96)
Regrout the shower wallsFloors and tilesCracked tiles on the bathroom floor (0.99); Squeaky floorboards on the landing (0.92); Sand and varnish the wooden floor (0.92)
Not urgent, any time this year is finethe middle (no topic stands out)Urgent: help needed today (0.99); Burst pipe under the sink (0.78); No hot water since this morning (0.78)
Urgent: help needed todaythe middle (no topic stands out)Not urgent, any time this year is fine (0.99); Burst pipe under the sink (0.78); No hot water since this morning (0.76)
fig. 2 Each dot lands where its numbers put it. Jobs about the same thing end up together without anyone sorting them.

Nobody labelled these groups. They appear because similar requests get similar numbers.

04 · Cutting text

How you cut the text changes what you find.

Documents are cut into pieces (chunks) before they get numbers. One customer wrote about two jobs in one message. Kept whole, the message lands halfway between both topics and matches neither search well. Cut per sentence, each piece lands right next to the search it answers.

The customer's message

Our boiler makes a banging noise every morning.

Also, could someone look at the cracked tiles on the bathroom floor?

Distance to each search: 1 minus the score

sentence 1sentence 2 search: "Heating engineer needed"search: "Bathroom tiler needed"

Best score per search

  • "Heating engineer needed" one chunk0.75 per sentence0.99
  • "Bathroom tiler needed" one chunk0.68 per sentence1.00
Show as text
How the message is cutHeating engineer neededBathroom tiler needed
One chunk0.750.68
One chunk per sentence0.99 (sentence 1)1.00 (sentence 2)

The message: "Our boiler makes a banging noise every morning. Also, could someone look at the cracked tiles on the bathroom floor?" As one chunk it is about two things, so its numbers sit halfway between heating and floors. It matches both searches only so-so, and might lose to a message about one thing. Per sentence, each search finds a strong match.

fig. 4 A chunk about two things sits between both searches. Cut it per sentence and each piece lands on top of the search it answers. The cost: a sentence on its own can lose context, like who wrote it.

Chunking is a product decision: it decides which questions can find which answers.

05 · Limits

Close is not the same as correct.

Embeddings capture what text is about, not what it says is true. Pick a pair from the map that sits close for the wrong reasons, and compare their numbers. A third trap is not a pair: "Tiles behind the stove are cracked" sits between kitchen and floors, so either team could get it, unless you add a rule for who owns it.

Two messages

AWater dripping from the ceiling

BLeak in the attic after heavy rain

Their numbers, A above B

  1. roof
  2. plumbing
  3. kitchen
  4. garden
  5. heating
  6. floors
  7. urgent
  8. other

Score

0.87: very close

What each one needs

A
Often a pipe upstairs: a plumber
B
The roof: a roofer

Different trade

Show as text
PairScoreWhat each one needs
"Water dripping from the ceiling" and "Leak in the attic after heavy rain"0.87A: Often a pipe upstairs: a plumber. B: The roof: a roofer. Different trade.
"Not urgent, any time this year is fine" and "Urgent: help needed today"0.99A: Any time this year. B: Today. Opposite.
"Tiles behind the stove are cracked" and "Complete kitchen renovation"0.83A: A tiler, an hour or two. B: A kitchen fitter, weeks of work. A different job.
fig. 5 A big difference in meaning can be a small difference in numbers. The score says the two are close; it cannot say they need the same thing.

What helps: filter first (region, job type, customer), then rank by similarity. Or store the key facts as fields and look them up. That is the topic of the next explainers.

Use similarity to find candidates, then use filters and structure to pick the right one.

Questions

What is an embedding, in one sentence?

A list of numbers that places a piece of text in a space where texts with similar meaning end up close together.

Does a closer match mean a correct answer?

No. Two texts can be close because they share words or a theme while meaning different things, for example a roof leak and a tap leak. Add filters or structure when that matters.