Skip to content
AI, explained

How an AI answers,
and what it can do.

What to know about language models and agents to use them in medicine.

7-minute read

A language model can connect the elements of a case, suggest leads, prepare documents and find a reference. Understanding how it works helps you examine what it suggests.

1 · The model

A colleague who has read everything, thousands of times.

Imagine a colleague who had read an entire library: textbooks, articles, guidelines, millions of pages. They keep no book on their desk. What they read has become a way of thinking.

Teaching diagram: a real small network, learning before your eyes. Each line is a setting, and each correction moves it a little.

This is a language model. Its reading set billions of connections, called its weights. It has no files to look up: everything it knows lives in those settings.

2 · Learning

Just like in medical school.

Remember medical school: we reread, recited and rewrote until it stuck. Then one day, the answer came on its own.

A model learns the same way, on another scale. That epinephrine is the first-line treatment for anaphylaxis, it has read thousands of times: in textbooks, guidelines, articles, cases. Each reading strengthened the same connections a little more. Today, the question calls up the answer, as it does for an experienced clinician.

The same sentence, read again and again
The first-line treatment for anaphylaxis is an antihistamine.
Read1 time
Its chances of writing the right word6%
Teaching diagram: by rereading the same association, the right answer becomes the most likely, like a notion reviewed a hundred times.

It has also read errors. But an error read once weighs little against what thousands of serious sources repeat. Then experts, including physicians, grade its answers, and it learns to prefer the good ones.

3 · No fatigue

A memory that does not tire.

After the fifteenth admission of the night, our memory slips. Its memory knows neither fatigue nor lack of sleep, and it has read more than any of us will in a lifetime.

20 h0 h4 h8 hThe modelUs
Teaching diagram: over a night shift, fatigue weighs on us, not on its settings.

What it lacks is what you have: the patient in front of you, their exam, their history. That is why it suggests, and you decide.

Support, even at 4 a.m.

4 · How it writes

How it writes an answer.

It splits text into pieces, called tokens.

Example of splitting
The patient has received 1 g ofacetaminophen for the fever.
pneumothoraxepinephrinescaphoid
A common word fits in one token; a long medical word takes several.

Each token becomes an address in a vast space, where words that go together move closer.

The map of meanings
DRUGSepinephrineadrenalinesalbutamolDIAGNOSESanaphylaxisasthmahivestreatstreats
Teaching diagram: epinephrine and adrenaline land in the same place, and the same direction leads from each drug to what it treats. Then the map pulls back: each point is a word, each line a learned association. Farther out, medicine is just one region of everything it has read.

To answer, it writes one word at a time, taking the most likely each time. The most likely is not a roll of the dice: it is what medicine has written most often for a question like yours.

One word at a time
Distal radius fracture, immobilized with a
Teaching diagram: at each step, it weighs the possible words and takes the most likely. Then it starts again, for the next word.

That is also its limit: faced with a rare question, or a practice that has just changed, the most frequent is not always the most accurate.

That is where sources make the difference.

5 · In front of it

It reads what it is shown.

During a conversation, it reads what it is shown: your question, attached documents, what was said before. That is its context window. It is large: it can work with a lot of information at once.

Yesterday’s conversation
What it seesYour questionAn attached PDFWhat was saidThe guideline just read
The chart nobody showed it
Like the chart open on your desk: it reads what is placed there.

Its limit is the edge of the window: what it is not shown, it does not see. That is why AtomicMD starts from your dictation: the case, as you described it, is in front of it.

6 · Memory

A dated memory, an up-to-date reference.

What it knows by heart stops on the day its training ended, like a textbook printed on a given date.

End of trainingWhat it readNever readToday
Each point is a publication. Last month’s trial and this fall’s updated guideline land on the wrong side of the line.

We do the same: we do not memorize every update, we open the reference. That is what Source does: it reads guidelines and articles at the time of the question, even those published last month.

7 · Made-up answers

When it does not know, it fills the gap.

A model does not like silence. Faced with a question whose answer it does not know, it produces what most resembles a good answer: a plausible dose, a study with a credible name, a well-formed reference.

