How to Read Your First AI Research Paper
Read Attention Is All You Need in three passes. Trace a claim to its results table, compare an ablation and check a training cost estimate.
You’ve watched a few videos on Transformers, and you figure it’s time to read the original paper. So you open Attention Is All You Need. The abstract mostly makes sense. Then you get to a diagram full of boxes and arrows, and you’re wondering how much of it you need to understand before you can keep reading.
So let’s start with a smaller question. What were the authors trying to improve, and where do they show whether it worked? We’ll read the Transformer paper together, using S. Keshav’s three-pass approach to decide where to look.
The abstract says the Transformer beats the previous best English-to-German result by more than two BLEU points. You can check that claim before you know how to read the attention equation. Open the paper in another tab and follow along. The scores and training times below come from the paper, and we'll show where we calculate something from them. Vaswani et al., 2017, Table 2
Read the paper in three passes
Each pass answers a different question. On the first, you want to know whether the paper is relevant to what you're learning. On the second, you want to explain a result and say what backs it up. A third pass makes sense when you want to use, implement or examine the method more closely. Keshav, 2007, Section 2
| Pass | Where to look | What to write down |
|---|---|---|
| 1. Get oriented | Title, abstract, introduction, headings and conclusion. Glance at the references. | The problem, what the authors changed and one question you want to answer. |
| 2. Check the evidence | The results and their captions, then the method details you need to read them. | One claim with its comparison, metric and evaluation setup. |
| 3. Reconstruct one part | The method, equations or setup behind the result you picked. | Your reconstruction and any assumptions or missing details. |
Choose a pass to see where to look in the Transformer paper and what you should be able to explain afterward.
Pass 1. Find the question the paper asks
Start with the abstract and introduction. In this paper, the authors want to reduce the sequential computation that makes recurrent models harder to train in parallel. Their proposal is the Transformer, which uses attention in place of recurrence or convolution to connect positions. Figure 1 shows the architecture. An encoder represents the input sentence and a decoder produces the translation one token at a time. You can note the role of each half and come back to its individual layers later. Vaswani et al., 2017, Sections 1 and 3
If the diagram feels busy, follow just one arrow. In Figure 1, trace the encoder output into the decoder. That connection shows where the decoder gets information about the original sentence. Vaswani et al., 2017, Figure 1 and Section 3
Now jump to the conclusion. The authors wanted to make generation less sequential and explore how restricting which positions can attend to each other could help with large inputs and outputs. One of those open problems gives you a useful thing to write down. The paper changes how the model processes sequences, and its decoder still generates the translation in order. Vaswani et al., 2017, Sections 3 and 7
At this point, your note could be one sentence. The authors try a new architecture for translation that relies on attention to connect positions, and I want to check how it compares with earlier systems. That's enough to decide what to read next. If you meet a term like multi-head attention here, write down where it appears and keep going. You'll have a reason to look it up when you know which result or diagram you want to explain.
Pass 2. Follow a claim to its evidence
The abstract gives you several places to start. Pick the one that matches your question and find the exact table or section behind it. Choose a claim below to see where its evidence is in the paper.
| Claim | Where to check |
|---|---|
| The big Transformer scores 28.4 BLEU on English-to-German translation. | Table 2 and Section 6.1 show the score and earlier systems. |
| The abstract reports 41.8 BLEU on English-to-French translation. | Table 2 and Section 6.1 give different numbers. We'll check them below. |
| The big model trained for about 3.5 days on eight GPUs, with a lower estimated cost than several earlier systems. | Section 5.2 gives the hardware and time. Section 6.1 compares the estimated costs. |
| The architecture also works for English constituency parsing, a task that groups words into phrases. | Table 4 and Section 6.3 describe a separate experiment and report F1 on the Wall Street Journal test split. |
Read the caption before the score
Open Table 2 and read the caption and column headings before looking for the biggest number. The caption names newstest2014 as the test set. The two BLEU columns are for two translation directions. We'll stay in EN-DE, English to German. BLEU is an automatic score for translation quality based on overlap with reference translations. A higher score indicates more agreement under this metric. Vaswani et al., 2017, Table 2, Papineni et al., 2002
A baseline is a system or setup you compare a result against. Here, use the ConvS2S Ensemble, which combines multiple models and has the highest earlier score in the English-to-German column at 26.36. Find Transformer (big) in that same column. It scores 28.4. Subtract the two and you get 2.04 BLEU points. So the table supports the claim for this benchmark and these comparisons. If you want to know what part of the Transformer contributed to the result, look for a comparison within the architecture itself. Vaswani et al., 2017, Table 2 and Section 6.2
Check how the experiment was run
Table 3 is where the authors try different versions of the Transformer. Before comparing those versions, though, look at the base model. It scored 27.3 on English-to-German translation in Table 2, and here it scores 25.8. What changed between the two tables? The first number comes from the newstest2014 test set. The second is from the newstest2013 development set, which the authors used to study model variants. The evaluation procedure differs too. A checkpoint saves the model's parameters at a point in training. For Table 2, the authors averaged the base model's parameters from its last five checkpoints. Section 6.2 says the Table 3 runs used no checkpoint averaging. Vaswani et al., 2017, Sections 6.1 and 6.2
So if you subtract those scores, the gap reflects two different evaluation setups. To measure the effect of averaging alone, you'd need both scores on the same data, with the other settings held fixed.
Read an ablation
An ablation changes or removes part of a method and compares the result with a reference configuration. In Table 3, look at the base row and the rows marked (A). The caption tells you that blank settings inherit the values from the base row. The authors changed how many attention heads the model uses and adjusted the key and value dimensions in each head to keep the amount of computation comparable. When the number of heads doubles from 8 to 16, each key and value vector shrinks from 64 to 32 dimensions. Both and give 512 coordinates across the heads. Vaswani et al., 2017, Sections 3.2.2 and 6.2
| Attention heads | Key and value dimensions per head | BLEU on the development set |
|---|---|---|
| 1 | 512 | 24.9 |
| 4 | 128 | 25.5 |
| 8 (base) | 64 | 25.8 |
| 16 | 32 | 25.8 |
| 32 | 16 | 25.4 |
Choose a head count to compare it with the eight-head base model. What happens to the width of each head as you add more heads?
The single-head setting scores 0.9 BLEU points below the best settings. At the displayed precision, eight and sixteen heads tie. Table 3 gives a single BLEU score per setting, so you can describe what happened in this experiment. To judge whether a small gap would hold across repeated training runs, you'd need more information about how much the results vary. Vaswani et al., 2017, Table 3, Keshav, 2007, Section 2.2
The interactive also shows PPL, short for perplexity. On the same text, a lower value means the model assigned a higher probability to the observed sequence. Table 3 measures this per subword token. For the comparison we're making here, stay with the BLEU column. Dive into Deep Learning, Section 9.3.2, Vaswani et al., 2017, Table 3
Pass 3. Recreate one calculation
Keshav's third pass asks you to work out how you would recreate the study and examine its assumptions. Start with one small part. Here, we'll reconstruct how the authors got the training cost in Table 2. You need the training time and GPU count from Section 5.2, and the throughput assumption from the note in Section 6.1. Keshav, 2007, Section 2.3, Vaswani et al., 2017, Sections 5.2 and 6.1
Choose Base or Big, then use the steps to work out the training cost. Try the reported training time first.
The big model trained for about 3.5 days, or 302,400 seconds, on eight NVIDIA P100 GPUs. The paper assumes each GPU sustains 9.5 trillion single-precision floating-point operations per second. Multiply the time, the number of GPUs and the assumed rate per GPU. Vaswani et al., 2017, Section 5.2, Section 6.1 and footnote 5 in the PDF
That matches the rounded estimate in Table 2. It is about 30% of the FLOPs the paper estimates for the ConvS2S Ensemble in the same translation direction. Try the same calculation with the base model's 12 reported hours. You'll get about FLOPs. What you've reproduced is the paper's estimate from training time and assumed throughput. Vaswani et al., 2017, Table 2 and Section 6.1
Now try Steps × time per step for the base model. Section 5.2 also says it took 100,000 steps at about 0.4 seconds per step. Multiplying those rounded inputs gives 40,000 seconds, or about FLOPs at the same assumed rate. If you were taking notes for your own comparison, you'd record which time you used. Vaswani et al., 2017, Section 5.2
Check which version you are reading
The first arXiv version gives 41.0 BLEU for the big model on English to French in both the abstract and Table 2. In version 7, the abstract and Table 2 give 41.8, while Section 6.1 still says 41.0. So if you use that result, write down the version and where each number appears. You can report the disagreement with both locations in your notes.
The same check helps when you use an AI assistant to explain a term. Ask which section it is working from, then open that section in your copy of the paper before adding a number to your notes.
Write a note you can reuse on the next paper
Try closing the paper and filling in these fields from memory. Then open it again to check the details. If you can state a claim and point to its evidence, you have something you can use in a discussion or return to later.
| What to note | Example from Attention Is All You Need |
|---|---|
| Paper and version | Vaswani et al., 2017, arXiv v7. |
| Problem and change | Can a translation model use attention in place of recurrence and convolution? Section 3 describes the Transformer. |
| Evidence | Table 2, English-to-German newstest2014, 28.4 BLEU for Transformer (big) compared with 26.36 for ConvS2S Ensemble. |
| What qualifies the result | Table 3 uses a different dataset split and omits checkpoint averaging. The training cost in Table 2 is estimated. |
| One question to come back to | How could the decoder generate with fewer sequential steps? The authors raise this in Section 7. |
Check what you can do
- An earlier model gets 26.36 BLEU and the big Transformer gets 28.4. What is the gap? Name the test set and translation direction that belong with it.
- Why can't you attribute the gap between 27.3 and 25.8 to checkpoint averaging alone?
- What changes besides the number of heads when you go from eight to sixteen? What happens to the reported BLEU score?
- What three inputs do you need to recreate the big model's training cost estimate?
- Name one open problem the authors mention in the conclusion.
Compare your answers
- The gap is 2.04 BLEU points on English-to-German
newstest2014. Table 2 - The base model in Table 2 uses checkpoint averaging and is evaluated on
newstest2014. Table 3 usesnewstest2013and omits checkpoint averaging, so both the data and the procedure changed. Sections 6.1 and 6.2 - Each key and value vector shrinks from 64 to 32 dimensions. Both settings report 25.8 BLEU at the precision shown. Table 3
- Use 302,400 seconds, eight GPUs and the assumed sustained throughput of operations per second per GPU. Sections 5.2 and 6.1
- One is making generation less sequential. The authors also propose exploring restricted attention for large inputs and outputs. Section 7
Continue from the section that slowed you down
If the results make sense but the architecture still feels unfamiliar, pick one part of Section 3 to study. Then return to the same paragraph or figure in the paper and see what you can now explain.
| If you got stuck on | Continue with |
|---|---|
| Figure 1 and the two stacks | The Transformer Architecture |
| Section 3.2 and how a head mixes information | The worked Attention lesson |
| Figure 1's Add & Norm and feed-forward blocks | Layers of Understanding |
| Section 3.4 and how a token gets a vector | The Embedding Matrix |
| Section 3.5 and how the model represents position | Sinusoidal Positional Encoding |
To see how the scores and weights fit together across a sentence, try 3Blue1Brown's attention walkthrough. If the symbols in Section 3.2 are what slowed you down, What Math Do You Need to Understand Transformers? walks through the attention equation for two tokens.
For code, The Annotated Transformer walks through the paper's encoder-decoder translation model. Intuitive AI Academy's GPT-2 from Scratch brings the same building blocks together in a decoder-only language model. Pick the one that answers the question you wrote down, then come back to the paper.
How are LLM benchmarks run?
Tables 2 and 3 showed why the test data and evaluation setup matter when you compare two scores. In our lesson on zero-shot and few-shot benchmarks, you can see what changes when you include examples in a prompt. Then look at how a task's prompt and scoring rule are specified in EleutherAI's LM Evaluation Harness task guide.
Try another research paper
Open Table 10 of the Tülu 3 paper and find the row marked w/o Math Data. Which row would you use as the baseline? What happens to the GSM8K and MATH scores when the authors remove the math training data? Once you've made your comparison, see how we read the same result in our Tulu 3 ablation walkthrough.