The Transformers architecture clearly explained ππ»
Today I'm starting a new series of threads to simplify the concept of Transformers and what's behind the Natural Language abilities of LLMs.
Let's start with the basics of the Transformer architecture:
The encoder/decoder concept. π§ β¨
1οΈβ£ πͺπππ§ ππ¦ π π§π₯ππ‘π¦ππ’π₯π ππ₯?
A Transformer is a neural network that excels at understanding the context of sequential data and generating new data from it.
They are the first to rely solely on self-attention, without using RNNs or convolution.
2οΈβ£ π§π₯ππ‘π¦ππ’π₯π ππ₯ ππ¦ π πππππ ππ’π«
Imagine a Transformer for language translation as a BLACK BOX. π©
β’ Input: A sentence in one language.
β’ Output: Its translation.
But what happens inside this black box? Let's find out! π
3οΈβ£ ππ‘ππ’πππ₯/ππππ’πππ₯ architecture
β’ Input: Spanish sentence ΒΏDe quiΓ©n es?
β’ Encoder: Transforms it into a structured format capturing its essence.
β’ Decoder: Receives this encoded data and generates the translation.
β’ Output: The translated sentence: Whose is it?
4οΈβ£ π§ππ ππ₯ππππ§πππ§π¨π₯π BEHIND THE TRANSFORMERS
Each encoder and decoder is made up of layers. Here's how they work:
β’ Encoders: Process the input sequentially, layer by layer.
β’ Decoders: Take the encoded data and generate the output step by step.
Both use self-attention and feed-forward neural networks, enabling the generation of natural language.
Tomorrow we will break down the architecture of both core elements of the Transformers architecture.
Do you want to understand the Transformers architecture?
Then go check my last article about Transformersππ»
aigents.co/data-science-bβ¦
If you are interested in...
β’ Python π
β’ SQL πΎ
β’ ML/MLOps π
β’ LLMs & NLP π£
β’ DataViz π£
β’ AI Engineering βοΈ
Then follow me β @rfeers
Did you like this post?
Then join my freshly started DataBites newsletter to get all my content right to your mail every week! π§©
ππ» databites.tech
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.
