AIAny

The Unreasonable Effectiveness of Recurrent Neural Networks

Karpathy's 2015 walkthrough of character-level RNNs trained to predict the next character, showing how a tiny model learns to generate convincing Shakespeare, C code, and LaTeX — and what its neurons actually track.

Introduction

The most persuasive argument for sequence models was never a benchmark — it was a screen full of fake Shakespeare, fake C code, and fake math papers produced by a model that had only ever been told to guess the next character. Karpathy's bet here is pedagogical: instead of explaining what RNNs can do, he shows you their raw output and lets the strangeness of it do the convincing. The lasting lesson is that "predict the next token" is a deceptively far-reaching training objective — the same idea that, scaled up, became the entire premise of modern language models.

Core Idea
  • Character-level, not word-level. The model sees one character at a time and predicts the next, so it has to discover spelling, punctuation, brackets, and indentation from scratch — making its competence feel earned rather than templated.
  • Output is the proof. Samples trained on Shakespeare, the Linux kernel source, Wikipedia markup, and LaTeX read as eerily plausible, demonstrating that an RNN captures structure across long spans, not just local n-grams.
  • Neurons are interpretable. Visualizing individual cells reveals ones that track quote-open/quote-close state or position inside a line — concrete evidence that the hidden state stores meaningful, human-legible features.
  • Simplicity is the point. A short, hackable training loop produces these results, which is why "char-rnn" became a rite of passage and the on-ramp many people took into deep learning.
Who It Fits / When to Skip

Great fit if you want intuition for why next-token prediction works, or a vivid first contact with sequence modeling before touching attention. Look elsewhere if you need a current architecture — RNNs and LSTMs were largely displaced by the Transformer, so treat this as the conceptual seed of that lineage, not a recipe for today's models.

Information

  • Websitekarpathy.github.io
  • OrganizationsStanford University
  • AuthorsAndrej Karpathy
  • Published date2015/05/21

More Items

GitHub

A 12-week, 24-lesson beginner-friendly AI curriculum with executable Jupyter notebooks, quizzes and labs that teach neural networks, computer vision, NLP, generative models and ethics using PyTorch and TensorFlow examples.

Frames AI research as a trainable practice of reading, building, debugging, and fast feedback. The essay is most useful for researchers learning how to avoid hype-chasing, benchmark tunnel vision, and agent-induced blind spots.

Career advice for ML researchers from the creator of TRPO and PPO: how to pick problems worth solving, why goal-driven beats idea-driven research, and the daily notebook-and-review habit that compounds small experiments into breakthroughs.