How chatbots work
What happens inside ChatGPT, Claude and Gemini when you press Enter.
Inside the model
The transformer, LLMs, how a chatbot is trained and what happens when you press Enter.
- Transformer architecture: The transformer is the design (architecture) behind almost every modern language AI.
- Inside attention: queries, keys, values and multi-head attention: Self-attention lets every token look at every other token and decide how much each one matters.
- Large Language Models (LLMs): An LLM is the kind of AI behind ChatGPT, Claude and Gemini.
- How a chatbot is made: from pre-training to alignment: A chatbot like ChatGPT or Claude is built in stages.
- How an LLM is trained: data, next-token prediction and alignment: An LLM learns by playing one game trillions of times: predict the next token.
- What happens when you press Enter: the inference pipeline: When you ask "What is gravity?", the model runs a precise pipeline.
Models of every size
Models that see and hear, and small models you can run yourself.
- How multimodal models see, hear and read: A large multimodal model (LMM) can take in more than text: images, audio and video.
- Small and open models: running AI on your own computer: Not every AI needs a giant model in the cloud.
The settings that shape answers
Tokens, memory and creativity: the dials behind every reply.
- Tokens: AI doesn't read whole words.
- How tokenization works: BPE, WordPiece and special tokens: Before an LLM can read your text, a tokenizer cuts it into tokens and swaps each one for a number (its token ID) from a fixed vocabulary.
- Context window: The context window is how much text the AI can keep in mind at once: your messages, its replies and any documents you paste.
- Temperature: Temperature is a setting that controls how creative or predictable the AI's answers are.
When chatbots go wrong
Made-up answers and unfair patterns, and how to spot them.
- Hallucination: A hallucination is when AI gives an answer that sounds right but is made up: a fake statistic, a book that doesn't exist, a wrong date.
- How generative AI is evaluated: BLEU, ROUGE, perplexity and LLM-as-judge: Generated text has no single correct answer, so it is judged with several measures at once: automatic metrics that compare it with a reference answer, scores of how well the model predicts real text, other AI models acting as judges, and real people.
- Bias & responsible AI: Bias is when AI repeats unfair patterns from its training data.
Building your own chatbot
Chatbot types, intents and entities, and the 8 steps from idea to launch.
- Types of chatbots: rule-based, AI and hybrid: Not every chatbot is ChatGPT.
- Build a chatbot step by step: from idea to launch: Building a useful chatbot is less about code and more about design: choosing one clear job, listing what people will ask, writing good instructions, giving it the right knowledge, testing it with real questions, and only then launching it.