AI dictionary · Deep learning
What is Attention?Attention kya hai?
Attention: The mechanism in transformers that lets each word look at every other word to understand its meaning in context.Transformers ka woh mechanism jisse har shabd baaki har shabd ko dekhkar context mein apna matlab samajhta hai.
🧸 Think of it likeAise samjho
Like reading a sentence with a highlighter: to understand the word 'it', your eyes jump back to the words that tell you what 'it' is.Highlighter ke saath sentence padhne jaisa: 'it' samajhne ke liye aapki nazar wapas un shabdon pe jaati hai jo batate hain ki 'it' kya hai.
📘 ExplainedVistaar se
Each token creates a query, a key and a value vector. Comparing a token's query with every key gives attention weights (how relevant each other token is), and the token's new representation is a weighted mix of the values. So 'bank' near 'river' ends up different from 'bank' near 'loan'. Attention cost grows with the square of the text length, which is why long contexts are expensive.Har token ek query, ek key aur ek value vector banata hai. Token ki query ko har key se compare karne pe attention weights milte hain (baaki token kitne relevant hain), aur token ki nayi representation values ka weighted mix hoti hai. Isliye 'river' ke paas wala 'bank' 'loan' ke paas wale 'bank' se alag ban jaata hai. Attention ka kharch text ki lambai ke square ke saath badhta hai, isliye lambe contexts mehenge hain.
💡 Real exampleAsli example
In 'The animal didn't cross the road because it was tired', attention links 'it' to 'animal'.'The animal didn't cross the road because it was tired' mein attention 'it' ko 'animal' se jodta hai.
📖 Learn it step by stepStep by step seekho
🔗 Related termsJude hue shabd
Questions people ask
What is Attention?
The mechanism in transformers that lets each word look at every other word to understand its meaning in context. Each token creates a query, a key and a value vector. Comparing a token's query with every key gives attention weights (how relevant each other token is), and the token's new representation is a weighted mix of the values. So 'bank' near 'river' ends up different from 'bank' near 'loan'. Attention cost grows with the square of the text length, which is why long contexts are expensive.
How can I understand Attention in simple words?
Like reading a sentence with a highlighter: to understand the word 'it', your eyes jump back to the words that tell you what 'it' is.
What is an example of Attention?
In 'The animal didn't cross the road because it was tired', attention links 'it' to 'animal'.
Attention ka matlab kya hai?
Transformers ka woh mechanism jisse har shabd baaki har shabd ko dekhkar context mein apna matlab samajhta hai. Highlighter ke saath sentence padhne jaisa: 'it' samajhne ke liye aapki nazar wapas un shabdon pe jaati hai jo batate hain ki 'it' kya hai.
See Attention in the full A to Z dictionary · Start a free AI course