You are reading immutable version 28. The current guide may be newer.

Study the paper

Attention Is All You Need

Lessons, visuals, quizzes, flashcards, and resources—organized in teaching order.

All activities

Injecting Order with Positional Encoding

Sinusoidal Positional Encoding (Even): step by step

Interactive study view

Sinusoidal Positional Encoding (Even): step by step

Illustrative teaching data

Follow the existing bounded walkthrough in its intended sequence.

Step 1 of 4

  1. Step 1

    Determine the exponent: 2 * i / d_model = 0

  2. Step 2

    Compute the denominator: 10000^0 = 1

  3. Step 3

    Compute the angle: pos / 1 = 1

  4. Step 4

    Compute the sine: sin(1) ≈ 0.84147098