Embedding Vectors
Embedding is a technique that converts content such as text and images into a string of numbers (a vector). It is the foundation that lets computers "understand semantics".
Core idea
A computer cannot directly compare how similar "cat" and "kitty" are. But once they are converted into vectors, mathematical distance can be computed. Content with similar meaning also ends up at nearby positions in the vector space.
Classic example: vector(king) - vector(man) + vector(woman) = about vector(queen). This shows that the semantic dimension of "gender" is captured in the vector space.
What it actually looks like
An embedding is usually a floating-point array of 768, 1024, or even 3072 dimensions. For example, "artificial intelligence" might be represented as more than a thousand numbers like [0.023, -0.451, 0.887, ...].
How similarity is judged
Using cosine similarity: compute the cosine of the angle between two vectors; the closer to 1, the more similar. This is the core operation of vector database retrieval.
Main uses
- Semantic search: searching "how to lose weight" can find "weight loss methods" even if the wording differs
- RAG retrieval: convert documents and questions into vectors for matching
- Recommender systems: find similar products and similar users
- Cluster analysis: automatically group massive amounts of text
- Deduplication: find articles with duplicate content
Mainstream models
OpenAI text-embedding-3, the BGE series (excellent on Chinese), M3E, GTE, Jina Embeddings. For Chinese scenarios BGE or GTE is recommended.