Foundations to Frontier
Tests
A. Mathematical Foundations › A1 Prerequisites and Mathematical Thinking

Reading Mathematical Notation in ML and Robotics Papers

A phrasebook for the language of research papers. Greek letters, bold vectors, hats, tildes, argmins and frame superscripts, and how to turn any equation into working code.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Maths is a language

Road signs tell you things without words: 🛑 means stop, ➡️ means turn right. Mathematics works the same way. A tiny symbol can stand for a whole sentence:

Symbol Says
++ “add”
== “is exactly the same as”
≈\approx “is very close to” (like π ≈ 3.14)
Σ\Sigma “add them all up”
x3x_3 “the third x in the list”

Scientists from every country read the same symbols, which is why papers from around the world can be understood everywhere. Learning to read them is like learning the alphabet before reading books.

Letters from another alphabet

Mathematicians ran out of English letters, so they borrowed Greek ones: α\alpha (alpha), β\beta (beta), θ\theta (theta), λ\lambda (lambda), π\pi (pi), σ\sigma (sigma). In AI, θ\theta usually means the settings the computer learns, like the knobs on a radio.

Every formula in a paper is a short way of writing a few lines of code. Click the symbols below to translate them.

From notation to code
Σᵢ: sum over every index i: a loop that adds
y_hat = sum(w[i] * x[i] for i in range(len(x))) + b
ŷ = 0.5·1 − 0.2·2 + 0.1·3 + 0.0 = 0.40
Click any part of the formula. Every symbol is a short name for a piece of code: Σ is a loop that adds, a subscript is an index, a hat marks an estimate, ← is an assignment and ∇ is a gradient. Data used: x = [1, 2, 3], w = [0.5, −0.2, 0.1], y = [1, 2, 2.5], ŷ = [1.2, 1.7, 2.6], z = [2, 1, 0.1].
📝 Quick check (Level 0)
0/3 answered
  1. 1. Which symbol means 'add them all up'?
  2. 2. In the list x₁, x₂, x₃, x₄, what is x₃?
  3. 3. π = 3.14 or π ≈ 3.14?

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

The Greek alphabet, as used in ML and robotics

Letter Name Typical meaning
α\alpha alpha learning rate, a weight, angular acceleration
β\beta beta momentum (Adam’s β1,β2\beta_1, \beta_2), regression coefficients
γ\gamma gamma discount factor in RL, a scale parameter
δ,Δ\delta, \Delta delta small change, error, failure probability
ϵ,ε\epsilon, \varepsilon epsilon tiny number, noise, tolerance
η\eta eta learning rate
θ\theta theta model parameters, an angle (joint angle)
λ\lambda lambda regularization strength, eigenvalue
μ\mu mu mean, friction coefficient
π\pi pi 3.14159…, or a policy in RL
σ\sigma sigma standard deviation, sigmoid
τ\tau tau temperature, time constant, torque
ϕ,φ\phi, \varphi phi feature map, roll angle
ψ\psi psi yaw angle, a second network
ω,Ω\omega, \Omega omega angular velocity, frequency, sample space

Common symbols

Symbol Read as Example
∈\in “is in” x∈Rx \in \mathbb{R}: x is a real number
∀,∃\forall, \exists for all, there exists (A1-2)
⇒,  ⟺  \Rightarrow, \iff implies, if and only if (A1-2)
y^\hat y y hat a prediction or estimate of yy
xˉ\bar x x bar the mean of xx
x∗x^* x star the optimal (best) value
x~\tilde x x tilde a modified or approximate xx
x′x' x prime the next value, or a derivative
∝\propto proportional to p(θ∣D)∝p(D∣θ)p(θ)p(\theta\mid D) \propto p(D\mid\theta)p(\theta)
:=:= or ≜\triangleq “is defined as” f(x):=x2f(x) := x^2
∣x∣\lvert x\rvert, ∥x∥\lVert \mathbf x\rVert absolute value, norm (length) (A1-6)

max vs argmax

max⁡xf(x)\max_x f(x) is the best value. arg⁡max⁡xf(x)\arg\max_x f(x) is the input that achieves it. If test scores are 5, 9 and 2 for students 1, 2 and 3, then the max is 9 and the argmax is student 2. Training a model is written θ∗=arg⁡min⁡θL(θ)\theta^* = \arg\min_\theta L(\theta): “the parameters that make the loss smallest”.

📝 Quick check (Level 1)
0/3 answered
  1. 1. In a paper, θ̂ most likely means…
  2. 2. f = (4, 1, 7, 3) over x = 1, 2, 3, 4. What is argmin f?
  3. 3. In reinforcement learning papers, π usually means…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 35 minUndergraduate students and practising engineers.

Typography carries meaning

Most ML papers follow the conventions in the “Notation” section of Goodfellow, Bengio and Courville (2016):

