Skip to content

Mathematical reading skills

  • Lesson 1
  • 45 min
  • Module 1: Numbers, notation and data summaries
Lesson 1 of 18 · Essential Mathematics and Statistics for AIMathematical reading skills

What you will be able to do

Read the numbers and symbols in AI documents correctly: a model card, a table of results, a training log, a formula. Most mistakes with AI numbers are reading mistakes, not calculation mistakes.

Before you startWhat to know and to have readyAbout 45 minutes

What you need to know

  • No earlier course or lesson. You need school arithmetic: add, multiply and divide.

What you need to have ready

  • A calculator. A phone calculator is enough. Step 7 of the guided practice uses its eˣ key, and Logarithms of probabilities uses its ln key.
  • A text file with the name c03-notes.md, in any folder that you can find again. Make it now. You write your answers in this file for the whole course. Give each lesson a heading with the lesson’s name, for example ## Reading skills.

Every lesson in this course uses one fictional company. Larkfield is an online shop for home and garden products. Each customer message becomes a ticket, and about 1,200 tickets arrive each week. Five teams handle them: returns, delivery, payment, warranty and account. Larkfield is building AI that suggests a team and a priority for each new ticket.

You meet five people:

Name Role What they do in this course
Priya Data scientist Measures and explains the numbers
Tomás AI engineer Builds and trains the models, and wants to release them quickly
Grace Support lead Knows the tickets, and asks what a number means for her team
Omar Product manager Decides, and asks about cost and risk
Mei Data engineer Knows where the data comes from and how the team collected it

Tickets have IDs such as T-2041. Costs are in minutes of work or in cost points, not in money.

Before the team uses a model, somebody reads its numbers. These are typical places:

  • A model card. A short document that describes a model: what it does, how the team tested it, and the results. It says “accuracy 0.91” or “error rate 9%”.
  • A training log. Each line reports progress: epoch 12 loss 0.0841 lr 1e-3. You must read 1e-3 and know if 0.0841 is good.
  • A release note. “The new model improves accuracy by 2%.” Two percent of what?
  • A formula in documentation. A page about a metric shows 1n∑i=1nxi\frac{1}{n}\sum_{i=1}^{n} x_i and expects you to read it.

This lesson teaches you to read all four. Here is the model card that Priya uses in the worked example later:

Ticket team classifier, model A
Test set 300 tickets with a known correct team
Accuracy 0.91 (273 / 300)
Log loss 0.29
Learning rate 1e-3
Training steps 2.4 × 10⁴
Embedding size 384
Latency p95 180 ms

Some words in it are new. You learn each one below, or in a later lesson that the text names.

Model A gave the correct team for 273 of the 300 test tickets. You can write this in three ways:

Form Value How to get it
Fraction 273 / 300 correct tickets ÷ all tickets
Decimal 0.91 do the division
Percentage 91% multiply the decimal by 100

All three say the same thing. Accuracy is the share of test tickets where the model’s answer is correct. A model card often writes it as a decimal (0.91), and a slide writes it as a percentage (91%).

The most important part of a fraction is the bottom number: of how many? “91% accurate” on 30 tickets and on 3,000 tickets are not equally strong results. Always find the bottom number before you trust a percentage. Module 5 shows how much a result on 300 tickets can change by chance.

A useful habit: turn a percentage back into counts. 9% wrong on 300 tickets is 27 tickets, and on 1,200 tickets a week it is 108 tickets. Grace understands “108 tickets a week go to the wrong team” better than “9% error”.

A model improves from 90% to 95% accuracy. How much better is it? There are two correct answers, and they measure different things.

  • Percentage points measure the difference between two percentages: 95 − 90 = 5 percentage points.
  • Percent (a relative change) measures the change compared with the old value. Look at the errors: 10% wrong becomes 5% wrong. That is 50% fewer errors, because the errors are cut in half.
A change of 5 percentage points in accuracy halves the number of wrong answers.
Text description of the chart

Two columns. A model with 90% accuracy gives 100 wrong answers per 1,000 tickets. A model with 95% accuracy gives 50 wrong answers per 1,000 tickets. The second column is half the height of the first.

The rule for a relative change is: the change, divided by the old value. In words: “new minus old, divided by old”.

relative change=new−oldold=5%−10%10%=−0.5=−50%\text{relative change} = \frac{\text{new} - \text{old}}{\text{old}} = \frac{5\% - 10\%}{10\%} = -0.5 = -50\%

Near 100%, a small number of points is a large change in errors. From 98% to 99% accuracy is only 1 point, but it halves the errors. This is why AI teams often report the error rate (the share of wrong answers) as well as accuracy.

