Reading AI papers
Get the idea out of a research paper in 30 minutes.
Create a free account Try part of it here
Why it matters
New ideas in AI arrive as research papers. Every method in this course started as one: transformers, scaling laws, LoRA, DPO and GRPO. You don't need to read papers like a researcher. But you can learn to pull out the main idea, the evidence and the weak spots in half an hour. Then you can judge vendor claims and news stories for yourself, instead of trusting a summary.
What you'll be able to do
- Read a paper in three passes, spending time only where it pays
- Check a paper's numbers yourself: parameter counts, compute, and whether gains exceed the noise
- Spot the common weaknesses: weak baselines, missing ablations, cherry-picked results
- Use LLMs to speed up reading without outsourcing your judgment
What it covers
- What a paper looks like
- Three passes
- Check the numbers
- Worked example: count a tiny model
- Three famous models
- Is the gain real?
- Worked example: is a 10-point gain real?
- A table that fools people
- What to look for
- Reading with an LLM
What a paper looks like
A research paper is a short report. It says what the authors tried and what happened. Most AI papers follow the same layout, so they're easier to skim than they look.
- Title and abstract. The abstract is the summary paragraph at the top. It states the main claim.
- Introduction. Why the problem matters. Its last paragraph often lists the paper's contributions: the new things the authors say they add.
- Method. What the authors built or changed.
- Experiments. What they compared, on which data, and how they measured it. The main results table lives here.
- Limitations and conclusion. What the authors admit, and what they think it all means.
- Appendix. Extra details at the end.
Where do you find papers? Nearly all AI papers appear first on arXiv (say "archive"), a free website. Many are preprints. A preprint is posted before peer review, the check where other experts read a paper before a journal or conference accepts it. Hugging Face Papers picks daily highlights and hosts discussion. The big labs also write research blogs. These often explain the same work in easier words than the paper.
Show the answer
At the end of the introduction, as the contributions
The introduction's last paragraph often lists the contributions. The results table shows the evidence, and the appendix holds the extra details.
Three passes
Think about buying a house. First you skim the listing for two minutes. If it looks good, you visit. Only if you're serious do you pay for a full inspection. Papers deserve the same treatment.
This method comes from computer scientist Srinivasan Keshav ("How to Read a Paper", 2007). Here it's adapted to AI papers.
- Five minutes: what's claimed? Read the title, the abstract and the list of contributions. Look at the figures and their captions. Read the conclusion. Then write down the main claim in one sentence. For many papers, you can stop here.
- Twenty minutes: is it supported? Read the method well enough to explain its diagrams and equations in your own words. Then read the experiments: what was compared, on what data, measured how. Look hard at the main results table. Does it back up your one-sentence claim?
- Only if you need it: could you redo it? Work through the details, the appendix and the code. Save this pass for papers you'll build on, or must judge in depth.
Show the answer
The five-minute first pass: it gives you the main claim, which is enough to decide
The first pass tells you what the paper claims. That's what you need to decide whether, and how deeply, to read on.
Check the numbers
Papers list their models' settings in tables. The settings are called the configuration. With a little arithmetic, you can check a model's headline size yourself. It's like checking a restaurant bill. You don't have to trust the total when you can add up the items.
A model's size is its number of parameters: the numbers it learned in training. A GPT-style model is a stack of identical blocks, also called layers. You met them in Phase 5. Each block has two parts: attention and an MLP. The model also has an embedding table, which stores one list of numbers for each token in the vocabulary.
Four settings decide the count:
- layers: how many blocks are stacked;
- width: how many numbers describe each token inside the model;
- MLP size: how wide the MLP's hidden layer is;
- vocabulary: how many different tokens the model knows.
Here's the rule of thumb:
parameters ≈ layers × (attention weights + MLP weights) + vocabulary × width
In plain words: count the weights in one block. Multiply by the number of blocks. Then add the embedding table. In a plain block, attention has four tables of width × width numbers. A plain MLP has two tables of width × MLP size.
Go deeper Where the block counts come from
Attention has four weight tables: queries, keys, values and output. The query and output tables are width × width. The key and value tables are width × kv. In plain attention, kv equals the width, so attention has 4 × width² weights.
Some newer models use grouped-query attention. Several heads share the same keys and values, so kv is smaller than the width. The attention helper in the next section lets you pass a smaller kv for that case.
A plain MLP has two tables: width × MLP size going in, and MLP size × width coming out. A gated MLP, like the SwiGLU in Llama-style models, has three.
The count skips a few small things: biases, layer norms and position embeddings. They're usually a few percent of the total at most.
Worked example: count a tiny model
A tiny model has 2 layers, width 10, an MLP size of 40 and a vocabulary of 100 tokens. Count it by hand.
- Attention: four tables of 10 × 10, so 4 × 100 = 400 weights.
- MLP: two tables of 10 × 40, so 2 × 400 = 800 weights.
- One block: 400 + 800 = 1,200. Two blocks: 2,400.
- Embeddings: 100 tokens × 10 numbers each = 1,000.
The total is 2,400 + 1,000 = 3,400 parameters. Now the same sum in Python.
layers, width, mlp_size, vocab = 2, 10, 40, 100 attention = 4 * width * width # four width x width tables mlp = 2 * width * mlp_size # two width x mlp_size tables blocks = layers * (attention + mlp) embeddings = vocab * width print(attention, mlp, blocks, embeddings, blocks + embeddings)
It prints 400 800 2400 1000 3400, matching the hand count. Real models use the same sum with much bigger numbers.
Three famous models
Now try it on real papers. The code below has two helpers. attention(d, kv) counts one attention part, where d is the width. mlp(d, hidden, gated) counts one MLP, where hidden is the MLP size.
Two details from the papers matter:
- The original Transformer (2017) has an encoder and a decoder. Each decoder block has two attention parts. One is the usual self-attention. The other, cross-attention, reads the encoder's output.
- GPT-3 uses the same embedding table for input and output, so it's counted once. This is called tied embeddings. Llama 2 keeps two separate tables, so it's counted twice.
def attention(d, kv=None): kv = kv or d return 2 * d * d + 2 * d * kv # queries and output: d x d; keys and values: d x kv def mlp(d, hidden, gated): return (3 if gated else 2) * d * hidden # gated (SwiGLU) MLPs have three matrices # "Attention Is All You Need" (2017), base model: 6 encoder + 6 decoder layers, width 512, # MLP 2048, a shared 37,000-token vocabulary. Reported: 65 million parameters. d, hidden = 512, 2048 encoder = 6 * (attention(d) + mlp(d, hidden, False)) decoder = 6 * (2 * attention(d) + mlp(d, hidden, False)) # self-attention plus cross-attention print(f"Transformer base: {(encoder + decoder + 37000 * d) / 1e6:.0f}M (reported 65M)") # GPT-3 (2020): 96 layers, width 12,288, MLP 4x width, 50,257-token vocabulary shared with the output. print(f"GPT-3: {(96 * (attention(12288) + mlp(12288, 4 * 12288, False)) + 50257 * 12288) / 1e9:.1f}B (reported 175B)") # Llama 2 7B (2023): 32 layers, width 4,096, gated MLP of 11,008, 32,000 tokens, separate input/output embeddings. print(f"Llama 2 7B: {(32 * (attention(4096) + mlp(4096, 11008, True)) + 2 * 32000 * 4096) / 1e9:.2f}B (reported 6.7B)")
The estimates are 63M against a reported 65M, 174.6B against 175B, and 6.74B against 6.7B. All three land within a few percent. Part of the gap is rounding in the reported figures (the Llama 2 estimate is even a little above its rounded 6.7B). The rest is the biases, layer norms and position embeddings the count skips.
When your estimate is far off, one of two things happened. You misread the configuration, or the paper leaves something out. The second case is worth asking about.
The same habit works for training compute. Compute is counted in FLOPs: one FLOP is one multiply or one add on decimal numbers. The pretraining lesson gave the rule: compute is about 6 × parameters × tokens.
In plain words: training costs about 6 FLOPs for every parameter, for every token it reads.
Take a model with 1,000 parameters trained on 50 tokens. That's 6 × 1,000 × 50 = 300,000 FLOPs. In Python, 6 * 1_000 * 50 gives the same 300000. To check a paper's compute claim, plug in its own parameter and token counts. Cost claims yield to the same kind of arithmetic.
layers, width, mlp_size = 10, 100, 400 print(layers * (4 * width * width + 2 * width * mlp_size))
Show the answer
1200000
One block has 4 × 100 × 100 = 40,000 attention weights plus 2 × 100 × 400 = 80,000 MLP weights. That's 120,000 per block, and 10 blocks make 1,200,000, printed as 1200000.
Is the gain real?
Most results tables compare a new method with a baseline. A baseline is an existing method used as the yardstick. A bigger number in the new method's column looks like a win. But test scores wobble with luck, as you saw in the benchmarks lesson.
Picture a taste test between two bakeries. Say 6 of 10 tasters prefer bakery A. That could easily be luck. Now say 600 of 1,000 tasters prefer A. That almost certainly isn't luck. The share is the same, but the evidence is very different. What matters is the size of the gap compared with the size of the wobble.
The standard error is the typical size of that wobble. You met it in the benchmarks lesson. Divide the gap by the standard error of the gap, and you get the z-score:
z = gap ÷ standard error of the gap
In plain words: z says how many "typical wobbles" the gap is. Suppose the two methods were really equally good. Then a z further from zero than 1.96 would turn up by luck less than 5% of the time. So above 1.96 (about 2), call the gain real. Below it, the gain is within the noise.
Go deeper The formula in full
Write each accuracy as a share between 0 and 1. Call the new method's accuracy "new" and the baseline's "base". Let be the number of test items.
Read it as: the gap on top, divided by the standard error of the gap below. Each piece like new(1 − new)/n is one score's variance, the square of its standard error. Adding the two gives the gap's variance, as long as the two scores wobble independently. The square root turns that back into a standard error.
Both methods are usually scored on the same items. That allows a paired test, which compares the two methods item by item. It's more sensitive, but papers rarely report one.
Worked example: is a 10-point gain real?
A new method scores 60% on a 400-item test. The baseline scores 50%. So new = 0.6, base = 0.5 and n = 400. Work it out by hand.
- New method's variance: 0.6 × 0.4 = 0.24, then ÷ 400 = 0.0006.
- Baseline's variance: 0.5 × 0.5 = 0.25, then ÷ 400 = 0.000625.
- Add them: 0.001225. The square root is 0.035. That's the standard error of the gap.
- The gap is 0.1. So z = 0.1 ÷ 0.035, about 2.86.
That's above 1.96, so the gain is real. Now check it in Python.
import math new, base, n = 0.60, 0.50, 400 se = math.sqrt(new * (1 - new) / n + base * (1 - base) / n) # standard error of the gap z = (new - base) / se print(round(se, 3), round(z, 2))
It prints 0.035 and 2.86. A 10-point gap is almost three typical wobbles on 400 items. That's hard to explain by luck alone.
A table that fools people
Here's a made-up results table. It's the kind behind many abstracts that say "our method improves accuracy on all three benchmarks". Each row has the benchmark, its number of test items, and the two accuracies.
import math rows = [ # benchmark, number of test items, new method, baseline ("Benchmark A", 500, 0.712, 0.704), ("Benchmark B", 10_000, 0.655, 0.641), ("Benchmark C", 150, 0.820, 0.787), ] for name, n, new, base in rows: se = math.sqrt(new * (1 - new) / n + base * (1 - base) / n) # standard error of the difference z = (new - base) / se verdict = "real (|z| > 1.96)" if abs(z) > 1.96 else "within the noise" print(f"{name}: +{(new - base) * 100:.1f} points on {n:,} items, z = {z:.2f} -> {verdict}")
Read the output row by row.
- Benchmark A: +0.8 points on 500 items gives z = 0.28. That's within the noise.
- Benchmark B: +1.4 points on 10,000 items gives z = 2.07. That's real.
- Benchmark C: +3.3 points on 150 items gives z = 0.72. That's within the noise.
The biggest gain, +3.3 points on Benchmark C, is one of the least convincing. Its test set is tiny. The modest +1.4 points on Benchmark B is the only clear win. "Improves on all three" is true, but only one of the three gains shows more than luck.
Show the answer
The +1 point on 20,000 questions; the small test set's noise could explain +4
The margin of error shrinks with the square root of the number of items. On 120 questions, the typical wobble in the gap is about 4 to 7 points (it depends on the scores), so luck could explain +4. On 20,000 questions, it's about half a point or less, so +1 stands out.
What to look for
Your second pass is where you test the evidence. Here's a checklist.
- Baselines. Are they strong and recent? Were they run with the same care as the new method: the same prompts, tuning and compute? Beating a weak or poorly tuned baseline proves little.
- Ablations. Picture a cake recipe with three changes: more butter, a hotter oven and a new flour. The cake is better, but which change did it? You only know if you bake it again, leaving out one change at a time. In a paper, that's an ablation. Without ablations, you can't tell which part of a method did the work.
- Selection. Are the reported numbers the best of many runs, seeds or prompts? Are the examples in the figures typical, or cherry-picked: chosen because they look good?
- Evaluation details. How big is the test set? Did the authors check for contamination, test questions leaking into training data? How many runs were there? How were outputs scored: exact match, an LLM judge, or people? Did the rival models get the same treatment?
- Compute and cost. A small gain bought with ten times the compute may not be worth it.
- Scope of the claim. Results on one model family, one language or toy tasks don't automatically carry over to others. Read the limitations section. Good papers write a real one.
- Who and how. Lab papers often describe systems you can't reproduce. Preprints haven't been peer reviewed. Even peer review rarely re-runs the experiments.
These are the quick checks you can run on any results table.
Show the answer
An ablation: removing each trick in turn to see which ones cause the gain
With only the combined result, one trick might do all the work while the other two do nothing, or even hurt. An ablation shows which ingredient matters.
Reading with an LLM
Language models make good reading assistants. You can ask for a summary in plain language. You can ask what an unfamiliar term or equation means. You can ask, "What are the weakest parts of this paper's evidence?"
Give the model the real text. Paste it in, or use a model that can read the PDF. A summary from the model's memory can be wrong or out of date. Then check the key numbers and claims against the paper yourself. A summary is a map, not the territory.
For marketers: a vendor might say, "a study shows our AI improves conversion by 30%". Apply the same checks. What was compared? On how many cases? Chosen how, and measured how?
Practice what you just read
- 4 code examples you can edit and run
- a practice exercise that checks your code
- a 5-question quiz
- 5 review cards for spaced repetition
Try a quiz question
What's the point of an ablation study in a paper?