liveBook · Manning

Token

As explained in Data Analysis with LLMs

A token is the atomic unit of text representation processed by a language model, typically corresponding to about four characters.

A token is the atomic unit of text that a language model processes. One token typically corresponds to about four characters, though the exact amount varies. section 1.5.1

Models read tokens from inputs and generate tokens in outputs. Processing fees are often tied to token counts, so counting tokens helps estimate invocation costs and compare model choices. section 1.5.1 section 9.2

Estimating review-classification costs

Suppose a product review averages 100 tokens, or about 400 characters, and a company receives 10,000 reviews daily. That amounts to roughly one million tokens per day. At the example prices given, processing a year of reviews costs about $21,900 with GPT-4 or $182.50 with GPT-3.5 Turbo. section 9.1

How Data Analysis with LLMs covers it

How deep it goes
Defines tokens as atomic text units and gives an approximate character count, without detailing tokenization.
Examples
Estimates annual classification costs for 10,000 daily reviews averaging 100 tokens each.
What you can do after
Evaluate invocation costs by counting tokens used on sample classifications.
How it connects
Connects tokens to language-model inputs and outputs, processing fees, and model selection.

Also explained in

Compare how 31 books explain token →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Analysis with LLMs. The section links point to the parts of the book it draws on.