Sitemap
MR ROBOT

MR ROBOT

Myanmar Refining Operations & Building Optimus Technica

Press enter or click to view image in full size

The Transformer

2 min readOct 9, 2026

--

ပြီးခဲ့တဲ့အကြောင်းအရာတွေမှာ RNN, LSTM တို့လို model တွေဟာ စကားလုံးတွေကို တစ်လုံးပြီးမှ တစ်လုံး အစဉ်လိုက် (Sequential) တွက်ချက်ရတဲ့အကြောင်းတွေ၊ Factorization Tricks နဲ့ Conditional Computation အကြောင်း တွေကို ဆွေးနွေးခဲ့ပြီးဖြစ်ပါတယ်။ ဒီနေ့မှာတော့ Transformer အကြောင်းကို အတူတူ လေ့လာသွားကြမယ်။

Transformer က အစဉ်လိုက်တွက်ချက်တာမျိုးမဟုတ်ဘဲ Input နဲ့ Output ကြားက Global Dependencies တွေကို ရှာဖွေဖို့ Attention Mechanism တစ်ခုတည်းကိုသာ အသုံးပြုခဲ့ပြီး တစ်ပြိုင်နက်တည်း တွက်ချက်မှုတွေကို သိသိသာသာ လုပ်ဆောင်နိုင်ခဲ့ပါတယ်။

📍Transformer ဆိုတာ ဘာလဲ?

Transformer ဆိုတာ AI model တွေမှာ Attention တစ်ခုတည်းကိုသာ အသုံးပြုပြီး စကားလုံးတွေကြားက ဆက်စပ်မှုကို ရှာဖွေတဲ့ neural network architecture အမျိုးအစားတစ်ခုဖြစ်ပါတယ်။

Attention ဆိုတာကို ကျွန်တော်တို့ ဒီ What is Attention ဆိုတဲ့ link မှာရှင်းပြပြီးသားဖြစ်တဲ့အတွက် သွားရောက်ဖတ်ရှုုနိုင်ပါ‌တယ်။

Transformerတွေ ဒီလိုမြန်ဆန်စွာတွက်ချက်နိုင်ရတာက Recurrent Model တွေလိုမျိုး စကားလုံးတစ်လုံးပြီးမှ တစ်လုံး မတွက်ဘဲ စကားလုံးအားလုံးကို တစ်ပြိုင်နက်တည်း (Parallel) တွက်ချက်နိုင်လို့ ဖြစ်ပါတယ်။ ဒီအမြန်နှုန်းက အထူးသဖြင့် training လုပ်တဲ့အချိန်မှာ သိသာပါတယ်။

📍 Parallelization (တစ်ပြိုင်နက်တည်း တွက်ချက်ခြင်း )

Footprints II မှာ ပြောခဲ့သလို RNN မှာ စကားလုံးအမှတ်စဉ် ၉၉ မပြီးမချင်း ၁၀၀ ကို စတွက်လို့ မရပါဘူး။ Transformer မှာတော့ Recurrence မရှိတော့တဲ့အတွက် အထူးသဖြင့် training လုပ်တဲ့အချိန်မှာ စကားလုံး ၁ ကနေ ၁၀၀ အထိကို တစ်ချိန်တည်းမှာ တွက်ချက်နိုင်ပါတယ်။

ထိုအချိန်တုန်းက Base model လို့ခေါ်တဲ့ အသေးစား Transformer ကို English → German train နိုင်ဖို့ အချိန် ၁၂ နာရီအတွင်း NVIDIA ကုမ္ပဏီရဲ့P100 GPU ၈ လုံးကိုသာအသုံးပြုခဲ့ပြီး ဒီတွေ့ရှိမှုဟာ အဲဒီအချိန်တုန်းက ဘယ်သူမှ မကျော်နိုင်သေးတဲ့ အကောင်းဆုံး ရလဒ်တစ်ခုဖြစ်လာခဲ့ပါတယ်။

နောက်လာမယ့် အကြောင်းအရာတွေမှာတော့ Transformer မပေါ်ခင်ကတည်းက Sequential Computation ကို လျှော့ချဖို့ ကြိုးစားခဲ့ကြတဲ့ Extended Neural GPU, ByteNet, ConvS2S ဆိုတဲ့ model တွေအကြောင်းအရာတွေကို ဆက်လက် ဆွေးနွေးသွားမှာ ဖြစ်ပါတယ်။

Get MR ROBOT’s stories in your inbox

Join Medium for free to get updates from this writer.

[ English Version ]

In previous topics, we discussed how models like RNN and LSTM process words sequentially, one after another, and also covered Factorization Tricks and Conditional Computation. Today, we will learn about Transformer together.

Instead of sequential processing, Transformer significantly improved parallel computation by using only an Attention Mechanism to find Global Dependencies between Input and Output.

📍 What is Transformer?

Transformer is a type of neural network architecture in AI models that uses only Attention to find relationships between words.

We have already explained Attention in this What is Attention link, so you can read it there.

Transformers can compute so quickly because they process all words in parallel, rather than one word at a time like Recurrent Models. This speed is especially noticeable during training.

📍 Parallelization

As mentioned in Footprints II, in RNNs, you cannot start processing word 100 until word 99 is finished. In Transformer, since there is no recurrence, words 1 to 100 can be processed at the same time, especially during training.

At that time, to train the small Transformer, called the Base model, for English → German translation, only 8 NVIDIA P100 GPUs were used within 12 hours, and this finding became the best result that no one had surpassed at that time.

In the upcoming sections, we will continue to discuss models such as Extended Neural GPU, ByteNet, and ConvS2S, which attempted to reduce Sequential Computation even before the advent of Transformer.

Author — MR ROBOT (Myanmar Refining Operations & Building Optimus Technica)

#NIPS-2017-attention-is-all-you-need-Paper

--

--

MR ROBOT
MR ROBOT

Written by MR ROBOT

Myanmar Refining Operations & Building Optimus Technica