Module 1 · From characters to vectors

How the model knows what order the words were in

In this lesson

  • 8 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 7 of 9 in this chapter

This chapter’s goalTrace a piece of text from characters to token ids to vectors and back to a score for every possible next token, predict where a tokenizer will split unfamiliar input, and count the parameters of a model from four numbers on its config page.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 7Free · no account needed
Lesson steps

Attention is a bag of tokens

Here is a fact that surprises people: the attention operation, on its own, does not know the order of its inputs. Shuffle the tokens and, without a positional signal, each output is a weighted sum over the same set of values: the same set, in a different arrangement. “Dog bites man” and “man bites dog” would be identical.

Something has to supply order. That something is the positional encoding, and the choices made there explain a large part of why long context was hard.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the AI, Actually Explained exam.

Stuck on something?Ask Anjali, your AI tutor

How to cite: Addaly (2026) ‘How the model knows what order the words were in’, in How a Language Model Actually Works. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/how-llms-work/position-and-order (Accessed: 29 November 2026).