Skip to main content

Glossary

Agent

In LLM applications an agent is a system that uses a language model to decide a sequence of actions, typically by calling tools, observing results, and looping until a goal is met. It differs from a single prompt-response call because control flow is delegated to the model rather than hardcoded. Reliable agents constrain the action space, cap iterations, and validate every tool output before feeding it back.

Agentic Workflow

An agentic workflow orchestrates one or more LLM calls with tools, memory, and branching to accomplish a multi-step task. It ranges from fixed pipelines (prompt chaining, routing) to open-ended loops where the model plans its own steps. Anthropic distinguishes predictable workflows from autonomous agents and recommends the simplest pattern that solves the problem.

Chunking

Chunking is the process of splitting source documents into smaller passages before embedding them for retrieval. Chunk size and overlap trade recall against precision: chunks that are too large dilute relevance, while chunks that are too small lose context. Common strategies are fixed-size windows with overlap, sentence or paragraph splitting, and structure-aware splitting by headings.

Context Window

The context window is the maximum number of tokens a model can attend to in a single request, counting both the input (system prompt, messages, retrieved context, tool definitions) and the generated output. Exceeding it causes truncation or an API error. Managing the window - summarising history, trimming retrieved passages, and paging long inputs - is a core LLM Ops concern.

Embedding

An embedding is a dense numeric vector that represents the semantic meaning of a piece of text, produced by an embedding model. Texts with similar meaning map to nearby vectors under a distance metric such as cosine similarity. Embeddings power semantic search and are the retrieval backbone of most RAG systems.

Evaluation (Eval)

An evaluation is a repeatable measurement of an LLM system's quality against a fixed dataset of inputs and expected outcomes. Evals can be exact-match, rule-based, or model-graded (LLM-as-judge), and they gate releases the way unit tests gate code. A golden eval set with grounded reference answers is the single most valuable asset for shipping LLM features safely.

Faithfulness

Faithfulness (also called groundedness) measures whether a generated answer is supported by the retrieved context rather than invented. It is a primary RAG metric: a faithful answer makes no claim that cannot be traced to its supplied passages. Low faithfulness indicates hallucination or retrieval that failed to surface the needed evidence.

Few-Shot Prompting

Few-shot prompting includes a handful of worked input-output examples in the prompt to demonstrate the desired format and behaviour before the actual task. It steers the model without fine-tuning and is especially effective for structured output and edge-case handling. The examples should be diverse, correct, and representative of the real distribution.

Fine-Tuning

Fine-tuning continues training a pretrained model on a curated dataset so it adapts to a specific task, format, or style. It changes model weights, unlike prompting or retrieval, and is justified when prompt engineering and RAG plateau. It improves consistency and latency on narrow tasks but does not reliably add new factual knowledge and can cause regressions if data quality is poor.

Function Calling

Function calling (tool use) lets a model emit a structured request to invoke a developer-defined function with typed arguments, which the application executes and returns to the model. The model never runs code itself; it proposes calls that the host validates and dispatches. It is the mechanism behind agents, structured extraction, and integrations with external systems.

Grounding

Grounding is the practice of conditioning a model's output on authoritative, retrieved, or provided context so its answers are anchored to verifiable sources. RAG is the dominant grounding technique. Strong grounding requires both good retrieval and a prompt that instructs the model to answer only from the supplied context and to abstain when it is insufficient.

Guardrails

Guardrails are the controls that constrain what an LLM system accepts as input and emits as output, covering safety, format, scope, and policy. They include input validation, output schema enforcement, content filters, and refusal rules. Effective guardrails are layered: prompt instructions, programmatic validators, and an independent moderation pass.

Hallucination

A hallucination is a fluent, confident model output that is factually wrong or unsupported by any source. It arises because language models predict plausible text, not verified truth. The main mitigations are retrieval grounding, instructing the model to abstain when unsure, citing sources, and evaluating faithfulness against context.

Hybrid search combines lexical retrieval (keyword or BM25) with dense vector retrieval and fuses the results, often via reciprocal rank fusion. It captures both exact-term matches that embeddings miss and semantic matches that keywords miss. It is a robust default for production RAG because it degrades gracefully when one signal is weak.

Inference

Inference is the act of running a trained model to produce output from input, as opposed to training. In LLM Ops it covers latency, throughput, cost per token, batching, and hardware utilisation. Optimising inference (caching, quantization, batching, smaller models for easy tasks) is where most production cost is won or lost.

