Study Vault Search notes, aliases and full text
Graph
ConceptDBISAI-written · not yet proofread

Embedding

Also Embeddings

A (word) embedding assigns to each element of a vocabulary V a dense vector in R^d, usually with d much smaller than |V|, such that semantically related words get similar vectors (high cosine similarity).

Properties#

PropertyOne-Hot EncodingWord embedding
Dimension∣V∣\lvert V \rvert (very large)dd, e.g. 300 (ES11: d=300d = 300, ∣V∣=129 603\lvert V \rvert = 129\,603)
Densitysparse (one nonzero entry)dense
cos-sim of distinct wordsalways 00high for related words
  • Semantics in the direction: relatedness is encoded in the direction of the vectors, which is exactly what cos-sim compares; its length-invariance also means a summed document embedding (whose length grows with the number of words) is compared by what it is about, not by how long it is.
  • How embeddings are learned is not covered in DBIS (see IR WS 22/23, Lecture 9); for ES11 they are provided as a dictionary word → tensor.
  • Sum = bag of words: the summed text embedding, like the VSM document vector (sum of one-hot encodings), ignores word order because addition is commutative: “cute cats eating” and “eating cute cats” get the same vector and cos-sim 11.
  • Sum vs. embedding model: Lecture 12 calls the sum “simplistic”, because not every word is equally relevant for a text. ES12 uses a dedicated embedding API (mixedbread-ai/mxbai-embed-large-v1 at https://ad-llm.cs.uni-freiburg.de/v1/embeddings) that returns one embedding per input text; the same API must be used for chunks and queries.
  • Uses: similarity search over words or documents (ES11) and retrieving the chunks most similar to a query in Retrieval-Augmented Generation (ES12).

Example#

Sources#

Search

Type In
↑ ↓ move ↵ open ⇥ next section Ctrl↵ results page Prefix # to search text only