All questions
Showing of 55What is a large language model, and how does it actually generate text?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
A large language model (LLM) is a neural network trained to predict the next token in a sequence. A token is a small piece of text. During generation, the model reads the prompt, assigns a probability to each possible next token, chooses one, and repeats the process.
The model does not look up a complete answer stored in a database. Its training has encoded patterns about language, facts, code, and common reasoning into its weights. This lets it produce useful text, but it can also produce a fluent answer that is wrong. Chat models receive extra training after basic text prediction so they can follow instructions, use tools, and respond like assistants.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is a token, and why do models work with tokens instead of whole words or characters?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
A token is a unit of text that a language model reads or writes. It may be a whole word, part of a word, punctuation, or whitespace. A tokenizer converts text into token IDs before the model processes it.
Tokens balance vocabulary size and sequence length. Character-based input would create very long sequences. Whole-word input would need a huge vocabulary and handle new words, typos, code, and many languages poorly. Subword tokens can represent any text while keeping sequences manageable.
Tokenization matters because context limits, cost, latency, and rate limits are usually measured in tokens. The exact count depends on the model's tokenizer, so estimates based only on characters can be inaccurate.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
Why do token counts matter so much in practice?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Token counts affect whether an LLM feature is affordable, fast, and reliable. Providers usually charge separately for input and output tokens. More input increases prompt-processing work, while more output increases generation time and often costs more per token.
Tokens also determine whether a request fits inside the model's context window. The prompt, conversation history, retrieved documents, tool descriptions, and expected response must all fit. Large requests can fail or lose important content through truncation.
Measure tokens on realistic traffic instead of using one average. Track input, output, cached, and reasoning tokens when the provider exposes them. Common savings include removing repeated instructions, retrieving fewer documents, limiting output length, and routing simple tasks to smaller models.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is a context window?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
A context window is the maximum amount of information a model can process in one request. It normally includes system instructions, messages, tool definitions, documents, images represented as tokens, and the generated response.
The context window is not permanent memory. Most APIs require the application to resend any history that the model should consider. As a conversation grows, the application may need to drop old turns, summarize them, or retrieve only relevant facts.
Do not fill the entire window with input. Leave room for the answer and for any tool results added later. A large advertised window does not guarantee equal attention to every token. Test whether the model can find and use important details across realistic long prompts.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What does the temperature parameter control?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Temperature changes how strongly the model favors its most likely next tokens. A low value makes common choices more dominant, which usually produces more consistent output. A higher value gives less likely choices more chance, which can add variety but also increase mistakes or drift.
Use lower temperature for extraction, classification, and strict formatting. Moderate values can help with brainstorming or creative drafts. Temperature does not control truthfulness: the model's most likely answer can still be wrong.
Some models, especially reasoning models, do not expose temperature or support only a default value. Treat sampling settings as model-specific. Change one setting at a time and compare results on an evaluation set rather than choosing a value by intuition alone.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is the difference between pretraining and post-training?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Pretraining teaches a model broad language patterns by asking it to predict missing or next tokens across a very large dataset. This stage builds most of the model's general knowledge and basic abilities. The result is often called a base model.
Post-training teaches that base model how to behave for particular uses. It can include examples of good instruction following, human or AI preference feedback, safety training, tool use, and reinforcement learning on tasks with verifiable answers.
The distinction matters because a knowledgeable base model may only continue text instead of answering a request. Post-training makes it more helpful and easier to control, but it can also introduce biases such as excessive agreement or refusal. Both stages shape the final behavior.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is a hallucination, and why do LLMs hallucinate?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
A hallucination is a claim produced by a model that sounds plausible but is unsupported or false. Examples include an invented citation, a nonexistent API, or a wrong date stated with confidence.
LLMs learn to generate likely text, not to verify every statement. Their training data can be incomplete, outdated, or conflicting. Knowledge stored in model weights is also an imperfect compression of that data. When a prompt requires missing information, the model may continue with a pattern that resembles a good answer.
Applications should assume hallucinations can occur. Useful controls include retrieval from trusted sources, calculation tools, and clear permission to admit uncertainty. Tie citations to source text and evaluate whether claims have factual support.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is a knowledge cutoff, and how should it influence how you build with a model?
What does it mean for a model to be multimodal?
What are embeddings, in simple terms?
What does the major model landscape look like in 2026?
What is the difference between open-weight and proprietary API models, and when would you choose each?
Describe the transformer architecture at the level an application engineer should understand.
Explain self-attention conceptually. What problem does it solve?
How does byte-pair encoding (BPE) tokenization work?
Why does the same content cost different amounts in different languages, and why should engineers care?
How do you count tokens accurately before sending a request, and why not just estimate?
How do temperature and top-p interact, and how should you set them in practice?
What is top-k sampling, and how does it compare with top-p?
What are stop sequences, and when would you use them?
What happens to model quality as the context window fills up?
Compare context window sizes across the major 2026 models. What caveats apply?
What is prompt caching, and how do you structure prompts to exploit it?
Explain RLHF at a high level. Why is it needed?
What is the difference between a base model and an instruct or chat model, and when does it matter?
What are reasoning models, and when do they actually help?
What is test-time compute, and why did it become a major scaling axis?
What practical techniques reduce hallucinations in an LLM application?
How do embeddings power semantic search and RAG?
How do you choose an embedding model in 2026?
What are scaling laws, and how do they inform model size, data, and compute decisions?
What is the difference between encoder-only, decoder-only, and encoder-decoder transformer models, and where is each used?
What is LoRA, and how does parameter-efficient fine-tuning compare with full fine-tuning?
Why is attention quadratic in sequence length, and what does that imply for long-context work?
What is the KV cache, and why does it dominate LLM inference economics?
What is a Mixture-of-Experts architecture, and why has it become standard for large models?
What are the tradeoffs when quantizing a self-hosted model?
Is temperature 0 deterministic? Explain why or why not.
Give a taxonomy of hallucination causes and match mitigations to each.
How would you design model routing or cascading to balance cost and quality?
When does a small model beat a frontier model?
How do you control how much a reasoning model thinks, and why does it matter?
Compare DPO with PPO-based RLHF for preference tuning.
What are RLAIF and Constitutional AI?
How do multimodal models process images, and what does that cost in tokens?
Advertised context windows keep growing. How do you evaluate what a model can actually use?
What techniques reduce LLM inference latency, and which matter most?
How would you measure and monitor hallucinations in a production LLM system?
Walk through the economics of a high-volume LLM feature and the levers for optimizing cost.
Discuss sampling beyond temperature and top-p: failure modes and current practice.
What are the known failure modes of RLHF-style post-training?
When do you choose RAG, long context, or fine-tuning, and how do they combine?
How much should you trust a reasoning model's visible chain of thought?
Can token log probabilities be used to estimate model confidence, and what are the limits?
How do transformers represent token order, and what are rotary position embeddings (RoPE)?
This answer is part of Pro.
The full written answer, with the trade-offs and follow-ups an interviewer will probe.
No matches
Try a different filter or search term.
From the blog
Posts about LLM Fundamentals, each written from a video on our YouTube channel, with its charts, code and sources.
LLM Fundamentals cheatsheet
- The 30-second mental model01
- Transformer and attention (practitioner view)02
- Tokenization03
- Context windows04
- Sampling parameters05
- Reasoning models and test-time compute06
- Hallucinations07
- Embeddings08
- The 2026 model landscape09
- Model selection10
- Pretraining vs post-training11
- Multimodality basics12
- + 3 more inside
- + 9 more inside
48 of 55 LLM Fundamentals answers are in Pro.
Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.
- Full answers + code
- AI explanations, simpler or deeper
- 1,000 AI credits / month
- Cancel anytime
Change topic
Pick a different technology or stack. Your current topic stays put until you choose a new one.
MEAN
MongoDB, Express, Angular, Node.jsMERN
MongoDB, Express, React, Node.jsDjango
Python Full-Stack DevelopmentRuby on Rails
Convention over ConfigurationServerless on AWS
Serverless Architecture on AWSInterviewers also test these - they're common to every stack, whichever one you picked above.
Flutter Mobile
Flutter Cross-Platform Mobile DevelopmentInterviewers also test these - they're common to every stack, whichever one you picked above.
Spring Boot
Enterprise Java Development.NET
Microsoft EcosystemVue
Vue.js, Vite, TypeScript, Tailwind, Node.jsGo Backend
Golang, gRPC, PostgreSQL, Redis, RabbitMQInterviewers also test these - they're common to every stack, whichever one you picked above.
FastAPI
Python, FastAPI, SQLAlchemy, PostgreSQLReact Native
React, TypeScript, Redux, FirebaseiOS Native
Swift, SwiftUI, UIKit, FirebaseAndroid Native
Java, Jetpack Compose, FirebaseDevOps / Platform
Docker, Kubernetes, Terraform, CI/CDInterviewers also test these - they're common to every stack, whichever one you picked above.
AI Engineer
LLMs, RAG, Agents, EvalsAI-Powered Developer
Claude Code, Copilot, Agentic WorkflowsCore SWE Interview Prep
Data structures, algorithms, OS, concurrency, networking, gitInterviewers also test these - they're common to every stack, whichever one you picked above.
Interviewers also test these - they're common to every stack, whichever one you picked above.