Tutorials / Prompt Engineering with ChatGPT / What a language model is, in plain words

What a language model is, in plain words

11 min read text
Course contents (19 lessons)
  1. Understanding the tool
  2. What a language model is, in plain words
  3. How ChatGPT works from a user's point of view
  4. Building a good prompt
  5. The anatomy of a good prompt
  6. Being specific: how to remove guesswork
  7. Showing examples: few-shot prompting
  8. Asking for step-by-step reasoning
  9. Controlling and improving answers
  10. Controlling length, tone and format
  11. Iterating: how to improve an answer with follow-ups
  12. Custom instructions and memory
  13. Working with files and images
  14. ChatGPT for real tasks
  15. Using ChatGPT for writing: emails, reports and rewrites
  16. Using ChatGPT for studying and learning
  17. Using ChatGPT for coding and technical work
  18. Using ChatGPT for data, spreadsheets and business tasks
  19. Prompt templates
  20. A library of reusable prompt templates
  21. Reliable and safe use
  22. Avoiding hallucinations and checking facts
  23. Privacy and safe use
  24. Workflows and final project
  25. Building repeatable workflows and custom assistants
  26. Final project: build your own prompt toolkit

Start with your phone keyboard

When you type a message on your phone, the keyboard suggests the next word. You type "see you" and it offers "soon", "tomorrow" or "later". It does this because it has learned which words often follow other words.

A language model is the same idea, made much bigger. It has read a huge amount of text: books, articles, websites, code, forum posts. From that text it learned patterns, such as how sentences are built, how a polite email sounds, how a Python function looks, and which facts tend to appear together. When you give it some text, it predicts what text should come next, one small piece at a time. Those small pieces are called tokens. A token is roughly a short word or part of a word.

ChatGPT is a product built on a large language model, and it has been trained further to follow instructions and answer in a helpful way. That extra training is why you can ask it for something and get a useful reply, not just a random continuation.

What it is not

It is useful to be clear about what this thing is not, because most mistakes come from wrong pictures in our heads.

  • It is not a search engine. It does not look up a page and copy the answer. It writes a new answer from patterns it learned. Some versions can also search the web or read files you give them, but that is an extra tool added on top.
  • It is not a database of facts. It does not store "the capital of France" in a row you can query. The fact is spread across its learned patterns, and sometimes the pattern gives a wrong result.
  • It is not a person. It does not have opinions, experiences or memories of its own. It can write like it does, because people write that way in its training text.

Try seeing the prediction yourself

You can see the "next piece of text" behaviour directly. Give the model the start of something and ask it to continue.

Continue this sentence in three different ways, each one short:

"The meeting ran long because"

You will get three different endings. None is "the" correct one. The model has many possible continuations and it picks plausible ones. That is why asking the same question twice can give two different answers. The variation is normal and, for many tasks like brainstorming, it is a feature.

Now try a question with one right answer:

What is 17 multiplied by 24? Show the steps.

Often the model gets this right, especially when it shows the steps. But it is not using a calculator unless the tool has one switched on. It is predicting digits that look right. For long or unusual calculations, this is where it can slip. We will come back to that in the lesson on checking facts.

Why it sounds so confident

The model writes fluent text. Fluent text feels trustworthy. But fluency and truth are different things. The model's job during training was to produce text that looks like real text, not to check that each statement is true. So it can write a perfectly smooth paragraph that contains a made-up detail. People call this a hallucination. It is not lying, because it has no intention. It is producing the most likely-looking words.

Here is a prompt that shows a safer way to ask:

Explain what a mortgage "escrow account" is in simple words.
If you are not sure about any part, say so instead of guessing.

The second line matters. It gives the model permission to say "I am not sure", which reduces the pressure to fill in the gaps. It does not remove errors, but it helps.

What it is good at

Good fitNeeds care
Drafting and rewriting textExact facts, dates, quotes, citations
Explaining ideas at your levelVery recent events
Summarising something you paste inMaths with many steps
Brainstorming optionsLegal, medical and financial decisions
Writing and explaining codeAnything where one wrong detail is costly

The pattern: it is strong when the answer is shaped by language and weak when the answer must be exactly right and you cannot easily check it. Use it as a fast, tireless assistant who is very well read and sometimes wrong. A good colleague, not an oracle.

Why this helps you write better prompts

Once you see the model as a text predictor trained to be helpful, the advice in the rest of this course follows naturally. It only knows what is in the conversation, so you give it the context. It predicts text that fits the pattern you start, so you show it the pattern you want. It tries to please, so you tell it what a good answer looks like. And it can be wrong, so you check.

The common mistake

The biggest beginner mistake is treating the first answer as final and true. The second is the opposite: trying once, getting an average answer, and deciding the tool is useless. Both come from not understanding what it is. Expect a decent first draft that you then guide and check.

Try it yourself

  1. Open ChatGPT and send the "continue this sentence" prompt above. Then press the regenerate option, if your version has one, and compare the results.
  2. Ask it the same factual question about something you know well, such as your hometown or your job. Count how many details are right and how many are off.
  3. Write down one task from your own week that is mostly language (an email, a summary, a plan) and one that must be exactly right (a tax figure, a legal clause). Decide which one you would trust it with first.
text
Continue this sentence in three different ways, each one short:

"The meeting ran long because"

This course is free to read. Create a free account to enrol, save your progress and pick up where you left off.

Sign up free I already have an account