How Large Language Models Learn

CSTTP Virtual Lab, Estevan and Ocean Man together. Build a tiny language model, see how the big ones are trained, and talk through what this means for our projects.

Part 1 ?? 10 minutes

An LLM guesses the next word

ChatGPT, Copilot and Claude all do one thing over and over: look at the text so far and guess what comes next. Then they add that guess and guess again. That is the whole trick, done with billions of examples.

Try it as a class. What comes next?

  • "The hockey game starts at 7 ___"
  • "Thank you for ___"
  • "Pancake breakfast at the community ___"

You guessed from everything you have read and heard before. A model does the same thing, but its "before" is its training data.

Part 2 ?? 30 minutes ?? hands on

Train your own tiny model

This model learns by counting which word follows which in the training text. Real LLMs are far more complex, but the core idea is the same: patterns in the data become predictions.

Not trained yet.
See the tokens the model learned from

Real LLMs split text into word pieces, not whole words. A word they rarely saw gets chopped into many small pieces, which is one reason they struggle with languages that are rare online.

Click a prediction to keep going.

Let it write

Press it a few times. Same model, different rolls of the dice.

Experiments to run
  1. Ask what comes after a word that is not in the training data, like "moose". What happens?
  2. Load the kitchen talk and train again. Ask after "the" now. Why did the answers change?
  3. Add three sentences of your own about Estevan or Ocean Man events and retrain. Can the model now write about them?
  4. Delete one of your sentences. Does the old model forget it, or do you have to train again?
Part 3 ?? 15 minutes

How the big ones are trained

StageWhat happensWhat it means for us
1. PretrainingThe model reads a huge pile of text, mostly from the internet and books, and learns to predict the next word piece. This takes months and costs millions of dollars.The model only knows what was in that pile. Languages with little text online, like Nakoda, barely show up.
2. Fine tuningA trained model gets extra training on a smaller, focused set of examples, like questions and good answers.This is how a model could be taught a specific skill or style using our own data. It changes the model itself.
3. FeedbackPeople rate answers, and the model is nudged toward the ones people prefer.Who gives the feedback shapes how the model behaves.
4. UseWe type a prompt and the model predicts its answer word by word.It can sound sure and still be wrong. Someone who knows the topic needs to check.
Part 4 ?? 15 minutes

Teaching a model Nakoda: two ways

The Ocean Man project idea is to scan Nakoda textbooks (with permission), use AI to help build a word database, and have Elders and Knowledge Keepers check the results. There are two main ways to bring the textbooks to a model.

Fine tuning

Train the model further on the textbook text so the patterns become part of the model.

  • The knowledge is baked in. It can't be pulled back out of the model.
  • Needs a lot of good examples. A few textbooks is not much.
  • Mistakes are harder to trace back to a source.

Look up (RAG)

Keep the textbook text in a database. The model searches it and quotes from it when answering.

  • The community can remove or restrict a page at any time.
  • Answers can point to the page they came from.
  • This is where our SQL and database skills come in.

Either way, the model runs on college computers, not a cloud service, unless Ocean Man agrees otherwise. And either way, Elders and Knowledge Keepers decide what is right.

Part 5 ?? 15 minutes

Who owns it?

Part 6 ?? 20 minutes

AI across our projects

Nakoda language (Ocean Man)

AI helps turn scanned textbooks into a searchable word database and learning tools. Elders and Knowledge Keepers check every entry. The community controls the data.

Community Calendar (Discover Estevan)

AI checks event posts before they go live: a missing date, a time that makes no sense, no link to a source. A person still approves each event.

Dispatch analytics (IDS)

Dispatch data is confidential, so AI models run on our own computers instead of a cloud service. Dananji's research looks at what the data can predict to help dispatch work.

Rural health care (KCCH)

AI could help sort interview notes into common themes about why health staff stay or leave. Notes have names removed, stay on secure college systems, and AI never scores or judges a person.

Talk it through in your group
  1. What data would the AI need for your project, and who owns it?
  2. What could go wrong if the AI is confidently wrong?
  3. Who checks the AI's work, and how?
  4. Should it run on our own computers or a cloud service? Why?