{"course":{"slug":"ai-for-small-business","title":"AI for a Small Business","url":"https://addaly.com/learn/ai-for-small-business","level":"beginner","track":"work"},"lesson":{"slug":"embeddings-for-non-programmers","title":"Why it finds \"refund\" when the customer typed \"money back\"","url":"https://addaly.com/learn/ai-for-small-business/embeddings-for-non-programmers","position":22,"of":88,"minutes":10,"answer":"An embedding turns text into a position in a space of meaning, so search becomes a distance calculation rather than a word hunt, which is why it matches paraphrases and other languages.","keyIdea":"An embedding turns text into a position in a space of meaning, so search becomes a distance calculation rather than a word hunt, which is why it matches paraphrases and other languages, and also why \"our refund policy\" and \"our no-refund policy\" sit dangerously close together."},"body":{"format":"markdown","text":"## The thing under search\n\nA customer writes \"can I get my money back?\" Your help page says \"refunds\". Word matching finds nothing. A modern search finds it instantly.\n\nThe mechanism behind that is called an **embedding**, and it is worth twenty minutes of your attention even if you never write a line of code, because it is what search, document Q&A, recommendation and clustering are all built on, and it explains several behaviours that otherwise look like magic or malfunction.\n\n## Meaning as a position\n\nImagine giving every piece of text a position in space using three numbers, in the way a place has a latitude, longitude and altitude.\n\nSuppose the first number measures how much a phrase is about money, the second how much it is about complaint, the third how much it is about time. Then:\n\n```text\n\"refund\"          -> (0.9, 0.6, 0.2)\n\"money back\"      -> (0.9, 0.6, 0.2)\n\"chargeback\"      -> (0.9, 0.8, 0.3)\n\"delivery delay\"  -> (0.1, 0.7, 0.9)\n\"opening hours\"   -> (0.0, 0.0, 0.8)\n```\n\n\"Refund\" and \"money back\" share no words and sit in almost the same place. \"Opening hours\" is far away. Search becomes a distance calculation rather than a word hunt, and distance does not care what words you used.\n\n> Figure: Distance is similarity of subject, not agreement. Bars (cosine similarity, 1 is the same direction): refund and money back 0.75; refund and chargeback 0.62; our refund policy and our no-refund policy 0.91; refund and opening hours 0.05. The two policies sit closer together than any honest pair on this chart, because they are about the same thing. Retrieval can hand the model the opposite of your rule and the model will answer from it faithfully.\n\nReal embeddings use hundreds or thousands of numbers instead of three, and nobody chose what each one measures: they were learned from a very large amount of text, on the principle that words appearing in similar contexts should end up near each other. But the picture is exactly the one above, only with more dimensions than you can draw.\n\n## Where you meet them without knowing\n\n- Your document tool finding the right passage although you used different words.\n- A shop suggesting related products.\n- Your email sorting messages into categories.\n- \"Find similar\" in a photo library.\n- The retrieval step in every grounded system from the previous lesson.\n\nAll the same operation: turn things into positions, then find what is nearby.\n\n## What this explains\n\n**Why retrieval finds the wrong passage sometimes.** Nearness is similarity of meaning, not correctness. \"Our refund policy\" and \"our no-refund policy\" sit very close together, because they are about the same subject. A search may hand the model the wrong one, and the model will answer from it faithfully.\n\n**Why short queries retrieve badly.** \"Price?\" has almost no meaning to position. It lands in a crowded region and pulls back whatever happens to be nearest.\n\n**Why chunk size matters.** Embed a whole 40-page document as one position and it means \"a bit about everything\", which is near nothing in particular. This is why documents are split into passages: a passage has one subject and therefore a meaningful position.\n\n**Why it works across languages.** Multilingual embeddings place \"refund\", \"remboursement\" and \"reembolso\" in nearly the same spot. Search your English documents with a Spanish question and it works, which is a useful property for a business with customers in more than one language.\n\n## Trying it for free\n\nIf you are curious enough to look at real numbers, `sentence-transformers` is a free Python library that runs on an ordinary laptop with no GPU:\n\n```python\nfrom sentence_transformers import SentenceTransformer, util\nm = SentenceTransformer(\"all-MiniLM-L6-v2\")   # small, free, offline\nv = m.encode([\"refund\", \"money back\", \"opening hours\"])\nprint(util.cos_sim(v[0], v[1]))   # about 0.75\nprint(util.cos_sim(v[0], v[2]))   # about 0.05\n```\n\nThe number is cosine similarity: 1 means the same direction, 0 means unrelated. Seeing 0.75 against 0.05 with your own two phrases is the moment this stops being abstract.\n\n## What it does not do\n\nAn embedding captures topic and rough sense. It does not capture negation reliably, it does not know which document is authoritative, and it certainly does not know which of two similar passages is current.\n\nSo embeddings decide **what to look at**. They never decide what is true. That job stays with your documents being right, and with you.\n\n## Where the numbers are stored\n\nIf you use a purpose-built document tool, this is invisible: it computes the positions when you upload and keeps them in a **vector database**. Chroma and FAISS are free and open; Pinecone, Weaviate and Qdrant are the commercial names you will see in vendor materials.\n\nYou do not need one. The word is here so that a supplier's technical proposal does not read as unfamiliar, and so you can ask the question that matters: how are the documents kept current, and what happens to the old positions when a file changes.\n\n## The cost, so it is not mysterious\n\nEmbedding text is cheap even on a paid service: a whole small business's document set typically costs a few cents to embed, and running an open model locally costs nothing but electricity.\n\nWhere cost appears is re-embedding. Change your chunking, change the model, or reload the library, and everything is recomputed. At a small business's scale this is trivial. It is worth knowing only because a vendor quoting a large figure for \"indexing\" is charging you for their engineering, not for the arithmetic."},"check":{"question":"A grounded assistant is asked whether deposits are refundable and confidently answers yes, citing a real passage from the company handbook. The passage is the section explaining when deposits are NOT refundable. What does this illustrate?","options":[{"text":"The model misread a passage it retrieved correctly, which is a comprehension failure rather than a retrieval one.","correct":false,"tempting":"Possible in principle, but it skips the more likely and more instructive step: the retrieval itself had no way to prefer the affirmative passage over the negative one."},{"text":"The handbook is ambiguous and needs rewriting so that each policy appears in only one place.","correct":false,"tempting":"Reasonable housekeeping that would help, yet it treats a general property of similarity search as a documentation defect specific to this company."},{"text":"Embeddings place text by subject, so a passage about deposits not being refundable sits very close to one saying they are, and negation is not reliably captured.","correct":true},{"text":"The chunk was too large, so the retrieved passage covered several deposit policies at once and the model picked the wrong one from within a block of text that contained both.","correct":false,"tempting":"Names a real chunking problem, but a short passage entirely about non-refundable deposits would be retrieved for this query just as readily."}]},"prev":{"slug":"why-retrieval-beats-memory","title":"Grounding: answering from your material rather than its memory","url":"https://addaly.com/learn/ai-for-small-business/why-retrieval-beats-memory"},"next":{"slug":"the-tools-that-hold-your-files","title":"Four ways to keep a small library, and what each costs","url":"https://addaly.com/learn/ai-for-small-business/the-tools-that-hold-your-files"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Exam keys checked blind by a second model: 3,665 of 3,666 agreed. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'Why it finds \"refund\" when the customer typed \"money back\"', in AI for a Small Business. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/ai-for-small-business/embeddings-for-non-programmers (Accessed: 13 October 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"Why it finds “refund” when the customer typed “money back”","courseTitle":"AI for a Small Business","module":{"index":3,"slug":"your-own-knowledge","title":"Your own documents, and getting straight answers out of them"},"answer":null,"keyIdea":"An embedding turns text into a position in a space of meaning, so search becomes a distance calculation rather than a word hunt, which is why it matches paraphrases and other languages, and also why “our refund policy” and “our no-refund policy” sit dangerously close together.","hero":{"kind":"figure","figure":{"t":"figure","label":"Figure","figure":{"type":"bars","unit":"cosine similarity, 1 is the same direction","title":"Distance is similarity of subject, not agreement","series":[{"label":"refund and money back","value":0.75},{"label":"refund and chargeback","value":0.62},{"label":"our refund policy and our no-refund policy","value":0.91,"highlight":true},{"label":"refund and opening hours","value":0.05}],"caption":"The two policies sit closer together than any honest pair on this chart, because they are about the same thing. Retrieval can hand the model the opposite of your rule and the model will answer from it faithfully."},"alt":"Figure: Distance is similarity of subject, not agreement. Bars (cosine similarity, 1 is the same direction): refund and money back 0.75; refund and chargeback 0.62; our refund policy and our no-refund policy 0.91; refund and opening hours 0.05. The two policies sit closer together than any honest pair on this chart, because they are about the same thing. Retrieval can hand the model the opposite of your rule and the model will answer from it faithfully."}},"blocks":[{"t":"h2","id":"the-thing-under-search","runs":[{"text":"The thing under search"}]},{"t":"p","runs":[{"text":"A customer writes “can I get my money back?” Your help page says “refunds”. Word matching finds nothing. A modern search finds it instantly."}]},{"t":"p","runs":[{"text":"The mechanism behind that is called an "},{"text":"embedding","b":true},{"text":", and it is worth twenty minutes of your attention even if you never write a line of code, because it is what search, document Q&A, recommendation and clustering are all built on, and it explains several behaviours that otherwise look like magic or malfunction."}]},{"t":"h2","id":"meaning-as-a-position","runs":[{"text":"Meaning as a position"}]},{"t":"p","runs":[{"text":"Imagine giving every piece of text a position in space using three numbers, in the way a place has a latitude, longitude and altitude."}]},{"t":"p","runs":[{"text":"Suppose the first number measures how much a phrase is about money, the second how much it is about complaint, the third how much it is about time. Then:"}]},{"t":"code","lang":"text","label":"Text","text":"\"refund\"          -> (0.9, 0.6, 0.2)\n\"money back\"      -> (0.9, 0.6, 0.2)\n\"chargeback\"      -> (0.9, 0.8, 0.3)\n\"delivery delay\"  -> (0.1, 0.7, 0.9)\n\"opening hours\"   -> (0.0, 0.0, 0.8)"},{"t":"p","runs":[{"text":"“Refund” and “money back” share no words and sit in almost the same place. “Opening hours” is far away. Search becomes a distance calculation rather than a word hunt, and distance does not care what words you used."}]},{"t":"p","runs":[{"text":"Real embeddings use hundreds or thousands of numbers instead of three, and nobody chose what each one measures: they were learned from a very large amount of text, on the principle that words appearing in similar contexts should end up near each other. But the picture is exactly the one above, only with more dimensions than you can draw."}]},{"t":"h2","id":"where-you-meet-them-without-knowing","runs":[{"text":"Where you meet them without knowing"}]},{"t":"ul","items":[[{"text":"Your document tool finding the right passage although you used different words."}],[{"text":"A shop suggesting related products."}],[{"text":"Your email sorting messages into categories."}],[{"text":"“Find similar” in a photo library."}],[{"text":"The retrieval step in every grounded system from the previous lesson."}]]},{"t":"p","runs":[{"text":"All the same operation: turn things into positions, then find what is nearby."}]},{"t":"h2","id":"what-this-explains","runs":[{"text":"What this explains"}]},{"t":"p","runs":[{"text":"Why retrieval finds the wrong passage sometimes.","b":true},{"text":" Nearness is similarity of meaning, not correctness. “Our refund policy” and “our no-refund policy” sit very close together, because they are about the same subject. A search may hand the model the wrong one, and the model will answer from it faithfully."}]},{"t":"p","runs":[{"text":"Why short queries retrieve badly.","b":true},{"text":" “Price?” has almost no meaning to position. It lands in a crowded region and pulls back whatever happens to be nearest."}]},{"t":"p","runs":[{"text":"Why chunk size matters.","b":true},{"text":" Embed a whole 40-page document as one position and it means “a bit about everything”, which is near nothing in particular. This is why documents are split into passages: a passage has one subject and therefore a meaningful position."}]},{"t":"p","runs":[{"text":"Why it works across languages.","b":true},{"text":" Multilingual embeddings place “refund”, “remboursement” and “reembolso” in nearly the same spot. Search your English documents with a Spanish question and it works, which is a useful property for a business with customers in more than one language."}]},{"t":"h2","id":"trying-it-for-free","runs":[{"text":"Trying it for free"}]},{"t":"p","runs":[{"text":"If you are curious enough to look at real numbers, "},{"text":"sentence-transformers","code":true},{"text":" is a free Python library that runs on an ordinary laptop with no GPU:"}]},{"t":"code","lang":"python","label":"Python","text":"from sentence_transformers import SentenceTransformer, util\nm = SentenceTransformer(\"all-MiniLM-L6-v2\")   # small, free, offline\nv = m.encode([\"refund\", \"money back\", \"opening hours\"])\nprint(util.cos_sim(v[0], v[1]))   # about 0.75\nprint(util.cos_sim(v[0], v[2]))   # about 0.05"},{"t":"p","runs":[{"text":"The number is cosine similarity: 1 means the same direction, 0 means unrelated. Seeing 0.75 against 0.05 with your own two phrases is the moment this stops being abstract."}]},{"t":"h2","id":"what-it-does-not-do","runs":[{"text":"What it does not do"}]},{"t":"p","runs":[{"text":"An embedding captures topic and rough sense. It does not capture negation reliably, it does not know which document is authoritative, and it certainly does not know which of two similar passages is current."}]},{"t":"p","runs":[{"text":"So embeddings decide "},{"text":"what to look at","b":true},{"text":". They never decide what is true. That job stays with your documents being right, and with you."}]},{"t":"h2","id":"where-the-numbers-are-stored","runs":[{"text":"Where the numbers are stored"}]},{"t":"p","runs":[{"text":"If you use a purpose-built document tool, this is invisible: it computes the positions when you upload and keeps them in a "},{"text":"vector database","b":true},{"text":". Chroma and FAISS are free and open; Pinecone, Weaviate and Qdrant are the commercial names you will see in vendor materials."}]},{"t":"p","runs":[{"text":"You do not need one. The word is here so that a supplier’s technical proposal does not read as unfamiliar, and so you can ask the question that matters: how are the documents kept current, and what happens to the old positions when a file changes."}]},{"t":"h2","id":"the-cost-so-it-is-not-mysterious","runs":[{"text":"The cost, so it is not mysterious"}]},{"t":"p","runs":[{"text":"Embedding text is cheap even on a paid service: a whole small business’s document set typically costs a few cents to embed, and running an open model locally costs nothing but electricity."}]},{"t":"p","runs":[{"text":"Where cost appears is re-embedding. Change your chunking, change the model, or reload the library, and everything is recomputed. At a small business’s scale this is trivial. It is worth knowing only because a vendor quoting a large figure for “indexing” is charging you for their engineering, not for the arithmetic."}]}],"check":{"question":[{"text":"A grounded assistant is asked whether deposits are refundable and confidently answers yes, citing a real passage from the company handbook. The passage is the section explaining when deposits are NOT refundable. What does this illustrate?"}],"options":[{"text":[{"text":"The model misread a passage it retrieved correctly, which is a comprehension failure rather than a retrieval one."}],"correct":false,"tempting":[{"text":"Possible in principle, but it skips the more likely and more instructive step: the retrieval itself had no way to prefer the affirmative passage over the negative one."}]},{"text":[{"text":"The handbook is ambiguous and needs rewriting so that each policy appears in only one place."}],"correct":false,"tempting":[{"text":"Reasonable housekeeping that would help, yet it treats a general property of similarity search as a documentation defect specific to this company."}]},{"text":[{"text":"Embeddings place text by subject, so a passage about deposits not being refundable sits very close to one saying they are, and negation is not reliably captured."}],"correct":true,"tempting":null},{"text":[{"text":"The chunk was too large, so the retrieved passage covered several deposit policies at once and the model picked the wrong one from within a block of text that contained both."}],"correct":false,"tempting":[{"text":"Names a real chunking problem, but a short passage entirely about non-refundable deposits would be retrieved for this query just as readily."}]}],"order":[1,3,0,2],"why":null},"prev":{"slug":"why-retrieval-beats-memory","title":"Grounding: answering from your material rather than its memory","minutes":9},"next":{"slug":"the-tools-that-hold-your-files","title":"Four ways to keep a small library, and what each costs","minutes":9}}}