Skip to content
AriadneTechnology

The Inner Ring · Chamber 8 of 8

Writing It Up: LaTeX & the Research Paper

Structure a paper, craft an abstract, typeset equations like a pro and file your first research note.

35 min 60 XP + 5 questions + 3 challengesVideoWritingMathCode

In this chamber you will

  • Structure a paper around a clear story
  • Write an abstract with the five-move pattern
  • Typeset equations, references and citations in LaTeX
  • Write a short research note about your own experiment

Writing is part of the research

It's tempting to think of writing as the chore that comes after the science. In practice, writing is where you discover whether you understand your own result. A vague paragraph usually means a vague idea. A paper is also how your work enters the conversation: an unwritten result, or an unreadable one, might as well not exist.

In his much-loved talk, computer scientist Simon Peyton Jones argues that you should write early: draft the paper before the research is finished, because the draft tells you what you still need to find out.

How to Write a Great Research PaperSimon Peyton Jones · Microsoft Research

The shape of a paper

A good ML paper tells one story. It rarely follows the order in which you actually did the work. It follows the order in which a reader needs to understand it:

  1. 1

    The problem

    What are we trying to do, and why does anyone care?
  2. 2

    The gap

    Why don't existing approaches already solve it?
  3. 3

    The idea

    Our key insight, in one or two sentences.
  4. 4

    The evidence

    Experiments that would convince a skeptic, with baselines, ablations and error bars.
  5. 5

    The implications

    What changes if we're right? What are the limitations?

The introduction carries that whole arc in miniature and ends with an explicit list of contributions, the same list you learned to hunt for in Chamber 6. Many readers stop after the introduction, so make it complete. And design Figure 1 to communicate the key idea or result at a glance: plenty of people look at it before they read anything else.

The abstract: five moves

The abstract is the most-read part of any paper, so it deserves the most rewriting. Strong ML abstracts almost always make the same five moves, in the same order: context → problem → approach → results → implications. Put this one back together:

Interactive lab

Abstract architect

The sentences of this (fictional) abstract have been shuffled. Drag them, or use the arrows, into the order a reader expects.
  1. 1

    On five small-data benchmarks, MixThread improves test accuracy by 4.2 points over the strongest baseline, with gains consistent across 10 random seeds.

  2. 2

    Neural networks trained on small datasets often overfit, memorising noise instead of learning patterns that generalise.

  3. 3

    These findings suggest that feature-space augmentation is a promising direction for data-efficient learning; code and models are publicly available.

  4. 4

    We introduce MixThread, a data-augmentation method that interpolates between training examples along paths in a learned feature space.

  5. 5

    Existing regularisers such as dropout require careful tuning and can underperform when fewer than 1,000 labelled examples are available.

Challenge: Abstract architectPut the sentences of an abstract in the right order.+40 XP

Writing clearly

Clear technical writing is a learnable skill. A few principles do most of the work:

  • One idea per paragraph, announced in its first sentence.
  • Define notation before you use it, then never change it.
  • Numbers beat adjectives. "Improves accuracy by 2.3 points" says more than "dramatically improves".
  • Hedge honestly. Results suggest; proofs show. Don't claim more than your evidence supports.
  • Cut ruthlessly. Every sentence should earn its place.

Before

It is well known that our novel approach significantly outperforms existing methods.

After

Our method improves accuracy over the strongest baseline by 2.3 ± 0.4 points (mean ± std over 5 seeds) on three of four benchmarks.

The rewrite drops the unsupported 'well known' and 'novel', quantifies the gain, states the comparison and its uncertainty, and admits one benchmark didn't improve.

Before

The loss function is minimised using the optimiser with the parameters mentioned before.

After

We minimise the cross-entropy loss (Eq. 2) with Adam, using a learning rate of 3e-4 and a batch size of 128.

Specific references and concrete values make the work reproducible.

LaTeX essentials

Almost every ML paper is typeset in LaTeX, and the major conferences (NeurIPS, ICML, ICLR and more) provide LaTeX templates. You write plain text with markup, and LaTeX handles the typography, especially the mathematics. Online editors such as Overleaf mean you don't need to install anything to get started.

Here is the skeleton of a paper, including an equation you can reference, a citation and a publication-quality table:

LaTeX
\documentclass{article}
\usepackage{amsmath, amssymb}   % mathematics
\usepackage{graphicx}           % figures
\usepackage{booktabs}           % professional tables
\usepackage{hyperref}           % clickable references

\title{Gradient-Aware Warmup for Small Networks}
\author{Ada Researcher}

\begin{document}
\maketitle

\begin{abstract}
Small networks trained with large learning rates often diverge early in training...
\end{abstract}

\section{Introduction}
We minimise the empirical risk
\begin{equation}
  \mathcal{L}(\theta) = \frac{1}{n}\sum_{i=1}^{n} \ell\big(f_\theta(x_i), y_i\big)
  \label{eq:risk}
\end{equation}
using gradient descent. Equation~\eqref{eq:risk} is standard~\cite{rumelhart1986learning}.

\begin{table}[t]
  \centering
  \begin{tabular}{lcc}
    \toprule
    Method        & Accuracy (\%)    & Diverged runs \\
    \midrule
    Linear warmup & $91.2 \pm 0.4$   & 3/20 \\
    Ours          & $92.0 \pm 0.3$   & 0/20 \\
    \bottomrule
  \end{tabular}
  \caption{Mean $\pm$ standard deviation over 20 seeds.}
  \label{tab:main}
\end{table}

