Lesson · ⏱ 7 min read
💬 What is an LLM? Tokens, context and temperature
EnglishHinglish
🏠 Real-life example
Your phone keyboard suggests the next word as you type. An LLM (large language model) is that idea scaled up enormously: trained on a huge share of the internet's text, it predicts the next word so well that whole essays, code and answers come out. The 'context window' is how much of the conversation it can keep in mind at once, like the size of a whiteboard.
💡 In simple words
LLMs read and write in tokens, chunks of text roughly ¾ of an English word. Hindi and other languages often use more tokens per word. You pay for, and are limited by, tokens. The context window is the maximum number of tokens (your prompt plus documents plus the answer) the model can handle at once. Temperature controls randomness: low (0–0.3) gives focused, repeatable answers, and higher values are more creative. LLMs don't 'look things up' unless you give them tools or documents. They generate likely text, which is why they can confidently be wrong (hallucinate).
🎬 See how it works
An LLM scores every possible next token, picks one (here 'ginger'), adds it to the text, and repeats, one token at a time.
🪜 Step by step
- Your text is split into tokens (pieces of words). "Unbelievable" might become "un", "believ", "able".
- Everything the model sees at once, your instructions, documents, chat history and its own answer, must fit in the context window.
- The model predicts a probability for every possible next token, picks one, appends it, and repeats.
- Temperature controls how adventurous that pick is: low for facts and formats, higher for brainstorming.
- It has no memory between API calls. Chat apps resend the conversation each time, which is why long chats cost more.
🔑 Key terms
- Token
- The unit LLMs read and bill by, a word-piece.
- Context window
- The maximum text the model can consider in one go.
- Hallucination
- A confident-sounding answer that is made up or wrong.
👀 See it in action
Prompt: "Suggest a name for my chai startup"
temperature 0.0 → "Chai Point" (same every time)
temperature 1.0 → "Kettle & Kulhad", "Brew Bandhu", "Sip Sutra"… (varies)
Tokens: "Suggest a name for my chai startup" ≈ 8 tokensLow temperature for facts and code, higher for brainstorming.
⚠️ Common mistakes to avoid
- Treating answers as facts. LLMs produce plausible text; verify anything important or ground it with sources.
- Ignoring the knowledge cutoff. A model doesn't know events after its training data unless you give it that information.
✅ Quick check
Why can an LLM state a wrong fact confidently?
- It is lying on purpose
- It generates likely-sounding text and doesn't check facts by itself
- Its internet is slow
Show answer
B. It generates likely-sounding text and doesn't check facts by itself: LLMs predict plausible text. Without retrieval or tools they have no fact-checking step.
🙋 Questions learners ask
How many tokens is a page of text?
Roughly 500 to 700 tokens for a page of English. Hindi and other scripts often use more tokens for the same meaning.
Why does the same prompt give different answers?
Because a token is sampled from probabilities. Lower the temperature (towards 0) for more consistent output.
📌 Remember
LLM = super-powered next-word predictor. Mind tokens, context and temperature.
📖 Words from this lesson (AI dictionary)
Learn this as part of a full course
Track your progress, take the quick checks and follow the lessons in the right order. This lesson is part of:
AI Foundations Path · AI Product Engineer · LLM / Agent Engineer · AI Forward Deployed Engineer · AI Product Manager
Continue in the course