What exactly is a token in LLMs?
A token is a unit of text — a whole word or a piece of a word (including spaces, punctuation and special symbols). Tokenization rules depend on the model's tokenizer and are often based on token frequency in training data.
Why do interactions with LLMs become so expensive?
LLMs are autoregressive: every new token prediction conditions on the entire prior context, so long conversations or large inputs multiply the number of tokens processed. Input and especially output tokens are billed, so large outputs and repeated context increase costs quickly.
How do coding agents drive higher token usage compared to chatbots?
Coding agents autonomously access files, perform tool calls, and reinsert prior prompts and outputs into context. Those file reads, tool calls and iterative reasoning steps add many input and output tokens, rapidly raising the bill.
Do caching and optimization eliminate token costs?
Caching stores key/value activations to avoid recomputing relationships for already-processed tokens, improving speed and costs in some cases. But caching doesn't fully stop context growth or the billing of input/output tokens in workflows that keep re-sending context.
How can users reduce token-related expenses?
Be concise: limit context size, target specific fixes rather than broad multi-step reasoning, reduce unnecessary tool/file calls, and design prompts to minimize large generated outputs. Monitor input vs output token usage and prefer workflows that avoid iterating entire histories.