Slide 10
Slide 10 text
Example 1.6. Tokenization and Embeddings
Text: LLM must translate words into numbers it can work with.
Tokenized text: LLM must translate words into numbers it can work with.
Token IDs: 7454, 44, 2804, 24888, 6391, 1511, 8663, 480, 665, 1101, 483, 13, 220
Embeddings: [[0.021, -0.443, 0.287, 0.004, ..., -0.118],
[-0.023, -0.111, 0.043, 0.142, ..., 0.237],
…………………………………………………………………………….
[0.521, 0.049, -0.278, -0.309, ..., -0.538]]
The transformer architecture lets the model look at all tokens in a sentence at once, figure out which ones depend on
each other, and predict the most likely “next token.” That’s how an LLM generates text that feels fluent and logical.
However, the model doesn’t store facts the way a database does. Instead, it works with probabilities. Given the same
input twice, it might not give the identical answer. This non-deterministic behaviour comes from sampling different but
plausible next tokens.
Another important concept is the context window, it’s the maximum number of tokens the model can consider at one
time. A bigger window allows it to handle longer documents, such as large test logs, but it also increases memory and
processing cost.
ISTQB® CT-GenAI Training Course | Chapter 1. Introduction to Generative AI for Software Testing Page 10 of 34