Gen AI
Transformers, LLMs, RAG, Agents, and the generative AI stack
The Model
- Gen AI
How LLMs Work
An LLM reads your text as numbered tokens, refines them through stacked transformer blocks, and turns the last position into odds for what comes next. Then it draws one token, appends it, and repeats.
- Gen AI
Next-Token Prediction
You train a model on one job, guess the next word from the words before it, and getting that guess right across enough text forces grammar, facts, and habits of style into the same weights.
- Gen AI
Context Windows
A context window is the fixed run of tokens a model can read in one go. When the run is full, each new token pushes the oldest one out of sight.
- Gen AI
In-Context Learning
Show a model a few worked examples inside the prompt and its next answer follows their pattern. No training run, no weight change, nothing remembered afterward.
- Gen AI
Long-Context Extension
Long-context extension rescales a model's positional signal so sequences longer than its trained length still land back in the range it actually learned.
- Gen AI
Scaling Laws
Double compute, data, and model size together and test loss falls along a smooth predictable curve. That curve lets you forecast a huge training run from small cheap ones.
- Gen AI
Tokenization
Tokenization cuts your text into the pieces a model actually reads. Frequent words stay whole while rare ones split, so five words can cost six tokens or thirty-two characters depending on the cut.
- Gen AI
Byte-Pair Encoding
The most frequent letter pairs earn their own tokens first. Repeat that merge and a vocabulary of useful fragments builds itself from raw text.
- Gen AI
Chat Templates
A chat template turns your list of labeled messages into the single flat string a model actually reads, using small marker tokens to say who said what.
- Gen AI
Compute-Optimal Training
For a fixed training budget, the smartest model splits spending evenly between size and data. A giant model starved of tokens loses to a smaller one trained on far more text.
- Gen AI
Emergent Abilities
Some model skills look absent until scale crosses a threshold, then they switch on fast. The jump is usually in how you score the task, not a sudden rewiring inside the model.
- Gen AI
Perplexity
Perplexity is your model's average surprise on text it has never seen, turned into a headcount. A score of 1.62 means it wavers among fewer than two live options at each step.
- Gen AI
Tokenization Artifacts
Frequency-built vocabularies file the same word under several spellings, one token ID per surface form. Each ID gets its own embedding, so the model must relearn one meaning several times.
Rag
- Gen AI
RAG Architecture
Documents are indexed once ahead of time. Each query is embedded, matched against that index, and the best passages join the prompt before the model answers.
- Gen AI
RAG Evaluation
Score the search step and the writing step separately: one number for whether retrieval surfaced the right chunks, another for whether the answer stayed loyal to them. A single final-answer score can't tell you which step broke.
- Gen AI
RAG Failure Diagnosis
A wrong RAG answer lives in one of four stages. You check ingestion, chunking, retrieval, then generation in that order, cheapest first, so you fix what actually broke.
Retrieval
- Gen AI
Embeddings
An embedding turns a word or passage into a list of numbers positioned so that closeness means relatedness, which lets search match meaning instead of exact words.
- Gen AI
Vector Databases
An ANN index finds close vectors fast, but a product needs more: only your tenant's current chunks, durable across restarts, with inserts and deletes that actually stick.
- Gen AI
Approximate Nearest Neighbor Search
Exact search scores every stored vector against your query; approximate search scores only a shortlist picked by an index built ahead of time, trading a small, measurable chance of missing the true nearest match for a much faster query.
- Gen AI
Chunking Strategies
How you slice a document before embedding it decides whether each retrieved passage holds a whole idea or half of one. Even cuts are simple but blind; cuts that follow the document keep ideas intact.
- Gen AI
Similarity Metrics
Cosine similarity compares which way two embeddings point and ignores how long they are. That single choice decides whether your search ranks by meaning or by an accident of vector length.
- Gen AI
Late Interaction Retrieval (ColBERT)
You keep one vector per token instead of squeezing a document into one, then score each query token against its best match in the document. The detail a single pooled vector throws away is exactly what this keeps.
- Gen AI
Embedding Models
An embedding model turns text into vectors placed so related meanings land close together. You reach for one when search must match meaning instead of matching words.
- Gen AI
Hybrid Search
You run one search for meaning and one for exact words, then merge the two orderings into a single list. Each half catches what the other drops, so a rare error code and a reworded question both get found.
- Gen AI
Reranking
Retrieve cheaply and widely first, then read the shortlist carefully. A fast search pulls a hundred candidates and a slower judge reorders just those, so only the best few reach the model.
Diffusion
- Gen AI
Latent Diffusion
Diffusion's dozens of denoising steps run inside a small compressed latent space instead of on raw pixels, so image generation fits on one consumer GPU.
- Gen AI
Diffusion Models
A diffusion model learns one small skill: predicting the noise hiding in a noisy image. Start from pure static and repeat that cleanup, and a brand-new picture appears.
- Gen AI
Classifier-Free Guidance
At each denoising step the model predicts noise twice, once with your prompt and once without it, then steers past the prompted guess by the guidance scale.
- Gen AI
Forward and Reverse Diffusion
Forward diffusion buries an image in noise by a fixed recipe. Reverse diffusion learns to undo one step of that recipe, and repeating it turns static into a picture.
Applied Gen Ai
- Gen AI
Context Budgeting
Each request gets a fixed number of tokens to split. Budgeting decides how many go to instructions, retrieved passages, chat history, and the answer itself.
- Gen AI
Chain of Thought
Ask the model to show its work before its answer. Those written steps become a scratchpad the model can reuse, so hard problems get solved piece by piece.
- Gen AI
Context Degradation
A longer prompt doesn't make a model smarter. Past a point every extra paragraph steals attention from the answer, and facts buried in the middle go missing first.
- Gen AI
ReAct Pattern
ReAct makes the model think out loud, use one tool, and read the result before thinking again. That loop turns guessing from memory into checking the world.
- Gen AI
Multi-Agent Systems
One agent doing every job mixes instructions and grabs the wrong tool. A small team of narrow agents passes work along, each with one job and one tool.
- Gen AI
Agent Harness Design
The wrapper around a looping agent that sets the stops the model never sets itself: how many steps, how much time, which errors get a retry, and what it all cost.
- Gen AI
Agent Sandboxing
Give agent-written code its own disposable computer with no access to your files, secrets, or network. Only the answer comes back; the mess stays inside and gets thrown away.
- Gen AI
Context Compaction
Retrieval hands you far more text than the answer needs. Compaction keeps only the sentences that answer your query, so the main model reads a short note instead of the whole file.
- Gen AI
Prompt Chaining
Split one overloaded prompt into a short chain of focused steps, where each step's output becomes the next step's input, so a failure points at one step.
- Gen AI
Few-Shot Prompting
Show the model two or three worked examples inside the prompt, then ask your real question. It copies the pattern instead of guessing the format.
- Gen AI
Human-in-the-Loop (HITL)
Your agent does the prep work, but it may not send the email or issue the refund until you say yes. Human-in-the-loop is the pause before the risky tool runs.
- Gen AI
RAG in Production
A demo answers one person. A production system answers hundreds at once without leaking private files or paying twice for the same question.
- Gen AI
Self-Consistency
Ask the model the same hard question five times with room to wander, then take the answer that shows up most. One-off slips get outvoted.
- Gen AI
Self-RAG
Self-RAG is RAG where the model runs its own checks: it decides when search is needed, drops weak passages itself, and keeps only answers its support and utility checks pass.
- Gen AI
Sub-Agents and Handoffs
One receptionist agent hears your request, then hands you and your notes to the right specialist, so you never repeat yourself.
- Gen AI
Tree of Thoughts
Branch one hard question into a few candidate thoughts, score each one, and keep searching only the winners, walking back when a path dies.
- Gen AI
Zero-Shot Prompting
Ask for what you want and show nothing. The model answers from its training alone, so every word of the instruction carries weight.
- Gen AI
Agent-to-Agent Protocols
A shared envelope format that tells each agent who sent a message, what to do with it, and where the task stands, so handoffs keep their context.
- Gen AI
Agentic RAG
You ask one tricky question and the model acts like a researcher: it looks something up, reads what came back, looks something else up, then answers with receipts.
- Gen AI
Corrective RAG (CRAG)
Corrective RAG checks what your search brought back before it answers. When every passage looks weak, it asks the live web instead of letting the model guess.
- Gen AI
Parent-Child Chunking
Search tiny child chunks for precise matches, then hand the model the full parent passage they came from. Sharp matching, full context.
- Gen AI
Query Decomposition
One tangled question rarely matches one stored passage. Query decomposition splits it into small focused searches that run side by side, then combines what they find.
- Gen AI
Query Rewriting
You ask a vague follow-up and the retriever hears the wrong thing. Query rewriting has a small model restate your words as a standalone question, so the search runs on what you meant.
- Gen AI
Semantic Search
Keyword search looks for the same words. Semantic search looks for the same meaning, so a query about a leaky pipe can find a passage about dripping plumbing with no words in common.
- Gen AI
Supervisor Pattern
One manager agent decides who works next and checks each result. Workers never talk to each other, so the whole job stays easy to trace.
- Gen AI
Text-to-SQL
Type a plain question and get a working SQL query back. The model reads your words plus the database schema, then writes the SELECT for you.
- Gen AI
Tool Result Curation
A tool can hand back a phone-book-sized answer. Curation trims it to the few lines the model needs next, before those lines re-enter the prompt.
- Gen AI
Tool Retrieval
Your agent cannot read 500 tool manuals at once. Tool retrieval finds the two it needs for this request and shows it only those.
- Gen AI
Agent Cost Control
Each agent step re-sends everything before it, so costs climb faster than steps. Budgets, cached text and cheaper models for easy steps keep one run affordable.
- Gen AI
Automatic Prompt Optimization
You stop hand editing prompts. You score each version on a small test set, let another model propose fixes for the misses, and keep the version with the best score.
- Gen AI
Citations and Attribution
A RAG answer you can click through: every factual sentence carries a marker that opens the exact passage it came from, so you check the source instead of trusting the tone.
- Gen AI
Computer Use Agents
When an app has no API, a computer use agent uses the screen instead. It looks, clicks the right pixel, types if needed, and checks what changed.
- Gen AI
Document Ingestion Pipelines
Ingestion is the offline prep that turns messy PDFs and pages into clean chunks with vectors and metadata, so your model can find the right passage at answer time.
- Gen AI
Episodic and Semantic Memory
Episodic memory keeps the raw transcript of what happened. Semantic memory keeps the lasting facts distilled from it, so your agent still knows you next month without rereading years of chats.
- Gen AI
Graph RAG
Plain vector search finds chunks that sound like your question. Graph RAG turns those chunks into a graph of entities and how they connect, then walks the links to answer questions no single chunk can answer.
- Gen AI
Hypothetical Document Embeddings (HyDE)
You ask a short vague question, the model drafts a fictional answer, and you search with that draft because answer shaped text lands closer to the real passage than your question does.
- Gen AI
Long-Horizon Agents
An agent that keeps going for hours without losing the plot. It writes down where it is, trims its notes, and rechecks the plan after every milestone.
- Gen AI
Metadata Filtering
Vector databases search by semantic meaning, but sometimes you just want exact constraints (like 'only documents from 2024'). Metadata filtering combines the fuzziness of AI search with the precision of SQL.
- Gen AI
Model Context Protocol
MCP is the shared plug between an agent and its tools. One client talks to any server that speaks the standard, so tools, files and data arrive in the same typed shape instead of one custom wrapper each.
- Gen AI
Multimodal RAG
Text-only search cannot read charts. Multimodal RAG files images next to text, so a question about a bar chart pulls the chart itself into the answer.
- Gen AI
Parallel Tool Calling
When one request needs several independent lookups, the model lists them all in a single reply and your code runs them together, so you pay for one wait instead of three in a row.
- Gen AI
Query Understanding
Raw search boxes get typos, vague words, and buried details like size 10. Query understanding cleans the spelling, labels the intent, and splits filters from search text before retrieval runs.
- Gen AI
RAG Fusion
You ask the same question a few different ways, run each version, and trust the passages that keep showing up. One awkward phrasing stops deciding everything.
- Gen AI
Reflection and Self-Correction
Do not ship the model's first draft. Make it check its own answer against a short checklist, fix exactly what fails, and stop after a couple of tries.
- Gen AI
Relevance Tuning
One query looks fine while a thousand others quietly break. Relevance tuning means grading a test set of queries once, scoring every change against it, and only shipping the change that lifts the whole set.
- Gen AI
Semantic Chunking
Split a document where its meaning shifts, not every 500 characters, so each chunk you embed and retrieve holds one whole idea.
- Gen AI
Structured Data Agents
A structured data agent is text-to-SQL that gets to try again. It runs its query, reads the error or the empty result, and rewrites the query until the database confirms the answer.
- Gen AI
Voice Agent Architecture
A voice agent keeps one live audio link open, listens and talks at the same time, and lets you cut in. It turns your speech into actions and answers back in speech.
- Gen AI
Prompting Anti-Patterns
Five prompt habits that silently make models worse: polite filler, banned-word lists, mega-prompts, described-not-shown formats, and buried instructions. Each one has a small mechanical fix.
Security
- Gen AI
Guardrails
A guardrail is a checkpoint on each side of the model. One screens what goes in, one screens what comes out, so a hostile prompt or a leaking draft gets stopped before it can do harm.
- Gen AI
Jailbreaking
Jailbreaking tricks a safety-trained model into dropping its refusal and answering anyway. You hide the same request in roleplay or code so the filter misses it.
- Gen AI
Watermarking and Provenance
A watermark is a secret lean hidden in AI output that a detector can count later. Provenance is a signed history that says who made a file and what changed since.
- Gen AI
Indirect Prompt Injection
When your assistant reads a web page or document for you, hidden instructions inside that file can hijack its answer. The attacker is the page author, not you.
- Gen AI
Tool Permissions
An agent's tools are its hands. Permissions choose which hands it gets, so a tricked model can look up order 1842 but cannot delete your database.
- Gen AI
Memorization and Extraction
Your model memorized a training passage word for word, and a prompt holding its first half can pull out the second half. Scrub secrets before training, because no filter can reliably catch them after.
- Gen AI
Red Teaming
You attack your own model on purpose before strangers do. Thousands of hostile prompts go in, the breaks get patched, and launch happens after the ambush, not before.
- Gen AI
Agent Security
An agent can act, not just answer, so you secure what it can touch: filter what goes in, limit each tool, keep each user's memory apart, and run code where it cannot hurt you.
- Gen AI
Reduce LLM Hallucinations
LLMs guess the most plausible next word, so you ground answers in retrieved passages and check each claim against those passages before the user sees it.
- Gen AI
Model Supply Chain Security
You did not train the file, so you cannot trust the file. Check its hash, its signature, and its format before you load it.
- Gen AI
Prompt Injection
Your instructions and the user's words end up in one shared text stream, so a sentence shaped like an order can overrule the real one. That hijack is prompt injection.
- Gen AI
Synthetic Media Detection
A detector gives every clip a fakeness score and calls it fake past a threshold. You trade false alarms against misses by moving that line.
Reasoning
- Gen AI
Hallucination Mechanisms
A language model is trained to write the most plausible next word, not the truest one. When the fact is missing from its weights, it answers anyway, fluently and wrong.
- Gen AI
Reasoning Models
A reasoning model writes out its working before it answers. Those extra thinking tokens buy it time to try steps, catch slips, and only then commit to a final answer.
- Gen AI
Process vs Outcome Rewards
Grading only the final answer teaches a model to guess. Grading each reasoning step teaches it to reason.
- Gen AI
Test-Time Compute in LLMs
Spend extra effort at answer time, not training time. You sample several tries and keep the one that checks out.
- Gen AI
Chain-of-Thought Training
You train the model on worked solutions instead of bare answers, so every intermediate step gets graded. The model learns to show its work because guessing the final answer alone no longer earns full credit.
- Gen AI
LLM Confidence & Calibration
If you say 80% when you mean it, people can plan around you. Calibration is whether a model's 80% means 80%.
- Gen AI
Reasoning Effort Controls
A reasoning model thinks in hidden tokens before it answers. The effort dial sets how many of those tokens it may spend, so you choose between a quick guess and a checked answer.
Inference Mechanics
- Gen AI
Temperature Sampling
Temperature is the knob that sets how wildly the model draws its next token. Turn it down for steady answers you can rerun, turn it up when you want fresh options and can live with misses.
- Gen AI
Decoding Strategies
The model hands you odds for the next word. Decoding is how you pick one: always the favourite, a weighted draw, or several guesses at once.
- Gen AI
KV Cache
Once your model has computed a past token's keys and values, it files them away instead of redoing them. Each new token then costs one fresh computation plus a lookup, not a full replay.
- Gen AI
Paged Attention
Your GPU saves every past token's keys and values so it never recomputes them, and that store grows with each token you generate. Paged attention chops the store into small fixed blocks tracked by a table, so memory fills slot by slot and almost none of it sits empty.
- Gen AI
Constrained Decoding
Constrained decoding puts a mask over the model's next-token votes so banned tokens get zero chance. You still let the model choose the words, but the shape of the answer always parses.
- Gen AI
Prefix Caching
When every request opens with the same instructions, you should compute that opening once and reuse it. Prefix caching stores those key and value blocks a single time and shares them across requests.
- Gen AI
Repetition Penalties
When a model starts echoing itself, repetition penalties tax the scores of words it has already used so a fresh word can win.
- Gen AI
Top-K Sampling
Keep only the K most likely next tokens and throw the rest away, then draw from the survivors. You keep some surprise without ever drawing a hopeless outsider.
- Gen AI
Top-P (Nucleus) Sampling
Top-p keeps the smallest set of next tokens whose odds add up to your target, so a confident model keeps one or two options and an unsure model keeps many.
- Gen AI
Beam Search
Keep a few best guesses alive at each word instead of locking in one, then keep the few full sentences with the best total score.
- Gen AI
Min-P Sampling
You keep only the tokens that score at least a fixed fraction of the best token. When the leader is strong the bar is high, and when the race is close the bar drops.
- Gen AI
Speculative Decoding
A tiny model drafts the next few words and the big model checks them all at once. You pay for one big pass but can keep several tokens.
Agents
- Gen AI
AI Agent Architecture
An agent is a model running in a loop with tools and memory, so it can check a result and try again instead of guessing once and stopping.
- Gen AI
Tool Use & Function Calling
Function calling lets a model request a real action by naming a tool and filling in its arguments, while ordinary code checks the request and runs it. The model writes the request; it never runs anything itself.
- Gen AI
Agent Evaluation
An agent can reach the right answer through wasteful or lucky steps. Agent evaluation scores the whole run, not just the ending, so a lucky success never passes as a reliable one.
- Gen AI
Agent Failure Modes
An agent can keep working while already wrong. It repeats the same call, invents a tool detail, or reports a finished job the log does not back up.
- Gen AI
Planning & Reasoning
An agent can write the whole plan before it acts, or it can reason one step at a time and let each tool result pick the next move. The first is cheap and predictable, the second adapts when the world surprises you.
Prompting
- Gen AI
System Prompts & Personas
A system prompt is a standing instruction you set once, ahead of the chat, so the model keeps the same role and rules on every turn without being reminded.
- Gen AI
Prompt Anatomy
A prompt has four jobs: set standing rules, say what to do, fence off untrusted text as data, and lock the reply shape. Get those four right and the model stops guessing.
- Gen AI
Structured Outputs
Structured outputs force a model to return data in an exact, predictable shape a program can trust, instead of prose you have to parse and hope is right.
Tuning
- Gen AI
Supervised Fine-Tuning
SFT keeps training a pretrained model on curated example answers, scoring only the answers, so a fixed response shape becomes its habit instead of a suggestion.
- Gen AI
LoRA & QLoRA
Freeze the pretrained model and train only two tiny matrices per layer that add a small correction to its output. QLoRA compresses the frozen weights to 4-bit so the whole job fits on one GPU.
Generative Vision Audio Multimodal
- Gen AI
Image Editing and Inpainting
You mask the part of a photo you want changed and keep the rest. The model redraws only inside the mask, so the sofa turns red while your cat stays exactly the same.
- Gen AI
Consistency Models
You start from static and want a finished image. A consistency model learns a direct jump from any halfway-noisy version straight to that finished image, so one pass can replace a whole chain of cleanup steps.
- Gen AI
ControlNet and Spatial Conditioning
A text prompt says what to draw but not where. ControlNet adds a spatial map, like edges or depth, that pins down the layout while the frozen image model keeps doing the drawing.
- Gen AI
LoRA for Image Models: Tiny Adapters
Teach a frozen image model one person, pet, or style with a tiny add-on you can plug in or pull out, instead of retraining the whole model.
- Gen AI
Video Generation
A video model cleans up every frame of a clip at the same time, tying each patch to itself across frames, so the cat in frame 1 is still the same cat in frame 16.
- Gen AI
Automatic Speech Recognition (ASR)
You talk, it types. Speech recognition slices your audio into tiny frames, scores each one for likely sounds, then merges the repeats into text.
- Gen AI
Contrastive Vision-Language Pretraining (CLIP)
Two encoders learn one shared map where a photo and its caption land on the same spot, so naming a new picture is just finding its nearest sentence.
- Gen AI
Denoising Diffusion Probabilistic Models
A DDPM turns pure static into an image by running one small denoising step hundreds of times, after learning that step from real photos buried in noise.
- Gen AI
Diffusion Samplers
A trained diffusion model knows which way is cleaner from any noisy image. The sampler is the walking plan: how big each stride is, and how many you take before you call the image done.
- Gen AI
Document Understanding with Vision Models
Photograph a receipt and get back a checked database row instead of a pile of words. The model reads the photo itself, so every number keeps the row and column it came from.
- Gen AI
Flow-Based Models (Normalizing Flows)
A flow turns plain Gaussian noise into data through warps you can run backward. Sampling runs forward, scoring runs backward, and both are exact.
- Gen AI
Flow Matching
Draw a straight line from random noise to a real picture, then teach a network the arrow pointing along that line. Sampling just follows the learned arrows home.
- Gen AI
Generative Media Evaluation
A generated picture has no answer key, so you judge it like a contest entry: automatic checks for realism and prompt match, plus blind human votes. This page shows how all three scores work and where each one lies to you.
- Gen AI
Multimodal Fusion
One model that looks at a photo and reads your question at the same time, by turning both into numbers it can mix into a single code.
- Gen AI
Neural Audio Codecs
Raw audio is tens of thousands of numbers per second, far too long for a Transformer to write out. A neural audio codec squeezes each slice of sound into a few codebook tokens, so generating audio becomes predicting the next token.
- Gen AI
Projector vs. Cross-Attention
A projector translates a picture into extra words pasted at the front of your prompt. Cross-attention instead leaves the picture on the side and lets every layer of the model glance at it.
- Gen AI
Promptable Segmentation
Point at any object with a click, box, or short phrase and get its exact pixel outline back. One model cuts every object with no retraining per object.
- Gen AI
Rectified Flow
Train a flow model, watch which noise becomes which image, then train again on those matched pairs. Each round straightens the paths, so sampling needs fewer steps.
- Gen AI
Score-Based Generative Models
You never teach the model the odds of each image. You teach it which way is uphill toward real images at every noise level, then walk that way out of static.
- Gen AI
Self-Supervised Vision Features
An encoder trained by hiding most of each photo and rebuilding it, so its output vectors already know shape and texture before you show a single label. You reuse those vectors frozen or fine-tuned.
- Gen AI
Speaker Diarization
One recording, several voices. Diarization writes the speaker labels in the margin: who spoke, and exactly when.
- Gen AI
Speech Synthesis (Text-to-Speech)
Type a sentence, attach a seconds-long clip of a voice, and the model reads your words in that voice. Underneath, the audio is just tokens, so speaking is next-token prediction.
- Gen AI
Speech-to-Speech Models
You speak and it answers in speech, with your sigh and its chuckle intact. No text step in the middle strips the tone away.
- Gen AI
Text-to-Speech (TTS)
Text to speech turns writing into sound in two passes: first it sketches how each sound should look over time, then it renders that sketch into a wave a speaker can play.
- Gen AI
U-Net vs. Diffusion Transformers (DiT)
A diffusion model needs a denoiser that takes a noisy image and guesses the noise. U-Net does that with shrinking convolutions, while a Diffusion Transformer cuts the image into patches and lets every patch talk to every other patch.
- Gen AI
Vision-Language Models (VLMs)
A vision-language model gives a chat model sight by translating photo patches into word-like tokens, so one model reads your picture and your question together.
- Gen AI
Visual Question Answering (VQA)
You show the model a photo and ask a written question about it. It looks at the right patches, mixes what it sees with what you asked, and picks one answer.
- Gen AI
Whisper Architecture
Whisper listens to a whole 30-second clip once, then writes the words one by one. A few short tokens up front tell it whether to transcribe or translate to English.
Evaluation Science
- Gen AI
LLM-as-a-Judge
When many answers can be right, a stronger model grades each output against a rubric or picks a winner head to head, giving you human-like signal at script speed.
- Gen AI
Benchmark Contamination
Benchmark questions live on the public internet, and so does your training scrape. When the two overlap, the score measures memory instead of reasoning.
- Gen AI
Judge Bias & Calibration
An LLM asked to grade answers has favorite shortcuts: the first option, the longer answer, and writing that sounds like itself. Left unchecked, those habits decide the winner instead of quality.
- Gen AI
Pairwise Preference and Elo
You stop asking how good one answer is and ask which of two answers wins. Those blind wins feed a chess style rating that ranks every model.
- Gen AI
Prompt Regression Testing
Every prompt edit is a new deployment. One fixed case can break two working ones, so you rerun a frozen set of old cases and count what got fixed against what regressed.
- Gen AI
Safety Evaluation
You grade a model by attacking it with fixed hostile prompts and counting clean refusals. The refusal share decides whether it may launch.
Post Training
- Gen AI
When to Fine-Tune
Prompting, retrieval, and fine-tuning fix different failures. You only rewrite the model's weights when the cheaper fixes cannot fix the error you have.
- Gen AI
Constitutional AI
You hand the model a short list of rules, let it critique and rewrite its own bad drafts, then train it on the rewrites and on AI judged preferences instead of human harmlessness labels.
- Gen AI
Fine-Tuning Data Preparation
Your fine-tune learns exactly what your data file shows it. Get the chat template, the loss mask, and the dedup right, and the run has a chance; get any wrong and no learning rate saves it.
- Gen AI
Full Fine-Tuning
You update every weight in the model at once, so it can absorb behavior a small adapter cannot reach. You pay for that reach with the full training memory bill.
- Gen AI
Post-Training Quantization
Training needs 16-bit precision for tiny gradient updates. Once weights are frozen, you can round them to 8-bit or 4-bit integers and cut memory severalfold with no retraining.
- Gen AI
Data Mixing and Curriculum
You set the exact share of web, code, and math in every batch instead of accepting whatever the crawl contains. Then you shift those shares from easy to hard as training runs.
- Gen AI
Catastrophic Forgetting in Fine-Tuning
Fine-tuning on one narrow task rewrites the shared weights behind every other skill, so old abilities fade while the new one climbs. Mixing a little of the old data back into each batch holds the old skills in place.
- Gen AI
GRPO
GRPO skips the extra value model PPO needs. It samples a small group of answers to one prompt and treats beating the group average as good.
- Gen AI
Instruction Tuning
Instruction tuning turns a base model from a text continuer into a request answerer. You show it prompt-plus-ideal-answer pairs, and it learns that the job is to answer, not to extend.
- Gen AI
Mid-Training
Mid-training resumes next-token prediction on dense domain text after pretraining ends, before instruction tuning teaches the model how to answer. Same loss, narrower bookshelf.
- Gen AI
Model Merging
Two fine-tunes that started from the same base can be combined by adding their weight changes, so you get one model with both skills and no retraining.
- Gen AI
PEFT Methods
Freeze the giant model and train only a tiny add-on instead. LoRA, adapters, prefix tuning, and IA3 are four places to put that add-on, and this page maps all four.
- Gen AI
Post-Training Evaluation
Training loss can fall while the model gets worse where it counts. You grade the tune on held-out tasks against a prompted baseline, then check general skills for what it forgot.
- Gen AI
Preference Optimization Variants
DPO still loads a frozen copy of your model as an anchor. Its variants cut that cost, cap its overconfidence, or learn from plain thumbs up and down instead of ranked pairs.
- Gen AI
Pretraining
Train a model to guess each next word across a huge pile of raw text, and the guessing game forces grammar, facts, and style into the weights. The result is a base model: fluent, knowledgeable, and not yet taking orders.
- Gen AI
Reasoning Distillation
You stop asking a small model to invent reasoning from scratch. A large teacher writes its step-by-step thinking, a checker keeps only the correct traces, and the small model learns those steps by heart.
- Gen AI
Rejection Sampling Fine-Tuning
Sample several answers per prompt, let a checker keep only the best one, and fine-tune on those winners. The model's everyday answer starts to look like its old lucky best.
- Gen AI
Reward Modeling
You cannot ask a person to grade every reply your model writes while it trains. A reward model learns what your annotators preferred from side by side comparisons, then grades each new reply alone with one fast number.
- Gen AI
RL from Verifiable Rewards (RLVR)
When an answer can be checked by a rule instead of a judge, train on the rule. RLVR pays full marks only when code runs or math matches, so the model must be right, not just sound right.
- Gen AI
Synthetic Data for Post-Training
You use a stronger model to write the prompt-answer pairs you cannot afford to write by hand, then you train a smaller model on the filtered set.
Context Engineering
- Gen AI
Context Engineering
A language model only sees the tokens inside its fixed window. Context engineering chooses what goes in there: which rules, which history, which retrieved passages and which tool output, and what gets cut when they stop fitting.
- Gen AI
Memory Systems
Short-term memory is what sits in the context window right now. Long-term memory is facts you saved on purpose and pull back only when the current task needs them.
The Deep Math
- Gen AI
Hierarchical Navigable Small World (HNSW)
HNSW stacks your vectors into layers of graphs: almost empty on top for long jumps, crowded at the bottom for close inspection, so each query skips far before it looks closely.
- Gen AI
BM25 and Inverted Indexes
An inverted index files every word under the documents that hold it, so lookup is instant, and BM25 ranks those matches by how often the word appears, how rare it is, and how long the document runs.
- Gen AI
Embedding Fine-Tuning
A public embedding model ranks words the way the web uses them. Fine-tuning re-trains it on your own query and document pairs, so your meaning of a term is the one that wins.
- Gen AI
IVF and Product Quantization (IVF-PQ)
Two tricks that let large vector search fit in memory: IVF skips most of the data at query time, and product quantization shrinks each vector into a few bytes.
- Gen AI
Learned Sparse Retrieval
SPLADE reads each document with a neural network, guesses extra vocabulary terms that fit it, and files the document under those terms too. Search stays an exact index lookup, but synonyms now match.
- Gen AI
Locality-Sensitive Hashing (LSH)
LSH hashes vectors so close ones land in the same bucket. You check one bucket instead of the whole collection, and accept a small chance of missing.
- Gen AI
Maximal Marginal Relevance (MMR)
Top-k by relevance alone hands you the same idea five times. MMR picks the next chunk by what it adds, not just how well it matches.
Mechanistic Interpretability
- Gen AI
Activation Patching
Swap one clean layer state into a corrupted run. If the right answer comes back, that layer caused it.
- Gen AI
Activation Steering
Add a small chosen direction to the model's mid-run activations so the next words lean that way for one pass, with weights untouched and the effect gone on the next prompt.
- Gen AI
The Logit Lens
Peek at a model's half-finished thinking. Run any middle layer through its final word decoder and read which word is winning so far.
- Gen AI
Sparse Autoencoders (SAEs)
One hidden state mixes many ideas in a few numbers. A sparse autoencoder spreads it across thousands of features so only a few fire at once and you can read them.
- Gen AI
Steering Vectors in LLM Hidden States
Take the average hidden state of polite answers, subtract the average of rude ones, and the leftover arrow points at politeness. Add a little of it back during one forward pass and the model leans that way.
- Gen AI
Superposition and Circuits
Your model squeezes far more ideas than it has neurons, so ideas share directions. Small wired groups of heads then turn those shared directions into decisions you can trace.
Audio And Speech
Future Frontiers
- Gen AI
Agentic Software Engineering
You file a bug report and walk away: a coding agent reads the issue, finds the faulty file, edits it, and runs the tests until they pass. You return to a pull request, not a blinking cursor.
- Gen AI
Measuring General Capability
A high exam score can mean the model memorized the questions. You measure general capability by testing it on tasks it has never seen and watching the gap.
Safety And Alignment
- Gen AI
The Alignment Problem
A capable model does what scores highest, not what you meant. Alignment is the work of closing that gap.
- Gen AI
Reward Hacking
Your model stops doing the job and starts gaming the score. Reward hacking is when it finds a loophole that raises its reward while making the real answer worse.
Attention
Advanced Architectures
- Gen AI
Diffusion Language Models
Instead of writing left to right one word at a time, a diffusion language model starts from a line of blanks and fills the whole line in at once, refining every word together over a few fixed passes.
- Gen AI
Memory-Augmented Architectures
A small controller network that keeps its facts in a searchable outside table instead of baking them into its weights, reading and rewriting that table as it works.
Alignment
- Gen AI
DPO
DPO tunes a chat model straight from chosen and rejected answers with one loss, so you skip training a reward model and running PPO.
- Gen AI
RLHF
You start from a model that already follows instructions, have people pick the better of two answers, and use those picks to steer it toward replies people prefer.