PromptItIn logoPromptItIn
AI glossary · Technical

Embedding

A dense numerical vector that represents a token, sentence, or document in a continuous semantic space.

PromptItIn team

A bookshelf with one card pulled out

What it means

An embedding is a fixed-length numerical vector that encodes semantic meaning such that similar concepts are geometrically close in the vector space. Word embeddings (Word2Vec, GloVe) capture word-level semantics; sentence and document embeddings (from models like text-embedding-ada-002 or E5) represent longer spans.

LLMs internally use token embeddings at every layer; these evolve through the network from surface-level lexical representations to rich contextual ones.

Embeddings are the foundation of semantic search, clustering, classification, and RAG systems — documents are encoded as embeddings and retrieved by computing vector similarity (cosine or dot product) rather than keyword matching.

Examples

  • Using OpenAI's text-embedding-ada-002 to convert 10,000 product descriptions into 1536-dimensional vectors, then finding the 5 most similar products to a user query via cosine similarity.
  • Word embeddings capturing that 'Paris' − 'France' + 'Germany' ≈ 'Berlin' in vector arithmetic.

Vector Database

A database optimised for storing and querying high-dimensional embedding vectors via similarity search.

RAG (Retrieval-Augmented Generation)

Augmenting model responses by retrieving relevant documents from an external knowledge base at inference time.

Tokenisation

The process of splitting text into tokens using a vocabulary and encoding algorithm like BPE.

Put this into practice

PromptItIn applies techniques like embedding for you: describe what you want and it builds the prompt.

Try PromptItIn freeAdd to Chrome, free

You might also like

Write a Technical Spec →Write a Product Spec →Gemini Prompt Generator →Few-Shot Prompting: Examples That Work →System Prompts Explained: What They Are, Examples & How to Write One →Perplexity AI →
← Browse the AI prompt glossary