Generative AI Fundamentals: Tokens, Inference, and Output
Two people use the same generative AI application in Microsoft Foundry. They ask nearly the same question, and both receive fluent, reasonable answers. Yet the wording differs, one answer emphasizes a detail the other barely mentions, and neither response is an exact copy of anything the users recognize.
Is that evidence that one request failed? Not necessarily. To understand what happened, you need a better mental model than a database that looks up a stored answer.
A generative model processes and produces tokens. A token is a unit of information handled by the model. When the input is text, the request is broken into these units rather than treated as one indivisible passage.
The model also produces its response as a sequence of tokens. That matters because the model isn’t simply searching for a complete sentence that matches the user’s request. During inference, it generates an output based on patterns learned during training and the context available for the current request.
Inference is the process of using a trained model to produce an output from an input. For a text generation request, the model evaluates the prompt and the response generated so far, then uses learned patterns to determine plausible tokens that can come next. This continues until the response is complete or reaches another applicable boundary. The result can sound deliberate because the generated tokens form connected language. That fluent language doesn’t turn the model into a person, and it doesn’t prove that every statement in the response is factual.
Probability is an important part of this behavior. The model can have more than one plausible continuation for a request. Two nearly identical prompts can therefore lead to different but still reasonable outputs.
Even when the prompts appear identical to a user, an application may supply other instructions or context that affect the interaction. The useful question isn’t whether every run produces one fixed sentence. It’s whether the observed responses satisfy the workload’s actual requirements.
This separates generative AI from a fixed response table. A system built around approved templates could return the same stored text whenever a particular condition is met. A generative model is useful when the desired output involves producing new language that fits the supplied request and context.
If the business requirement is to return one exact, preapproved statement every time, unconstrained generation may be a poor match. Fluent variation is a capability when variation is acceptable. It becomes a problem when exact wording is the requirement.
Tokens also connect the input to the model’s context. Context is the information available to the model while it handles the request. It can include application instructions, the user’s prompt, and relevant material supplied as part of the interaction.
Context has limits. A model can’t handle an unlimited amount of input and output in one request. That boundary affects how much information the application can provide, how much the model can consider, and how long the resulting output can be.
This doesn’t mean you need to calculate token counts for every conceptual question. It means you should recognize the operational consequence. A long document, several pages of instructions, a detailed user request, and a long expected answer all compete within a limited request. If important information isn’t available in the usable context, you shouldn’t expect the model to apply it merely because someone believes the model must know it.
Now consider a support team that wants a Foundry application to draft replies to customer questions. The team’s requirement is not just to use generative AI. It needs to be stated in terms of input and output.
The input might include the customer’s question and instructions for the kind of reply needed. The desired output might be a concise draft that addresses the question in an appropriate style. The team also needs to identify constraints, such as whether the response must follow particular rules or use exact supplied information.
That requirement points toward a repeatable decision chain. Begin with what goes in. Then state what should come out.
Identify the capability needed to transform the input into that output. Choose an implementation that supports the capability and constraints. Finally, decide what evidence would show that the result works. This four-stage decision pattern is more dependable than memorizing a product name and choosing it whenever a scenario mentions AI.
Prompts are part of that implementation. A system prompt and a user prompt have different roles. The system prompt supplies instructions that shape how the model should behave in the interaction.
The user prompt carries the immediate request from the user. For the support application, the system prompt might establish that responses should be concise and should remain within a defined support purpose. The user prompt then contains the customer’s particular question.
Those two prompt roles shouldn’t be treated as interchangeable. If every user has to repeat the application’s core behavior rules in every request, the implementation isn’t clearly separating application-level guidance from the current task. On the other hand, putting a customer’s changing question into a fixed system instruction would confuse stable guidance with request-specific input. Both can shape the output, but they shape it from different positions in the interaction.
Return to the two users who received different answers. First, compare the actual inputs. Were the user prompts truly identical, or did one contain an extra detail?
Did the application supply the same system prompt and relevant context to both requests? Were both requests sent to the intended model deployment and processing path? A visible prompt alone might not represent everything the model received, so comparing only the text shown in the user interface can miss an important difference.
Next, compare the outputs with the requirement. If both answers correctly address the question, follow the application instructions, and remain within the acceptable form of a draft, variation may be expected rather than defective. If one answer omits a required detail, the problem isn’t simply that the wording differs. The observable failure is that the output doesn’t satisfy the agreed requirement. That gives the team something specific to investigate.
Suppose one response is helpful but too long. The first step shouldn’t be to declare that generative AI is unpredictable and therefore unusable. Check whether the desired length was stated clearly in the prompt instructions.
Confirm that the intended system and user prompts reached the intended deployment. Then repeat the test with representative requests. The evidence you want is not one attractive response. You want to know whether the implementation behaves acceptably for the workload you actually plan to give it.
The same discipline applies when the output contains a confident statement that hasn’t been established as correct. Natural language quality and factual reliability are different observations. A response can be clear, grammatical, and relevant while still making a claim that shouldn’t be trusted without validation. Generative behavior creates plausible output from learned patterns and available context. Plausibility isn’t a certificate of truth.
This is why describing the model as a fact database produces bad decisions. A database lookup suggests that a request identifies a stored record and the system returns that record. A generative model can instead construct a new response token by token. Its wording may resemble patterns encountered during training, but you can’t safely infer that the complete answer was stored as a matching sentence and retrieved for this prompt. The model’s fluent output doesn’t provide evidence for that conclusion.
You can expose the mistaken assumption with a controlled comparison. Give the same deployed model two nearly identical requests that preserve the same meaning. Keep the application instructions and supplied context consistent.
Then compare the outputs. If the wording changes while both responses remain plausible, that observation conflicts with the claim that the system must retrieve one exact stored sentence for every matching request. It supports the more useful interpretation that the model is generating a response from patterns and current context.
That test has limits. It can show that exact repetition isn’t guaranteed in the observed interaction. It can’t prove that every future response will vary, and it can’t prove that every generated statement is correct. It also doesn’t, by itself, tell you why a particular token was selected. Good verification states both what the evidence supports and what remains uncertain.
A second test can focus on prompt roles. Keep the user’s question the same, but correct a missing or unclear application instruction in the system prompt. If the output then follows the intended style or boundary more closely, you have evidence that prompt configuration affected the result. If nothing changes, continue checking the request path, deployment, supplied context, and whether the desired behavior is supported. Don’t keep rewriting prompts blindly when the real problem may be elsewhere in the implementation.
The lowest-complexity useful test is usually the one that changes only what you need to examine. If you’re testing whether a length instruction matters, avoid changing the model, user question, context, and endpoint at the same time. Too many simultaneous changes make the result hard to interpret. A more controlled comparison helps you connect observed behavior to a particular implementation decision, while still acknowledging that probabilistic generation can produce variation.
Verification also needs more than a single happy-path prompt. A support drafting application should be observed with inputs that represent its intended workload. One question may be short and direct.
Another may contain several details or an ambiguous request. The purpose isn’t to demand identical wording. It’s to check whether the generated outputs meet the defined input and output contract often enough and reliably enough for the way people intend to use them. The accepted standard comes from the workload, not from how impressive one demonstration sounds.
This connects technical behavior to human ownership. The model produces the output, but people define what acceptable output means, decide how it will be used, monitor what happens, and respond when evidence shows a problem. Saying that the model decided to be inaccurate doesn’t identify a corrective action. Saying that the observed response omitted a required detail directs attention toward the prompt, context, model capability, integration, or validation process.
For an AI-901 scenario, look for clues about the required transformation. If the input is a natural-language request and the desired output is newly generated language shaped by instructions and context, generative AI may fit. If the requirement is an exact stored response with no acceptable variation, a fixed retrieval or template approach may fit better. The word AI in a scenario doesn’t settle the choice. The required behavior does.
Then look for clues about the prompts. A rule that should guide the interaction generally belongs in the application’s system-level instructions. A person’s immediate question belongs in the user prompt.
The distinction helps you reason about why an output behaved as it did. If a required boundary was never provided to the model, you can’t treat the missing behavior as evidence that the entire capability is wrong. You first need to test a correctly specified interaction.
Context clues matter as well. If the requested answer depends on information that wasn’t supplied in the available context, the model’s confident wording can’t substitute for the missing evidence. If a request attempts to include more input and output than the applicable context permits, the implementation must account for that constraint. The next episode will examine those limits more closely. For now, retain the central point that a model can only process the request within the context available to it.
A strong explanation of the Foundry support scenario can now be stated as one connected decision. The team needs newly generated draft language, so a generative model fits better than a fixed sentence table when reasonable variation is acceptable. The system prompt supplies the application’s continuing instructions, while each user prompt supplies the current support question. The team then evaluates representative outputs against requirements such as relevance, required content, and acceptable form instead of trusting the first fluent answer.
The rejected alternative should be explained too. Treating the model as an exact-answer database fails because the observed output can vary and because fluency doesn’t demonstrate factual retrieval. Treating every difference as a defect also fails because multiple outputs can satisfy the same generative requirement. What matters is whether each output meets the intended contract, not whether every token matches a previous run.
If the evidence conflicts with your prediction, revise the decision rather than protecting the first answer. Confirm the requirement, inspect the prompts and supplied context, verify the model deployment and request path, and run a controlled comparison. Record what changed and what remained uncertain. A successful correction is not merely a better-looking answer. It’s an answer whose improvement can be connected to a defensible change and checked against the workload.
This style of reasoning carries beyond one application. Start with the business need rather than the service name. Classify the capability required, choose an implementation that can provide it, and define observable evidence before declaring success. Responsible use then depends on people continuing to evaluate that evidence instead of transferring ownership to a model because its language sounds confident.
When you encounter an unfamiliar certification scenario, you don’t need to guess what sentence Microsoft wants you to memorize. Identify the input, desired output, instructions, context, and constraints. Ask whether the scenario needs generated language or an exact stored result. Then choose the capability that matches and name a verification step. That explanation shows not only which option fits, but why nearby alternatives don’t.
The two different answers at the beginning can therefore be interpreted without panic or blind trust. Their variation is compatible with probabilistic generation, but that alone doesn’t make either response acceptable. You still compare each answer with the requirement, inspect the context and prompt roles, and validate the behavior across representative requests. The model’s job is generation. The implementation decision and judgment about whether the result is fit for use remain grounded in observable evidence.
A useful mental model begins with tokens, learned patterns, prompts, and the context available during inference. That model explains why two plausible responses can differ and why fluent language isn’t proof that the model retrieved a stored fact. In practice, start with the required input and output, separate continuing system instructions from the user’s immediate request, and decide whether generated variation is acceptable.
Then test what the deployed application actually does. Compare representative outputs with the workload’s requirements, investigate missing context or unclear instructions, and preserve any uncertainty the evidence hasn’t resolved. Generative AI becomes a defensible choice when its capability matches the requirement and its observed behavior is verified, not merely because its first answer sounds convincing.
Before moving on, ask yourself: When two plausible responses differ, what evidence would tell you whether variation is acceptable for the workload? Use the companion episode reference for tokens, inference, learned patterns, probabilistic generation, and acceptable response variation. This lesson was produced by Bare Metal Cyber dot com.