Introduction to Large Language Models
Understand tokens, context, training, and why fluent answers still need verification.
On this page
Introduction to Large Language Models
From text to tokens
A large language model (LLM) processes text as tokens. A token may be a word, part of a word, punctuation, or another unit. Tokenization varies by model and language. Two passages with a similar word count can use different numbers of tokens.
Training and inference
During training, a common objective is to predict the next token from earlier tokens. The model adjusts its parameters using many examples. During inference, a model trained this way scores possible next tokens, selects one according to its decoding settings, and repeats the process. In a transformer, attention helps the model weigh relationships among tokens in the context.
Give the model a clear task
The context can include instructions, conversation history, and supporting text. For example, supply a short library notice and ask for its opening hours in one sentence. A limit on the context means long inputs may need to be shortened or selected before they are sent.
Check what the answer is based on
A plausible answer can still contain an invented date or unsupported claim. Compare important details with the original notice. If the notice omits the answer, ask the model to say so. When relevant evidence lives across many documents, retrieval-augmented generation can help select the passages to include.