AI numbers are often very large or very small. A power of ten is a short way to write them. The small number above the 10 says how many times you multiply by 10, or divide by 10 if it is negative.

Power Written in full In code Where you see it
10³ 1,000 1e3 1,000 tickets in a test set
10⁴ 10,000 1e4 training steps
10⁹ 1,000,000,000 1e9 a model with “1B” (one billion) parameters
10⁻¹ 0.1 1e-1 a large learning rate
10⁻³ 0.001 1e-3 a common learning rate
10⁻⁵ 0.00001 1e-5 a small learning rate

In code and in logs, e means “times ten to the power”. So 2.4e4 is 2.4 × 10⁴ = 24,000, and 3e-4 is 3 × 10⁻⁴ = 0.0003. The learning rate is the size of each training step. Module 4 explains it. For now, read it as a small number.

To compare two powers of ten, count the steps between them. A learning rate of 1e-2 is 10 × 10 = 100 times larger than 1e-4, because the powers differ by 2.

A logarithm answers the opposite question: how many times must you multiply 10 to get this number? The logarithm (base 10) of 1,000 is 3, because 10 × 10 × 10 = 1,000. Write it as log⁡101000=3\log_{10} 1000 = 3, and read it as “log base ten of a thousand is three”.

Number 0.001 0.01 0.1 1 10 100 1,000
log₁₀ −3 −2 −1 0 1 2 3

Each step to the right multiplies the number by 10, and adds 1 to the logarithm. So a logarithm turns “times 10” into “plus 1”.

This is the reason why charts in AI often use a log axis. On a log axis, each gridline is 10 times the one below. So 0.001, 0.01, 0.1 and 1 are the same distance apart. Small values that a normal axis squeezes against zero get room on the chart.

Tomás trains the ticket classifier twice, with two different settings, for 40 epochs each. An epoch is one pass through all the training data. The loss is a number that measures how wrong the model is on the training data; lower is better. Module 4 explains loss in detail.

Explore

The same two training runs on two kinds of axis

Run A at the end
0.05
Run B at the end
0.00379
Run A ÷ Run B
13.2 times

Linear axis: equal steps of 0.5. After epoch 15, both lines lie on the floor of the chart, so the runs look the same.

  • Run A
  • Run B
00.511.522.5Training loss010203040EpochRun ARun ARun BRun B
00.511.522.5Training loss010203040EpochRun ARun ARun BRun B
On a linear axis, both runs look finished after about 15 epochs. On a log axis, run B is still improving at epoch 40, and its loss ends about 13 times lower.
Text description of the explorer

A line chart of training loss for epochs 0 to 40, for two runs. Both runs start at a loss of 2.3 and fall fast in the first 10 epochs. At epoch 10, the loss is 0.13 for run A and 0.10 for run B. At epoch 20, it is 0.053 for run A and 0.014 for run B. At epoch 40, it is 0.050 for run A and 0.0038 for run B, about 13 times lower. On the linear axis, from 0 to 2.5, both lines look flat and equal after epoch 15. On the log axis, from 0.001 to 10, run A is flat at 0.05. Run B continues to go down.

What a linear axis hides: after the first fast drop, all later progress looks like nothing. If Tomás looks only at the linear chart, he can stop run B too early, or think that the two settings are equal.

The second place you meet logarithms is with probabilities. A probability is a number from 0 to 1 that says how likely something is: 0 is “never”, 1 is “certain”. A classifier gives a probability for each team, for example 0.75 for “payment”.

Here, AI tools use the natural logarithm, written ln. It counts factors of a special number, e ≈ 2.718, instead of factors of 10. The idea is the same: it turns multiplication into addition. You do not need to calculate it by hand; use the ln key on a calculator.

Training often makes a number called the log loss as small as possible. For one ticket, the log loss is −ln⁡p-\ln p, where p is the probability that the model gave to the correct team. Read it as “minus the natural log of p”.

Probability for the correct team, p 0.99 0.9 0.75 0.5 0.1 0.01
Log loss, −ln p 0.01 0.105 0.288 0.693 2.303 4.605

Read the table from left to right. A confident correct answer (0.99) costs almost nothing. A confident wrong answer (0.01 for the correct team) costs a lot. Each time p gets 10 times smaller, the loss goes up by the same amount, 2.303.

Now you can read the model card. A log loss of 0.29 is the same as giving the correct team a probability of about 0.75 on every ticket. Language models report the same idea for each word or part of a word that they predict.

