Ch 6 · Similarity — How AI Finds "Related" Things · AI & LLM Literacy

Topic 6 of 7 in AI & LLMs — How They Actually Work — 2 lessons.

Turning Sentences Into Vectors

How does AI know two sentences are "about the same thing"? It turns text into vectors (lists of numbers) so that similar meanings point in similar directions. The simplest version is bag-of-words: count how often each vocab word appears. Let's build the vectors first.

Cosine Similarity

To compare two vectors we measure the cosine of the angle between them: 1.0 means identical direction (very similar), 0.0 means unrelated. This is the seed of embeddings and AI-powered search.

All topics in AI & LLM Literacy Beginner

  1. What Is an AI Language Model?
  2. Tokens — How AI Reads Text
  3. How the CodeArc AI Tutor Works
  4. What Is a Prompt?
  5. Why AI Gets Things Wrong
  6. Similarity — How AI Finds "Related" Things
  7. Now You Try!