Meet the chatbots: LLMs
How ChatGPT, Claude and friends work: one word at a time, with surprising results.
A large language model (LLM) is a neural network trained on a huge amount of text. Its core skill sounds almost too simple: given some text, predict what comes next.
๐งฉ Tokens, not words
Text is chopped into tokens: whole words, word pieces, or punctuation. "unbelievable" might become "un" + "believ" + "able".
Roughly, 1 token โ ยพ of an English word.
๐ฒ One token at a time
The model outputs a probability for every token in its vocabulary, picks one, adds it to the text, and runs again.
A setting called temperature controls randomness: low = safe and predictable, high = more creative and more chaotic.
At its core, what is an LLM trained to do?
๐ From autocomplete to assistant
Step 1, pre-training: read a huge slice of the internet and books, predicting next tokens. Result: a brilliant but unruly autocomplete.
Step 2, fine-tuning: train on example conversations and human feedback so it follows instructions and is helpful and safe.
๐ซ๏ธ Hallucinations
LLMs generate what sounds likely, not what is verified. Sometimes that's confidently wrong: a fake citation, an invented date.
Always double-check facts that matter, especially names, numbers, quotes and sources.
โ๏ธ Prompting tips that actually work
Be specific: say who it's for, how long, what format.
Give context and examples of what good looks like.
Ask it to think step by step for reasoning tasks.
Iterate: treat the first answer as a draft and refine.
An LLM gives you a book citation that sounds perfect. What should you do?
โจ Before you drift off
- LLMs predict the next token, one at a time.
- Pre-training makes them knowledgeable; fine-tuning makes them helpful.
- They can hallucinate, so verify facts that matter.
- Clear, specific prompts with context get better answers.
๐ Go deeper (free & open)
- Intro to Large Language Models (1-hour talk) โ ยท Andrej Karpathy
- Prompt Engineering Guide โ ยท DAIR.AI ยท Open-source, MIT licensed
- Hugging Face LLM Course, chapter 1 โ ยท Hugging Face ยท Apache 2.0