A large language model is a probabilistic token machine: it turns your text into tokens, repeatedly predicts the most likely next token, and stops when it decides the answer is done. It has no built-in truth-checker and no memory beyond the current call, and every token it reads or writes shows up on your bill.

Quick Answer: An LLM turns text into tokens, predicts the next token repeatedly inside a fixed-size context window, and charges you per token for the privilege. Cost, latency, and hallucination are not separate topics — they are the direct, physical consequences of that one mechanism.

Most PMs meet large language models backwards. They see a chat demo that feels like magic, they greenlight a feature, and only in week three does anyone explain what a "context window" is or why the API bill just tripled. This guide flips that order. It gives you the underlying mental model first — what an LLM actually is, mechanically — and then walks it through one running example so the abstractions stop being abstract.

That example is a support-ticket summarizer: a feature that reads a long customer support conversation and produces a three-bullet summary plus a suggested next action for the agent. It is a deliberately unglamorous feature, which is exactly why it works as a teaching tool — every PM has shipped something like it, or will.

By the end, you should be able to look at any "let's add AI to this" idea and immediately ask the right five questions: how many tokens does this cost, what needs to be inside the context window, how fast does it need to respond, what happens when it's confidently wrong, and does this need to be one call or a chain of them.

The One-Sentence Mental Model: AI as a Probabilistic Token Machine

A large language model does one mechanical thing on repeat: given a sequence of tokens, it calculates a probability distribution over every possible next token, picks one, and repeats with the new, longer sequence. There is no lookup, no verification step, no understanding — only pattern-completion, learned from training text.

This is the shift the rest of your AI literacy depends on: moving from "AI is magic" to "AI is a probabilistic token machine with a bill and a blast radius." Once you internalize that, features you were treating as software behave differently in your head — because they behave differently in reality.

Why "Probabilistic" Is the Load-Bearing Word

Traditional software is deterministic: the same input plus the same code produces the same output, every time, forever. An LLM is not. Ask it the same question twice and you can get two differently worded — sometimes differently structured — answers, because it is sampling from a distribution, not executing a fixed branch of logic.

This single property explains why:

  • QA for AI features can't just be a pass/fail test suite; you need evaluation sets and score distributions, not binary checks.
  • The same summarizer prompt can produce a great summary nine times and a subtly wrong one on the tenth — and neither engineering nor you did anything different.
  • "Version 2 is better" claims need statistical evidence across dozens or hundreds of examples, not a screenshot of one good output.

Researcher and educator Andrej Karpathy, a former OpenAI and Tesla AI lead, has described this plainly in his public talks on large language models: at inference time, the model is fundamentally a next-token predictor, and everything more elaborate — chat behavior, tool use, "reasoning" — is built as scaffolding on top of that core loop. Keep that image in your head. It will save you from arguing with engineers about "bugs" that are actually the model behaving exactly as a probabilistic system should.

The Architecture Underneath, in One Paragraph

You don't need to derive the math, but it helps to know the name: the Transformer architecture, introduced by Vaswani et al. in the 2017 paper "Attention Is All You Need" (Google), is the design almost every modern LLM is built on. Its core trick — "self-attention" — lets the model weigh how relevant every other token in the input is to the one it's currently generating. That mechanism is also, not coincidentally, why context windows and embeddings work the way they do, which is where we're headed next.

The Running Example: A Support-Ticket Summarizer

Picture this feature request from support ops: "Agents are drowning in long threads. Can we get a one-glance summary and a suggested next step at the top of every ticket?" It sounds like a small ask. Under the hood, it touches every concept in this guide — tokens, embeddings, context, cost, latency, and hallucination — so we'll keep coming back to it.