LLM-as-Judge

LLM-as-judge uses a language model to score or compare the outputs of another model against criteria such as correctness, helpfulness, or faithfulness. It scales evaluation beyond what humans can label by hand and correlates reasonably with human judgement when the rubric is clear. Risks include self-preference bias and position bias, mitigated by using a different judge model and randomising order.

LLMOps

LLMOps is the set of practices, tooling, and infrastructure for developing, deploying, evaluating, and operating applications built on large language models. It extends MLOps with concerns specific to LLMs: prompt management, retrieval pipelines, token cost, latency, evals, guardrails, and continuous monitoring of non-deterministic outputs in production.

Latency

Latency is the time between sending a request and receiving the response, often split into time-to-first-token (TTFT) and total generation time. For LLMs it is dominated by output length because tokens are generated sequentially. Streaming, shorter outputs, smaller models, and prompt caching are the primary levers to reduce perceived and actual latency.

MLOps

MLOps is the discipline of reliably deploying and maintaining machine-learning models in production, covering data pipelines, training, versioning, deployment, and monitoring. LLMOps is a specialisation of MLOps for foundation-model applications, where the model is usually consumed via API rather than trained in-house, shifting emphasis to prompts, retrieval, and evaluation.

Model Context Protocol (MCP)

The Model Context Protocol is an open standard that defines how applications expose tools, resources, and prompts to LLM clients over a common interface. Introduced by Anthropic, it lets an agent connect to many data sources and tools through one protocol instead of bespoke integrations. Servers advertise capabilities; clients (such as IDEs or chat apps) discover and invoke them.

Prompt Caching

Prompt caching stores the processed representation of a stable prompt prefix so repeated requests reuse it instead of reprocessing every token. It cuts cost and time-to-first-token substantially when a long system prompt, document, or few-shot block is reused across calls. The cacheable portion must be an exact, unchanging prefix; dynamic content goes after it.

Prompt Engineering

Prompt engineering is the practice of designing the instructions, context, examples, and output format given to a model to elicit reliable behaviour. It includes role setting, explicit constraints, few-shot examples, and output schemas. It is the cheapest and fastest lever to improve quality and should be exhausted before reaching for fine-tuning.

Prompt Injection

Prompt injection is an attack where untrusted input (user text, a retrieved document, a tool result) contains instructions that hijack the model's behaviour, overriding its system prompt. Indirect injection hides instructions in content the model reads. Defences include separating trusted instructions from untrusted data, least-privilege tool access, output validation, and never executing model output without checks.

Quantization

Quantization reduces the numeric precision of model weights (for example from 16-bit to 8-bit or 4-bit) to shrink memory footprint and speed inference, at some accuracy cost. It enables larger models to run on smaller or cheaper hardware. The trade-off between size, speed, and quality must be measured on the target task, not assumed.

RAG (Retrieval-Augmented Generation)

Retrieval-Augmented Generation augments a model's prompt with passages fetched from an external knowledge source at query time, so answers reflect current, proprietary, or authoritative data the model was not trained on. A RAG pipeline retrieves relevant chunks, assembles them into context, and generates a grounded answer with citations. It is the standard pattern for question answering over private corpora.

Re-ranking

Re-ranking reorders an initial set of retrieved candidates using a more expensive, more accurate model (typically a cross-encoder) that scores each query-passage pair jointly. The retriever fetches a broad top-k cheaply; the re-ranker promotes the truly relevant few to the top. It materially improves precision at the cost of extra latency per query.

Retrieval

Retrieval is the step that finds the most relevant passages for a query from an indexed corpus, using lexical search, vector search, or both. Its quality sets a ceiling on RAG answer quality: the generator cannot use evidence the retriever never surfaces. Recall (did we fetch the right passage?) and precision (is the top-k clean?) are the metrics that matter.

Semantic search ranks documents by meaning rather than exact keyword overlap, by embedding the query and documents into the same vector space and comparing them. It surfaces relevant results that share no literal terms with the query. It is the vector half of most retrieval systems and complements lexical search in hybrid setups.

System Prompt

The system prompt is the top-level instruction that defines a model's role, scope, rules, and output format for an entire conversation, separate from user turns. It is where grounding rules, guardrails, and persona belong. Keeping it stable also makes it cacheable, reducing cost and latency.

Temperature

Temperature is a sampling parameter that controls randomness in generation: low values make output more deterministic and focused, high values make it more diverse and creative. For factual, structured, or tool-calling tasks a low temperature is preferred for consistency; for brainstorming a higher value helps. It does not change correctness, only the spread of sampled tokens.