\bibliographystyle{plain}
\bibliography{references}   % entries live in references.bib
\end{document}

Citations live in a separate BibTeX file. Most paper pages (and Google Scholar) will give you the entry:

LaTeX
@article{rumelhart1986learning,
  title   = {Learning representations by back-propagating errors},
  author  = {Rumelhart, David E. and Hinton, Geoffrey E. and Williams, Ronald J.},
  journal = {Nature},
  volume  = {323},
  number  = {6088},
  pages   = {533--536},
  year    = {1986}
}

The commands you'll type most often:

You typeYou get
\frac{a}{b}ab\frac{a}{b}
x^2, x_i, x_{i,j}x2x^2, xix_i, xi,jx_{i,j}
\sum_{i=1}^{n}∑i=1n\sum_{i=1}^{n}
\theta, \eta, \sigmaθ\theta, η\eta, σ\sigma
\hat{y}, \mathbf{x}y^\hat{y}, x\mathbf{x}
\mathcal{L}, \mathbb{E}L\mathcal{L}, E\mathbb{E}
\nabla_\theta, \partial∇θ\nabla_\theta, ∂\partial
\log, \explog⁡\log, exp⁡\exp
Quick check +20 XP

Which LaTeX produces 1n∑i=1nxi\frac{1}{n}\sum_{i=1}^{n} x_i?

Now forge some equations of your own. Every one of them is an old friend from this course:

Interactive lab

The LaTeX forge

0/4
Reproduce each target equation in LaTeX. The forge compares the meaning of your formula, not the exact keystrokes, so \frac1n and \frac{1}{n} both count.
1

The sigmoid

+15 XP

Target

σ(z)=11+e−z\sigma(z) = \frac{1}{1 + e^{-z}}

Your preview

Start typing to see it render.

\sigma\frac{…}{…}e^{-z}
2

The gradient descent update

+15 XP

Target

θt+1=θt−η ∇θL(θt)\theta_{t+1} = \theta_t - \eta\,\nabla_\theta \mathcal{L}(\theta_t)

Your preview

Start typing to see it render.

\theta_{t+1}\eta\nabla_\theta\mathcal{L}
3

Mean squared error

+15 XP

Target

L(θ)=1n∑i=1n(fθ(xi)−yi)2\mathcal{L}(\theta) = \frac{1}{n}\sum_{i=1}^{n}\left(f_\theta(x_i) - y_i\right)^2

Your preview

Start typing to see it render.

\frac{1}{n}\sum_{i=1}^{n}f_\theta(x_i)(…)^2
4

Binary cross-entropy (boss level)

+15 XP

Target

L=−1n∑i=1n[yilog⁡y^i+(1−yi)log⁡(1−y^i)]\mathcal{L} = -\frac{1}{n}\sum_{i=1}^{n}\left[y_i \log \hat{y}_i + (1 - y_i)\log(1 - \hat{y}_i)\right]

Your preview

Start typing to see it render.

\log (not log)\hat{y}_i\left[ … \right]
Challenge: LaTeX forgeTypeset all four equations.+40 XP

Peer review

Before a paper is published at a conference or in a journal, other researchers review it. They judge its soundness (are the claims supported?), significance (does it matter?), novelty (is it new?) and clarity (can it be understood?). Chamber 7 made you a reviewer. Being one makes you a better author, because you learn to anticipate the questions.

When the reviews come back:

  • Thank reviewers, then address every point specifically, with evidence where you can.
  • Change the paper, not just the rebuttal. If a reviewer misunderstood, other readers will too.
  • Stay calm. Review is noisy: in the NeurIPS 2014 experiment, two independent committees reviewed the same set of papers, and roughly half of the papers accepted by one were rejected by the other. A rejection is data, not a verdict on you.

Your first research note

Time to write. In Chamber 5 you ran a real experiment: how often does a network with a given number of hidden units solve XOR? Write it up as a short research note, with a question, a hypothesis, a setup, results and conclusions. This is the same structure as a paper, in miniature. If you haven't collected your numbers yet, open the trainer in another tab.

Writing lab

Your first research note

Run the Chamber 5 trainer on XOR with 1, 2, 3 and 4 hidden units and five seeds each, then write it up. Markdown and LaTeX both work. Your note saves automatically in this browser and appears in your lab notebook.
58 / 120 words6 placeholders left to fill in
Challenge: First authorWrite and file a research note of at least 120 words.+50 XP

Key takeaways

  • Writing is thinking: draft early, and let the draft tell you what's missing.
  • A paper tells one story: problem → gap → idea → evidence → implications, with contributions stated explicitly.
  • Abstracts make five moves. Clear writing prefers numbers to adjectives and honest hedges to hype.
  • LaTeX is the language of ML papers: equations, labels, citations and booktabs tables.

Checkpoint

Prove it to the labyrinth

Answer every question to clear this chamber. First-try answers earn the most XP.

0/4
Question 1 of 4 +20 XP

Which order works best for a strong abstract?

Question 2 of 4 +20 XP

Which sentence is better scientific writing?

Question 3 of 4 +20 XP

Why do papers use \label and \eqref instead of typing equation numbers by hand?

Question 4 of 4 +20 XP

What makes a good Figure 1 in an ML paper?

End of the chamber

Clear this chamber

  • Questions in this chamber (0/5 solved)Next unsolved
  • Bonus: Abstract architect (+40 XP)
  • Bonus: LaTeX forge (+40 XP)
  • Bonus: First author (+50 XP)
+60 XPAbstractLaTeXPeer Review