Document (#38866)

Author
Karpathy, A.
Title
¬The unreasonable effectiveness of recurrent neural networks
Source
https://karpathy.github.io/2015/05/21/rnn-effectiveness/
Year
2015
Abstract
There's something magical about Recurrent Neural Networks (RNNs). I still remember when I trained my first recurrent network for Image Captioning. Within a few dozen minutes of training my first baby model (with rather arbitrarily-chosen hyperparameters) started to generate very nice looking descriptions of images that were on the edge of making sense. Sometimes the ratio of how simple your model is to the quality of the results you get out of it blows past your expectations, and this was one of those times. What made this result so shocking at the time was that the common wisdom was that RNNs were supposed to be difficult to train (with more experience I've in fact reached the opposite conclusion). Fast forward about a year: I'm training RNNs all the time and I've witnessed their power and robustness many times, and yet their magical outputs still find ways of amusing me. This post is about sharing some of that magic with you. By the way, together with this post I am also releasing code on Github (https://github.com/karpathy/char-rnn) that allows you to train character-level language models based on multi-layer LSTMs. You give it a large chunk of text and it will learn to generate text like it one character at a time. You can also use it to reproduce my experiments below. But we're getting ahead of ourselves; What are RNNs anyway?

Similar documents (content)

  1. Karpathy, A.; Fei-Fei, L.: Deep visual-semantic alignments for generating image descriptions (2015) 0.23
    0.2334631 = sum of:
      0.2334631 = product of:
        0.83379674 = sum of:
          0.010124075 = weight(abstract_txt:with in 1868) [ClassicSimilarity], result of:
            0.010124075 = score(doc=1868,freq=1.0), product of:
              0.051840793 = queryWeight, product of:
                1.0643615 = boost
                2.4997334 = idf(docFreq=9868, maxDocs=44218)
                0.019484479 = queryNorm
              0.19529167 = fieldWeight in 1868, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                2.4997334 = idf(docFreq=9868, maxDocs=44218)
                0.078125 = fieldNorm(doc=1868)
          0.06198422 = weight(abstract_txt:networks in 1868) [ClassicSimilarity], result of:
            0.06198422 = score(doc=1868,freq=2.0), product of:
              0.10929547 = queryWeight, product of:
                1.0927968 = boost
                5.133032 = idf(docFreq=708, maxDocs=44218)
                0.019484479 = queryNorm
              0.5671252 = fieldWeight in 1868, product of:
                1.4142135 = tf(freq=2.0), with freq of:
                  2.0 = termFreq=2.0
                5.133032 = idf(docFreq=708, maxDocs=44218)
                0.078125 = fieldNorm(doc=1868)
          0.029308237 = weight(abstract_txt:about in 1868) [ClassicSimilarity], result of:
            0.029308237 = score(doc=1868,freq=1.0), product of:
              0.09567129 = queryWeight, product of:
                1.2522031 = boost
                3.9211915 = idf(docFreq=2381, maxDocs=44218)
                0.019484479 = queryNorm
              0.30634308 = fieldWeight in 1868, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                3.9211915 = idf(docFreq=2381, maxDocs=44218)
                0.078125 = fieldNorm(doc=1868)
          0.02155613 = weight(abstract_txt:that in 1868) [ClassicSimilarity], result of:
            0.02155613 = score(doc=1868,freq=4.0), product of:
              0.058223538 = queryWeight, product of:
                1.2611235 = boost
                2.3694751 = idf(docFreq=11241, maxDocs=44218)
                0.019484479 = queryNorm
              0.3702305 = fieldWeight in 1868, product of:
                2.0 = tf(freq=4.0), with freq of:
                  4.0 = termFreq=4.0
                2.3694751 = idf(docFreq=11241, maxDocs=44218)
                0.078125 = fieldNorm(doc=1868)
          0.07144112 = weight(abstract_txt:generate in 1868) [ClassicSimilarity], result of:
            0.07144112 = score(doc=1868,freq=1.0), product of:
              0.15137596 = queryWeight, product of:
                1.2860764 = boost
                6.0408955 = idf(docFreq=285, maxDocs=44218)
                0.019484479 = queryNorm
              0.47194496 = fieldWeight in 1868, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                6.0408955 = idf(docFreq=285, maxDocs=44218)
                0.078125 = fieldNorm(doc=1868)
          0.18650502 = weight(abstract_txt:neural in 1868) [ClassicSimilarity], result of:
            0.18650502 = score(doc=1868,freq=3.0), product of:
              0.19899614 = queryWeight, product of:
                1.474554 = boost
                6.926203 = idf(docFreq=117, maxDocs=44218)
                0.019484479 = queryNorm
              0.93722934 = fieldWeight in 1868, product of:
                1.7320508 = tf(freq=3.0), with freq of:
                  3.0 = termFreq=3.0
                6.926203 = idf(docFreq=117, maxDocs=44218)
                0.078125 = fieldNorm(doc=1868)
          0.45287797 = weight(abstract_txt:recurrent in 1868) [ClassicSimilarity], result of:
            0.45287797 = score(doc=1868,freq=2.0), product of:
              0.471085 = queryWeight, product of:
                2.7786484 = boost
                8.701155 = idf(docFreq=19, maxDocs=44218)
                0.019484479 = queryNorm
              0.96135086 = fieldWeight in 1868, product of:
                1.4142135 = tf(freq=2.0), with freq of:
                  2.0 = termFreq=2.0
                8.701155 = idf(docFreq=19, maxDocs=44218)
                0.078125 = fieldNorm(doc=1868)
        0.28 = coord(7/25)
    
  2. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, L.; Polosukhin, I.: Attention Is all you need (2017) 0.19
    0.19246955 = sum of:
      0.19246955 = product of:
        0.6014674 = sum of:
          0.011454084 = weight(abstract_txt:with in 970) [ClassicSimilarity], result of:
            0.011454084 = score(doc=970,freq=2.0), product of:
              0.051840793 = queryWeight, product of:
                1.0643615 = boost
                2.4997334 = idf(docFreq=9868, maxDocs=44218)
                0.019484479 = queryNorm
              0.22094731 = fieldWeight in 970, product of:
                1.4142135 = tf(freq=2.0), with freq of:
                  2.0 = termFreq=2.0
                2.4997334 = idf(docFreq=9868, maxDocs=44218)
                0.0625 = fieldNorm(doc=970)
          0.059991796 = weight(abstract_txt:training in 970) [ClassicSimilarity], result of:
            0.059991796 = score(doc=970,freq=3.0), product of:
              0.10840573 = queryWeight, product of:
                1.0883397 = boost
                5.112096 = idf(docFreq=723, maxDocs=44218)
                0.019484479 = queryNorm
              0.5534006 = fieldWeight in 970, product of:
                1.7320508 = tf(freq=3.0), with freq of:
                  3.0 = termFreq=3.0
                5.112096 = idf(docFreq=723, maxDocs=44218)
                0.0625 = fieldNorm(doc=970)
          0.035063572 = weight(abstract_txt:networks in 970) [ClassicSimilarity], result of:
            0.035063572 = score(doc=970,freq=1.0), product of:
              0.10929547 = queryWeight, product of:
                1.0927968 = boost
                5.133032 = idf(docFreq=708, maxDocs=44218)
                0.019484479 = queryNorm
              0.3208145 = fieldWeight in 970, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                5.133032 = idf(docFreq=708, maxDocs=44218)
                0.0625 = fieldNorm(doc=970)
          0.008622452 = weight(abstract_txt:that in 970) [ClassicSimilarity], result of:
            0.008622452 = score(doc=970,freq=1.0), product of:
              0.058223538 = queryWeight, product of:
                1.2611235 = boost
                2.3694751 = idf(docFreq=11241, maxDocs=44218)
                0.019484479 = queryNorm
              0.1480922 = fieldWeight in 970, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                2.3694751 = idf(docFreq=11241, maxDocs=44218)
                0.0625 = fieldNorm(doc=970)
          0.027761685 = weight(abstract_txt:time in 970) [ClassicSimilarity], result of:
            0.027761685 = score(doc=970,freq=1.0), product of:
              0.10707606 = queryWeight, product of:
                1.3247385 = boost
                4.148331 = idf(docFreq=1897, maxDocs=44218)
                0.019484479 = queryNorm
              0.2592707 = fieldWeight in 970, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                4.148331 = idf(docFreq=1897, maxDocs=44218)
                0.0625 = fieldNorm(doc=970)
          0.08614298 = weight(abstract_txt:neural in 970) [ClassicSimilarity], result of:
            0.08614298 = score(doc=970,freq=1.0), product of:
              0.19899614 = queryWeight, product of:
                1.474554 = boost
                6.926203 = idf(docFreq=117, maxDocs=44218)
                0.019484479 = queryNorm
              0.43288767 = fieldWeight in 970, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                6.926203 = idf(docFreq=117, maxDocs=44218)
                0.0625 = fieldNorm(doc=970)
          0.1162443 = weight(abstract_txt:train in 970) [ClassicSimilarity], result of:
            0.1162443 = score(doc=970,freq=1.0), product of:
              0.24300349 = queryWeight, product of:
                1.6294633 = boost
                7.653836 = idf(docFreq=56, maxDocs=44218)
                0.019484479 = queryNorm
              0.47836474 = fieldWeight in 970, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                7.653836 = idf(docFreq=56, maxDocs=44218)
                0.0625 = fieldNorm(doc=970)
          0.2561865 = weight(abstract_txt:recurrent in 970) [ClassicSimilarity], result of:
            0.2561865 = score(doc=970,freq=1.0), product of:
              0.471085 = queryWeight, product of:
                2.7786484 = boost
                8.701155 = idf(docFreq=19, maxDocs=44218)
                0.019484479 = queryNorm
              0.54382217 = fieldWeight in 970, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                8.701155 = idf(docFreq=19, maxDocs=44218)
                0.0625 = fieldNorm(doc=970)
        0.32 = coord(8/25)
    
  3. Haynes, M.: Your Google algorithm cheat sheet : Panda, Penguin, and Hummingbird (2013) 0.18
    0.18147649 = sum of:
      0.18147649 = product of:
        0.6481303 = sum of:
          0.009106589 = weight(abstract_txt:this in 2542) [ClassicSimilarity], result of:
            0.009106589 = score(doc=2542,freq=1.0), product of:
              0.04830646 = queryWeight, product of:
                1.0274388 = boost
                2.4130175 = idf(docFreq=10762, maxDocs=44218)
                0.019484479 = queryNorm
              0.18851699 = fieldWeight in 2542, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                2.4130175 = idf(docFreq=10762, maxDocs=44218)
                0.078125 = fieldNorm(doc=2542)
          0.010124075 = weight(abstract_txt:with in 2542) [ClassicSimilarity], result of:
            0.010124075 = score(doc=2542,freq=1.0), product of:
              0.051840793 = queryWeight, product of:
                1.0643615 = boost
                2.4997334 = idf(docFreq=9868, maxDocs=44218)
                0.019484479 = queryNorm
              0.19529167 = fieldWeight in 2542, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                2.4997334 = idf(docFreq=9868, maxDocs=44218)
                0.078125 = fieldNorm(doc=2542)
          0.04486974 = weight(abstract_txt:still in 2542) [ClassicSimilarity], result of:
            0.04486974 = score(doc=2542,freq=1.0), product of:
              0.11101809 = queryWeight, product of:
                1.101375 = boost
                5.173325 = idf(docFreq=680, maxDocs=44218)
                0.019484479 = queryNorm
              0.404166 = fieldWeight in 2542, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                5.173325 = idf(docFreq=680, maxDocs=44218)
                0.078125 = fieldNorm(doc=2542)
          0.050763357 = weight(abstract_txt:about in 2542) [ClassicSimilarity], result of:
            0.050763357 = score(doc=2542,freq=3.0), product of:
              0.09567129 = queryWeight, product of:
                1.2522031 = boost
                3.9211915 = idf(docFreq=2381, maxDocs=44218)
                0.019484479 = queryNorm
              0.5306018 = fieldWeight in 2542, product of:
                1.7320508 = tf(freq=3.0), with freq of:
                  3.0 = termFreq=3.0
                3.9211915 = idf(docFreq=2381, maxDocs=44218)
                0.078125 = fieldNorm(doc=2542)
          0.02155613 = weight(abstract_txt:that in 2542) [ClassicSimilarity], result of:
            0.02155613 = score(doc=2542,freq=4.0), product of:
              0.058223538 = queryWeight, product of:
                1.2611235 = boost
                2.3694751 = idf(docFreq=11241, maxDocs=44218)
                0.019484479 = queryNorm
              0.3702305 = fieldWeight in 2542, product of:
                2.0 = tf(freq=4.0), with freq of:
                  4.0 = termFreq=4.0
                2.3694751 = idf(docFreq=11241, maxDocs=44218)
                0.078125 = fieldNorm(doc=2542)
          0.076173276 = weight(abstract_txt:post in 2542) [ClassicSimilarity], result of:
            0.076173276 = score(doc=2542,freq=1.0), product of:
              0.15798886 = queryWeight, product of:
                1.3138676 = boost
                6.1714344 = idf(docFreq=250, maxDocs=44218)
                0.019484479 = queryNorm
              0.4821433 = fieldWeight in 2542, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                6.1714344 = idf(docFreq=250, maxDocs=44218)
                0.078125 = fieldNorm(doc=2542)
          0.43553713 = weight(title_txt:your in 2542) [ClassicSimilarity], result of:
            0.43553713 = score(doc=2542,freq=1.0), product of:
              0.20047867 = queryWeight, product of:
                1.4800365 = boost
                6.9519553 = idf(docFreq=114, maxDocs=44218)
                0.019484479 = queryNorm
              2.172486 = fieldWeight in 2542, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                6.9519553 = idf(docFreq=114, maxDocs=44218)
                0.3125 = fieldNorm(doc=2542)
        0.28 = coord(7/25)
    
  4. Kelley, D.: Relevance feedback : getting to know your user (2008) 0.15
    0.15116583 = sum of:
      0.15116583 = product of:
        0.62985766 = sum of:
          0.012618459 = weight(abstract_txt:this in 1924) [ClassicSimilarity], result of:
            0.012618459 = score(doc=1924,freq=3.0), product of:
              0.04830646 = queryWeight, product of:
                1.0274388 = boost
                2.4130175 = idf(docFreq=10762, maxDocs=44218)
                0.019484479 = queryNorm
              0.2612168 = fieldWeight in 1924, product of:
                1.7320508 = tf(freq=3.0), with freq of:
                  3.0 = termFreq=3.0
                2.4130175 = idf(docFreq=10762, maxDocs=44218)
                0.0625 = fieldNorm(doc=1924)
          0.01402833 = weight(abstract_txt:with in 1924) [ClassicSimilarity], result of:
            0.01402833 = score(doc=1924,freq=3.0), product of:
              0.051840793 = queryWeight, product of:
                1.0643615 = boost
                2.4997334 = idf(docFreq=9868, maxDocs=44218)
                0.019484479 = queryNorm
              0.27060407 = fieldWeight in 1924, product of:
                1.7320508 = tf(freq=3.0), with freq of:
                  3.0 = termFreq=3.0
                2.4997334 = idf(docFreq=9868, maxDocs=44218)
                0.0625 = fieldNorm(doc=1924)
          0.040610686 = weight(abstract_txt:about in 1924) [ClassicSimilarity], result of:
            0.040610686 = score(doc=1924,freq=3.0), product of:
              0.09567129 = queryWeight, product of:
                1.2522031 = boost
                3.9211915 = idf(docFreq=2381, maxDocs=44218)
                0.019484479 = queryNorm
              0.42448142 = fieldWeight in 1924, product of:
                1.7320508 = tf(freq=3.0), with freq of:
                  3.0 = termFreq=3.0
                3.9211915 = idf(docFreq=2381, maxDocs=44218)
                0.0625 = fieldNorm(doc=1924)
          0.012193988 = weight(abstract_txt:that in 1924) [ClassicSimilarity], result of:
            0.012193988 = score(doc=1924,freq=2.0), product of:
              0.058223538 = queryWeight, product of:
                1.2611235 = boost
                2.3694751 = idf(docFreq=11241, maxDocs=44218)
                0.019484479 = queryNorm
              0.20943399 = fieldWeight in 1924, product of:
                1.4142135 = tf(freq=2.0), with freq of:
                  2.0 = termFreq=2.0
                2.3694751 = idf(docFreq=11241, maxDocs=44218)
                0.0625 = fieldNorm(doc=1924)
          0.027761685 = weight(abstract_txt:time in 1924) [ClassicSimilarity], result of:
            0.027761685 = score(doc=1924,freq=1.0), product of:
              0.10707606 = queryWeight, product of:
                1.3247385 = boost
                4.148331 = idf(docFreq=1897, maxDocs=44218)
                0.019484479 = queryNorm
              0.2592707 = fieldWeight in 1924, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                4.148331 = idf(docFreq=1897, maxDocs=44218)
                0.0625 = fieldNorm(doc=1924)
          0.5226445 = weight(title_txt:your in 1924) [ClassicSimilarity], result of:
            0.5226445 = score(doc=1924,freq=1.0), product of:
              0.20047867 = queryWeight, product of:
                1.4800365 = boost
                6.9519553 = idf(docFreq=114, maxDocs=44218)
                0.019484479 = queryNorm
              2.6069832 = fieldWeight in 1924, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                6.9519553 = idf(docFreq=114, maxDocs=44218)
                0.375 = fieldNorm(doc=1924)
        0.24 = coord(6/25)
    
  5. Doval, Y.; Gómez-Rodríguez, C.: Comparing neural- and N-gram-based language models for word segmentation (2019) 0.15
    0.14986506 = sum of:
      0.14986506 = product of:
        0.53523237 = sum of:
          0.014570543 = weight(abstract_txt:this in 4675) [ClassicSimilarity], result of:
            0.014570543 = score(doc=4675,freq=4.0), product of:
              0.04830646 = queryWeight, product of:
                1.0274388 = boost
                2.4130175 = idf(docFreq=10762, maxDocs=44218)
                0.019484479 = queryNorm
              0.3016272 = fieldWeight in 4675, product of:
                2.0 = tf(freq=4.0), with freq of:
                  4.0 = termFreq=4.0
                2.4130175 = idf(docFreq=10762, maxDocs=44218)
                0.0625 = fieldNorm(doc=4675)
          0.011454084 = weight(abstract_txt:with in 4675) [ClassicSimilarity], result of:
            0.011454084 = score(doc=4675,freq=2.0), product of:
              0.051840793 = queryWeight, product of:
                1.0643615 = boost
                2.4997334 = idf(docFreq=9868, maxDocs=44218)
                0.019484479 = queryNorm
              0.22094731 = fieldWeight in 4675, product of:
                1.4142135 = tf(freq=2.0), with freq of:
                  2.0 = termFreq=2.0
                2.4997334 = idf(docFreq=9868, maxDocs=44218)
                0.0625 = fieldNorm(doc=4675)
          0.014934524 = weight(abstract_txt:that in 4675) [ClassicSimilarity], result of:
            0.014934524 = score(doc=4675,freq=3.0), product of:
              0.058223538 = queryWeight, product of:
                1.2611235 = boost
                2.3694751 = idf(docFreq=11241, maxDocs=44218)
                0.019484479 = queryNorm
              0.2565032 = fieldWeight in 4675, product of:
                1.7320508 = tf(freq=3.0), with freq of:
                  3.0 = termFreq=3.0
                2.3694751 = idf(docFreq=11241, maxDocs=44218)
                0.0625 = fieldNorm(doc=4675)
          0.027761685 = weight(abstract_txt:time in 4675) [ClassicSimilarity], result of:
            0.027761685 = score(doc=4675,freq=1.0), product of:
              0.10707606 = queryWeight, product of:
                1.3247385 = boost
                4.148331 = idf(docFreq=1897, maxDocs=44218)
                0.019484479 = queryNorm
              0.2592707 = fieldWeight in 4675, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                4.148331 = idf(docFreq=1897, maxDocs=44218)
                0.0625 = fieldNorm(doc=4675)
          0.12418207 = weight(abstract_txt:character in 4675) [ClassicSimilarity], result of:
            0.12418207 = score(doc=4675,freq=3.0), product of:
              0.17607468 = queryWeight, product of:
                1.387033 = boost
                6.515104 = idf(docFreq=177, maxDocs=44218)
                0.019484479 = queryNorm
              0.70528066 = fieldWeight in 4675, product of:
                1.7320508 = tf(freq=3.0), with freq of:
                  3.0 = termFreq=3.0
                6.515104 = idf(docFreq=177, maxDocs=44218)
                0.0625 = fieldNorm(doc=4675)
          0.08614298 = weight(abstract_txt:neural in 4675) [ClassicSimilarity], result of:
            0.08614298 = score(doc=4675,freq=1.0), product of:
              0.19899614 = queryWeight, product of:
                1.474554 = boost
                6.926203 = idf(docFreq=117, maxDocs=44218)
                0.019484479 = queryNorm
              0.43288767 = fieldWeight in 4675, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                6.926203 = idf(docFreq=117, maxDocs=44218)
                0.0625 = fieldNorm(doc=4675)
          0.2561865 = weight(abstract_txt:recurrent in 4675) [ClassicSimilarity], result of:
            0.2561865 = score(doc=4675,freq=1.0), product of:
              0.471085 = queryWeight, product of:
                2.7786484 = boost
                8.701155 = idf(docFreq=19, maxDocs=44218)
                0.019484479 = queryNorm
              0.54382217 = fieldWeight in 4675, product of:
                1.0 = tf(freq=1.0), with freq of:
                  1.0 = termFreq=1.0
                8.701155 = idf(docFreq=19, maxDocs=44218)
                0.0625 = fieldNorm(doc=4675)
        0.28 = coord(7/25)