Token

A token is the atomic unit a model reads and generates - roughly a word piece, where common English words are often one token and rarer words split into several. Pricing, context limits, and latency are all measured in tokens, not characters or words. Estimating token counts is essential for cost control and staying within the context window.

Tool Use

Tool use is the capability by which a model invokes external functions - search, code execution, database queries, APIs - to extend beyond text generation. The model proposes a structured call; the application executes it and returns the result for the model to continue. It turns a chatbot into a system that can act, and demands strict validation of every call.

Vector Database

A vector database stores embeddings and supports fast approximate nearest-neighbour (ANN) search over them, often alongside metadata filters. It is the retrieval index for most RAG systems. Examples include pgvector, Pinecone, Weaviate, Qdrant, Milvus, and Redis with vector search; the choice trades scale, cost, filtering, and operational simplicity.

Vector Embedding

See Embedding. A vector embedding is the stored numeric representation of text used for semantic similarity search; the term emphasises its role as an indexed vector inside a vector database rather than the act of producing it.

Chain-of-Thought

Chain-of-thought prompting asks the model to reason step by step before giving a final answer, which improves performance on multi-step reasoning, arithmetic, and logic tasks. The intermediate reasoning can be shown or hidden, but exposing untrusted reasoning to users carries leakage and injection risks. It increases token cost and latency, so apply it where reasoning depth actually pays off.

Cosine Similarity

Cosine similarity measures the angle between two vectors, giving a score from -1 to 1 that ignores their magnitude and captures orientation. It is the most common distance metric for comparing text embeddings because it reflects semantic closeness regardless of vector length. Vector indexes often optimise specifically for cosine or inner-product search.

Cross-Encoder

A cross-encoder is a model that takes a query and a candidate passage together and outputs a single relevance score, attending to both jointly. It is far more accurate than the bi-encoder used for first-stage retrieval but too slow to run over a whole corpus, so it is applied as a re-ranker over a shortlist. The retrieve-then-rerank pattern combines a bi-encoder's speed with a cross-encoder's accuracy.

Drift

Drift is the gradual degradation of a deployed system's quality as the world, the data, or the underlying model changes over time. For LLM apps it includes corpus staleness, shifting user intent, and silent provider model updates. Continuous monitoring against a fixed eval set is how drift is detected before users do.

Guard Model

A guard model (or moderation model) is a separate, often smaller model that classifies inputs or outputs for safety, policy, or scope violations independently of the main generator. Running it as a distinct pass avoids relying on the same model to both produce and police content. It is a core layer of defence-in-depth for production LLM systems.

Hallucination Rate

The hallucination rate is the measured fraction of outputs that contain unsupported or fabricated claims, evaluated against grounding context or ground truth. Tracking it over time and per release turns "the model lies sometimes" into a metric you can drive down. It is typically estimated with an LLM-as-judge faithfulness check on a sampled or golden set.

Idempotency

Idempotency in LLM Ops means designing tool calls and side-effecting actions so that retrying them - common with non-deterministic agents - does not duplicate effects. An idempotency key lets the backend deduplicate repeated create operations. It is essential because agents and retries can issue the same action more than once.

Observability

Observability for LLM systems is the ability to inspect what happened in a request: the prompts sent, retrieved context, token usage, tool calls, latency, and the final output, usually via tracing. It is harder than for deterministic services because the same input can yield different outputs. Per-request traces with full prompt and context capture are the foundation of debugging and evaluation.

Reciprocal Rank Fusion

Reciprocal rank fusion (RRF) is a method for combining multiple ranked result lists into one by summing, for each item, a score based on its reciprocal rank in each list. It is the standard, parameter-light way to fuse lexical and vector results in hybrid search. It needs no score calibration between systems, which makes it robust in practice.

Structured Output

Structured output constrains a model to emit responses in a machine-parseable format such as JSON conforming to a schema. It is achieved via function/tool definitions, JSON mode, or constrained decoding, and it is essential for piping model output into downstream code reliably. Always validate the output against the schema rather than trusting the model to comply.

Top-k

Top-k refers to the number of highest-ranked passages a retriever returns for a query, and separately to a sampling cutoff that limits generation to the k most probable next tokens. In retrieval, a larger k raises recall but adds noise and tokens; in sampling, a smaller k makes output more focused. Both are tuned empirically against the target task.