How Generative AI Works - A Clinician's Guide
Ask a generative AI to write a discharge summary and watch something uncanny happen. In seconds it produces a paragraph that reads exactly like a physician wrote it: the cadence, the hedges, the "patient tolerated the procedure well." Then ask it for the reference supporting a treatment choice and it hands you a citation, authors, journal, year, volume, page numbers, that looks flawless and does not exist. Same tool. Same confidence. One output safe to lean on, one a trap. A clinician does not need to build these models, but you do need a working mental model of how they generate text, because that single piece of understanding explains, all at once, why the tool is so useful, why it lies without knowing it, and exactly where to catch it before it reaches a patient.
The One Thing a Language Model Actually Does
Strip away the branding and a large language model does exactly one thing: it predicts the next chunk of text. Given everything so far, it estimates the most probable next piece, adds it, then repeats, one small step at a time, until the answer is done. That is the whole engine. It is autocomplete that read most of the internet and got frighteningly good at the game. When you type "the patient was started on metformin for type 2," the model does not consult a pharmacology database. It computes that words like "diabetes" are the overwhelmingly likely continuation and writes one. It is playing an extraordinarily sophisticated probability game with language, and it plays it well enough that the output feels like understanding.
Here is the mental image to keep. Imagine the most well-read medical scribe in history, someone who has absorbed millions of notes, textbooks, and forum posts, but who has never examined a patient, never been to your hospital, and has no idea what is true. Ask them to continue any medical sentence and they will produce the most typical, natural-sounding next words, drawn from everything they have ever read. That is your model. Its fluency is a memory of how medical language usually flows. Its danger is that "usually flows" and "is correct for this patient" are not the same thing, and the model cannot tell the difference because it was never built to.
Tokens, the Atoms of the Machine
The model does not think in words or concepts. It works in tokens, small fragments of text, roughly a few characters each, that it strings together by probability. This sounds like trivia until you see why it matters clinically. A model assembling "amlodipine" or "amiodarone" token by token is following statistical paths, not retrieving a specific drug's identity from a verified list. That is one reason it can glide from a real medication to a plausible-looking wrong one, or land on a dose that reads normally but was never in any guideline. It is not recalling a fact. It is completing a pattern, and patterns of text can look right while pointing at the wrong drug.
The two drug names above are worth dwelling on precisely because they share so many letters. To a clinician they are wildly different molecules, a calcium channel blocker and an antiarrhythmic with a fearsome side-effect profile; confuse them and you have a serious error. To a model working in token fragments, they overlap heavily in text and can sit near each other along a probability path, which is exactly why a fluent draft can substitute one for the other while every word around it stays perfectly sensible. The same is true of numbers. A dose of 25 milligrams and a dose of 250 milligrams differ by a decimal to you and by one small token to the machine, and nothing in the mechanism makes the tenfold error feel any less natural to produce than the correct value. This is the deep reason a clinician cannot outsource the drug list, the dose, or the units to the model's confidence: the very thing that makes the prose smooth, working in fragments of text rather than verified facts, is what lets a dangerous swap read as unremarkably as the truth.
Why It Is So Fluent, and Why It Sounds So Confident
The fluency is not an illusion; it is the genuine product of training on a vast amount of human writing, including a great deal of clinical text. The model has effectively internalized the rhythm of a good note, the structure of a patient message, the shape of an argument. This is why it drafts so convincingly, and why it is genuinely useful for the tedious first pass of writing you were going to do anyway. It has read enough discharge summaries to know that "patient tolerated the procedure well" tends to follow a procedure description, enough consult notes to reproduce the hedged, careful cadence of a specialist, enough patient letters to strike a warm and plain register on command. That mastery of form is real and worth using.
But mastery of form is exactly the thing that should keep you alert, because in clinical writing form and correctness usually travel together in a human author and come apart in a model. When a colleague writes a fluent, well-structured note, the fluency is a reasonable proxy for competence, because a distracted or uncertain human tends to write more roughly. The model breaks that link. It can produce the polished form of a confident expert around a completely invented core, because the form and the facts are generated by the same indifferent process and the form does not depend on the facts being right. So the very signals you have spent a career using to gauge whether writing is trustworthy, its structure, its confidence, its clinical idiom, are the signals the model reproduces most reliably and that tell you the least about whether it is correct. You have to consciously stop reading fluency as a proxy for accuracy, because with this instrument it no longer is.
The confidence is the trap, and it is worth understanding where it comes from. The model produces the same smooth, assured prose whether it is on solid ground or completely fabricating, because from the inside there is no difference. It is always doing the identical thing: emitting the most probable next token. There is no separate module that checks a claim against reality, no internal flag that raises when it starts inventing, no tremor in the text. Human experts telegraph uncertainty. They slow down, they hedge, they say "let me look that up." A language model does not, because it does not experience uncertainty about facts; it only ever computes probabilities about words. The result is an instrument that is equally articulate when right and when wrong, which means its tone carries no information about its truth. You cannot listen for the lie. You have to check for it.
A language model is not trying to deceive you. It is trying to sound plausible, and it succeeds just as thoroughly when it is wrong. The confidence is constant. The truth is not.
What a Hallucination Actually Is, Mechanically
The word "hallucination" makes it sound like a glitch, a rare malfunction the next version will fix. It is not a bug. It is the same mechanism that makes the model useful, seen from its bad side. When the model produces a fake citation, it is doing precisely what it does when it produces a real one: generating the most plausible-looking continuation. A citation has a predictable shape, author names, a journal that sounds right, a year, a volume. The model has seen thousands of them and can assemble a brand-new one that fits the pattern perfectly. It does not know that a real reference must correspond to a real paper, because it has no concept of correspondence to reality at all. It has the shape of a citation, and it fills the shape.
This reframing is the most useful thing in the lesson, so sit with it. The model is not sometimes truthful and sometimes hallucinating, as if flipping between two modes. It is always generating plausible text. Sometimes the plausible text happens to match reality, because reality was well represented in its training and the pattern points the right way. Sometimes it does not, and then we call the identical behavior a hallucination. The tool has no idea which just happened. That is why a fabricated lab value, an invented family history, a nonexistent guideline, and a made-up drug interaction all arrive in the same calm, competent voice as the correct material around them. They were produced by the same process, and the process does not distinguish.
This is also why "the newer model hallucinates less, so I can relax" is a dangerous half-truth. Better models do fabricate less often, because more of reality is well represented in their training and their patterns point right more of the time. But less often is not never, and, worse, a lower error rate makes each remaining error harder to catch, because you have been trained by a hundred correct outputs to stop looking. A tool that fabricates one time in fifty is in one sense safer than one that fabricates one time in five, and in another sense more treacherous, because the one-in-fifty error arrives inside a stream of reliability that has quietly lowered your guard. The mechanism guarantees that some fabrication will always remain, and the improving quality of the surrounding prose is precisely what makes the rare fabrication slip through. Your verification habit therefore cannot scale down as the models improve; if anything it has to hold steadier, because the failure is getting quieter, not disappearing.
Where the Risk Spikes
Hallucination is not uniform; it climbs predictably, and knowing the terrain tells you when to tighten your guard. The risk rises when you ask for specifics the model cannot look up: exact doses, precise statistics, citations, numeric lab values, dates. It rises when the true answer is rare or absent in training data, an unusual presentation, a niche drug, your hospital's particular protocol, because the model will still produce a confident answer rather than admit a gap. It rises when you ask it to work from information it was never given, such as summarizing a specific patient's chart it cannot actually see, where it will helpfully fill the void with what such a chart typically contains. And it rises with leading prompts: ask "what are the three studies proving this," and it will manufacture three, because you told it they exist and it obliges the pattern.
Why the Same Question Can Give You Two Different Answers
Here is an experience that unsettles clinicians the first time they notice it. Ask the model the identical question twice and you may get two different answers, sometimes subtly, sometimes materially. A lab test result recalls the same value every time; a generative model does not, and understanding why matters for how much you can lean on it. The model does not pick the single most probable next token every time. It samples from a distribution of likely next tokens, with a setting often called temperature governing how adventurous that sampling is. Turn it down and the output is more repetitive and cautious; turn it up and it is more varied and creative. Either way, there is an element of chance baked into the generation, which is why the tool feels a little different on each run.
For a clinician this has a concrete implication. A generative model is not a reference source that returns a stable, authoritative answer. It is a probabilistic writer that produces one plausible version of an answer this time and might produce a different plausible version next time. If a fact were truly settled and verifiable, you would not expect it to wobble between runs. The wobble itself is a quiet signal that you are dealing with generation, not retrieval, and that a specific claim deserves an external check rather than repeated asking. Asking the model the same thing three times until it agrees with itself is not verification. It is three samples from the same imperfect distribution, and three fabrications can agree.
What the Model Cannot See: Context and Memory
Two more limits shape everyday use, and both surprise people who assume the model is a knowledgeable colleague sitting beside them. The first is that the model only knows what is in front of it right now, its context window, the span of text it can hold at once, plus whatever fuzzy patterns it absorbed in training. It does not have live access to your EHR, this morning's labs, or the patient's actual chart unless that information is explicitly placed into the conversation. When a tool appears to "know" a patient, it is because a system quietly fed the record in behind the scenes, and the quality of that feed determines the quality of the output. Ask a bare model to summarize a patient it was never given and it will not say "I do not have that." It will generate a summary of a plausible patient, which is a fabrication wearing the costume of a chart note.
The second limit is memory, or rather the lack of it. A model does not durably remember your last conversation unless the system is built to carry that context forward, and its training has a cutoff date, so its background knowledge is frozen at some point in the past. A guideline that changed last quarter may not be reflected at all. This is why the safest clinical uses feed the model the current, specific, local material it needs in the moment rather than trusting it to already hold it. The pattern that keeps recurring, and that later levels turn into real systems, is the same one every time: do not ask the model to know; give the model what it needs to work from, then verify what it produced.
The training cutoff deserves a clinician's particular attention because medicine moves and the model does not. A dosing recommendation that was standard when the model was trained may have been revised after a trial read out; a drug may have gained a boxed warning; a screening interval may have shifted. The model has no way to know any of this has happened and no signal that its answer is stale, so it will state the outdated guidance in the same assured voice it uses for everything else. Recency is invisible to it. This is one more reason the safe pattern is to supply the current source rather than to quiz the model's memory: when you paste in this quarter's protocol, you are not just grounding the wording, you are overriding a frozen knowledge base with live material the model would otherwise never reach. The habit that protects you is small and mechanical. If the answer depends on what is true now, the "now" has to come from you, not from the model's recollection of a world that has since changed.
A Worked Example: The Two Outputs
A hospitalist is preparing to counsel a patient and asks a generative tool two questions. First: "Rewrite this in plain language: your ejection fraction is reduced and we are starting a beta-blocker and an ARNI to protect the heart." The model returns a warm, clear, accurate paragraph a patient can understand. This is the tool at its best. The task played entirely to its strength, restating known content in a more natural register, and there was nothing to invent. The hospitalist reads it, sees it is faithful, and uses it. Verification took ten seconds because the source was right there to compare against.
Then the hospitalist asks the second question: "What is the mortality benefit of ARNI over ACE inhibitor in this population, with the citation." The model responds instantly and precisely: a specific relative risk reduction, a named landmark trial, authors, a journal, a year. It looks authoritative. And this is the moment the whole lesson exists for. The number might be roughly right, roughly wrong, or invented, and the citation might be real, subtly garbled, or wholesale fiction, and there is no way to tell from the output, because it is delivered in the identical confident voice as the plain-language paragraph that was perfectly fine. The task quietly crossed the line: from restating given content to asserting a specific external fact the model cannot verify. The informed hospitalist treats the first output as a usable draft and the second as an unverified claim to confirm against a trusted source before a single word of it informs care. Same tool, same session, same confidence, two completely different levels of trust, and the skill is knowing which is which in real time.
What This Means for How You Use It, at the Bedside
Understanding the mechanism converts into a handful of durable habits, and they are not burdensome once you see why each exists. Lean on the model hardest when the task is transformation of content you already have: summarize this note, rewrite this in plainer language, restructure these findings, draft a first version of this letter. Here the raw material is present, the model is reshaping rather than inventing, and you can verify by comparing output to source. Guard hardest when the task is generation of specific external facts: doses, statistics, citations, drug interactions, guideline details, anything numeric or verifiable. Here the model is most likely to fill a gap with a confident fabrication, and the cost of being wrong is highest.
Two further habits follow directly from the mechanism. First, give the model the source rather than asking it to recall. If you want it to work from a guideline, paste the guideline in, because a model reasoning from text you provided is far safer than a model reciting from a foggy memory of its training. This single move, grounding the model in real material, is the backbone of nearly every safe clinical AI workflow, and later levels build entire systems on it. Second, never let the model's fluency substitute for a source you can check. A specific claim that matters to a patient needs a real reference you actually verify, not the model's beautifully formatted assurance that one exists. The elegance of the output is not evidence. It is style, and style is exactly what the machine is best at.
It helps to notice that grounding is not a single on-off switch but a spectrum, and where a task sits on it predicts how hard you have to look. At the safe end, everything the model needs is in the prompt and the answer is a rearrangement of it: rewrite this paragraph, tighten this note. In the middle, the model draws partly on provided material and partly on its trained patterns, which is where a subtle drift can creep in, a plausible elaboration that was not in your source but sounds like it belongs. At the dangerous end, the model is working from nothing you gave it, reciting a dose or a statistic or a citation from its foggy internal memory, and here confident fabrication is not a risk but the expected behavior when the true answer is thin in its training. The practical move is to ask, before you trust an output, "where on this spectrum did that come from," and to route your scrutiny accordingly: light for pure transformation, heavy for pure recall.
None of this requires you to become an engineer, and none of it should make you abandon a tool that is genuinely giving clinicians their evenings back. The point is calibration, the same calibration you already apply to every other instrument in medicine. You trust a blood pressure cuff for a trend and confirm a shocking reading manually. You trust a consultant's summary and still read the key study yourself before you bet a patient on it. A generative model earns exactly that kind of trust: real weight on the tasks it is built for, a firm hand on the tasks where it invents.
Carry one sentence out of this lesson and let it run in the background whenever you use these tools. When the model is reshaping something you gave it, you are on solid ground, and your job is a quick comparison to the source. When the model is asserting something you did not give it, a dose, a statistic, a citation, a fact about a specific patient, you are on soft ground, and your job is to verify before it touches care. That single distinction, transformation versus assertion, is the whole mechanism translated into a habit, and it will keep you and your patients safe long after any particular model or vendor has been replaced by the next one. The technology will keep changing. The discipline does not.
Key Takeaways
- A large language model does one thing: it predicts the next chunk of text, token by token, choosing the most probable continuation. Its fluency is a memory of how language usually flows, not an understanding of what is true.
- The model works in tokens, statistical fragments, not verified facts, which is why it can glide from a real drug or dose to a plausible wrong one while sounding identical.
- Confidence carries no information about truth. The model emits the same assured prose whether grounded or fabricating, because there is no internal fact-checker and no tremor when it invents. You cannot hear the lie; you must check for it.
- A hallucination is not a bug. It is the same next-token mechanism producing plausible text that happens not to match reality, delivered in the same calm voice as the correct material.
- Risk spikes when you ask for specifics the model cannot look up (doses, statistics, citations, lab values), for rare or local knowledge, for facts about data it cannot actually see, or when you lead it toward an answer.
- Trust the model most on transformation of content you already have (summarize, rewrite, restructure), where you can verify against the source. Trust it least on generation of specific external facts.
- Ground the model in real source material instead of asking it to recall, and never let fluent formatting stand in for a citation you actually verify.
- The elegance of the output is style, not evidence, and style is precisely what the machine is best at producing whether or not it is right.
Skill.re