Recall & Review
beginner
What is a token in the context of language models?
A token is a small piece of text, like a word or part of a word, that the model processes. It can be a whole word, part of a word, or even punctuation.
Click to reveal answer
beginner
Why do we count tokens when using language models?
Counting tokens helps estimate how much text the model processes and predicts the cost, since many services charge based on the number of tokens used.
Click to reveal answer
beginner
How does token count affect the cost of using a language model?
The more tokens you use (input plus output), the higher the cost because pricing is usually per 1,000 tokens processed by the model.
Click to reveal answer
beginner
What is the difference between input tokens and output tokens?
Input tokens are the tokens you send to the model as a prompt. Output tokens are the tokens the model generates as a response.
Click to reveal answer
intermediate
How can you estimate the cost of a request to a language model?
Estimate the total tokens (input + output), then multiply by the cost per 1,000 tokens. For example, if cost is $0.02 per 1,000 tokens and you use 500 tokens, cost = 0.02 * (500/1000) = $0.01.
Click to reveal answer
What does one token usually represent in language models?
✗ Incorrect
Tokens are small pieces of text, often words or parts of words, not whole sentences or paragraphs.
Why is token counting important for cost estimation?
✗ Incorrect
Costs are usually calculated based on how many tokens the model processes.
If a model charges $0.03 per 1,000 tokens, how much does 2,000 tokens cost?
✗ Incorrect
2,000 tokens is twice 1,000 tokens, so cost is 2 * $0.03 = $0.06.
Which tokens count towards cost in a language model request?
✗ Incorrect
Both the tokens you send and the tokens the model generates count towards cost.
If your prompt has 300 tokens and you expect 700 tokens output, what is the total token count?
✗ Incorrect
Total tokens = input tokens + output tokens = 300 + 700 = 1,000.
Explain in your own words why counting tokens is important when using language models.
Think about how the model processes text and how pricing works.
You got /3 concepts.
Describe how you would estimate the cost of a language model request given the number of tokens and price per 1,000 tokens.
Use simple multiplication and division.
You got /3 concepts.