Logarithms also prevent a practical problem. A language model gives a probability to each word of a sentence. Suppose that 20 words each have a probability of 0.5. The probability of the sentence is 0.5 multiplied 20 times: 0.00000095. A computer can lose precision with such small numbers. The logarithm of that product is a sum instead: 20 × ln 0.5 = 20 × (−0.693) = −13.9. So AI tools add log-probabilities instead of multiplying probabilities.

Run Python in your browser

Optional: check the log values

This box is optional. It prints the log loss table above, then the 20-word example. In Python, math.log is the natural logarithm, ln. Change one probability and predict the new loss before you run it.

Formulas in AI documentation often use the Greek capital letter sigma, Σ. It means “add up”. Start with four tickets and their first-reply times in minutes:

i (position) 1 2 3 4
Ticket T-2041 T-2042 T-2043 T-2044
Minutes, xᵢ 12 15 18 18

The letter x is the list of values, and the small i below it says which one. So x₁ = 12 and x₃ = 18. The sum of all four is:

∑i=14xi=x1+x2+x3+x4=12+15+18+18=63\sum_{i=1}^{4} x_i = x_1 + x_2 + x_3 + x_4 = 12 + 15 + 18 + 18 = 63

Read it aloud as: “the sum of x-i, for i from 1 to 4”. The number under the Σ is where you start; the number on top is where you stop. When the list has n values, the top number is n.

Now you can read the formula from the start of this lesson:

1n∑i=1nxi\frac{1}{n}\sum_{i=1}^{n} x_i

In words: “add up all the values, then divide by how many there are”. For the four tickets: 63 ÷ 4 = 15.75 minutes. This is the mean, and the next lesson uses it on all 12 tickets.

A formula in documentation is a sentence. Read each part aloud, then say what it does in plain words. If you cannot say it in words, you do not yet know what the number means.

A unit says what a number counts: minutes, tickets, milliseconds, cost points. A number without a unit is a guess.

  • Write the unit every time. “Reply time 23” can be minutes or hours.
  • Convert before you compare. Latency (the time that a model takes to answer) of 180 ms is 0.18 seconds. One second is 1,000 milliseconds (ms).
  • Check the unit of a result. Units multiply and divide like numbers. 1,200 tickets per week × 6 minutes per ticket = 7,200 minutes per week. Divide by 60 minutes per hour: 120 hours of work per week.
  • Watch “per”. An error rate per ticket and per week are very different numbers.

The unit check catches many errors. If your answer for “how many hours” ends in “tickets”, a step is wrong.

Worked example: Priya reads the model card

Section titled “Worked example: Priya reads the model card”

Omar must decide if model A is good enough to test with Grace’s team. He asks Priya to explain the model card in plain words. She reads each line aloud, then translates it.

Line on the card Read aloud In plain words
Accuracy 0.91 (273 / 300) “zero point nine one, 273 of 300” The team was correct for 91 of 100 test tickets. 27 of the 300 were wrong. At 1,200 tickets a week, that is about 108 wrong tickets a week.
Log loss 0.29 “log loss zero point two nine” Lower is better. It is the same as a probability of about 0.75 for the correct team on each ticket.
Learning rate 1e-3 “one e minus three” 0.001. A setting for training. It does not tell Omar how good the model is.
Training steps 2.4 × 10⁴ “two point four times ten to the four” 24,000 steps. Also a training detail.
Embedding size 384 “three hundred eighty-four” The model turns each ticket into a list of 384 numbers. Module 2 explains this.
Latency p95 180 ms “p ninety-five, 180 milliseconds” 95 of 100 answers arrive in 0.18 seconds or less. The next lesson explains p95.

Priya adds one sentence: “Only two lines tell you about quality: accuracy and log loss. The other lines are about how Tomás made the model, and how fast it is.” Omar now knows which numbers to compare when Tomás brings model B.

Tomás brings the card for model B. It used the same 300 test tickets.

Ticket team classifier, model B
Accuracy 0.92 (276 / 300)
Log loss 0.25
Learning rate 3e-4
Latency p95 0.45 s
  1. In c03-notes.md, add the heading ## Model cards.
  2. Write the accuracy of model B as a fraction, a decimal and a percentage. Then write the number of wrong tickets out of 300.
  3. Write the difference in accuracy between A and B in percentage points.
  4. Count the wrong tickets for A and for B. Calculate the relative change in wrong tickets, in percent.
  5. Write the learning rate of model B as a decimal.
  6. Convert the latency of model B to milliseconds. Compare it with model A: how many times slower is it?
  7. Estimate the probability that matches a log loss of 0.25. On a calculator, calculate e to the power −0.25 (the eˣ key).

