AI & ML Glossary
Plain-English definitions of AI and machine learning terms. Understand RAG, transformers, embeddings, fine-tuning, attention mechanisms, and more.
- RAG (Retrieval-Augmented Generation) RAG is a technique that combines an LLM with an external knowledge retrieval system. Instead of relying solely on its training data, the model retrieves relevant documents at query time and uses them as context to generate more accurate, up-to-date responses. LLM Engineering
- Embedding An embedding is a numerical vector representation of data (text, image, audio) that captures semantic meaning. Similar concepts have embeddings that are close together in vector space, enabling AI systems to measure similarity, cluster data, and retrieve relevant information. Fundamentals
- Fine-tuning Fine-tuning is the process of continuing to train a pre-trained model on a smaller, task-specific dataset to specialise its behaviour. It updates the model's weights, making it more accurate for a specific domain, style, or task without training from scratch. LLM Engineering
- Transformer The Transformer is a neural network architecture introduced by Google in 2017 that uses self-attention to process sequences in parallel. It is the foundation of virtually all modern large language models, including GPT, Claude, Gemini, and LLaMA. Architecture
- Attention Mechanism Attention is a mechanism that allows neural networks to dynamically weight which parts of an input sequence are most relevant when producing each output token. It enables models to capture long-range dependencies and is the core innovation behind Transformer architectures. Architecture
- Hallucination Hallucination is when an AI language model generates plausible-sounding but factually incorrect or entirely fabricated information. The model 'hallucinates' facts, citations, names, or events that do not exist, presenting them with false confidence. LLM Engineering
- Temperature Temperature is a hyperparameter that controls the randomness of an LLM's output. A temperature of 0 produces deterministic, predictable responses. Higher values (0.7–1.0+) produce more creative, varied, and sometimes unpredictable text. LLM Engineering
- Tokenization Tokenization is the process of splitting text into smaller units called tokens that an LLM can process. Tokens are typically word fragments, not whole words. Most English text averages about 0.75 words per token, so 1,000 tokens ≈ 750 words. Fundamentals
- Vector Database A vector database stores and retrieves high-dimensional vector embeddings efficiently. It enables semantic similarity search — finding documents, images, or records that are semantically 'nearest' to a query vector. Examples include Pinecone, Weaviate, Qdrant, and ChromaDB. Infrastructure
- LLM (Large Language Model) A Large Language Model is a neural network trained on massive text corpora to predict and generate text. LLMs like GPT-4, Claude, and Gemini exhibit broad language understanding, reasoning, and generation capabilities that emerge from scale. Fundamentals
- Context Window The context window is the maximum amount of text (measured in tokens) that an LLM can process in a single inference call. Everything outside the window is effectively invisible to the model. Modern models range from 8K to 2M+ token context windows. LLM Engineering
- LoRA (Low-Rank Adaptation) LoRA is a parameter-efficient fine-tuning technique that trains only a small set of low-rank adapter matrices instead of updating all model weights. It reduces the number of trainable parameters by up to 10,000x while achieving fine-tuning quality comparable to full parameter updates. LLM Engineering
- RLHF (Reinforcement Learning from Human Feedback) RLHF is the training technique used to align LLMs with human preferences. Human annotators rank model outputs, those preferences train a reward model, and the LLM is then fine-tuned using reinforcement learning to maximise the reward signal. RLHF is how ChatGPT was trained to be helpful and safe. LLM Engineering
- Quantization Quantization reduces the numerical precision of model weights (e.g. from 32-bit floats to 4-bit integers), shrinking memory requirements and accelerating inference with minimal quality loss. It's the key technique for running large models on consumer hardware. LLM Engineering
- Semantic Search Semantic search retrieves results based on the meaning of a query rather than exact keyword matches. Using vector embeddings, it finds content that is conceptually related to the query, even when no words overlap — solving the vocabulary mismatch problem in traditional search. Infrastructure
- AI Agents AI agents are LLM-powered systems that can autonomously plan, use tools, and take multi-step actions to complete complex goals. Unlike a simple chatbot, an agent can browse the web, write and execute code, call APIs, and adapt its approach based on intermediate results. AI Agents
- Function Calling (Tool Use) Function calling allows LLMs to output structured calls to external functions or APIs instead of free-text responses. The model selects the appropriate function, fills in parameters from the user's request, and returns a structured JSON payload that your code can execute. LLM Engineering
- Grounding Grounding connects an LLM's outputs to verifiable, real-world information sources. A grounded model response is tied to specific, citable facts rather than relying purely on parametric knowledge, reducing hallucination and increasing trustworthiness. LLM Engineering
- In-Context Learning In-context learning is the ability of LLMs to learn new tasks from examples provided directly in the prompt, without updating model weights. By showing the model input-output pairs (few-shot examples), it generalises to new inputs in the same format. LLM Engineering
- Few-Shot Prompting Few-shot prompting is a technique where you include a small number of example input-output pairs in your prompt to guide an LLM's response format and style. It's one of the most effective prompt engineering techniques for improving output quality without fine-tuning. LLM Engineering
- Zero-Shot Prompting Zero-shot prompting asks an LLM to perform a task without providing any examples, relying entirely on the model's pre-trained knowledge and the clarity of the instruction. It works well for common tasks but often requires examples for specialised or nuanced outputs. LLM Engineering
- Chain-of-Thought (CoT) Prompting Chain-of-Thought prompting elicits step-by-step reasoning from an LLM before it produces a final answer. By showing or requesting intermediate reasoning steps, CoT dramatically improves accuracy on arithmetic, logical reasoning, and multi-step problem-solving tasks. LLM Engineering
- Cosine Similarity Cosine similarity measures the angle between two vectors in high-dimensional space. In AI, it quantifies how semantically similar two embeddings are — a score of 1.0 means identical direction (highly similar), 0 means orthogonal (unrelated), -1 means opposite meaning. Fundamentals
- Inference Inference is the process of running a trained model on new data to generate predictions or outputs. In LLMs, inference refers to generating a response given a prompt. It is the production phase of the AI lifecycle — distinct from training, which updates model weights. MLOps
- DPO (Direct Preference Optimisation) DPO is a simpler alternative to RLHF for aligning LLMs with human preferences. It directly optimises the language model on preference pairs (chosen vs rejected responses) without training a separate reward model or using reinforcement learning. LLM Engineering
- Perplexity Perplexity is a metric that measures how well a language model predicts a text sample. Lower perplexity means the model assigns higher probabilities to the actual tokens — it is less 'surprised' by the text. It is one of the primary intrinsic evaluation metrics for LLMs. Fundamentals