Tokens: The Real Unit of Work (and the Real Unit You're Billed For)

A token is the actual chunk of text a model reads and writes — not a word, not a character, but a sub-word piece produced by a tokenizer. A token might be a whole common word, part of a longer word, or a single punctuation mark. Every price sheet and context-window limit is denominated in tokens, not words.

This distinction matters because it's where PM assumptions quietly go wrong. A rough, widely used rule of thumb for English text is that 100 tokens ≈ 75 words, but that ratio shifts with jargon, code, non-English languages, and formatting like JSON or Markdown, which tends to tokenize less efficiently than plain prose.

Text typeApprox. wordsApprox. tokensWhy the gap
Plain English sentence20~26Common words are usually 1 token; rarer ones split
Product name or jargon ("Prodinja", "hallucination")12–4Uncommon strings get split into sub-word fragments
JSON-formatted output20~35–40Braces, quotes, and keys each consume tokens
Non-English text (e.g., Hindi, Japanese)2030–60+Many tokenizers were trained English-heavy, so other scripts fragment more

Applying It to the Summarizer

A 40-message support thread might run around 3,000 words. Using the rough ratio above, that's roughly 4,000 input tokens before you've added a system prompt, formatting instructions, or any retrieved context — and every one of those tokens is billed on top. The 120-word summary the model outputs is a comparatively tiny 150–200 output tokens, but on most providers' pricing, output tokens cost noticeably more per token than input tokens, so a short answer isn't automatically a cheap one.

If you remember one number from this section, make it this: the length of the input the model has to read is usually the dominant cost driver, not the length of what it writes back.

This is exactly why the industry treats tokens as the real unit of AI economics, not a technical footnote — it's the actual meter that's running. For the full breakdown of how providers price by token, why input and output tokens are billed differently, and how to forecast a feature's run-rate before you ship it, see our companion piece on why tokens, not words, are the unit AI actually bills you for.

Embeddings: How the Model Turns Meaning Into Math

An embedding is a list of numbers — a vector — that represents the meaning of a piece of text as a point in high-dimensional space, so texts with similar meaning end up mathematically close together, and unrelated texts end up far apart. It lets software compare meaning, not just matching letters.

Think of it as GPS coordinates for meaning. Two ticket summaries about "billing dispute" will cluster near each other in that space even if one says "invoice" and the other says "charge," while a ticket about "password reset" sits somewhere else entirely. That distance calculation is what powers semantic search, retrieval-augmented generation (RAG), deduplication, and clustering features across nearly every modern AI product.

Why This Matters for a PM, Not Just an Engineer

You don't need to compute embeddings, but you do need to know when a feature secretly depends on them, because that changes the build:

  1. Search and retrieval features ("find similar past tickets," "surface relevant docs") almost always run on embeddings and a vector index, not keyword matching.
  2. Grounding an LLM's answer in your own data — instead of only its training knowledge — typically means embedding your documents once, then embedding each incoming query to retrieve the closest matches.
  3. Quality here is a data problem before it's a model problem. Bad or sparse source documents produce weak retrieval no matter how good the generation model is.

Applying It to the Summarizer

To stop the model from inventing a refund policy it never saw, you'd embed your library of resolved tickets and internal policy docs once, then, for each new ticket, retrieve the handful of most semantically similar past resolutions before asking the model to summarize and suggest a next action. The summary is now grounded in something real instead of purely improvised from the model's training data.

That retrieval step is also where a second lever — quality versus completeness of grounding — gets decided; get the fundamentals of vector similarity and retrieval quality straight in our dedicated explainer, embeddings explained for product managers.

The Context Window: The Model's Working Memory (and Its Ceiling)

The context window is the maximum number of tokens — input plus output combined — a model can consider in a single call. Anything outside it, the model cannot see; anything near the limit tends to get read less reliably than content at the start or end. It behaves like short-term working memory, not a hard drive.

Context windows have grown dramatically. Early GPT-3-era models worked with roughly 2,000–4,000 tokens of context — a few pages of text. By the 2023 generation, 8,000–32,000-token windows were common, and by 2024–2025, several providers, including Anthropic and OpenAI, were shipping context windows in the hundreds of thousands of tokens, with some experimental configurations reaching into the millions.

Era (approximate)Typical context windowRoughly equivalent to
Early GPT-3 class (2020–2021)~2K–4K tokens3–6 pages of text
GPT-4 / Claude 2 class (2023)~8K–32K tokensA short chapter
Claude 3 / GPT-4 Turbo class (2024)~100K–200K tokensA full novel
Gemini 1.5 / long-context class (2024–2025)~1M+ tokens (select configurations)A multi-hundred-page technical manual

Bigger Windows Don't Mean the Problem Is Solved

A larger window is not the same as reliable use of that window. Research from Stanford, including the widely cited "Lost in the Middle" study (Liu et al., 2023), found that model performance on information retrieval tasks tends to degrade for content buried in the middle of a long context, even when that content is technically well within the token limit. The model can "see" it and still under-weight it.

For a PM, the practical implication is this: don't treat a bigger context window as a substitute for good information architecture. Put the most important instructions and facts near the start or end of the prompt, and don't dump everything you have into context just because the limit allows it.

Applying It to the Summarizer

A 40-message ticket thread, plus retrieved similar tickets, plus your system instructions, plus the model's own output, all share one context budget. If the thread grows to 150 messages, you need an actual strategy — truncate to the most recent N messages, run a rolling summary that compresses older parts, or retrieve only the sections relevant to the current question — rather than hoping the window is "big enough."

Deciding what actually belongs in that window is a product question before it's an engineering one, and it's worth answering with real evidence rather than assumption. Sit with the agents who'll use the summary and find out what they actually check first — order history, sentiment, prior escalations — the same rigorous, structured way you'd approach any product discovery effort, before you decide what the model needs to see.

Cost and Latency: The Bill and the Wait

Cost scales with total tokens processed — input plus output — multiplied by the model's per-token price, compounding with usage volume in a way flat-fee software never did. Latency has two faces: time-to-first-token (TTFT) and total generation time, and both trade off against model size and output length.

Unlike a traditional software feature, where the marginal cost of one more user is close to zero, an AI feature's marginal cost per use is real, variable, and directly tied to how much text goes in and comes out. Multiply a $0.01 summarization call by 50,000 tickets a month and you have a genuine, recurring line item — not a rounding error.

The Three Levers, and Why You Only Get Two

LeverPushing it favors...The typical cost
Bigger, more capable modelHigher-quality, more nuanced outputSlower responses, higher per-token price
Smaller, faster modelLow latency, low cost at scaleWeaker reasoning, more frequent errors on hard cases
Longer context / more retrievalBetter-grounded, more accurate answersMore input tokens, higher cost, slower TTFT

This is a real trade-off, not a solvable engineering puzzle — you cannot maximize quality, speed, and cost simultaneously in one architecture, because bigger models that reason more carefully are mechanically slower and pricier to run per token. The job of a PM is to decide, explicitly, which corner of that trade-off your feature needs to anchor on.

What the Research Says About Where This Is Headed

Directionally, the cost of achieving a given quality level has been falling fast. Stanford's AI Index Report has tracked the price of running GPT-3.5-class capability dropping by more than two orders of magnitude within about two years of its release, as smaller and more efficient models caught up to what once required a much larger, pricier model. That trend is a reason to prototype with a capable model first and optimize down later, rather than the reverse.

Latency has a perception problem as much as an engineering one. Human-computer interaction research from the Nielsen Norman Group has long held that responses under roughly 0.1 seconds feel instantaneous, responses up to about 1 second preserve a feeling of flow, and anything beyond about 10 seconds needs an explicit progress indicator or the user assumes something broke.

Streaming a response token-by-token — rather than waiting for the whole thing — is the single highest-leverage latency fix most AI features can make, because the user starts reading long before the full answer is generated.

Applying It to the Summarizer

If support wants the summary the instant a ticket is opened, you need a low TTFT, which argues for a smaller, faster model plus streaming — accepting a slightly less polished summary. If the summary can run as a background job that populates before an agent picks up the ticket, you can afford a larger model and a slower total generation time in exchange for higher quality. Same feature, two entirely different architecture decisions, and the difference is a five-minute product conversation, not a technical constraint.

For the full framework on making this trade-off explicitly instead of by accident, see our deep dive on trade-off analysis for AI product decisions.

Hallucination: Why the Model Is Confidently Wrong

Hallucination is fluent, plausible-sounding output that is not true or not grounded in the source material, because the model optimizes for the statistically likely next token, not a fact-check against a database. It is not a bug you patch away; it is a structural property of generation, so your job is to design for it.

In the summarizer, hallucination might look like the model inventing a refund the agent never offered, misattributing a complaint to the wrong product line, or confidently stating a resolution date that was never discussed. None of these show up as an error message. They show up as an agent trusting a summary that quietly isn't true — arguably worse than an obvious failure, because nothing signals that something went wrong.

Mitigating, Not Eliminating

You reduce hallucination risk with layered tactics, not a single fix:

  1. Ground the answer in retrieved source material (the embeddings and RAG pattern from earlier) so the model has real text to draw from instead of improvising from training data.
  2. Constrain the output format — asking for structured, citation-linked output makes it easier to spot-check a claim against its source.
  3. Lower the temperature setting for tasks where creativity is not the goal, which narrows the model toward its most probable — usually most conservative — completions.
  4. Keep a human in the loop for any output that triggers an action (a refund, an email, an account change), rather than letting the model act autonomously on what it generated.

The mature response to hallucination isn't "make the model stop lying." It's "design the interface so a wrong answer is caught before it does damage."

That reframing — treating AI failure as a UX design problem rather than purely a model-quality problem — is worth internalizing early, because it changes what you specify in a PRD. Instead of writing "the AI should never be wrong," you write acceptance criteria for graceful degradation, confidence signaling, and review checkpoints. We cover exactly how to design those interaction patterns in designing for the UX of AI failure.

Beyond One Call: Retrieval, Chaining, and Agentic Workflows

Most production AI features are not one prompt in, one answer out — they are a chain: retrieve context, call the model, parse the output, maybe call it again, maybe call a tool, then show the user something. Once a system decides its own next step, you have crossed into an agentic workflow.

Our summarizer can illustrate the jump cleanly. Version one is a single call: thread in, summary out. A more ambitious version might retrieve similar tickets (call one), draft a summary (call two), check whether the situation matches an escalation policy (call three), and draft a suggested reply for agent approval (call four) — four calls chained together, each with its own tokens, latency, and hallucination risk, compounding rather than adding.

Why This Changes the Math, Not Just the Architecture

Each additional call in a chain multiplies — not adds — your risk surface. If each step has a 95% chance of behaving correctly, four chained steps only succeed end-to-end about 81% of the time, purely from independent error compounding. Cost and latency stack the same way: four sequential calls are roughly four times the tokens and, if not run in parallel, four times the wait.

This is also where evaluation stops being optional. A single-call feature can sometimes get away with spot-checking outputs by eye. A multi-step agentic workflow needs systematic evals at each hop, because a subtle error introduced at step one silently poisons everything downstream.

Understanding when a feature genuinely needs this architecture — and when it's over-engineering a task a single well-grounded call could handle — is one of the highest-value judgment calls a PM makes on an AI roadmap. We unpack the failure modes, orchestration patterns, and specification approach in full in our complete guide to agentic workflows.

Building the Muscle: Where Prodinja Fits

Reading about tokens, context windows, and trade-offs builds vocabulary. It doesn't, by itself, build the instinct to catch a hallucination risk in your own spec before an engineer has to explain it to you after launch. That instinct tends to come from repetition on real artifacts, not from another slide deck.

Prodinja — currently shipping as an interactive UX prototype — includes an AI-fluency Studio with dedicated modules for Context Engineering, Evals, and Agentic Workflows, alongside its broader Spec Studio and prioritization tools. Rather than lecturing you on the concepts in this guide, the modules are designed to walk you through applying them to a spec you're actually writing.

The bet is that the trade-offs in this article become a habit through hands-on repetition, not by reading one more explainer — including this one.

What to Learn Next: The Fundamentals Map

This guide is the hub. Each concept it introduced has a deeper, standalone treatment if you want to go further on any single piece:

  1. Tokens and billing — start here if the cost side of AI features is the least intuitive part of your job: why tokens, not words, are the unit AI bills you for.
  2. Embeddings and retrieval — go here if you're specifying any feature involving search, similarity, or "find related items": embeddings explained for product managers.
  3. Cost, latency, and quality trade-offs — go here before your next AI PRD review with engineering: the complete trade-off analysis guide.
  4. Designing for failure — go here if your feature can act, send, or change something on a user's behalf: the UX of failure, complete guide.
  5. Chaining calls into agents — go here once a single prompt-and-response is no longer enough for what you're building: the complete guide to agentic workflows.
  6. Grounding it all in the right problem — go here before any of the above, to make sure you're solving a problem worth the token bill: the complete guide to product discovery.

Key Takeaways

  • An LLM is a probabilistic token machine: it predicts the next token from a distribution, not a fixed rule, which is why identical prompts can produce different outputs and why QA needs evaluation sets, not pass/fail tests.
  • Tokens, not words, are the true unit of both processing and billing; a rough rule of thumb is 100 tokens to about 75 English words, but jargon, code, and non-English text push that ratio around.
  • Embeddings turn meaning into comparable numbers, which is the mechanism underneath search, retrieval-augmented generation, and "find similar" features — treat weak source data as a retrieval problem before blaming the model.
  • The context window is a hard ceiling on what a model can see per call, and research like Stanford's "Lost in the Middle" shows content buried in a long context is read less reliably even when it technically fits.
  • Cost and latency scale with tokens and model size, and quality, speed, and cost trade off against each other — pick which corner your feature anchors on deliberately, rather than by default.
  • Hallucination is structural, not a bug; mitigate it with grounding, constrained output, lower temperature, and human review, and design your UX for graceful failure instead of promising zero errors.
  • Chaining multiple calls into an agentic workflow multiplies cost, latency, and error risk at every additional step — reserve it for tasks that genuinely need multi-step decisions.

Frequently Asked Questions

Do I need to learn math or statistics to understand LLMs as a PM?

No — you need the mental model in this guide, not the math. Understanding that an LLM predicts tokens probabilistically, is billed per token, and operates inside a fixed context window gives you everything necessary to scope features, write sane acceptance criteria, and ask engineering the right questions, without ever touching a training algorithm yourself.

What's the actual difference between a token and a word?

A token is a sub-word chunk produced by a model's tokenizer, while a word is a linguistic unit — they frequently don't match. Common English words are often a single token, but rarer words, jargon, code, and non-English scripts routinely split into two or more tokens each, which is why token counts, not word counts, are what determine both context-window usage and your bill.

Why does an AI feature cost so much more to run than a normal software feature?

Because unlike traditional software, where serving one more user costs close to nothing, every AI call has a real, variable marginal cost driven by how many tokens go in and come out. A feature that reads long documents and generates lengthy answers can cost real money per use, and that cost multiplies directly with usage volume — which is why forecasting token spend belongs in the PRD, not just the ops budget after launch.

Can hallucinations be eliminated by just using a smarter, more expensive model?

Not entirely — better models reduce the frequency of hallucination but don't remove the underlying mechanism, since even top-tier models are still predicting the statistically likely next token rather than verifying facts against a database. The reliable fix is architectural: ground answers in retrieved source material, constrain output format, and keep a human in the loop for any action with real consequences, regardless of which model you're running.

What should I read first if I'm completely new to all of this?

Start with this guide for the whole mental model, then go deepest on whichever concept maps to your current feature: tokens and billing if you're worried about cost, embeddings if you're building search or retrieval, and the trade-off analysis guide if you're about to argue with engineering about model choice. Each links out from the sections above so you can go exactly as deep as your roadmap requires.