Embeddings vs. Keyword Matching: Knowing When Closeness Trumps Exactness

Sai Pranavi Jeedigunta explains why fixed keyword rules quietly stop working when real language varies, using the acronym RIA as an example. She gives a three-question check for deciding when embeddings help and when exactness must win.

2:24 video3 min readWatch on YouTube

Fixed keyword rules often fail without anyone noticing. In this short video, Sai Pranavi Jeedigunta explains why keyword matching rules quietly break over time and what embeddings do differently. She also shows that embeddings are not the answer everywhere, and gives a three-question check for deciding which approach fits a given rule. The explanation is demonstrated with Claude Code.

How a keyword rule quietly stops working

The video starts with a concrete rule: flag any document that mentions "investment advisor." The rule works well until someone writes "RIA," the industry's own acronym for the same thing. The rule does not know what that means, so it misses the document.

The important detail is that nothing crashed. The rule simply stopped working for that one document, with no error to alert anyone. That silent failure is what makes keyword lists risky when real-world wording varies.

Three questions before you choose

Before looking at examples, the video gives a check made of three questions:

  • Does the wording actually vary in the real world, or is there only one way to say this?
  • Does context change what a phrase means, so that a fixed keyword could be right in one place and wrong in another?
  • Is exactness itself the point, such as matching a specific ID or code, where a close but different match would be wrong?

What embeddings do differently

Applying the questions to the advisor rule, the wording varies constantly. Different phrasings of the advisor role, including "RIA," all mean the same thing. An embedding does not check for an exact phrase. It measures how close two pieces of text are in meaning.

In that meaning space, "RIA" and "investment advisor" land close together even though they share no letters. A rule built on that closeness catches both, and it also catches the next synonym nobody thought to add.

The case where closeness is the wrong tool

The video is careful to show where this approach would fail if applied everywhere. A rule that matches a specific regulation number, for example section 4.12, should not use closeness of meaning. Section 4.12 and section 4.13 might sit close together in meaning space because they are provisions about similar topics. But they are different rules with different requirements.

Here, exactness is the whole point. An embedding would blur exactly the distinction you need to keep.

When to move a rule

The video's guidance is direct. If the first two questions are yes and the third is no, the rule is worth moving to similarity matching before the next synonym slips past it. A keyword list only knows the words you thought of. Embeddings measure the meaning you did not have to spell out, but only where closeness is what you actually want.

Key takeaways

  • Keyword rules can fail silently when real-world wording varies.
  • Acronyms like RIA show how a rule for "investment advisor" can miss the same concept.
  • Ask whether wording varies, whether context changes meaning, and whether exactness is the point.
  • Embeddings measure how close two texts are in meaning, not whether they match a phrase.
  • A similarity-based rule can catch the next synonym nobody listed.
  • Exact codes such as regulation section numbers should still use exact matching.
  • Embeddings could blur distinctions, like 4.12 versus 4.13, that must stay sharp.

Try it yourself

Find one keyword matching rule you rely on today and ask the three questions about it. Does the wording actually vary? Does context change the meaning? Is exactness the whole point? If the first two answers are yes and the third is no, that rule is a candidate for similarity matching.

Chapters

  1. 0:00Why keyword matching rules quietly break over time
  2. 0:15The three-question evaluation framework
  3. 0:30Semantic closeness vs. exact regulation numbers
  4. 0:50Transitioning rules to similarity matching
  5. 1:10Measuring unspelled meaning with Claude Code
Full transcript(auto-generated, with timestamps)

Why keyword matching rules quietly break over time

[0:04]Hi, I'm Sai Pranavi Gedegunta. This video is about why keyword matching rules quietly break over time and what embeddings actually do differently. So, you know when you need them and when you

The three-question evaluation framework

[0:15]Don't. Picture a rule that flags any document mentioning investment advisor. It works great until someone writes RIA, the industry's own acronym for the exact same thing, and the rule doesn't know what that means. Nothing crashed. It

Semantic closeness vs. exact regulation numbers

[0:32]Just quietly stopped working for that one document. Here's the check before any example. Three questions. One, does the wording actually vary in the real world or is there only one way to say this? Two, does context change what a phrase means? So, a fixed keyword could be right in one place and wrong in another.

Transitioning rules to similarity matching

[0:50]Three, is exactness itself the point like matching a specific ID or code where a close but different match would actually be wrong? Back to that advisor rule. Wording varies constantly. Advisor, advisor, RIA all mean the same role. An embedding doesn't check for an exact phrase. It measures how close two

Measuring unspelled meaning with Claude Code

[1:10]Pieces of text are in meaning. RIA and investment advisor land close together in that space even though they don't share a single letter in common. A rule built on that closeness catches both and catches the next synonym nobody thought to add, too. Now, the case that would break this if applied everywhere. A rule that matches a specific regulation number, say section 4.12, should not use closeness of meaning. Section 4.12 and section 4.13 might land close together in meaning space because they are both provisions about similar topics. But, they are different rules with different requirements. Here, exactness is the whole point. An embedding would blur exactly the distinction you need to keep. Here's something to check today. Find one keyword matching rule you rely on. Ask the three questions. Does the wording actually vary? Does context change the meaning? And is exactness the whole point? If the first two are yes and the third is no, that's a rule worth moving to similarity matching before the next synonym quietly slips past it. A keyword list only knows the words you thought of. Embeddings measure the meaning you didn't have to spell out, but only where closeness is actually what you want. Explained with Claude code.

More from Humanitarians AI Fellows

Humanitarians AI Lyrical Literacy Project