Labeled SetGet the app
Menu

Concept · filed under How generative AI models work

Tokens, embeddings and transformers, explained for AI-901

A token is the chunk of text a language model actually processes, often a piece of a word. An embedding is a list of numbers that places text by meaning. A transformer is the model design that uses attention to work out which tokens matter to each other. All three sit under the objective on how generative AI models work in the AI-901 study guide, which names the objective and leaves the vocabulary to you.

  • ExamAI-901 (replaced AI-900 on June 30, 2026)
  • Questions here6
  • UpdatedOct 19, 2026

One pipeline, three stages

The three terms describe the same pipeline at different stages. That is why answer options borrow from each other. Text is cut into tokens. Each token becomes a vector. Attention layers in the transformer relate the tokens to one another, and the model predicts the next token, then the one after, until the reply is finished.

No math is needed for the exam. You need what each term is, what it is not, and the practical fact that hangs on tokens: usage and limits are counted in them.

Fig. 1

Unboxing the charger took longer than charging.Unboxing the charger took longer than charging.
Fig. 1 An illustrative split. Each model family has its own tokenizer, so the same sentence can be cut differently.

Tokens are the meter

For software sold on how well it understands language, a model is oddly uninterested in words. Common words often stay whole; rarer words split into pieces, and punctuation gets its own token. Text in many languages other than English tends to need more tokens for the same meaning.

Two practical facts follow. Generative model usage is metered in tokens, so a longer exchange costs more. And every model has a context window, a maximum number of tokens it can work with at once, shared between what goes in and what comes out. Exam options that measure a model in words, pages or characters are describing something else.

Fig. 2

Embeddings: close means similar

Dimension 1 of manyDimension 2PaymentsWeatherPets
Fig. 2 A flat sketch of embedding space. Real embeddings have far more dimensions, but the idea holds: texts with related meaning land near each other.

Embeddings and attention, in words

An embedding turns a word, sentence or passage into a vector so that similar meanings sit close together, whatever the wording. That is what lets a search for “getting my money back” find a page titled “Refunds” with no words in common. Embedding models produce these vectors for search and comparison. They do not write replies, which makes them a frequent wrong option when a scenario needs a chat model.

Attention is how a transformer reads in context. For each token, it weighs the other tokens it can see and draws information from the ones that matter. In “The trophy did not fit in the suitcase because it was too big,” attention is what ties “it” to the trophy. Many attention layers stacked together build up a picture of the whole passage before the next token is chosen.

The transformer is the architecture; GPT-style language models are built on it. AI-900 listed “features of the Transformer architecture” under machine learning (AI-900 study guide, exam retired June 30, 2026), so older courses teach it there. To see where prompts, retrieved passages and fine-tuning fit on top of all this, read prompt engineering vs RAG vs fine-tuning.

Table 1

Side by side

Token, embedding and attention compared on what an exam question tends to ask
PointTokenEmbeddingAttention
What it isThe unit a model reads and writesA vector that encodes meaningA weighting between tokens inside the model
Looks likeA word piece with an ID numberA long list of numbersScores computed during processing
Where you meet itUsage, context window, max tokensSemantic search, retrieval, recommendationsExplanations of how transformers work
Do you set it?You control how many you send and allow backYou choose an embedding modelNo, it is learned in training
Clue words in a questioncost, length, limitsimilar, related, by meaningcontext, which words relate

The rule

Max tokens caps how long the reply may get; it does not make the model plan a shorter answer. Hit the cap and the text simply stops. If you want brevity, ask for it in the prompt.

Worksheet

Check the three ideas

A few questions go a layer below this page, into how a transformer keeps track of word order and what it can see while it writes. Evaluate the batch for the reasoning.

Questions come in batches of five. Pick an answer for each, then evaluate the batch: notes on all four options open under every question.

Accuracy by batch

0 evaluated · 0 right · 6 to go

Batch 1 questions 1–5

  1. 01

    In the context of language models, what is a token?

    Your label —The notes on all four options open when this batch is evaluated.

  2. 02

    A team embeds three sentences: "The flight was delayed", "Our plane left late" and "The soup was too salty". What should they expect from the embedding vectors?

    Your label —The notes on all four options open when this batch is evaluated.

  3. 03

    In a transformer, what does the attention mechanism do?

    Your label —The notes on all four options open when this batch is evaluated.

  4. 04

    A support bot sends a long system message, the full chat history and several retrieved documents with every request. Why does this raise the cost of running it?

    Your label —The notes on all four options open when this batch is evaluated.

  5. 05

    A transformer looks at all the tokens in a sequence together rather than reading them strictly one at a time. How does it still keep track of word order?

    Your label —The notes on all four options open when this batch is evaluated.

0 of 5 labeled

Batch 2 question 6

  1. 06

    While a transformer's decoder predicts the next token of a completion, which tokens can its attention take into account?

    Your label —The notes on all four options open when this batch is evaluated.

0 of 1 labeled

Asked about transformers

What does GPT stand for?

Generative pre-trained transformer: a model trained in advance on large amounts of text, built on the transformer architecture, that generates output one token at a time.

How deep does AI-901 go into attention?

Not to the math. The outline asks you to describe how generative AI models work and to pick a model by its capabilities (AI-901 study guide, skills measured as of April 15, 2026). Tokens, vectors and attention at the depth of this page cover it.

Is a token always the same length?

No. A tokenizer keeps frequent words whole and breaks rare ones into pieces, and different model families split the same text differently.

Is there a quick way to drill these terms?

The AI-901 flashcards include token, embedding and attention alongside the prompt and deployment vocabulary.