Question 1 of 5

How does a token differ from a word?

A guide says retry_seconds: 15. Counting by spaces gives two pieces, but the model can receive a very different number of units.

Consider the product code KLM-407. A reader sees one item, but a tokenizer may produce separate pieces for the letters, hyphen and digits. Models can use different rules for splitting text. Counting words between spaces therefore cannot tell you exactly how many tokens a request uses.

WHERE TO START

How could you find out how much space a long word takes in a request?

What to know before this question
Topic example · Prediction error

Move the prediction closer to the target and compare the numbers.

target = 4
prediction = 7
print(abs(target - prediction))
Line notes
  1. Set the known target value.
  2. Set one prediction.
  3. Print the distance from the prediction to the target.

How would you rate your understanding?

This is your self-assessment. Progress is saved in this browser.

Not rated yet

← Back to How a model works