Style Meaning Example
lowercase italic scalar (one number) x,α,nx, \alpha, n
lowercase bold vector (a column) x∈Rd\mathbf x \in \mathbb{R}^d
uppercase bold or italic matrix W∈Rm×n\mathbf W \in \mathbb{R}^{m\times n}
calligraphic set, space, distribution, loss D,X,N(μ,σ2),L\mathcal{D}, \mathcal{X}, \mathcal{N}(\mu, \sigma^2), \mathcal{L}
blackboard bold number sets, expectation, probability R,E,P\mathbb{R}, \mathbb{E}, \mathbb{P}
subscript index or component xix_i (i-th entry), Wij\mathbf W_{ij}
superscript in brackets which example x(i)\mathbf x^{(i)}: the i-th training example, not a power
superscript ⊤\top transpose x⊤y\mathbf x^\top\mathbf y = dot product

Reading shapes

The most useful habit when reading a paper is checking shapes. If W∈R64×128\mathbf W \in \mathbb{R}^{64\times128} and x∈R128\mathbf x \in \mathbb{R}^{128}, then Wx∈R64\mathbf W\mathbf x \in \mathbb{R}^{64}. Inner dimensions must match, and the outer ones give the result. Shape errors are the most common bugs when implementing a paper.

Probability notation

Notation Meaning
x∼px \sim p xx is a random sample from distribution pp
p(y∣x)p(y\mid x) probability of yy given xx
pθ(y∣x)p_\theta(y \mid x) or p(y∣x;θ)p(y\mid x;\theta) a model with parameters θ\theta
Ex∼p[f(x)]\mathbb{E}_{x\sim p}[f(x)] the average of f(x)f(x) when xx comes from pp
1[⋅]\mathbb{1}[\cdot] indicator: 1 if the condition is true, else 0
i.i.d. independent and identically distributed
N(μ,σ2)\mathcal{N}(\mu, \sigma^2) normal (Gaussian) distribution

A complete sentence, decoded

θ∗=arg⁡min⁡θ 1n∑i=1nℓ(fθ(x(i)), y(i))+λ∥θ∥22\theta^* = \arg\min_{\theta}\ \frac{1}{n}\sum_{i=1}^{n} \ell\big(f_\theta(\mathbf x^{(i)}),\, y^{(i)}\big) + \lambda\lVert\theta\rVert_2^2

“The best parameters are the ones that minimise the average loss over the nn training examples, plus λ\lambda times the squared length of the parameter vector.” That’s regularized empirical risk minimization, the sentence behind most of supervised learning.

🐍 Exercise 1: from notation to code
Each function's comment is its formula. Implement MSE, cross-entropy and the L2 norm exactly as written.
📝 Quick check (Level 2)
0/3 answered
  1. 1. x⁽³⁾ in an ML paper means…
  2. 2. W ∈ ℝ^{32×10}, x ∈ ℝ^{10}. What is the shape of Wx?
  3. 3. 𝔼_{x∼D}[ℓ(x)] means…

Level 3: Advanced

★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.

Decoding famous equations

Scaled dot-product attention (Vaswani et al., 2017):

Attention⁡(Q,K,V)=softmax⁡ ⁣(QK⊤dk)V\operatorname{Attention}(Q, K, V) = \operatorname{softmax}\!\Big(\frac{QK^\top}{\sqrt{d_k}}\Big)V

Shapes: Q∈Rn×dkQ \in \mathbb{R}^{n\times d_k}, K∈Rm×dkK \in \mathbb{R}^{m\times d_k}, V∈Rm×dvV \in \mathbb{R}^{m\times d_v}. QK⊤QK^\top is n×mn\times m (each query scored against each key). The softmax is applied to each row, and the result is n×dvn \times d_v. Dividing by dk\sqrt{d_k} keeps the scores from growing with dimension, which would make the softmax too sharp (A1-4).

The Adam update (Kingma and Ba, 2015, Algorithm 1):

mt=β1mt−1+(1−β1)gt,vt=β2vt−1+(1−β2)gt2,m^t=mt1−β1t,v^t=vt1−β2t,θt=θt−1−α m^tv^t+ϵ\begin{aligned} m_t &= \beta_1 m_{t-1} + (1-\beta_1) g_t, & v_t &= \beta_2 v_{t-1} + (1-\beta_2) g_t^2,\\ \hat m_t &= \frac{m_t}{1-\beta_1^t}, \quad \hat v_t = \frac{v_t}{1-\beta_2^t}, & \theta_t &= \theta_{t-1} - \alpha\,\frac{\hat m_t}{\sqrt{\hat v_t} + \epsilon} \end{aligned}

Watch for overloading: β1t\beta_1^t really is a power (β1\beta_1 to the tt), but mtm_t is a time index, and gt2g_t^2 squares each entry of the gradient vector (element-wise).

The policy-gradient objective in RL:

J(θ)=Eτ∼πθ[∑t=0Tγtrt]J(\theta) = \mathbb{E}_{\tau\sim\pi_\theta}\Big[\sum_{t=0}^{T}\gamma^t r_t\Big]

“The expected discounted total reward of trajectories τ\tau generated by running the policy πθ\pi_\theta.” Here γt\gamma^t is a power, and rtr_t is the reward at time tt.

