June 2026
Intermediate
440 pages
11h 28m
English
The complete code examples for the exercise solutions can be found in the supplementary GitHub repository at https://github.com/rasbt/reasoning-from-scratch.
We can use a prompt similar to “Hello, Ardwarklethyrx. Haus und Garten.”, which contains a made-up word ("Ardwarklethyrx") and three words in a non-English language (German):
prompt = "Hello, Ardwarklethyrx. Haus und Garten."
input_token_ids_list = tokenizer.encode(prompt)
for i in input_token_ids_list:
print(f"{[i]} --> {tokenizer.decode([i])}")
The output is:
[9707] --> Hello [11] --> , [1644] --> Ar [29406] --> dw [838] --> ark [273] --> le [339] --> th [10920] --> yr [87] --> x [13] ...
Read now
Unlock full access