MIT 6.S191 (2023): Recurrent Neural Networks, Transformers, and Attention

2024 ж. 16 Мам.
644 862 Рет қаралды

MIT Introduction to Deep Learning 6.S191: Lecture 2
Recurrent Neural Networks
Lecturer: Ava Amini
2023 Edition
For all lectures, slides, and lab materials: introtodeeplearning.com
Lecture Outline
0:00​ - Introduction
3:07​ - Sequence modeling
5:09​ - Neurons with recurrence
12:05 - Recurrent neural networks
13:47 - RNN intuition
15:03​ - Unfolding RNNs
18:57 - RNNs from scratch
21:50 - Design criteria for sequential modeling
23:45 - Word prediction example
29:57​ - Backpropagation through time
32:25 - Gradient issues
37:03​ - Long short term memory (LSTM)
39:50​ - RNN applications
44:50 - Attention fundamentals
48:10 - Intuition of attention
50:30 - Attention and search relationship
52:40 - Learning attention with neural networks
58:16 - Scaling attention and applications
1:02:02 - Summary
Subscribe to stay up to date with new deep learning lectures at MIT, or follow us @MITDeepLearning on Twitter and Instagram to stay fully-connected!!

Пікірлер
  • I just can't believe how amazing the educators are and damn !! they're providing it out here for free... Hats off to the team !!

    @lonewolf-_-8634@lonewolf-_-863411 ай бұрын
    • researchers are providing the content for free too

      @js913@js91311 ай бұрын
    • Would love it, if they found mature experts on these topics instead of children.

      @jurycould4275@jurycould42752 ай бұрын
  • I am a Professor and this is the best course I have found to learn about Machine learning and Deep learning....

    @deepakspace@deepakspace Жыл бұрын
    • I just took a paid course in this subject matter, and this free explanation is so much more intelligible.

      @Rhapsody83@Rhapsody83 Жыл бұрын
    • agreed

      @sijiaxiao1557@sijiaxiao1557 Жыл бұрын
    • Coursera machine learning specialization

      @avinashdwivedi2015@avinashdwivedi20159 ай бұрын
    • Why do I think you are an undergraduate student 😂

      @olutoki@olutoki3 ай бұрын
    • @@olutokigenes

      @PriyanshuAman-dn5jx@PriyanshuAman-dn5jxАй бұрын
  • Watching those MIT courses alongside course at my Uni in Poland, so grateful to be able to experience such a high quality education

    @lazydart4117@lazydart4117 Жыл бұрын
    • This girl looks so young

      @GuinessOriginal@GuinessOriginal Жыл бұрын
    • Mogę spytać gdzie i co studiujesz ? ( jestem maturzystą i chciałbym wiedzieć gdzie w Polsce są kierunki podobnego typu )

      @ukaszkasprzak5921@ukaszkasprzak5921 Жыл бұрын
    • @@ukaszkasprzak5921 Kognitywistyka UW Zagadnienia z AI, machine learningu i matematyki są tu omawiane obok zagadnień humanistycznych: Lingwistyka, Filozofia Umysłu, Psychologia Poznawcza etc. Radzę przejrzeć Program studiów, proste googlowanie wystarczy

      @lazydart4117@lazydart4117 Жыл бұрын
  • These are some spectacular lessons. Thank you very much for making this available.

    @MrPejotah@MrPejotah Жыл бұрын
  • One of the best lectures I have seen on Sequence Models, with crystal clear explanations! :)

    @pankajsinha385@pankajsinha38511 ай бұрын
  • Thank you so much MIT and instructors for making these very high quality lectures available to everyone. Students from developing countries who have aspirations to achieve something big is now possible with this type of content and information!

    @tgyawali@tgyawali11 ай бұрын
    • couldn't agree more. thanks once again MIT for providing world class education.

      @geosaiofficial1070@geosaiofficial107011 ай бұрын
  • Extremely informative, well structured and paced. A pleasure to watch and follow. Thank you.

    @vsevolodnedora7779@vsevolodnedora7779 Жыл бұрын
  • I watched and read a lot of content about Transformers and never understood what are those three Q, K, and V vectors doing so I coulnd't understand how attention works, until today when I watched this lecture doing the analogy of KZhead search and the Iron Man picture. Now it became much much clearer! Thanks for the brilliant analogies that you are making!

    @hamza-325@hamza-32510 ай бұрын
  • This is what we need in this day and age, the teaching is amazing and can be understood by people of variable intelligence. Nice work and thanks for this course.

    @anshikajain3298@anshikajain3298 Жыл бұрын
  • Indeed commendable the way this lecture has been ordered and difficult topic like self-attention has been lucidly explained. Thanks to the instructors, really appreciated.

    @roy11883@roy1188311 ай бұрын
  • Over all videos on KZhead that explained about Transformer architecture (including the visual explanation) , this is the BEST EXPLANATION ever done. Simple, contextual, high level, step by step complexity progression. Thank you the educators and MIT!

    @joxa6119@joxa61197 ай бұрын
  • Thank you for this amazing content! There are many concepts discussed intuitively!

    @nataliameira2283@nataliameira2283 Жыл бұрын
  • As a CS student from University of Tehran, you guys don't have any idea how much such content could be helpful and the idea that all of this is free make it really amazing. Really appreciate it Alexander and Ava. Best hops.

    @kiarashgeraili8595@kiarashgeraili85955 ай бұрын
  • This is incredible! Thanks a lot for this video, it’s going to help me a lot in my undergrad reasearch :)

    @ViniciusVA1@ViniciusVA1 Жыл бұрын
  • Wow, Transformers, and Attention was an absolute lifesaver! 🚀🙌 The explanations were crystal clear, and I finally have a solid grasp on these concepts. This video saved me so much time and confusion. Huge thanks to the Ava for making such an informative and engaging tutorial! Can't wait to delve deeper into the world of AI and machine learning. 🤖💡

    @nagashayanreddy7237@nagashayanreddy72379 ай бұрын
  • These lectures are simply amazing. Thank you so much!

    @hullabulla@hullabulla Жыл бұрын
  • Best end to the lecture: “Thank you for your attention.” ❤😂

    @xvaruunx@xvaruunx Жыл бұрын
  • The most intutive explanation of Self Attention I have seen!

    @AIlysAI@AIlysAI Жыл бұрын
  • Just watched lecture 1, looking forward to this and the lab coming after. Thanks for this great open resource!

    @alhassanchoubassi2441@alhassanchoubassi2441 Жыл бұрын
    • Are there the labs available as well?

      @subcorney@subcorney Жыл бұрын
  • 50:30 - Attention mechnaism beautifully explained. Thank you #AvaAmini

    @aravindsd6839@aravindsd683910 ай бұрын
  • I am trying to step into deep learning for last couple of month. This is the best thing I have found so far. Thank you sir!.

    @nitul_singha@nitul_singha3 ай бұрын
  • Amazing course! Thank you so much!

    @ngrunmann@ngrunmann11 ай бұрын
  • How beautifully explained. Loved it 🥰

    @tcoc15yuktamore4@tcoc15yuktamore411 ай бұрын
  • Amazing . thank you MIT.

    @tapanmahata8330@tapanmahata83307 ай бұрын
  • Summary by Gemini: The lecture is about recurrent neural networks, transformers, and attention. The speaker, Ava, starts the lecture by introducing the concept of sequential data and how it is different from the data that we typically work with in neural networks. She then goes on to discuss the different types of sequential modeling problems, such as text generation, machine translation, and image captioning. Next, Ava introduces the concept of recurrent neural networks (RNNs) and how they can be used to process sequential data. She explains that RNNs are able to learn from the past and use that information to make predictions about the future. However, she also points out that RNNs can suffer from vanishing and exploding gradients, which can make them difficult to train. To address these limitations, Ava introduces the concept of transformers. Transformers are a type of neural network that does not rely on recurrence. Instead, they use attention to focus on the most important parts of the input data. Ava explains that transformers have been shown to be very effective for a variety of sequential modeling tasks, including machine translation and text generation. In the last part of the lecture, Ava discusses the applications of transformers in various fields, such as biology, medicine, and computer vision. She concludes the lecture by summarizing the key points and encouraging the audience to ask questions.

    @gemini_537@gemini_5373 ай бұрын
    • 👍🌚

      @Shadowfaex@Shadowfaex2 ай бұрын
    • You should comment on every video. Liked it.

      @user-mc5ox7cv8k@user-mc5ox7cv8k20 күн бұрын
  • Great lecture, learnt a lot. Thank you for sharing!

    @ellenxiao223@ellenxiao223 Жыл бұрын
  • 15:05 we have different weights matrix for generating h_t and generating y_t h_t generated using two different weights matrix, to take contribution from previous state and current input 51:20 start of attention explanation 59:30 each attention head focus on some part similar to how each filter in cnn can learn to extract specific features like horizontal lines etc

    @mostinho7@mostinho75 ай бұрын
  • ty to MIT for giving back a little in an impactful way

    @sorover111@sorover111 Жыл бұрын
  • I have used LSTM and Transformer a lot, but I can still get more insights from this lecture.

    @jackq2331@jackq2331 Жыл бұрын
  • Your explanation of attention took me 2 revisits to this video to truly truly understand! But now when I did, my love for deep learning got stronger :)

    @excitingtomorrow@excitingtomorrow11 ай бұрын
    • oh epochs=3 rofl

      @manojbp07@manojbp07Ай бұрын
  • Lovely presentation! It couldn't get more interesting!

    @varunahlawat9013@varunahlawat9013 Жыл бұрын
  • Came here to refresh my memory of deep learning for sequential data. I really like how Ava brings us from one algorithm to another. It makes perfect sense to me.

    @TimelyTimeSeries@TimelyTimeSeries4 ай бұрын
  • Grateful for the efforts of MIT and its incredible professors delivering high quality free lectures. Filling every gap I have in my current classes ❤

    @monome3038@monome30385 ай бұрын
  • This is my favorite subject :) (following is self clarification of said words that feel exaggerated) 4:08 - binary classification or filtering is a sequence of steps: - new recording - retrieval of a constant record - compare new and constant record - express a property of the compare process So, sequencing really is a property of maybe all systems. While "wave sequencing" is built on top of a Sequencer System, that repeatedly uses the "same actions" per sequence element.

    @gidi1899@gidi1899 Жыл бұрын
  • Thank you for this beautiful lecture.

    @chineduezeofor2481@chineduezeofor248115 күн бұрын
  • Thank you so much for the free course. Benifit and appreciate

    @jingji6665@jingji666510 ай бұрын
  • Wow just amazing, no words left. Really Thanks 🙏

    @goswamimohit@goswamimohit9 ай бұрын
  • Wonderful, easy to focus and understand :). Great quality! Grateful that this is open source!

    @AnonymousIguana@AnonymousIguana Жыл бұрын
  • amazing lecture series, thanks for sharing this knowledge with the world. I am curious if theres a lecture on LSTM'S

    @digitalnomad2196@digitalnomad2196 Жыл бұрын
  • She absolutely killed it. Amazing lecture(r)!

    @Djellowman@Djellowman Жыл бұрын
    • I have many years of lecturing experience and just wish I was as competent she is. Great job.

      @cienciadedados@cienciadedados10 ай бұрын
  • Thank you Ava Soleimany and MIT ☺😊🤗💜

    @nikteshy9131@nikteshy9131 Жыл бұрын
  • Thanks for this amazing course

    @neuralnexus340@neuralnexus3405 ай бұрын
  • Fully understand transformers. One of the clearest and succinct explanations out there, so intuitive. Thank you!!

    @Reaperaxe9@Reaperaxe9 Жыл бұрын
  • Great Presentation @8:00 minutes it really explained a circuitry I was looking forward to exploring

    @jamesandino8346@jamesandino83464 ай бұрын
  • I already have some knowledge on the subject, however, I like to keep myself updated and there is always something new to learn. She clearly explains how what she is teaching really works. The whole video is worth watching.

    @luizmeier@luizmeier Жыл бұрын
  • Very intuitive explanation, thanks!

    @ziku8910@ziku8910 Жыл бұрын
  • This was the third video I watched in search of understanding what transformers are, and by far the best one. Thanks.

    @Itangalo@Itangalo10 ай бұрын
  • Great Teamwork of Alex Amini and Ava Amini.

    @eee8@eee89 ай бұрын
  • best Friday after-work fun thanks!

    @TJ-hs1qm@TJ-hs1qm Жыл бұрын
  • What an amazing content! Thank you! ❤️

    @dotmalec@dotmalec3 ай бұрын
  • Simply brilliant!

    @BruWozniak@BruWozniak Жыл бұрын
  • Awesome Course, Very easy to understand+++, Thx all MIT instructors 😊😊😊

    @NoppadatchSukchote@NoppadatchSukchote11 ай бұрын
  • I come back every year to check these lectures and to see what innovations made it into the lectures. Pleasantly surprised to see the name change, congrats!

    @twiddlebit@twiddlebit Жыл бұрын
    • What do you mean by name change?

      @agamersdiary1622@agamersdiary1622 Жыл бұрын
    • @@agamersdiary1622 This woman got married to one of the other lecturers (the channel owner Alexander).

      @diamondshock4405@diamondshock440511 ай бұрын
  • Till Now best Course, I am doing great when I found these MIT's Lecture

    @RNDbyvaibhav@RNDbyvaibhav3 ай бұрын
  • I worked in spatial statistics during my graduation. And now, I think your classes will push me more and more towards the machine learning. Looking forward to apply my learning in my upcoming level of study. Thanks for your efforts 💝

    @riyajunjannat7294@riyajunjannat729410 ай бұрын
    • Штоэто.запрасмоттр.непанядно

      @user-xq3sw9fj3d@user-xq3sw9fj3d7 ай бұрын
  • Mr Amini thanks for your channel

    @mohadreza9419@mohadreza94195 ай бұрын
  • Best explanation ever!!!! thank you

    @vin-deep@vin-deep10 ай бұрын
  • I always meant to watch these lectures since 2020, but something always comes up. Now, nothing is going to stop me. Not even nothing. Great lectures, best way to learn.

    @michaelngecha9227@michaelngecha9227 Жыл бұрын
    • Same man. The academic stress as an undergraduate was my "something always comes up," but since I just graduated a few days ago, I now have no excuse to not indulge myself in these videos lol.

      @josephlee392@josephlee39211 ай бұрын
  • Finally I understand the transformer concept now. Great lecture series👍!

    @elu1@elu1 Жыл бұрын
  • Thank you for this amazing and easy to understand course! I'm a beginner of the RNN, but I can almost know all the concepts from this lecture!

    @estherni9412@estherni9412 Жыл бұрын
  • I was searching about RNN for my Thesis work.She solved it...Nice Miss:)

    @umarfarooq-gc7vz@umarfarooq-gc7vz10 ай бұрын
  • legendary lecture, thank you for sharing

    @glowish1993@glowish19936 ай бұрын
  • I just started learning about RNN and LSTM especially for NLP and found this video very helpful to me. It would be really exciting if you provided a video about transformers in more depth :)

    @maduresenerd5716@maduresenerd57166 ай бұрын
  • Thank you for the awesome lecture

    @holderstown643@holderstown643Ай бұрын
  • This is some really deep learning. MIT is the height of institutional education. 👏👏. Thanks for sharing.

    @chukwunta@chukwunta Жыл бұрын
  • She is fantastic at teaching. I love how easily understandable she makes it. Thank you, Prof Amini.

    @pw7225@pw72258 ай бұрын
  • Thanks for sharing!

    @jennifergo2024@jennifergo20245 ай бұрын
  • Thanks for sharing such high quality content! 👌

    @theneumann7@theneumann7 Жыл бұрын
  • Thank you@MIT

    @gksr@gksr5 ай бұрын
  • Great material and the best educator!. Thank you for the fantastic video! The material was not only informative but also engaging, and the quality of the presentation was top-notch. Your depth of knowledge truly shines through, making the learning experience both enriching and enjoyable. Presented such complex material with such ease. You've done an exceptional job in communicating the concepts clearly. Great work!" and everything is free! Great job MIT team!!

    @andyandurkar7814@andyandurkar78145 ай бұрын
  • This is shockingly good. Thank you.

    @alexchow9629@alexchow96292 ай бұрын
  • Great 👍 presentation 👏

    @krishnakumark.p8184@krishnakumark.p81848 ай бұрын
  • query key value pairs always put me off whener I start to learn about transformers, this time I actually finished the video. Thanks MIT

    @nazrinnagori@nazrinnagori5 ай бұрын
  • She is so good!!!!🎉🎉❤❤

    @derrickxu908@derrickxu9083 ай бұрын
  • Really helpful! ⭐️

    @meghan______669@meghan______6692 ай бұрын
  • Very good !

    @lf655@lf6559 ай бұрын
  • Thank you very much for this great oppurtunity to watch MIT lectures. always dreamt of a world class education and finally im doing a degree in AI and such videos are supporting my learning process very much

    @MuhammadIbrahim-ut3rq@MuhammadIbrahim-ut3rq4 ай бұрын
  • Pretty straight forward lecture.

    @Sal-imm@Sal-imm Жыл бұрын
  • I am an auditor and have very little to do with this subject, except for my curiosity. I feel lucky that these kind of videos are available for free

    @vohra82@vohra824 ай бұрын
  • Thanks for sharing

    @joshismyhandle@joshismyhandle Жыл бұрын
  • Awesome Course, Very easy to understand+++

    @NoppadatchSukchote@NoppadatchSukchote11 ай бұрын
  • I can't wait to watch

    @peetprogressngoune3806@peetprogressngoune3806 Жыл бұрын
  • I am 6 years old, and I have been able to follow everything said, after watching 3 times.

    @megalomaniacal@megalomaniacal Жыл бұрын
    • Life works on what she is speaking . We need to look deep into life to evolve and make a shift in thinking

      @johnpaily@johnpailyАй бұрын
  • Salutes hopr to come back MIT Deep learning. I feel you peple need to look deep inro life

    @johnpaily@johnpailyАй бұрын
  • This is amazing. Studying from Kenya, and this absolutely is quality lectures.

    @Roy-hk8yh@Roy-hk8yh Жыл бұрын
  • Code showed at RNN Intuition chapter at 14:00 makes thing clear af. I literally said "Wow"

    @akj3344@akj334411 ай бұрын
  • que increible! esto es genial!

    @ayo4757@ayo475710 ай бұрын
  • I've always wanted to study deep learning, but I never really knew where to start. This MIT course was my answer

    @prishamaiti@prishamaiti Жыл бұрын
  • Thank you so much

    @johanliebert6206@johanliebert6206Ай бұрын
  • It's very helpful for me ❤

    @user-gv4uk2ez6g@user-gv4uk2ez6g10 ай бұрын
  • Would like to see the coming lectures and the interesting student projects!

    @yongqinzhao8087@yongqinzhao8087 Жыл бұрын
  • Awsome! Video!! Very well thought out lecture. Keep rockin' !!! You just solved my problem in my NNW optimization project, in just two sentences.🤣 For 4 months, this has been driving me completely insane.💥🤣🔫 I think I'm in love.😀

    @Jupiter-Optimus-Maximus@Jupiter-Optimus-Maximus8 ай бұрын
  • 🎯Course outline for quick navigation: [00:09-02:02]Sequence modeling with neural networks -[00:09-00:37]Ava introduces second lecture on sequence modeling in neural networks. -[00:55-01:46]The lecture aims to demystify sequential modeling by starting from foundational concepts and developing intuition through step-by-step explanations. [02:02-13:24]Sequential data processing and modeling -[02:02-02:46]Sequential data is all around us, from sound waves to text and language. -[03:10-03:50]Sequential modeling can be applied to classification and regression problems, with feed-forward models operating in a fixed, static setting. -[05:02-05:26]Lecture covers building neural networks for recurrent and transformer architectures. -[11:56-12:37]Rnn captures cyclic temporal dependency in maintaining and updating state at each time step. [13:24-20:04]Understanding rnn computation -[14:40-15:04]Explains rnn's prediction for next word, updating state, and processing sequential information. -[15:05-15:47]Rnn computes hidden state update and output prediction. -[16:17-17:05]Rnn updates hidden state and generates output in single operation. -[18:45-19:39]The total loss for a particular input to the rnn is computed by summing individual loss terms. the rnn implementation in tensorflow involves defining an rnn as a layer operation and class, initializing weight matrices and hidden state, and passing forward through the rnn network to process a given input x. [20:05-29:13]Rnn in tensorflow -[20:05-20:54]Tensorflow abstracts rnn network definition for efficiency. practice rnn implementation in today's lab. -[21:16-21:43]Today's software lab focuses on many-to-many processing and sequential modeling. -[22:53-23:21]Sequence implies order, impacting predictions. parameter sharing is crucial for effective information processing. -[25:04-25:29]Language must be numerically represented for processing, requiring translation into a vector. -[28:29-28:56]Predict next word with short, long, and even longer sequences while tracking dependencies across different lengths. [29:14-41:53]Rnn training and issues -[30:02-30:27]Training neural network models using backpropagation algorithm for sequential information. -[30:45-31:43]Rnns use backpropagation through time to adjust network weights and minimize overall loss through individual time steps. -[32:03-32:57]Repeated multiplications of big weight matrices can lead to exploding gradients, making it infeasible to train the network stably. -[35:45-37:18]Three ways to mitigate vanishing gradient problem: change activation functions, initialize parameters, use a more robust version of recurrent neural unit. -[36:13-37:01]Relu activation function helps mitigate vanishing gradient problem by maintaining derivatives greater than one, and weight initialization with identity matrices prevents rapid shrinkage of weight updates. -[37:54-38:25]Lstms are effective at tracking long-term dependencies by controlling information flow through gates. -[40:18-41:13]Build rnn to predict musical notes and generate new sequences, e.g. completing schubert's unfinished symphony. [41:53-50:11]Challenges in rnn and self-attention -[43:58-44:40]Rnns face challenges in slow processing and limited capacity for long memory data. -[46:37-47:00]Concatenate all time steps into one vector input for the model -[47:21-47:45]Feed-forward network lacks scalability, loses in-order information, and hinders long-term memory. -[48:11-48:34]Self-attention is a powerful concept in deep learning and ai, foundational in transformer architecture. -[48:58-49:25]Exploring the power of self-attention in neural networks, focusing on attending to important parts of an input example. [50:13-56:20]Neural network attention mechanism -[50:13-50:43]Understanding the concept of search and its role in extracting important information from a larger data set. -[51:52-55:24]Neural networks use self-attention to extract relevant information, like in the example of identifying a relevant video on deep learning, by computing similarity scores between queries and keys. -[53:32-53:54]A neural network encodes positional information to process time steps all at once in singular data. -[55:32-55:57]Comparing vectors using dot product to measure similarity. [56:20-01:02:47]Self-attention mechanism in nlp -[56:20-57:14]Computing attention scores to define relationships in sequential data. -[59:11-59:39]Self-attention heads extract high attention features, forming larger network architectures. -[01:00:32-01:00:56]Self-attention is a key operation in powerful neural networks like gpt-3. offered by Coursnap

    @bohanwang-nt7qz@bohanwang-nt7qz3 ай бұрын
  • Great job simplifying very complex understanding the functions of neural networks! Avi MD MBA, MS, MHA

    @avideshmukh6308@avideshmukh63085 ай бұрын
  • thank you sir, you produce great stuff

    @zbc-sh6mf@zbc-sh6mf Жыл бұрын
  • The fact that these videos now have millions of views.... the world is evolving so fast scientifically or at least scientific culture.

    @jerahmeelsangil247@jerahmeelsangil2474 ай бұрын
  • perfect

    @user-ov7ze8yc9l@user-ov7ze8yc9l9 ай бұрын
  • ThNks mit

    @glenngilmour2562@glenngilmour256223 күн бұрын
  • Thanks a lot!

    @Friemelkubus@Friemelkubus3 ай бұрын
  • Thank you.

    @snehashispanda4808@snehashispanda4808 Жыл бұрын
KZhead