49. What Transformers Are (Text and Sequences)
49.1 Why Sequences Need Attention
49.1 Sequences ला attention का
Text grids नाही. Order आणि long-range links — “not good” ≠ “good.”
हे का शिकायचं?
Why. Text आणि sequences images सारखे grids नाहीत. Meaning order आणि long-range links वर अवलंबून: “not good” ≠ “good.” Transformers हे attention ने handle करतात.
हे काय आहे?
What. Transformer block प्रत्येक token ला इतर tokens कडे बघू देतो आणि काय महत्त्वाचं ते ठरवतो (“attention”). Stacked blocks = modern NLP; ChatGPT-style models ची backbone idea (पूर्ण apps Gen AI course मध्ये).
कसं करायचं?
How.
Sequence problem ओळखा
- Reviews, SMS, support tickets, Marathi/English mix captions.
- Order matter करते.
- एकटी word bag पेक्षा जास्त context हवा (TF-IDF अजून useful — Chapter 52).
print("bag-of-words ignores order; attention can use order + context")
Ravindra Bagale's Tip
A transformer works like smart focus: for each word, it decides which other words it should pay attention to. It is not magic, because these attention weights are learned from data during training.
Ravindra Bagale's Tip – मराठी
Transformer एका smart focus सारखं काम करतो: प्रत्येक word साठी तो ठरवतो की इतर कोणत्या words कडे लक्ष द्यायचं. यात काही magic नाही, कारण हे attention weights training दरम्यान data मधून शिकले जातात.
Ravindra Bagale's Tip – हिंदी
Transformer एक smart focus की तरह काम करता है: हर word के लिए वह तय करता है कि किन दूसरे words पर ध्यान देना है. इसमें कोई magic नहीं है, क्योंकि ये attention weights training के दौरान data से सीखे जाते हैं.