Check: after step 4, your relative change is negative, because the number of errors went down.

Show the example answer
  1. 276 / 300 = 0.92 = 92%. Wrong: 300 − 276 = 24 tickets.
  2. 92% − 91% = 1 percentage point.
  3. A: 27 wrong. B: 24 wrong. Relative change: (24 − 27) ÷ 27 = −3 ÷ 27 = −0.111, or about 11% fewer errors.
  4. 3e-4 = 3 × 0.0001 = 0.0003.
  5. 0.45 s × 1,000 = 450 ms. 450 ÷ 180 = 2.5 times slower than model A.
  6. e to the power −0.25 ≈ 0.78. So model B gives the correct team a probability of about 0.78 on a typical ticket, compared with about 0.75 for model A.

A one-point difference is only 3 tickets out of 300. Module 5 asks if 3 tickets are enough to say that B is better.

Independent variation: a card in a different form

Section titled “Independent variation: a card in a different form”

A third model, C, has a card that uses different forms:

Ticket team classifier, model C
Error rate 7.5% on 400 test tickets
Latency p95 200 ms

In your notes, convert the card into the same form as cards A and B. Write the accuracy as a decimal, the counts of correct and wrong tickets, and the latency in seconds. Then write one sentence: can you compare C with A and B directly? Why or why not?

Show the example answer

Accuracy: 1 − 0.075 = 0.925. Wrong tickets: 0.075 × 400 = 30. Correct: 400 − 30 = 370. Latency: 200 ms = 0.2 s.

Not directly. The team tested model C on 400 different tickets. If those tickets were easier or harder, the accuracy changes for that reason alone. To compare models fairly, test them on the same tickets.

Common mistake

Percent where you mean percentage points

Symptom: Tomás writes in a release note: “Recall for urgent tickets improved by 5%.” Omar reads it as a small change and does not tell Grace. But recall went from 80% to 85%. (Recall is the share of the real urgent tickets that the model finds; Module 6 defines it.)

Cause: “5%” can mean two things. Here, it is 5 percentage points. As a relative change, it is (85 − 80) ÷ 80 = 6.25%. The change in missed urgent tickets is larger: 20% missed became 15% missed, which is 25% fewer missed urgent tickets. For Grace, that is the number that matters.

Fix: write “points” for a difference between two percentages, and “percent” only for a relative change. Better, give both values and the counts: “Recall went from 80% to 85% (+5 points). Missed urgent tickets fell from 20 to 15 per 100.”

Check your understanding

A model's accuracy goes from 96% to 98%. What is the change in percentage points? By what percent did the number of errors fall?

Show the answer

The change is 98 − 96 = 2 percentage points. The error rate went from 4% to 2%, so the number of errors fell by (2 − 4) ÷ 4 = −50%: half as many errors. Near 100%, a small change in points is a large change in errors.

Check your understanding

One training run uses a learning rate of 1e-4, and another uses 1e-2. How many times larger is the second one? On a log axis, how many gridlines apart are they?

Show the answer

1e-2 = 0.01 and 1e-4 = 0.0001, so the second is 100 times larger. The powers differ by 2, so on a log axis (one gridline for each factor of 10) they are 2 gridlines apart.

Check your understanding

Read this formula aloud, then say what it calculates for the four reply times 12, 15, 18 and 18 minutes: the sum of (x-i minus 15.75), for i from 1 to 4.

Show the answer

“The sum of x-i minus 15.75, for i from 1 to 4.” It subtracts 15.75 (the mean) from each value, then adds the results. (12 − 15.75) + (15 − 15.75) + (18 − 15.75) + (18 − 15.75) = −3.75 − 0.75 + 2.25 + 2.25 = 0 minutes. The distances from the mean always add up to zero. The next lesson uses this fact to explain why the variance squares the distances first.

Recap

  • A fraction, a decimal and a percentage say the same thing. Always find the bottom number: “of how many?”
  • A difference between two percentages is in percentage points. A relative change is in percent. Near 100%, a few points can halve the errors.
  • 1e-3 is 10⁻³ = 0.001. To compare powers of ten, count the steps between them.
  • A logarithm counts factors of 10 (or of e). A log axis shows small values that a linear axis hides. Log loss, −ln p, is small for confident correct answers and large for confident wrong ones.
  • Read a formula aloud, then in plain words. Σ means “add up”.
  • Write the unit with every number, and check the unit of every result.

Next, you describe Monday’s 12 reply times with the mean, the median, percentiles and the standard deviation.

Next: Describe a dataset