Traps in notation

  • Abuse of notation. Authors write p(x)p(x) and p(y)p(y) for two different distributions, and the argument tells you which one. They write f(X)f(\mathbf X) to mean “apply ff to every row”.
  • Same symbol, different meaning. σ\sigma can be a standard deviation, the sigmoid, or a singular value. π\pi can be 3.14 or a policy. Check the paper’s own definitions.
  • Element-wise operations. ⊙\odot is element-wise product. v\sqrt{\mathbf v} and g2\mathbf g^2 in optimizer papers are usually element-wise too.
  • log base. In ML papers log⁡\log almost always means ln⁡\ln. In information theory it often means log⁡2\log_2.
  • Big-O. O(n2)O(n^2) means “grows at most like n2n^2, up to a constant”. Doubling nn roughly quadruples the cost.
Exercise 3.1: Write the shapes at every step of attention with n = 10 queries, m = 12 keys, d_k = 64, d_v = 32

QK⊤QK^\top: (10×64)(64×12)=10×12(10\times64)(64\times12) = 10\times12. Softmax keeps 10×1210\times12. Times VV (12×32)(12\times32) gives 10×3210\times32.

Exercise 3.2: Why is Adam’s first step about −α · sign(g)?

At t=1t=1: m1=(1−β1)gm_1 = (1-\beta_1)g and v1=(1−β2)g2v_1 = (1-\beta_2)g^2. Bias correction divides these by (1−β1)(1-\beta_1) and (1−β2)(1-\beta_2), giving m^1=g\hat m_1 = g and v^1=g2\hat v_1 = g^2. So the step is α g/(∣g∣+ϵ)≈α sign⁡(g)\alpha\, g/(\lvert g\rvert + \epsilon) \approx \alpha\,\operatorname{sign}(g).

📝 Quick check (Level 3)
0/3 answered
  1. 1. In attention, why divide by √d_k?
  2. 2. In Adam, what is β₁ᵗ?
  3. 3. An algorithm is O(n²). n goes from 1000 to 2000. Runtime roughly…

Level 4: Expert

★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.

Reading a paper’s mathematics efficiently

Keshav’s three-pass method (2007) works well for maths-heavy papers:

  1. First pass (10 minutes). Read the title, abstract, figures and conclusion. Skip the equations. Decide whether the paper is relevant.
  2. Second pass. Read the notation section and the main equations. Write down the shape of every symbol. Find the one or two key equations (the objective and the update rule) and restate them in words.
  3. Third pass. Re-derive the key results yourself, and implement the main equation with a small test (like the exercises on this page).

Practical habits that experienced researchers use:

  • Keep a personal notation table for each paper: symbol, meaning, shape.
  • Check units and shapes on both sides of every equation.
  • Try edge cases: what happens when T=1T = 1, λ=0\lambda = 0, or d=1d = 1? The formula should reduce to something you already know.
  • Write a unit test for each equation before trusting your implementation (Exercise 2 below).
🐍 Exercise 2 (research): implement attention from the paper
Implement Attention(Q, K, V) = softmax(QKᵀ/√d_k)V using plain lists. The tests check shapes and three behaviours the equation implies.

Robotics notation: frames and transforms

Robotics papers write coordinates relative to a frame, following Craig’s textbook convention:

Ap=ARB Bp+AtB,ATC=ATB BTC{}^{A}\mathbf p = {}^{A}R_{B}\,{}^{B}\mathbf p + {}^{A}\mathbf t_{B}, \qquad {}^{A}T_{C} = {}^{A}T_{B}\,{}^{B}T_{C}

Read ATB{}^{A}T_{B} as “the pose of frame B, expressed in frame A”. The leading superscript is the frame you’re measuring in, and the trailing subscript is the thing being described. Matching inner letters cancel, like shapes: WTR RTC=WTC{}^{W}T_{R}\,{}^{R}T_{C} = {}^{W}T_{C} (world ← robot ← camera). Other communities write the same thing as TWRT_{WR} or TRWT^{W}_{R}, so always check the convention.

Rotation conventions differ too. Quaternion multiplication follows either the Hamilton or the JPL convention, and they multiply in opposite orders. Sommer et al. (2018) document real bugs this caused. Euler angles come in 12 possible axis orders. Before using a robotics paper’s equations, find out which conventions it uses.

References

  1. D. Knuth (1992). “Two notes on notation.” American Mathematical Monthly, 99(5).
  2. J. Craig (2005). Introduction to Robotics: Mechanics and Control, 3rd ed. Pearson. (Frame notation.)
  3. S. Keshav (2007). “How to read a paper.” ACM SIGCOMM Computer Communication Review, 37(3).
  4. I. Goodfellow, Y. Bengio, A. Courville (2016). Deep Learning. MIT Press. (“Notation” section.)
  5. D. Kingma and J. Ba (2015). “Adam: A method for stochastic optimization.” ICLR.
  6. A. Vaswani et al. (2017). “Attention is all you need.” NeurIPS.
  7. H. Sommer et al. (2018). “Why and how to avoid the flipped quaternion multiplication.” Aerospace, 5(3).
  8. R. Sutton and A. Barto (2018). Reinforcement Learning: An Introduction, 2nd ed. MIT Press. (Notation summary.)