How LLMs work
You don't need any math to use AI tools well, but you do need a working picture of what they are doing. This module gives you that picture, and shows why the same tool can be useful and wrong in the same answer.
Where you already meet AI¶
AI already shows up across veterinary practice: reads on radiographs, flags from lab analysers, and scribes that write up the notes from a consult. This course is about the chat tools, such as Claude, ChatGPT and Gemini. They are built on large language models, or LLMs.
How an LLM answers¶
An LLM writes its answer a small piece at a time. At each step it predicts a likely next word, based on patterns in the very large amount of text it learned from. It is not looking anything up unless a search tool is switched on.
The diagram above shows one of those steps. Pick a prompt and watch it run. The text is cut into pieces called tokens. The model weighs every earlier token, not just the last one, and blends them into a single point. Then it scores every word it knows by how close that word sits to the point, and the closest words get most of the probability.
Run the chocolate prompt, then the sock one. Both sentences end with the vet about to act, yet one leads to vomiting and the other to radiographs. The prediction depends on the whole sentence, so how you word a question changes the answer you get.
Training sets how strongly each word pulls on the prediction. Nothing in that process checks whether an answer is true: the model learns what reads as likely.
How does a model learn those pulls? It starts out making random guesses. It is shown a stretch of real text with the next word hidden, guesses the word, and is nudged so that the right word would have scored a little higher. Repeat that over billions of sentences, from textbooks to forum posts, and the patterns of language settle into the model. No one writes the rules in by hand.
That gives a model that continues text, not an assistant. Ask it about a vomiting dog and it might carry on with more questions, the way a forum thread would. So it is trained again on example conversations, where a good answer follows each question, and then on people's ratings of its replies. That is where the helpful, polite manner comes from. The ratings reward answers people like, which is not always the same as answers that are right.
What follows from that¶
- It has a training cutoff. It can miss recent guidelines and new drugs.
- It can be fluent, confident and wrong. The usual name for this is hallucination.
- It can give different answers to the same question on different days.
- It tends to agree with whoever is asking. A leading question tends to get the answer it leads to.
- It does not remember you between chats, unless a memory feature is switched on.
Why it is still useful¶
It is very good at language work: drafting, summarising, rewording, explaining, and putting messy text into order. Those jobs are where the course spends most of its time.
Try it yourself¶
Open any AI chat tool you have access to. Each test takes a couple of minutes.
- Ask the same clinical question twice, in two new chats. Compare the answers. Where do they differ?
- Ask about something recent, such as a guideline or a drug from the last few months. Does the tool tell you it may not know?
- Ask a leading question, such as "Isn't drug X the best choice here?" Then ask it neutrally: "What are the options, and what are the trade-offs?" Compare the two answers.
Keep what you notice. Module 4 comes back to these habits and turns them into checks you run every time.
The one thing to take away¶
Fluent is not the same as right. The rest of the course is practice at getting the benefit while you stay the one in charge.
Where next
Previous · Course page Using AI in practice
Next · Using AI in practice Module 2: The landscape, and which tool for what
Previous · Course page Building a RAG system
Next · Building a RAG system Module 0: Setup and notebook primer
A shared question channel is on the way. When it opens, each answer will be written once and shared with everyone taking the course.