Skip to content

7.1 Reading papers

ready≈ 12 hoursNeeds: 4.6Unlocks: 7.2, 7.4
  1. 1 Learn
  2. 2 Bridge & derive
  3. 3 Explore (Paper reading guide)
  4. 4 Do
  5. 5 Check

Three passes. Don’t read a paper from start to end in one go. Keshav’s method reads it three times, each deeper. The first pass, 5 to 10 minutes, covers the title, abstract, introduction, section headings and conclusion, and tells you whether to go on. The second, up to an hour, reads the text and the figures but skips proofs and details. The third re-creates the work in your head, or in code, and is where you find the hidden assumptions. Most papers you meet only need the first pass.

The five Cs. After the first pass you should be able to say the paper’s category (a new method, a measurement, an analysis), its context (which earlier work it builds on), whether it looks correct, its contributions and its clarity (Keshav, section 2.1). Write them down: that is the start of the structured summary this module asks for, and the template is in the notebook.

Check the numbers. On the second pass, recompute any table entry that follows from others in the paper. A GPT-style model’s size follows from its width d, depth L, vocabulary and context: 12 d² + 13 d per block plus the embeddings. Training compute is about 6 N D FLOPs for N parameters and D tokens (Kaplan et al. 2020, section 2.1 and table 1), and time follows from compute, the GPU’s peak and the fraction of it you achieve. Redoing GPT-3’s table 2.1 this way agrees to 2%; the GPT-2 paper’s sizes come out 1 to 6% smaller than its own architecture implies.

Choosing what to read. Start from a survey or a course reading list, read the papers the good ones keep citing (a citation index such as Semantic Scholar shows both directions), and look at the code if it is released: when a paper’s text and its code disagree, the code is what produced the numbers. Keep your summaries in one place, so the context C of the next paper is easier.

Why training costs 6 N D FLOPsstep 1 of 5
  1. Y=XW,X∈RT×k,  W∈Rk×nY = XW, \quad X \in \mathbb{R}^{T \times k},\; W \in \mathbb{R}^{k \times n}

Paper reading guide

Reading papers

Static view on small screens. Open this page on a laptop to interact.

pass 5–10 minutes

Pass 1. A bird's-eye view: what kind of paper is this, and is it worth more time?

Title, abstract (read on pass 1, first read on pass 1). The claim in one sentence: attention alone, no recurrence or convolution, gives better translation quality at lower training cost. Note the two headline BLEU scores. At the end of this pass: Answer the five Cs: category, context, correctness, contributions, clarity.

Check a number: table 2's training cost

8 × 12 h × 3600 s × 9.5 × 10¹² FLOP/s = 3.3 × 10¹⁸ FLOPs; the paper reports 3.3 × 10¹⁸: -0.5%.

Section 5.2 gives 8 P100 GPUs for 12 hours (base) and 3.5 days (big); section 6.1 and its footnote take 9.5 TFLOPS for a P100. Their cost is wall time × GPUs × an estimate of each GPU's sustained capacity, not a count of the operations the model did, so it ignores how much of that capacity was actually used: the kind of assumption a third pass should notice.

A reading guide to “Attention Is All You Need”. Buttons choose the first, second or third pass; the paper’s parts are listed as buttons marked read, skim or skip for that pass, and selecting one shows what to look for in it. Below, a check of the paper’s table 2: buttons pick the base or big Transformer, sliders set the number of GPUs, the training hours and the throughput per GPU, and the readout gives the resulting cost in FLOPs against the paper’s figure, with the relative error. Keyboard: Tab to the pass buttons, the parts of the paper and the sliders.
Checking a paper's numbers stubs/m7_1_papers.py

Loading starter file…

Prefer your own editor? Edit exercises/stubs/m7_1_papers.py and run mlc check 7.1. The tests are identical; import the results on the progress page.

Hints · gpt2_params 0/3 revealed
Hints · check_claims 0/3 revealed

Then run the lab. Open notebooks/7.1-checking-papers.ipynb (a CPU is enough, under a minute) and paste in your 7.1 file. It counts the parameters of GPT-2 models built in PyTorch, checks GPT-2’s and GPT-3’s size tables, measures the FLOPs of a forward and backward pass to confirm 6 N D, and recomputes GPT-3’s training compute and the training costs in Attention Is All You Need. Then write structured summaries of three papers with its template: GPT-3 and the two other papers you most want to understand.

1. What is the first pass through a paper for?
2. A model has width 4096 and 32 layers. About how many FLOPs does training it on 10¹¹ tokens take?
3. Why is the backward pass about twice the cost of the forward pass?
4. Your recomputed parameter count is 6% larger than a paper reports. What is the most useful next step?
  • not yet: All tests pass (0/?)
  • not yet: Checkpoint quiz ≥ 80%
Finish the items above first.
Learner log: time spent and points of confusion

Every confusion you note becomes a fix before the module is marked stable. Export it from the progress page and attach it to an issue.