The word bank has a different meaning in 'river bank' and 'bank loan'. A model needs surrounding tokens, not just a dictionary lookup.
Caminho Solo context: This practical exercise complements Transformers: the 2017 idea that changed AI, explained without intimidating math, with the original research and fuller walkthrough.
Why this question matters
Consider "The customer returned the package because it arrived broken." Understanding the sentence requires connecting "it" to the package, not merely recognising each word separately. Neural language systems existed long before 2017. Recurrent neural networks (RNNs) and LSTMs processed sequences while carrying state from earlier steps. They were useful, yet sequential dependencies made parts of training difficult to parallelize and could complicate learning relationships over long distances. Researchers had also developed attention mechanisms. A major contribution came from Bahdanau, Cho and Bengio's work on neural machine translation, first circulated in 2014. It helped popularise allowing a translation system to focus on relevant portions of its input instead of relying on a single fixed summary.
Try the smallest experiment
Step 1. Write 'The bank near the river closed' and mark 'bank' as the word to interpret.
Step 2. Replace 'river' with 'loan' and explain which relationship changed. This is an intuition about contextual information, not a trained attention calculation.
Step 3. Consider why different learned heads might represent different relationships without assuming any head represents a fixed grammar rule.
What to write down
Exercise: sentence A -> context clue: river; sentence B -> context clue: loan; interpretation changes when information changes.
One failure mode to watch
Self-attention is learned numerical computation across layers; this analogy does not reveal actual attention weights.
Primary references
- Bahdanau, Cho and Bengio's work on neural machine translation
- Attention Is All You Need
- Google Research's historical introduction
How to judge your result
Keep the input, expected result and actual observation together. Check the failure case before using this workflow with real accounts or production data.
Editorial disclosure: Fully AI-generated adaptation of the published Caminho Solo English article. Examples are suggested exercises, not claims of tests actually run.
Continue with Caminho Solo: The original guide and references add the broader context for this focused example.

