Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Commit 319f4a5

Browse files
committed
Update transformers_llms_and_genai.ipynb
1 parent 06d188e commit 319f4a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Module 9 - GenAI (LLMs and Prompt Engineering)/2. Intro to Transformers, LLMs and GenAI/transformers_llms_and_genai.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
" - This architecture used to work well with smaller sentence.\n",
6262
" - **The Problem:** While it could handle variable-length input and output sequences, it used to rely on generating a single fixed-length context vector for the entire input sequence, which can lead to information loss, especially for longer sequences.\n",
6363
"3. **[(2015) Neural Machine Translation by Joint Learning to Align and Translate](https://arxiv.org/pdf/1409.0473.pdf)** paper introduced the concept of **Attention Mechanism** to solve the above problem.\n",
64-
" - Unlike traditional NMT models that encode the entire source sentence into a fixed-length context vector, the attention mechanism allows the model to focus on different parts of the source sentence dynamically while generating the translation.\n",
65-
" - Attention Mechanism also addressed the problem of learning alignment between input and output sequences, enables the model to weigh the importance of each word in the source sentence differently during translation. By dynamically adjusting the attention weights, the model can focus more on relevant words and ignore irrelevant ones, leading to more accurate translations.\n",
64+
" - Unlike traditional NMT models that encode the entire source sentence into a fixed-length context vector, the **attention mechanism allows the model to focus on different parts of the source sentence dynamically** while generating the translation.\n",
65+
" - Attention Mechanism also **addressed the problem of learning alignment between input and output sequences**, enables the model to weigh the importance of each word in the source sentence differently during translation. By dynamically adjusting the attention weights, the model can focus more on relevant words and ignore irrelevant ones, leading to more accurate translations. For eg: Think about the english to hindi translation for \"I work at Apple Inc\" vs \"I work at Apple Farm\". Where should I keep सेब vs एप्पल इंक ?\n",
6666
" - At each timestamp of the decoder, the dynamically calculated context vector indicates which timestamps of the encoder sequence are expected to have the most influence on the current decoding step of the decoder.\n",
6767
" - In simple terms, context vector will be the weighted sum of encoders hidden state. And these weights are called as **attention weights**.\n",
6868
" - The attention mechanism has improved, the quality of translation on long input sentences. But it was not able to solve a huge fundamental flaw i.e. sequential training.\n",

0 commit comments

Comments
 (0)