How does a sentence get inside an LLM?
You type “I love machine learning!”. A person sees words and meaning. A neural network works with numbers. The missing bridge is: split the text into manageable pieces, identify those pieces, then turn them into learned numerical representations.
Those pieces are called tokens. A token may be a whole word, part of a word, punctuation, a byte-like unit, or a special symbol depending on the tokenizer used by the model.
Step 1 — split text into tokens
For teaching, we might imagine “playing!” becoming play | ing | !. A real tokenizer may split it differently. Tokenization is model-specific, so visible word count is not a reliable token count.
Step 2 — give each token an ID
A vocabulary assigns each token an integer ID. Think of the ID as a catalogue number. If one token has ID 4217 and another has ID 4218, that does not mean their meanings are close.
Illustrative vocabulary lookup
Step 3 — turn IDs into learned vectors
The model uses each ID to look up an embedding: a vector, or ordered list of learned numbers. Training adjusts these numbers so the model can represent useful patterns and relationships.
A helpful mental model is a coordinate system. One point may end up closer to another because the model learned that they appear in related contexts. But the individual coordinates are not manually labelled “animal”, “positive”, or “technology”.
Now follow one piece of text through the complete conversion below. Splitting, indexing and looking up a vector are three different operations: the next stage uses the result of the previous stage.
How written text becomes numerical model input
A five-stage flow converts text into tokens, then token IDs, then learned embedding vectors, then passes the representations into the model.
How does the model know order?
The same words in a different order can mean something different: “dog bites man” is not the same as “man bites dog.” LLMs therefore combine token information with positional information so the network can distinguish where pieces appear in the sequence.
Context window — the model's current worktable
The context window is the finite amount of tokenized material the model can work with for a request. Instructions, conversation history, the current question, retrieved evidence, and room for the generated answer all consume that budget.
A context window is a limited worktable
A 1,600-token toy budget contains instructions, the user's question, retrieved evidence and an output allowance. The planned total shown is 2,000 tokens, which is 400 tokens over the budget.
The 1,600-token value is deliberately small and only for this worked example. Real model limits vary. The skill to learn is the budgeting: 2,000 planned − 1,600 available = 400 tokens that must be removed or reallocated.
Context is not long-term memory
A context window is temporary working material for the current interaction. If an application remembers your preference next week, software outside the base model typically stored that information and inserted it into a later request.
Do not confuse these
Why the next lesson matters
Now the model has numerical token representations. How can each token decide which other tokens matter?
Transformer Architecture & Attention →Summary / Key Takeaways
- LLMs first split text into model-specific pieces called tokens.
- A token ID is a vocabulary index, not a measure of meaning.
- Embeddings are learned numerical vectors that represent tokens inside the model.
- Positional information helps the model distinguish token order.
- The context window is a finite current working budget and must include room for the answer.
- A large context window is not the same as persistent application memory.