CertBrain
Sign in
← Back to decks
Sign in to save your progress.Sign in

How Generative AI Models Work

Generative AI models such as large language models write text by predicting what comes next. This lesson explains tokens, embeddings, prompts and the temperature setting, so you can describe how a model turns a prompt into a completion on the AI-901 exam.

10 cards

How Generative AI Models Work

In this lesson · 5 sections
Step 2 of 5

Tokens and embeddings

Before a model can work with text, the text is split into tokens: pieces that may be whole words, fragments of words, punctuation marks or other frequent character strings. Each token in the model's vocabulary has its own numeric ID. During training, every token is also given a vector, which is a list of numbers. A transformer model then uses attention, which weighs the neighboring tokens, to refine each vector. The refined vectors are called embeddings, and they carry meaning from context. Tokens used in similar settings end up with similar embeddings, as "invoice" and "receipt" might. When the model generates text, its decoder uses masked attention, so it looks only at the tokens that come before the one being predicted.