Category Theory
Zulip Server
Archive

You're reading the public-facing archive of the Category Theory Zulip server.
To join the server you need an invite. Anybody can get an invite by contacting Matteo Capucci at name dot surname at gmail dot com.
For all things related to this archive refer to the same person.


Stream: theory: applied category theory

Topic: A 2-category in robust statistics?


view this post on Zulip Peva Blanchard (Jul 28 2026 at 07:35):

I've been working recently on robust statistics (in adversarial machine learning), and I've stumbled on a 2-category (I think), which should be well-known around here. Let me first motivate the structure with the original problem.

The original example

Consider an euclidean space XX and the space P2(X)P_2(X) of probability distributions with finite variance. Assume there is a true distribution η\eta_\dagger, but an adversary AA contaminates η\eta_\dagger and you only get to observe a distribution μ\mu such that (1p)ημ(1-p) \eta_\dagger \le \mu. The goal is to estimate the mean mηm_{\eta_\dagger} of the true distribution.

In our formulation, we choose a gauge, i.e. a (lsc) function

(x,η)={xmη2ση2if ση2>00if ση2=0 and x=mη+if ση2=0 and xmη\ell(x,\eta) = \begin{cases} \frac{\lVert x - m_\eta \rVert^2}{\sigma^2_\eta} &\text{if } \sigma^2_\eta > 0 \\ 0 &\text{if } \sigma^2_\eta = 0 \text{ and } x = m_\eta \\ +\infty &\text{if } \sigma^2_\eta = 0 \text{ and } x \ne m_\eta \end{cases}

that prices the estimation xx against the truth. An defense gives a set D(μ)D(\mu) of candidates xx.
The defense DD is κ\kappa-robust against AA if

μ,xD(μ),ηA(μ),(x,η)κ\forall \mu, \forall x\in D(\mu), \forall \eta \in A^\top(\mu), \ell(x, \eta) \le \kappa

where A(μ)A^\top(\mu) denotes the set of admissible distributions η\eta, (1p)ημ(1-p)\eta \le \mu.
The least of such κ\kappa defines the robustness coefficient

κ(,A,D)=supμsupxD(μ)supηA(μ)(x,η)\kappa(\ell, A, D) = \sup_\mu \sup_{x \in D(\mu)} \sup_{\eta \in A^\top(\mu)} \ell(x,\eta)

Notice that in this example, the adversary AA can be represented as a relation A(η,μ)A(\eta,\mu) stating whether the candidate η\eta is admissible with respect to the observed μ\mu. Similarly, we are looking for defenses DD that are relations: D(x,μ)D(x,\mu) holds iff xx is a valid estimate with respect to the observed μ\mu.

Our work focuses on computing the robustness coefficient for various defenses, adversaries, gauges, etc.
We quickly realize that having ways to combine defenses, adversaries and gauges, and derive the robustness coefficients would be useful.

2-categorical formulation

Let V=([0,+],min,+)V = ([0,+\infty], \min, +) denote the tropical rig. I am considering a 2-category VV-mat of matrices valued in VV

(DA)(x,μ)=infη(D(x,η)+A(η,μ))(D \circ A)(x,\mu) = \inf_\eta (D(x,\eta) + A(\eta,\mu))

d(,)=inf{κ  :  +κ}d(\ell, \ell') = \inf \{ \kappa \;:\; \ell + \kappa \ge \ell' \}

Relations can be encoded as "hard" matrices whose entries are {0,+}\{0,+\infty\}. So hard adversaries and defenses can be represented as arrows in VV-mat.

Now the fun part,

When AA and DD represent hard adversary and defense, it turns out the following are equivalent

This generalizes obviously to any matrices A,DA,D.

Interestingly, the right extension A\ell^A of \ell along AA is the best (soft) defense, because of the adjunction

d(DA,)=d(D,A)d(D \circ A, \ell) = d(D, \ell^A)

The robust statistics game then becomes an issue of finding hard-approximations of A\ell^A. And the compositional nature of all this gives rules to compute robustness coefficients (which are just metric distances between parallel matrices).

Questions

Thank you.

view this post on Zulip Matteo Capucci (he/him) (Aug 10 2026 at 08:38):

That's pretty nice! I'm quite sure your definition is correct