Generative AI and LLMs
How large language models work and the retrieval, evaluation, safety and serving stack around them, in one map.
Overview
Generative AI refers to models that create new content: text, code, images, audio and more. Large language models (LLMs) are the best-known kind. Trained to predict the next token on enormous amounts of text, they learn to write, summarise, translate, reason and use tools.
An LLM on its own is like a well-read expert with no access to your files and no notebook. Useful products surround it with retrieval to bring in the right documents, evaluation to check quality, observability to see what happened, safety layers to block harm, and serving infrastructure to make it fast and affordable. This page maps that whole stack.
How LLMs work
- GPT architecture: decoder-only transformers trained to predict the next token.
- BERT: encoder models for understanding tasks and embeddings.
- Reasoning models: spending more computation at answer time on hard problems.
- KV cache and Speculative decoding: what makes generation fast.
- Small language models and Multimodal models: the trade-off between size, cost and capability, and models that see and hear.
- Transformers and FlashAttention: the underlying architecture and its efficient attention kernels.
Giving models the right information
Most business value comes from connecting models to your own data. Embeddings turn text into vectors; vector databases search them; Context engineering and Prompt engineering decide what the model sees and how it is instructed. Retrieval patterns range from Naive RAG to Agentic RAG, and Text-to-SQL brings structured data into the conversation.
Adapting models: fine-tuning
When prompting and retrieval are not enough, models are adapted with fine-tuning: full fine-tuning, parameter-efficient methods such as LoRA, QLoRA and PEFT, instruction tuning with SFT, and preference tuning with RLHF and DPO.
Measuring and protecting quality
Language model outputs vary, so every serious system needs evaluation, tracing and safety controls: observability platforms record each step, evaluation tools score outputs, and safety tools detect personal data, block jailbreaks and test defences through red-teaming. See also LLM-as-judge, Guardrails and Prompt-injection defense.
The full map
LLM concepts
Fine-tuning
Frontier topics
Vector databases
Vector indexes
LLM observability and evaluation
LLM safety
Related topics
- Agentic AI: models that plan and use tools.
- Deep learning: the neural network foundations.
- MLOps and AI infrastructure: serving, hardware and operations.
Frequently asked questions
What is the difference between generative AI and LLMs?
Generative AI is the broad category of models that create content. LLMs are generative models specialised in text and code, and increasingly in other modalities.
Do I need a vector database to use LLMs?
Only if you retrieve from your own documents at scale. Small projects can use simpler stores or PostgreSQL with pgvector.
How do I know if an LLM application is good enough?
Build an evaluation set from real tasks, score outputs with reliable graders, trace production traffic, and red-team for safety before release.
Summary
LLMs are powerful text predictors that become useful products when surrounded by retrieval, context design, evaluation, observability, safety and efficient serving. Use the map above to explore each layer.