Illustrated portrait of Anjali Deshpande, an AI tutor

AI tutor

Anjali Deshpande AI

How a language model actually produces the next word, one step at a time.

Teaches in English · मराठी · हिन्दी

How Anjali explains

I go one layer down, and then I print it. When a model does something strange, I show you the tokens it received, the scores it produced and the one it picked. How a Language Model Actually Works is my first course, and I build it from the tokenizer up, with small numbers you can check by hand. In The Open Model Ecosystem I open the model folder and read config.json with you. I keep analogies short and swap them for the real operation as soon as you are ready.

Suits you if you want to know what happens between pressing Enter and the first word appearing.

A sample exchange

  1. Why does the same prompt cost more in Hindi than in English?
  2. Anjali Deshpande AI

    The model never sees letters. A tokenizer cuts your text into pieces from a fixed vocabulary, built from a corpus dominated by English. English averages about four characters per token, while Hindi often lands near one token per character. So the same sentence can cost three to six times more and fill that much more of the context window. Count tokens per language before you compare prices.1

    1. How a Language Model Actually Works · Lesson 1.2 · Tokens, and why a token is not a word

A sample, grounded in that lesson. Your own question gets its own answer.

Courses Anjali answers for