The Attention Mechanism in Large Language Models

Поділитися
Вставка
  • Опубліковано 24 лип 2023
  • Attention mechanisms are crucial to the huge boom LLMs have recently had.
    In this video you'll see a friendly pictorial explanation of how attention mechanisms work in Large Language Models.
    This is the first of a series of three videos on Transformer models.
    Video 1: The attention mechanism in high level (this one)
    Video 2: The attention mechanism with math: • The math behind Attent...
    Video 3: Transformer models • What are Transformer M...
    Learn more in LLM University! llm.university
  • Наука та технологія

КОМЕНТАРІ • 149

  • @arvindkumarsoundarrajan9479
    @arvindkumarsoundarrajan9479 3 місяці тому +28

    I have been reading the "attention is all you need" paper for like 2 years. Never understood it properly like this ever before😮. I'm so happy now🎉

  • @user-bw5np7zz5m
    @user-bw5np7zz5m 7 днів тому

    I love your clear, non-intimidating, and visual teaching style.

    • @SerranoAcademy
      @SerranoAcademy  6 днів тому

      Thank you so much for your kind words and your kind contribution! It’s really appreciated!

  • @RG-ik5kw
    @RG-ik5kw 9 місяців тому +33

    Your videos in the LLM uni are incredible. Builds up true understanding after watching tons of other material that was all a bit loose on the ends. Thank you!

  • @TheMircus224
    @TheMircus224 5 місяців тому

    These videos where you explain the transformers are excellent. I have gone through a lot of material however, it is your videos that have allowed me to understand the intuition behind these models. Thank you very much!

  • @nealdavar939
    @nealdavar939 29 днів тому

    The way you break down these concepts is insane. Thank you

  • @EricMutta
    @EricMutta 5 місяців тому +17

    Truly amazing video! The published papers never bother to explain things with this level of clarity and simplicity, which is a shame because if more people outside the field understood what is going on, we may have gotten something like ChatGPT about 10 years sooner! Thanks for taking the time to make this - the visual presentation with the little animations makes a HUGE difference!

  • @malikkissoum730
    @malikkissoum730 6 місяців тому +12

    Best teacher on the internet, thank you for your amazing work and the time you took to put those videos together

  • @calum.macleod
    @calum.macleod 9 місяців тому +9

    I appreciate your videos, especially how you can apply a good perspective to understand the high level concepts, before getting too deep into the maths.

  • @gunjanmimo
    @gunjanmimo 9 місяців тому +8

    This is one of the best videos on UA-cam to understand ATTENTION. Thank you for creating such outstanding content. I am waiting for upcoming videos of this series. Thank you ❤

  • @apah
    @apah 9 місяців тому +3

    So glad to see you're still active Luis ! You and Statquest's Josh Stamer really are the backbone of more ml professionals than you can imagine

  • @mohameddjilani4109
    @mohameddjilani4109 6 місяців тому

    I really enjoyed how you give a clear explanation of the operations and the representations used in attention

  • @pruthvipatel8720
    @pruthvipatel8720 8 місяців тому +6

    I always struggled with KQV in attention paper. Thanks a lot for this crystal clear explanation!
    Eagerly looking forward to the next videos on this topic.

  • @JyuSub
    @JyuSub 2 місяці тому +2

    Just THANK YOU. This is by far the best video on the attention mechanism for people that learn visually

  • @aadeshingle7593
    @aadeshingle7593 8 місяців тому +2

    One of the best intuitions for understanding multi-head attention. Thanks a lot!❣

  • @kevon217
    @kevon217 8 місяців тому

    Wow, clearest example yet. Thanks for making this!

  • @saeed577
    @saeed577 3 місяці тому +1

    THE best explanation of this concept. That was genuinely amazing.

  • @bobae1357
    @bobae1357 2 місяці тому +2

    best description ever! easy to understand. I've been suffered to understanding attention. Finally I can tell I know it!

  • @RamiroMoyano
    @RamiroMoyano 8 місяців тому

    This is amazingly clear! Thank for your your work!

  • @ajnbin
    @ajnbin 4 місяці тому

    Fantastic !!! The explanation itself is a piece of art.
    The step by step approach, the abstractions, ... Kudos!!
    Please more of these

  • @amoghjain
    @amoghjain 4 місяці тому +1

    Thank you for making this video series for the sake of a learner and not to show off your own knowledge!! Great anecdotes and simple examples really helped me understand the key concepts!!

  • @anipacify1163
    @anipacify1163 2 місяці тому

    Omg this video is on a whole new level . This is prolly the best intuition behind the transformers and attention. Best way to understand. I went thro' a couple of videos online and finally found the best one . Thanks a lot ! Helped me understand the paper easily

  • @arulbalasubramanian9474
    @arulbalasubramanian9474 6 місяців тому

    Great explanation. After watching a handful of videos this one really makes it real easy to understand.

  • @hyyue7549
    @hyyue7549 4 місяці тому +3

    If I understand correctly, the transformer is basically a RNN model which got intercepted by bunch of different attention layers. Attention layers redo the embeddings every time when there is a new word coming in, the new embeddings are calculated based on current context and new word, then the embeddings will be sent to the feed forward layer and behave like the classic RNN model.

  • @abu-yousuf
    @abu-yousuf 5 місяців тому

    amazing explanation Luis. Can't thank you enough for your amazing work. You have a special gift to explain things. Thanks.

  • @docodemo727
    @docodemo727 5 місяців тому

    this video is really teaching you the intuition. much better than the others I went through that just throw formula to you. thanks for the great job!

  • @notprof
    @notprof 8 місяців тому

    Thank you so much for making these videos!

  • @ccgarciab
    @ccgarciab 2 місяці тому +1

    This is such a good, clear and concise video. Great job!

  • @karlbooklover
    @karlbooklover 9 місяців тому +1

    best explanation of embeddings I've seen, thank you!

  • @aaalexlit
    @aaalexlit 7 місяців тому

    That's an awesome explanation! Thanks!

  • @soumen_das
    @soumen_das 8 місяців тому +1

    Hey Louis, you are AMAZING! Your explanations are incredible.

  • @sayamkumar7276
    @sayamkumar7276 9 місяців тому +9

    This is one of the clearest, simplest and the most intuitive explanations on attention mechanism.. Thanks for making such a tedious and challenging concept of attention relatively easy to understand 👏 Looking forward to the impending 2 videos of this series on attention

  • @dr.mikeybee
    @dr.mikeybee 9 місяців тому +1

    Nicely done! This gives a great explanation of the function and value of the projection matrices.

  • @satvikparamkusham7454
    @satvikparamkusham7454 9 місяців тому

    This is the most amazing video on "Attention is all you need"

  • @prashant5611
    @prashant5611 8 місяців тому

    Amazing! Loved it! Thanks a lot Serrano!

  • @JorgeMartinez-xb2ks
    @JorgeMartinez-xb2ks 5 місяців тому

    El mejor video que he visto sobre la materia. Muchísimas gracias por este gran trabajo.

  • @pranayroy
    @pranayroy 3 місяці тому

    Kudos to your efforts in clear explanation!

  • @debarttasharan
    @debarttasharan 9 місяців тому

    Incredible explanation. Thank you so much!!!

  • @mohandesai
    @mohandesai 9 місяців тому +4

    One of the best explainations of attention I have seen without getting lost in the forest of computations. Looking forward to future videoas

  • @justthefactsplease
    @justthefactsplease 2 місяці тому

    What a great explanation on this topic! Great job!

  • @bankawat1
    @bankawat1 8 місяців тому

    Thanks for the amazing videos! I am eagrly waiting for the third video. If possible please do explain the bit how the K,Q,V matrices are used on the decoder side. That would be great help.

  • @dragolov
    @dragolov 9 місяців тому +1

    Deep respect, Luis Serrano! Thank you so much!

  • @sari54754
    @sari54754 5 місяців тому

    The most easy to understand video for the subject I've seen.

  • @kafaayari
    @kafaayari 9 місяців тому

    Well the gravity example is how I understood this after a long time. you are true legend.

  • @bananamaker4877
    @bananamaker4877 6 місяців тому

    Explained very well. Thank you so much.

  • @caryjason4171
    @caryjason4171 Місяць тому

    This video helps to explain the concept in a simple way.

  • @drdr3496
    @drdr3496 2 місяці тому +2

    This is a great video (as are the other 2) but one thing that needs to be clarified is that the embeddings themselves do not change (by attention @10:49). The gravity pull analogy is appropriate but the visuals give the impression that embedding weights change. What changes is the context vector.

  • @thelookerful
    @thelookerful 8 місяців тому

    This is wonderful !!

  • @tvinay8758
    @tvinay8758 9 місяців тому

    This is an great explanation of attention mechanism . I have enjoyed your maths for machine learning on coursera. Thank you for creating such wonderful videos

  • @alijohnnaqvi6383
    @alijohnnaqvi6383 3 місяці тому

    What a great video man!!! Thanks for making such videos.

  • @orcunkoraliseri9214
    @orcunkoraliseri9214 2 місяці тому

    I watched a lot about attentions. You are the best. Thank you thank you. I am also learning how to explain of a subject from you 😊

  • @user-dg2gt2yq3c
    @user-dg2gt2yq3c Місяць тому

    It's so great, I finally understand these qkvs, it bothers me so long. Thank you so much !!!

  • @DeepakSharma-xg5nu
    @DeepakSharma-xg5nu 2 місяці тому

    I did not even realize this video is 21 minutes long. Great explanation.

  • @perpetuallearner8257
    @perpetuallearner8257 9 місяців тому

    You're my fav teacher. Thank you Luis 😊

  • @LuisOtte-pk4wd
    @LuisOtte-pk4wd 3 місяці тому

    Luis Serrano you have a gift for explain! Thank you for sharing!

  • @orcunkoraliseri9214
    @orcunkoraliseri9214 2 місяці тому

    Wooow. Such a good explanation for embedding. Thanks 🎉

  • @agbeliemmanuel6023
    @agbeliemmanuel6023 9 місяців тому +2

    Wooow thanks so much. You are a treasure to the world. Amazing teacher of our time.

  • @ignacioruiz3732
    @ignacioruiz3732 2 місяці тому

    Outstanding video. Amazing to gain intuition.

  • @hkwong74531
    @hkwong74531 3 місяці тому

    I subscribe your channel immediately after watching this video, the first video I watch from your channel but also the first making me understand why embedding needs to be multiheaded. 👍🏻👍🏻👍🏻👍🏻

  • @eddydewaegeneer9514
    @eddydewaegeneer9514 Місяць тому

    Great video and very intuitive explenation of attention mechanism

  • @erickdamasceno
    @erickdamasceno 9 місяців тому +1

    Great explanation. Thank you very much for sharing this.

  • @jeffpatrick787
    @jeffpatrick787 4 місяці тому

    This was great - really well done!

  • @cyberpunkdarren
    @cyberpunkdarren 2 місяці тому

    Very impressed with this channel and presenter

  • @davutumut1469
    @davutumut1469 9 місяців тому

    amazing, love your channel. It's certainly underrated.

  • @maysammansor
    @maysammansor 2 місяці тому

    you are a great teacher. Thank you

  • @vishnusharma_7
    @vishnusharma_7 9 місяців тому

    You are great at teaching Mr. Luis

  • @bengoshi4
    @bengoshi4 9 місяців тому

    Yeah!!!! Looking forward to the second one!! 👍🏻😎

  • @MikeTon
    @MikeTon 3 місяці тому

    This clarifies EMBEDDED matrices :
    - In particular the point on how a book isn't just a RANDOM array of words, Matrices are NOT a RANDOM array of numbers
    - Visualization for the transform and shearing really drives home the V, Q, K aspect of the attention matrix that I have been STRUGGLING to internalize
    Big, big thanks for putting together this explanation!

  • @SulkyRain
    @SulkyRain 4 місяці тому

    Amazing explanation 🎉

  • @drintro
    @drintro 3 місяці тому

    Excellent description.

  • @jayanthkothapalli9.2
    @jayanthkothapalli9.2 2 місяці тому

    Wow wow wow! I enjoyed the video. Great teaching sir❤❤

  • @traveldiaries347
    @traveldiaries347 6 місяців тому

    Very well explained ❤

  • @user-uq7kc2eb1i
    @user-uq7kc2eb1i 4 місяці тому

    This video is really clear!

  • @surajprasad8741
    @surajprasad8741 5 місяців тому

    Thanks a lot Sir, clearly understood.

  • @ProgrammerRajaa
    @ProgrammerRajaa 9 місяців тому +1

    Your videos are so awesome plse upload more video thanks a lot

  • @khameelmustapha
    @khameelmustapha 9 місяців тому

    Brilliant explanation.

  • @WhatsAI
    @WhatsAI 9 місяців тому +1

    Amazing explanation Luis! As always...

  • @naimsassine
    @naimsassine 4 місяці тому

    super good job guys!

  • @sukhpreetlotey1172
    @sukhpreetlotey1172 2 місяці тому

    First of all thank you for making these great walkthroughs of the architecture. I would really like to support your effort on this channel. let me know how I can do that. thanks

    • @SerranoAcademy
      @SerranoAcademy  2 місяці тому

      Thank you so much, I really appreciate that! Soon I'll be implementing subscriptions, so you can subscribe to the channel and contribute (also get some perks). Please stay tuned, I'll publish it here and also on social media. :)

  • @serkansunel
    @serkansunel 3 місяці тому

    Excellent job

  • @TemporaryForstudy
    @TemporaryForstudy 8 місяців тому

    oh my god never understood V,K,Q as matrix transformations, thanks luis, love from india

  • @bravulo
    @bravulo 5 місяців тому

    Thanks. I saw also your "Math behind" video, but still missing the third in the series.

    • @SerranoAcademy
      @SerranoAcademy  4 місяці тому +2

      Thanks! The third video is out now! ua-cam.com/video/qaWMOYf4ri8/v-deo.html

  • @shashankshekharsingh9336
    @shashankshekharsingh9336 17 днів тому

    thank you sir 🙏, love from india💌

  • @muhammadsaqlain3720
    @muhammadsaqlain3720 6 місяців тому

    Thanks my friend.

  • @divikchoudhary8873
    @divikchoudhary8873 2 дні тому

    This is just Gold!!!!!

  • @EigenA
    @EigenA 4 місяці тому

    Great video!

  • @today-radio-in-the-zone
    @today-radio-in-the-zone 16 днів тому

    Thanks for your great effort to make people understand it. I, however, would like ask one thing such that you have explained V is the scores. scores of what? My opninion is that the V is the key vector so that the V makes QKT matrix to vector space again. Please make it clear for better understanding. Thanks!

  • @tristanwheeler2300
    @tristanwheeler2300 8 місяців тому +2

    Thanks so much for making this video. It's difficult to find people explaining these concepts on a higher level.
    One thing I missed was how we are able to have two different apples in the matrix. If something like this is possible then I'm guessing we have several instances every single word floating around - the ones with several different contextual potentials very scattered in the matrix, while the ones without so much variation in meaning closer together. So is this process where the positions of the words in the matrix is reevaluated based on the "gravitational pull" from the associations of the other words in the sentence also a process deciding whether or not to continue to use an existing instance of the word or to create an entirely new version of the word in a new position in the matrix?

  • @preetijani9658
    @preetijani9658 5 місяців тому

    Amazing

  • @mostinho7
    @mostinho7 5 місяців тому +1

    7:00 even with word embedding, words can be missing context and there’s no way to tell like the word apple. Are you taking about the company or the fruit?
    Attention matches each word of the input with every other word, in order to transform it or pull it towards a different location in the embedding based on the context. So when the sentence is “buy apple and orange” the word orange will cause the word apple to have an embedding or vector representation that’s closer to the fruit
    8:00

  • @ernesttan8090
    @ernesttan8090 4 місяці тому

    wonderful!

  • @junaidfayaz8323
    @junaidfayaz8323 2 місяці тому

    You are amazing !

  • @AlirezaGolabvand
    @AlirezaGolabvand 4 місяці тому

    thanks for this amazing video. i have a question. will you consider to make a video of teaching how t create videos like yours? the softwares and all from 0. it will be most helpfull. or at least please reply the softwares that you use for making these kind of beautiful animated presentation. thanks.

  • @BigAsciiHappyStar
    @BigAsciiHappyStar 14 днів тому

    13:32 "feel free to pause the video" reminds me of Chess UA-camr agadmator 🤣

  • @ramelgov7891
    @ramelgov7891 3 місяці тому

    amazing explanation! What software is used to make the visuals (graphs, transformations etc.) Thanks!

    • @SerranoAcademy
      @SerranoAcademy  3 місяці тому

      Thank you so much! I use Keynote for the slides.

  • @liminal6823
    @liminal6823 9 місяців тому

    Fantastic.

  • @Tony-tu8uz
    @Tony-tu8uz 9 місяців тому

    oh, thank you very much, it's a lot better than simpy talking about that paper without really explaining that

  • @samirelzein1095
    @samirelzein1095 9 місяців тому

    The great Luis!

  • @benhargreaves5556
    @benhargreaves5556 4 місяці тому

    Unless I'm mistaken, I think the linear transformations in this video incorrectly show the 2D axis as well as the object changing position, but in fact the 2D axis would stay exactly the same but with the 2D object rotating around it for example.

  • @angminhquan1491
    @angminhquan1491 24 дні тому

    love the video

  • @SergeyGrebenkin
    @SergeyGrebenkin Місяць тому

    At last someone explained the meaning of Q, K and V. I read original article and it just says "Ok, let's have 3 additional matrix Q, K and V to transform input embedding" ... What for? Thanks for explanation, this video really helps!