internalsGet Pro

Module 10 · Lesson 7 of 12Pro

Attention: the maths of focusing on what matters

Level
Intermediate
Topic
Deep learning architectures
Reading time
18 min

When you finish this page you can

  1. Compute an attention step by hand, from scores through softmax weights to the weighted average of values.
  2. Explain why the gradient reaches day 1 of 365 in one step with attention, and why scores are divided by √d.
  3. Build an attention-pooling churn model in PyTorch and read which days its weights pick.
  4. Choose between a recurrent network, attention pooling and full self-attention for a sequence, and say what each costs as sequences grow.
  1. Dot products: measuring how similar vectors are13 min
  2. Backpropagation: how neural networks learn17 min
  3. Recurrent networks for sequences18 min

Day 1 is 364 steps from the score

is our example online store. Every Monday, Joseph’s growth team sends ₹100 vouchers to the customers most likely to . Farah, an ML engineer, builds the model that picks them.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan