LLM Learning Hub

workspace/llm-course/home

Semantic Representation

A semantic representation encodes the meaning of text as a vector in a space where semantic similarity corresponds to spatial proximity. Embeddings trained on large corpora capture this automatically.

What is Semantic Representation?

A semantic representation encodes the meaning of text as a vector in a space where semantic similarity corresponds to spatial proximity. Embeddings trained on large corpora capture this automatically.

A semantic representation encodes the meaning of text as a vector in a space where semantic similarity corresponds to spatial proximity. Embeddings trained on large corpora capture this automatically.

Where is it used?

Sentence-embedding models (BERT, E5, bge) power RAG retrieval, clustering, and semantic search; LLM hidden states are also used as semantic representations for downstream tasks.

How to build it

Use `sentence-transformers` to encode sentences, compute pairwise cosine similarity, and verify that paraphrases score higher than unrelated sentences.