Simone BonviciniAI quiz

Seven cards and a quiz

How much do you know about AI?

The words that come up whenever a company picks or builds something with a language model, each with an example you can play with. Then twelve questions and a score. Nothing is saved.

Go to the quizAbout five minutes in all

01

Tokens

A model doesn’t read words. It reads tokens, which are pieces of text.

A token can be a whole word, part of a word or a punctuation mark. Each model splits text its own way, so the same text doesn’t weigh the same everywhere.

In English a token is about three quarters of a word on average. Italian usually needs more tokens to say the same thing.

In practicePrices and limits are counted in tokens, not in words or pages.

The same sentence in two languages

ThequotearrivesbyFriday.

5 words

6 tokens

An example split: every model has its own.

02

Input, output, context

What you send the model is the input, what it writes is the output. Together they have to fit in the context window.

The input is more than the question: it holds the system instructions, the conversation so far and any attached documents. The context window is the most the model holds in one call, input and output added up.

The model remembers nothing between calls. When a chat seems to remember, it’s the app sending the conversation back with every message.

In practiceInput and output are priced separately, and an output token usually costs several times an input token. A document attached to every question is paid for on every question.

100
8,000

Context window

200,000

  • Instructions3,000
  • Documents60,000
  • Question200
  • Room for the answer8,000

Input 63,200 + Output up to 8,000 = 71,200128,800 tokens free

Estimate: about 600 tokens per page of text, in a sample 200,000-token window.

03

Max tokens

The most tokens the model may write in one answer. It applies to the output, not the input.

At the cap the model stops where it is, even mid-sentence, and the API reports that the answer was cut. The limit doesn’t make the answer shorter or tighter: it cuts it off.

Short answers are asked for in the instructions. Max tokens is there to keep cost and time in check in the worst case.

In practiceYou pay only for what the model actually writes: a high cap costs nothing extra, one that’s too low gives you truncated answers.

Summarise the contract in three points.

Here are the three points. First: delivery is due by 30 March. Second: the late penalty is 0.5% a day, up to

Cut at the limit22 tokens written

22

To keep it simple, one word counts as one token here.

04

Temperature, top-k, top-p

At each step the model gives every possible token a probability, then draws one. These three settings decide which tokens are in the draw and how freely it picks.

Temperature
Divides the model’s scores before they become probabilities. Below 1 the probability gathers on the likeliest tokens, above 1 it spreads out and rare tokens come up more often. At zero the likeliest one nearly always wins.
Top-k
Keeps only the k likeliest tokens and drops the rest. With k set to 1 it always picks the first.
Top-p
Keeps the smallest group of tokens, likeliest first, whose probabilities add up to p. When the model is sure only a few remain, when it’s unsure many do.

After the cuts the remaining probabilities are rescaled to add up to 100, and one is drawn. Here the order is temperature, top-k, top-p; it can differ from one system to another.

In practiceFor extracting data or classifying, keep the temperature low; for more varied writing, raise it. Usually you tune temperature or top-p, not both. Not every API offers top-k.

I take my coffee

  1. black35%
  2. strong26%
  3. hot14%
  4. sweet10%
  5. iced6.3%
  6. weak4.3%
  7. decaf2.8%
  8. Irish1.6%
1.0
8 (all)
1.00

05

Guardrails

The checks around the model: one before it reads the request, one before the answer reaches whoever asked.

On the way in they stop off-topic requests and attempts to get around the rules, known as prompt injection. On the way out they check the answer: personal data, tone, format, promises it mustn’t make. They can be written rules, a classifier or a second model.

An instruction in the prompt helps, but it isn’t a guardrail: the model may not follow it.

In practiceThe strongest defence is still permissions: if the model can’t read a piece of data, no message can make it show it.

Pick a message

  1. Input check stopped

    It tries to get around the rules: the request never reaches the model.

  2. Model skipped

    Never sees the message.

  3. Output check skipped

    Nothing to check.

  4. Reply

    I can’t handle this request. I’ll pass you to someone on the support team.

07

Hallucinations

The model writes the most likely text, not the true one. If it doesn’t have a fact, it can make one up in the same confident tone.

That’s a hallucination. Lowering the temperature doesn’t remove it: it only makes the mistake more repeatable.

What helps is grounding: putting the right documents in the context (that’s what a RAG system does), asking it to cite the passage and to say it doesn’t know when the fact is missing.

In practiceOn a fact that matters, an answer with no source gets checked by a person.

What’s the late-delivery penalty in the contract with Rossi Srl?

The penalty is 2% per week, up to a maximum of 15% of the contract value.

Made up: sounds right, but has no source

Twelve questions

One at a time. After each answer you see why, and at the end your score. Nothing is saved: close the page and it’s gone.

12 questionsabout 3 minutesnothing saved