Open Interpretability Models Contributors Research Posts About

Visualizing and Understanding Recurrent Networks

Source

Citation. Andrej Karpathy, Justin Johnson and Li Fei-Fei, Department of Computer Science, Stanford University. "Visualizing and Understanding Recurrent Networks". arXiv:1506.02078, version 1 of 5 June 2015, revised as version 2 on 17 November 2015. The page header of version 2 says "Under review as a conference paper at ICLR 2016". The text names no later venue, so this page treats it as a preprint. The paper links no code.

Mismatch. Figure 1 says "The test set has 300,000 characters", but Section 4.4 counts "330K test set characters". The text also sets the 20-gram model against 1.077 on War and Peace, the GRU's best. On the Linux kernel it uses 0.84, the LSTM's best.

Status. Not applicable. No code uses it. papers/syntax-positive-controls cites it for the expectation that code models hold syntax units.

Read. On 2026-11-21 a web-fetch subagent read the abstract page and the HTML of version 2 for this page's author, a model (Claude Opus 5.5). It had the whole text in the source's own words, in two fetches. The page's author then read pages 5 and 6 of the PDF as images, to see Figure 2 and Table 2.

Summary

Claim. Character-level LSTMs hold some cells with clear jobs, such as tracking line length, quotes or brackets. The LSTM's edge over n-gram models comes from characters that need long-range context.

Method.

Findings, as the source reports them.

Setting Result
Interpretable cells (Section 4.2, Figure 2) Some cells "turn on inside quotes, the parenthesis after if statements, inside strings or comments". One rises "with increasing strength as the indentation of a block of code increases"
Range of a quote cell (Section 4.2) "∼230 characters in the quote detection cell example in Figure 2", longer than the 100-step training window
Test cross-entropy, best LSTM (Figure 1) 1.082 on War and Peace and 0.840 on the Linux kernel
20-gram baseline (Table 2) 1.195 on War and Peace and 0.889 on the Linux kernel
Errors of the best LSTM on War and Peace (Section 4.4) 42% of test characters. An n-gram oracle removes 18% of them

Where the claims go beyond the evidence

Use in this repo