← Back to LLMs Mind Map
中文·English
⚡ LLMsID: embeddings

Text Embeddings

文本嵌入 Embeddings
🎯Core Definition
Text embeddings map tokens or whole sentences into dense, low-dimensional real vectors so semantically similar texts lie close in vector space. Token-level embeddings come from the vocabulary embedding table E∈RV×dE \in \mathbb{R}^{V \times d} (V = vocab size, d = hidden dim); sentence-level embeddings typically take the CLS token output or mean-pool all token vectors, with cosine similarity measuring semantic closeness.
💡Use Cases
RAG retrieval (encode the document corpus offline into a vector store, nearest-neighbor search for queries), semantic search and QA recall, clustering/dedup, fine-tuning embedding models for domain retrieval — the underlying representation of vector DBs (ANN search) feeding KB question answering.
⚡Key Problems Solved
bag-of-words / one-hot vectors are V-dimensional (100K-level) and semantics-free — they cannot capture relations like king − man + woman ≈ queen; embeddings compress semantics into d≪Vd \ll V dense space with cosine similarity in [−1,1][-1, 1], replacing keyword matching with semantic search. With V=100K, d=4096 the embedding table alone is ~400M params (~1.6GB FP32), showing why high-dimensional sparse representations are infeasible.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Text Embeddings.
Use Cases
In production engineering, what are the primary use cases for Text Embeddings and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Token-level vs sentence-level embeddings? When CLS vs mean pooling?
2
Why cosine similarity over dot product or L2 distance? Its range?
3
Embedding's role in RAG: offline indexing, online ANN search, reranking?
4
Estimating params/memory of the vocab embedding table?
5
Static (Word2Vec) vs contextual representations (Transformer outputs)?
Updated 2026-08-12
🎯
Test Your Knowledge: Practice Questions for "Text Embeddings"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice ➔
← Previous CardTokenization: BPE / WordPieceNext Card →Padding & Packing

🔗 More LLMs Knowledge Cards

Agent & Tool CallingAlignment Tax & Preference DataScaled Dot-Product AttentionAttention Variants MHA/MQA/GQA