Skip to main content

Glossary

One-line, plain-English definitions for the terms used across these notes. Skim it before an interview, or jump here whenever a word is unfamiliar.

Core LLM terms​

  • LLM (Large Language Model) β€” a model that predicts the next token over and over; effectively a function from text to a probability distribution over the next token.
  • Token β€” the unit a model reads; a word-piece. ~1 token β‰ˆ 4 characters. Cost and context limits are counted in tokens.
  • Context window β€” the max tokens a model can consider at once (prompt + output).
  • Temperature β€” randomness of sampling; low = focused/deterministic, high = creative.
  • Top-p / top-k β€” limit which tokens are eligible before sampling (nucleus / top-k).
  • Hallucination β€” a confident but unsupported/false answer the model invents.
  • Reasoning model β€” a model trained to "think" (long internal chain) before answering; better at multi-step problems, slower and pricier.
  • System / user / assistant β€” message roles; system = standing rules, user = the request, assistant = the model's prior turns.

RAG terms​

  • RAG (Retrieval-Augmented Generation) β€” retrieve relevant text at query time and put it in the prompt so the model answers from it.
  • Indexing β€” the offline phase: load β†’ chunk β†’ embed β†’ store.
  • Querying β€” the live phase: embed question β†’ retrieve β†’ augment prompt β†’ generate.
  • Document β€” LangChain's common unit: page_content (text) + metadata.
  • Loader β€” reads a source (PDF, CSV, SQL, …) into Documents.
  • Chunk β€” a small, independently-retrievable piece of a document.
  • Chunk overlap β€” shared text between neighbouring chunks so boundary facts survive.
  • Recursive splitting β€” split on paragraph β†’ line β†’ sentence β†’ word; the default.
  • Grounding β€” tying the answer to retrieved source text (so it's citable).

Embeddings & similarity​

  • Embedding β€” a fixed-length vector that captures the meaning of text.
  • Dimension β€” how many numbers in the vector (e.g. MiniLM = 384, OpenAI small = 1536).
  • embed_query β€” embed one string (the question).
  • embed_documents β€” embed a list of strings (your chunks) in one batch.
  • Cosine similarity β€” angle between two vectors; 1 = same meaning, 0 = unrelated.
  • L2 (Euclidean) distance β€” straight-line distance; lower = more similar (ChromaDB's default β€” opposite direction to cosine).
  • Normalization β€” scaling a vector to length 1 so cosine == dot product (faster).

Vector storage & retrieval​

  • Vector store β€” lightweight library for storing + KNN-searching vectors (FAISS, Chroma); great under ~1M vectors.
  • Vector database β€” full system with filters, CRUD, sharding, HA for production scale (Pinecone, Qdrant, Weaviate, Milvus).
  • Retriever β€” embeds a query and returns the closest chunks (as_retriever).
  • top-k β€” how many chunks retrieval returns.
  • Similarity search β€” similarity_search (plain) / similarity_search_with_score.
  • HNSW β€” a graph index for fast approximate nearest-neighbour search; the common default. IVF β€” a cluster-based ANN index.

Building & chaining​

  • LangChain β€” framework for composing LLM apps (loaders, splitters, chains).
  • LCEL (LangChain Expression Language) β€” compose a pipeline with the | operator.
  • create_stuff_documents_chain β€” "stuffs" retrieved docs into the prompt's {context} slot.
  • create_retrieval_chain β€” wires a retriever to a document chain = the RAG pipeline.
  • History-aware retriever β€” rewrites a follow-up into a standalone query using chat history before retrieving.

Advanced RAG (coming up in the course)​

  • Hybrid search β€” combine dense (vector) + sparse (BM25/keyword) retrieval.
  • Reranking β€” a cross-encoder re-scores the shortlist for precision.
  • RRF (Reciprocal Rank Fusion) β€” merge ranked lists by rank, not score.
  • HyDE β€” embed a hypothetical answer instead of the question to retrieve better.
  • Multi-query β€” generate several phrasings, retrieve for each, merge.
  • Corrective RAG (CRAG) / Self-RAG / Adaptive RAG β€” agentic variants that check, correct, or decide when to retrieve.
  • Multimodal RAG β€” retrieval over text and images.
  • Guardrails β€” input/output filtering and injection defense.