Real
Nielsen et al. Targeted Temperature Management at 33 °C versus 36 °C after Cardiac Arrest. N Engl J Med, 2013.
Confidence of tone
Found
Made up
Tremblay et al. Hypothermia at 33 °C and survival after cardiac arrest. N Engl J Med, 2023.
Confidence of tone
Not found
Same form, same confidence. A search tells them apart.

This is called a hallucination. The risk is known, and sources and checks reduce it. That is Source’s rule: every statement carries its source, every citation is checked against its text, and a figure that no source supports is removed.

8 · The draft

Thinking before answering.

The most recent models write a draft before their answer. They frame the problem, consider several leads, check a calculation, then answer, like a clinician working through a differential before writing the plan.

The draft
  1. 68-year-old woman, dyspnea, leg edema.
  2. Leads: heart failure, embolism, pneumonia.
  3. The chest X-ray and BNP will tell them apart.
  4. Check kidney function before the diuretic.
The answer
Heart failure likely. Chest X-ray and BNP first; creatinine before furosemide.
Like a differential before the plan: it frames the problem, then it answers.

This draft makes them clearly better at a difficult problem. It changes nothing about their memory: what they have not read, they still do not know.

9 · Agents

Agents: it acts, then it reports back.

So far, the model answers. An agent, on the other hand, acts. It is given a goal and tools (search, read a document, calculate, fill out a form), and it chains the steps: it plans, acts, reads the result, adjusts, and starts again until it can report back.

It plansIt actsIt reads the resultIt adjustsTHE GOALa cited answer
The agent’s log
  1. Planslook first for Québec guidelines
  2. Searches“uncomplicated diverticulitis, antibiotics”
  3. ReadsINESSS 2024, pages 4 and 5
  4. Adjustsalso look for randomized trials
  5. ReadsDINAMO, Ann Surg 2021
  6. Checkseach citation against its page
  7. Reports backan answer, every sentence cited
Teaching diagram: a research agent, faced with a question about diverticulitis. It goes around the loop until it can answer, then it reports back.

This is the shift from an assistant that answers to an assistant that does the work.

An agent does the work. You keep the decision.

10 · The engine

The engine and the car.

A language model is the engine: knowledge and reasoning. The big companies build better ones every few months.

AtomicMD is the car built around it, for emergency medicine in Québec: precise instructions for each task, local references, forms and RAMQ billing, and checks.

YouInstructionsLocal referencesChecksEngineNewer
Teaching diagram: the engine changes, after the test. The car and the person at the wheel stay.

AtomicMD is not tied to any one model: when a better engine comes out, we test it on the same course before installing it.

The car stays built for your shift. And you stay at the wheel.

11 · The studies

What the studies measure.

This is no longer a promise: research measures it, and its results point the same way.

Reasoning
Physicians helped by a language model reasoned better on written clinical cases than without that help.
Randomized trials
Documenting
Less time spent documenting, and less burnout, including in a study in the emergency department.
Clinical studies
Comparing
Given the same questions, the big general models did better than AI tools built for medicine.
These studies are about other tools than ours. See the studies

AtomicMD is built on this strength: big general models, and the discipline of searching, reading and citing.

12 · Open book

Closed book, open book.

A model alone takes a closed-book exam: it answers from memory, with no way to check. It can also be given the book: search for the useful documents at the time of the question, have it read them, and ask it to answer from them, citing what it puts forward.

Closed book
The questionIts memoryAn answer
No source to open
Open book
The questionIt searchesA cited answer123
Every sentence can be checked
The difference between remembering an article and rereading it.

That is what Source does.

Six words to remember
Language model
A program trained on vast amounts of text, which writes by predicting the next word.
Weights
The billions of settings learned during training. They are its only memory.
Token
The piece of text it reads and writes: a short word, or part of a long word.
Context
What it has in front of it during a conversation. What is not there, it does not see.
Hallucination
A made-up answer, written with the same confidence as a correct one.
Agent
A model that acts with tools: it searches, reads, checks, then reports back.

An AI that cites is an AI you can check.

See also

So much for the theory.
Now see the tool.