About This Section
This section covers core NLP tasks, AI concepts, evaluation metrics, and research phenomena. Each entry links to the chapter where the concept is explored in depth.
- Alignment
- Training a language model to behave in ways that are helpful, harmless, and honest. Alignment is the final major training stage (after pretraining and SFT) and uses techniques like RLHF, DPO, and constitutional AI to shape model behavior according to human values.
- See Section 17.1 (The Alignment Problem)
- Attention (Self-Attention)
- A mechanism that lets each token in a sequence compute weighted relevance scores against every other token. Self-attention is the foundational building block of transformers, enabling models to capture long-range dependencies that RNNs struggle with.
- See Section 03.2 (Attention Mechanism) and Section 04.1
- Chunking
- Splitting documents into smaller segments for embedding and retrieval in RAG pipelines. Chunk size, overlap, and strategy (fixed-size, sentence-based, semantic) significantly affect retrieval quality. Getting chunking right is often the highest-leverage RAG optimization.
- See Section 19.3 (Chunking Strategies)
- Classification
- A task where the model assigns one or more labels to an input. Sentiment analysis, spam detection, and topic categorization are common examples. LLMs can perform classification via prompting (zero-shot or few-shot) or through fine-tuning on labeled data.
- See Section 01.2 (NLP Tasks) and Section 12.1
- Context Window (Context Length)
- The maximum number of tokens a model can process in a single forward pass. Modern LLMs support windows from 8K to over 1M tokens. Longer contexts enable processing entire documents but increase memory and compute requirements quadratically with naive attention.
- See Section 07.2 (Long-Context Models)
- Cosine Similarity
- A metric measuring the angle between two vectors, yielding a value from -1 to 1. Cosine similarity is the standard way to compare text embeddings in semantic search and RAG: high similarity means the texts are semantically close regardless of vector magnitude.
- See Section 19.1 (Embeddings)
- Data Contamination
- A situation where benchmark or evaluation data appears in a model's training set, artificially inflating performance scores. As training corpora expand to cover large portions of the internet, contamination is a growing concern that can make benchmark results misleading.
- See Section 29.4 (Evaluation Pitfalls)
- Embedding
- A dense, fixed-dimensional vector representation of a token, sentence, or document in continuous space. Embeddings capture semantic meaning so that similar concepts map to nearby points. They are the foundation of search, RAG, classification, and clustering systems.
- See Section 19.1 (Embeddings)
- Evaluation (LLM Evaluation)
- Measuring model quality using benchmarks, human judgments, or automated metrics (including LLM-as-judge). Effective evaluation combines multiple approaches because no single metric captures all dimensions of language model performance.
- See Section 29.1 (Evaluation Fundamentals)
- Few-Shot Learning
- The ability of a model to perform a task given only a handful of examples in the prompt, with no weight updates. Few-shot learning is a hallmark capability of large language models, first prominently demonstrated by GPT-3, and it eliminates the need for task-specific training data in many scenarios.
- See Section 11.1 (Prompt Engineering Basics)
- FLOPS (Floating-Point Operations Per Second)
- A measure of computational throughput, typically quoted for GPUs at different precisions (FP32, FP16, BF16, INT8). FLOPS is the key metric for estimating training time, comparing hardware, and calculating the compute budget for scaling law predictions.
- See Appendix G (GPU Hardware and Cloud Compute)
- Grounding
- Connecting a language model's outputs to factual, verifiable sources of information. RAG is the most common grounding technique. Grounding reduces hallucinations by anchoring responses in retrieved evidence rather than relying solely on parametric knowledge.
- See Section 20.1 (RAG Fundamentals)
- Hallucination
- When a language model generates plausible-sounding but factually incorrect or fabricated information. Hallucination is inherent to autoregressive models because they optimize for fluency, not truth. Mitigation strategies include RAG, grounding, self-consistency checks, and citation requirements.
- See Section 20.1 (RAG Fundamentals) and Section 32.3
- HNSW (Hierarchical Navigable Small World)
- A graph-based algorithm for approximate nearest neighbor search that builds a multi-layer navigable graph over vectors. HNSW offers excellent query speed and recall tradeoffs, making it the default index type in most vector databases.
- See Section 19.2 (Vector Databases)
- Inference
- Using a trained model to generate predictions or outputs for new inputs. For LLMs, inference optimization is critical for production costs and latency, and includes techniques like quantization, KV caching, continuous batching, and speculative decoding.
- See Section 09.1 (Inference Optimization Fundamentals)
- Instruction Tuning
- Fine-tuning a model on (instruction, response) pairs to improve its ability to follow human directions. Instruction tuning bridges the gap between a raw pretrained model (which just predicts next tokens) and a useful assistant (which follows instructions).
- See Section 14.2 (Supervised Fine-Tuning)
- Interpretability (Mechanistic Interpretability)
- The study of understanding how neural networks represent and process information internally. Techniques include attention visualization, probing classifiers, logit lens, and sparse autoencoders. The goal is to reverse-engineer what computations a model actually performs.
- See Section 18.1 (Interpretability Fundamentals)
- Logit
- The raw, unnormalized score output by the final linear layer for each token in the vocabulary. Logits are converted to probabilities via softmax. The "logit lens" technique inspects intermediate-layer logits to understand what the model is "thinking" at each layer.
- See Section 05.1 (Autoregressive Generation) and Section 18.2
- Named Entity Recognition (NER)
- A task that identifies and classifies named entities (persons, organizations, locations, dates) in text. NER can be performed by fine-tuned encoder models for speed and accuracy, or by prompting LLMs for flexibility and zero-shot capability.
- See Section 01.3 (NLP Tasks and Pipelines)
- Observability
- Monitoring, logging, and tracing LLM system behavior in production. Observability tools capture inputs, outputs, latency, token usage, and error rates, enabling debugging and continuous improvement of deployed AI systems.
- See Section 29.5 (Observability and Monitoring)
- Overfitting
- When a model performs well on training data but poorly on unseen data because it has memorized examples rather than learning general patterns. During fine-tuning, overfitting is common with small datasets and is mitigated by early stopping, regularization, and data augmentation.
- See Section 14.5 (Diagnosing Training Issues)
- Perplexity
- A metric measuring how well a language model predicts a sample, calculated as the exponentiated average cross-entropy loss. Lower perplexity means better predictions. Perplexity is the standard metric for comparing pretrained language models before task-specific evaluation.
- See Section 06.2 (Evaluation During Pretraining)
- Semantic Search
- Search based on the meaning of a query rather than keyword matching. Semantic search uses embeddings to find documents whose vector representations are close to the query vector. It is the retrieval backbone of most RAG systems and handles synonyms and paraphrases naturally.
- See Section 19.1 (Embeddings)
- Superposition
- A phenomenon where neural networks represent more features than they have dimensions by encoding them as nearly orthogonal directions in activation space. Superposition makes interpretability challenging because individual neurons often encode multiple unrelated concepts.
- See Section 18.3 (Superposition and Features)
- Synthetic Data
- Training data generated by AI models rather than collected from human sources. Synthetic data has become critical for instruction tuning, alignment, and domain adaptation, but requires careful quality filtering to avoid model collapse and distribution drift.
- See Chapter 13 (Synthetic Data)