Skip to content
MARL in Cooperative Environments
Edit this page

Equation annotation gallery

A reference fixture, not a lesson. It lives in the content collection but is absent from the sidebar, so it gets the full site chrome and the Markdown pipeline (heading anchors, table of contents) without appearing in the course navigation. Every equation component is exercised below, so a regression shows up here first.

The house style this project is calibrated against: labels outside the formula, each connected to one term, each coloured by what that term is. Reproduced here as the API’s acceptance test.

Fixture 1
LSFT(θ)=−1T∑t=1Tlog⁡πθ(xt∣x<t)\mathcal{L}_{\text{SFT}}(\theta) = -\frac{1}{\mark{T}{T}} \sum_{t=1}^{T} \log \mark{pi}{\pi_{\theta}} \mark{prob}{(x_t \given x_{<t})}
The supervised fine-tuning objective. Colour is doing work here: violet marks a learned component, blue marks a quantity you are given, green marks the quantity being maximised.
  • current policy: pi subscript theta
  • tokens in the sequence: capital T in the denominator
  • probability of token t: x subscript t given x subscript less than t

The same machinery with a stepper. Stepping is discrete, so it doubles as the reduced-motion form of progressive disclosure rather than an animation that has to be switched off.

Fixture 2
The equation
ati∼πi ⁣(ati∣oti)\mark{a}{\act{i}} \sim \mark{pi}{\pol{i}}\!\left(\act{i} \given \mark{o}{\obs{i}}\right)
A decentralized policy. Every symbol carries the index i, and nothing in the expression refers to the global state: that is the whole content of the word decentralized.
  • the action agent i takes: a superscript i subscript t
  • agent i's own policy: pi subscript i
  • only what agent i can see: o superscript i subscript t

3. Braces and coloured terms, done in LaTeX

Section titled “3. Braces and coloured terms, done in LaTeX”

KaTeX draws better braces than a hand-positioned SVG, so bracing stays in LaTeX via \ubrace{tone}{term}{label}, and \tone{tone}{term} colours a term in place. The annotation engine handles only what LaTeX cannot: labels outside the formula with drawn connectors.

Fixture 3
SINRu=Pi giu⏟signal you wantσ2⏟noise+∑j≠iPj gju 1[cj=ci]⏟others on your channel\mark{sinr}{\sinr_u} = \frac{\ubrace{reward}{\pow{i}\,\gain{i}{u}}{signal you want}}{\ubrace{observe}{\noise}{noise} + \ubrace{conflict}{\sum_{j \neq i} \pow{j}\,\gain{j}{u}\,\mathbb{1}[\chan{j} = \chan{i}]}{others on your channel}}
Signal to interference plus noise ratio for user u. The indicator function is the pedagogical heart of it: interference is summed only over stations transmitting on the same channel, which is exactly why two agents choosing the same channel hurt each other.
  • what user u actually gets
Fixture 4
  1. Action←Policy(Observation)\text{Action} \leftarrow \text{Policy}(\text{Observation})

    In words. What the agent does follows from what it sees.

  2. ati←πi(oti)\act{i} \leftarrow \pol{i}(\obs{i})

    The same sentence in symbols. Agent i, at time t.

  3. ati∼πi(ati∣oti)\act{i} \sim \pol{i}(\act{i} \given \obs{i})

    One real change: the policy returns a distribution, and the action is sampled from it rather than read off it.

By the third line the formal notation is a restatement of something already understood, not a new object to decode.

The underline shape rules the term’s full width as well as pointing at it, which removes the ambiguity about how much of a wide expression a label refers to.

Fixture 5
rt′=rt−λct\rew' = \mark{base}{\rew} - \mark{cost}{\lambda c_t}
Reward net of communication cost. The lambda term is what stops more communication from always looking better.
  • what the team earned: r subscript t
  • what the talking cost them: lambda times c subscript t

An equation with no annotations renders as a plain figure, with no label layer built at all.

Fixture 6
J(x1,…,xn)=(∑i=1nxi)2n∑i=1nxi2J(x_1, \dots, x_n) = \frac{\left(\sum_{i=1}^{n} \tone{reward}{x_i}\right)^{2}}{n \sum_{i=1}^{n} \tone{reward}{x_i}^{2}}
Jain's fairness index, with the rate terms coloured in place by \tone.

Two labels wide enough to collide, which forces the lane assignment to stack them rather than overlap them.

Fixture 7
rt=R ⁣(st,at)\mark{lhs}{\rew} = R\!\left(\st, \mark{rhs}{\jointact}\right)
Two labels wide enough to collide, stacked into separate lanes.
  • one reward, whole team
  • what everyone did