Back to Generative AI Notes
Topic #87

Embeddings – Complete Overview

An embedding is a list of numbers (a vector) that represents the meaning of a piece of text — generated so that texts with similar meaning end up with similar vectors. This single idea is the foundation of semantic search, RAG, recommendation systems, and clustering.

The Pipeline: Text → Embedding → Vector → Similarity → Retrieval

Text:      "How do I reset my password?"
  ↓ embedding model
Vector:    [0.021, -0.184, 0.093, ..., 0.056]  (hundreds to
                                                  thousands of numbers)
  ↓ compare against other vectors (e.g. a knowledge base)
Similarity: this vector is close to the vector for "password
            recovery steps" — even though the wording is different
  ↓
Retrieval: return the "password recovery steps" document as
           the most relevant match

This is the mechanism that makes semantic search possible — matching by meaning, not just overlapping keywords. See Semantic Similarity and RAG, which is built almost entirely on this pipeline.

A Concrete Example of "Similar Meaning, Similar Vector"

"How do I reset my password?"
"I forgot my password, what do I do?"
"Password recovery steps"

→ These three phrases share almost no exact words in common,
  but a good embedding model places their vectors close
  together in vector space, because they mean roughly the
  same thing.

"How do I reset my password?"
"What's the weather today?"

→ These share more surface-level similarity in sentence
  structure than the examples above, but their vectors would
  be far apart — meaning, not wording, drives the vector.

What This Section Covers

NoteFocus
Text EmbeddingsPractical usage — calling an embedding API
Embedding ModelsHow embedding models differ from LLMs, and from each other
Vector RepresentationsThe technical underpinning — what a vector actually encodes
Semantic Similarity, Cosine SimilarityMeasuring how close two vectors are
Embedding DimensionsWhat vector size means practically
Embedding SearchUsing embeddings to retrieve relevant content
Best PracticesPractical guidance for real applications

Common Mistakes

  • Confusing embeddings (used for search/similarity) with the internal token embeddings inside a transformer's architecture (see Embeddings in Transformers) — related idea, different scope and purpose
  • Assuming any embedding model works equally well for any task — models are often optimized differently (e.g. for search vs classification vs clustering)

Interview Relevance

Q: "Explain what an embedding is and why it's useful, without heavy math." — the "similar meaning → similar vector" framing, with a concrete example like the password-reset one above, is a strong, intuitive answer.

Practice Question

Explain why "cheap flights to Paris" and "affordable airfare to France" would be expected to have similar embedding vectors, despite sharing almost no exact words.

Want to go beyond the notes?

Join Coding Now Tech Institute's Generative AI course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

Embeddings – Complete Overview – FAQs

Quick answers about learning Embeddings – Complete Overview in Generative AI.

This free note from Coding Now Tech Institute explains Embeddings – Complete Overview in Generative AI — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every Generative AI topic on Coding Now Tech Institute, including Embeddings – Complete Overview, is 100% free with no signup required.
With focused practice, most students grasp Embeddings – Complete Overview in 1–3 days from these notes; pairing it with Coding Now Tech Institute's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the Coding Now Tech Institute Community (/community) — expert instructors answer within 24 hours.
Call NowEnroll Now