What is an LLM and how does it work in simple words?
An LLM (large language model) is a neural network trained on large amounts of text to predict the next token. It picks the most plausible continuation instead of checking facts, so a missing fact gets filled with a typical answer. Its knowledge stops at training time, the model keeps nothing between chats (app memory re-adds saved notes to the context), and temperature affects answer variety.
QA Fundamentals · AI in testing
An AI confidently answered about "our" API field that we never showed it. Where did the answer come from?
A colleague asks a chat assistant why the fee field in an API response is sometimes zero. The assistant writes a smooth answer with an explanation, an internal service name and a charging rule. The assistant had none of these things: it saw neither the specification nor the code. This lesson is about what an LLM actually does, why its answer sounds convincing even without knowledge, and what follows for QA.
How it works and why. An LLM (large language model) is trained on a large amount of text to predict the next token. A token is a piece of text: a word, part of a word or a punctuation mark, so one word can cost several tokens. At run time (inference) the model receives the context and computes probabilities for the possible next tokens. The program picks one, appends it to the text and repeats the step. The temperature parameter steers the pick: the higher it is, the more willingly less probable options are chosen, and the wider the spread of answers.
How an LLM builds an answer
Three practical consequences follow from this picture. First. Everything the model "sees" when it answers is the context window: the application's system instructions, the chat history, the pasted files. Between separate chats the model itself remembers nothing: what looks like memory is text the application put back into the context. Second. The model's knowledge is "frozen" at training time. Fresh library versions, yesterday's release or your requirements are known only if they are pasted into the context or the model is given a search tool or access to documents. Third. The model is optimised for the plausibility of a continuation, not for truth, so without the needed fact in the context it fills the gap with the most typical option (the consequences are in the lesson about hallucinations).
Example: one question with and without context. A made-up example that shows the mechanism (the answers are shortened, this is an illustration, not a log):
Request 1 (no context):
How many decimal places does a transfer amount allow?
-> the model answers "typically 2", because that is common
Request 2 (with context):
Requirement PAY-142: "The amount is given to the cent, extra
decimal places are rejected".
How many decimal places does a transfer amount allow?
-> the model relies on the pasted text: 2, extras are rejected
In the first case the answer looks right, because 2 places really are typical, but it rests on nothing: your system may allow 3 places or use another rounding rule. In the second case the model answers from the supplied text, and the answer can be checked against the source. The mechanism is the same, only the context differs. So the practical rule for QA: ask the model about your own product only together with the requirement text, a schema or a log, and ask it to name the fragment it relies on.
Limits and alternatives. The context window has a limit: a very long document will not fit, and in a long text details can get lost, so large requirements are better given in parts, with a request to quote. A model does not guarantee exact calculations or counting characters or lines: it is more reliable to let it run code or to count yourself. Applications extend the base model: web search, access to internal documents (RAG: relevant fragments are first retrieved from a store, then added to the context), tool calls. This reduces made-up answers but does not remove them, because the model can still retell what it found inaccurately. For QA it matters to know which mode a tool is in: a "bare" model or a model with access to sources.
Common mistakes.
- Treating an LLM as a knowledge base or a search engine: it generates text rather than retrieving a record, so "looking up a fact" without a source is unreliable.
- Asking about your own product without the requirements in the context: the answer will be plausible for a "typical" product, not yours.
- Assuming yesterday's chat "remembers" agreements: a new chat does not have these rules in its context unless the app inserts them itself (memory, project instructions), so they have to be pasted again.
- Expecting the same answer twice and calling the difference a tool bug: token choice is probabilistic. A lower temperature reduces the spread but does not guarantee identical text.
- Trusting a confident tone: a smooth style is not a signal of correctness.
Check yourself
A colleague pasted only the test code and asked what the maximum transfer amount in the product is. The model answered "10,000 UAH". Why can this answer not be trusted, and what should be added to the request?
Answer
The limit is not in the test code, so the model most likely guessed a typical value. Add the requirement or the specification where the limit is written, and ask the model to quote the line it relies on. Then the answer can be checked against the source.
The model worded the same question differently twice. Is that a defect?
Answer
No, it is expected: the next token is picked from a probability distribution. A defect would be a different substance (different facts or numbers). For checks of such text you compare properties of the answer, not an exact string.
Yesterday you agreed on a test case format with the assistant, today in a new chat it ignores it. What happened?
Answer
The model does not keep history between chats: yesterday the format was part of the context, today it is not there. Paste the agreement at the start of the chat or keep it as a template or a system instruction.