Artificial intelligence · University
Embeddings, similarity and retrieval representations
An embedding represents an item as a vector learned or designed for a task. Nearby vectors reflect the representation’s notion of similarity, not universal meaning.
Prerequisites
Vectors, dot products and norms.
Study notes
Embedding
An embedding represents an item as a vector learned or designed for a task. Nearby vectors reflect the representation’s notion of similarity, not universal meaning.
Cosine
For nonzero vectors, cosine similarity is u·v/(norm(u)norm(v)). It compares direction and differs from Euclidean distance.
Retrieval
An embedding search retrieves candidates. Relevance, factual correctness and permissions still need additional checks.
Evaluation
Test representations on the intended language, domain and retrieval tasks. A low-dimensional visual projection can distort relationships.
Worked examples
For nonzero identical vectors, find cosine similarity.
The dot product equals the product of their norms.
1
Find cosine similarity of (1,0) and (0,1).
The dot product is zero.
0
Check your understanding
Is ordinary cosine similarity defined for a zero vector without an extra convention?
- No
- Yes, always minus one
- Only in two dimensions
- Yes, always one
Find the dot product of (2,3) and (4,−1).
Why does a high embedding similarity not prove that a document supports a factual claim?
What can a two-dimensional embedding plot hide?
- Distortion introduced by dimensionality reduction
- All uncertainty permanently
- Every exact original distance by definition
- Only the legend
Answers and marking guidance
Answers and marking notes
- No
The norm product denominator is zero.
- 5
2×4+3×(−1)=5.
- Similarity measures the modelled representation relationship, while support requires reading the relevant content and checking its meaning and reliability.
Credit similarity versus evidence.
- Distortion introduced by dimensionality reduction
Projection can change or obscure high-dimensional relationships.
Further reading and review references
These are reference links, not copied exercises, institutional endorsement or proof of independent review.
AI-assisted preview; independent educational review required. Level labels describe prerequisites, not accreditation or official curriculum alignment.