Urgent.News

What's breaking now, across hundreds of outlets.

AI

The Transformer: How Attention Replaced the RNN

In Part 6, attention let the decoder look back at every word. In June 2017, eight researchers at Google asked a bolder question: what if attention is all you need? They dropped the RNN and the convolution, and built the Transformer. We show the idea in four pictures. 1. Why the RNN had to go An RNN reads word 1, then word 2, then word 3. Training cannot start step 4 until step 3 is done, so long…

In June 2017, eight researchers at Google proposed a radical idea: the Transformer could outperform traditional Recurrent Neural Networks (RNNs) by relying solely on attention mechanisms. The key takeaway was that RNNs, which process words sequentially, were too slow for long sentences due to their step-by-step nature. In contrast, the Transformer could handle entire sentences simultaneously, massively accelerating training.

Each word in the Transformer operates with a query, a key, and a value during self-attention. This process assigns weights to other words based on relevance, as illustrated by the example of the word "animal" receiving a weight of 0.68 when referring to an animal. The Transformer employs eight attention heads, each focusing on distinct patterns, which are then averaged to produce a comprehensive 512-wide vector.

The architecture further incorporates six stacked layers, each consisting of self-attention and feed-forward networks. The decoder not only attends to its own outputs but also attends to the encoder's output, with a mechanism that masks future words to prevent unnecessary "peeking." Positional encoding, utilizing sine and cosine waves, is added to each word to compensate for attention's lack of inherent order perception.

The base model consists of 65 million parameters and achieved BLEU scores of 28.4 for English-to-German translation and 41.8 for English-to-French translation. Training took place over 3.5 days using eight GPUs. The Transformer's success spawned a cascade of subsequent models, including the widely-used Large Language Models (LLMs) that power modern AI systems.

This final installment of the series traces the evolution from a solitary neuron in 1958 to the sophisticated language models underpinning contemporary artificial intelligence.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in AI

The cute AI animals your children imitate are carrying messages meant for adults

Every time I open TikTok, I meet the monkeys. They are cartoon monkeys, made with AI tools, and they speak my Sudanese dialect badly. Whoever makes them clearly doesn't know the dialect.

  • Cute AI animals mimic Sudanese dialects and customs, appealing to children.
  • Some content is sexually explicit while others mock tribal groups.
  • Trend spread globally, with 354 TikTok accounts and 43,000 AI videos viewed 4.5 billion times.

Two editors, one file: how an AI agent edits a project the user has open

Part 6 of a series on Movie Engine, where an AI agent edits Kdenlive video projects while the editor stays open. Earlier parts: 1, overview , 2, UI Automation without stealing focus , 3, menu names…

  • Kdenlive lacks automation API for AI editing
  • Movie Engine enables AI to edit projects safely
  • Lock and check system preserves user edits

More from Wednesday 25 November →