SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=Bkg6RiCqY7.
Nimit Sohoni, Jared Dunnmon, Geoffrey Angus, Albert Gu, and Christopher Ré. No subclass left behind: Fine-grained robustness in coarse-grained classification problems. Advances in Neural Information Processing Systems, 33:19339-19352, 2020.
Ishaan Gulrajani and David Lopez-Paz. In search of lost domain generalization. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=1QdXeXDoWtI.
A Appendix: Proof of Theorem 1, Corollary 1, and Theorem 2
A.1 Helper Lemmas
A.1.1 Bounding norms and inner products of isotropic random vectors.
The main lemmas of this section are lemma 3 and lemma 4. We will then use these two to bound norms of sums of random vectors and inner products between the sum and a single random vector in lemma 5. We first list some facts from [Vershynin, 2018] that we will use to bound the probability with which norms and inner products of Gaussian random vectors deviate far from their mean.
Definition 1. (Sub-Gaussian norm) For an r.v.  $\mathbf{x}$ , the sub-Gaussian norm, or  $\psi_{2}$ -norm, is
$$
\| \mathbf {x} \| _ {\psi_ {2}} = \inf  \{t > 0, \mathbb {E} [ \exp (\mathbf {x} ^ {2} / t ^ {2}) ] \leq 2 \}.
$$
An r.v. is called sub-Gaussian if its  $\psi_{2}$ -norm is finite and for some fixed constant  $c$
$$
p (| \mathbf {x} | > t) \leq 2 \exp \left(- c t ^ {2} / \| \mathbf {x} \| _ {\psi_ {2}}\right).
$$
A Gaussian r.v.  $\mathbf{x} \sim \mathcal{N}(0, \sigma^2)$  has an  $\psi_2$ -norm of  $G\sigma$  for a constant  $G = \sqrt{\frac{8}{3}}$ .<sup>2</sup>
Definition 2. (Sub-exponential norm) For an r.v.  $\mathbf{x}$ , the sub-exponential norm, or  $\psi_{1}$ -norm, is
$$
\| \mathbf {x} \| _ {\psi_ {1}} = \inf  \left\{t > 0, \mathbb {E} [ \exp (| \mathbf {x} | / t) ] \leq 2 \right\}.
$$
A sub-exponential r.v. is one that has finite  $\psi_{1}$ -norm.
Lemma 1. (Lemma 2.7.7 from [Vershynin, 2018]) Products of sub-Gaussian random variables  $\mathbf{x},\mathbf{y}$  is a sub-exponential random variable with it's  $\psi_{1}$ -norm bounded by the product of the  $\psi_{2}$ -norm
$$
\left\| \mathbf {x} \mathbf {y} \right\| _ {\psi_ {1}} \leq \left\| \mathbf {x} \right\| _ {\psi_ {2}} \left\| \mathbf {y} \right\| _ {\psi_ {2}}
$$
Lemma 1 implies that the product of two mean-zero standard normal vectors is a sub-exponential random variable with  $\psi_{1}$ -norm less than  $G^{2}$ .
Lemma 2. (Bernstein inequality, Theorem 2.8.2 [Vershynin, 2018]) For i.i.d sub-exponential random variables  $\mathbf{x}_1,\dots ,\mathbf{x}_d$  for a fixed constant  $c = \frac{1}{(2e)^2}$  and  $K = \| \mathbf{x}_1\|_{\psi_1}$
$$
p \left(\left| \sum_ {i = 1} ^ {d} \mathbf {x} _ {i} \right| > t\right) \leq 2 \exp \left(- c \min  \left\{\frac {t ^ {2}}{K ^ {2} d}, \frac {t}{K} \right\}\right)
$$
Next, we apply these facts to bound the sizes of inner products between two unit-variance Gaussian vectors.
Lemma 3. (Bounds on inner products of Gaussian vectors) Let  $\mathbf{u},\mathbf{v}$  be  $d$ -dimensional random vectors where each coordinate is an i.i.d standard normal r.v. Then, for any scalar  $\epsilon >0$  such that  $\epsilon \leq G^2\sqrt{d}$ , for a fixed constant  $c = \frac{1}{(2e)^2}$
$$
p \left(\left| \mathbf {u} ^ {\top} \mathbf {v} \right| > \epsilon \sqrt {d}\right) \leq 2 \exp \left(- c \frac {\epsilon^ {2}}{G ^ {4}}\right).
$$
$$
\begin{array}{l} \mathbb {E} _ {\mathbf {x} \sim \mathcal {N} (0, \sigma^ {2})} [ \exp (\mathbf {x} ^ {2} / t ^ {2}) ] = \int_ {- \infty} ^ {\infty} \frac {1}{\sigma \sqrt {2 \pi}} \exp (- x ^ {2} / 2 \sigma^ {2}) \exp (x ^ {2} / t ^ {2}) d x = \int_ {- \infty} ^ {\infty} \frac {1}{\sigma \sqrt {2 \pi}} \exp \left(- x ^ {2} \frac {(t ^ {2} - 2 \sigma^ {2})}{2 \sigma^ {2} t ^ {2}}\right) d x \\ = \frac {1}{\sigma \sqrt {2 \pi}} \sqrt {\frac {\pi}{\frac {(t ^ {2} - 2 \sigma^ {2})}{2 \sigma^ {2} t ^ {2}}}} = \frac {1}{\sigma \sqrt {\pi}} \sqrt {\frac {\pi \sigma^ {2} t ^ {2}}{(t ^ {2} - 2 \sigma^ {2})}} = \sqrt {\frac {t ^ {2}}{(t ^ {2} - 2 \sigma^ {2})}} \\ \sqrt {\frac {t ^ {2}}{\left(t ^ {2} - 2 \sigma^ {2}\right)}} \leq 2 \Rightarrow t ^ {2} \leq 4 \left(t ^ {2} - 2 \sigma^ {2}\right) \Rightarrow 8 \sigma^ {2} \leq 3 t ^ {2} \Rightarrow \inf  \left\{t: 8 \sigma^ {2} \leq 3 t ^ {2} \right\} = \sqrt {\frac {8}{3}} \sigma . \\ \end{array}
$$
$G = \sqrt{\frac{8}{3}}$ . This follows from:
Proof. First, the inner product is  $\mathbf{u}^{\top}\mathbf{v} = \sum_{i}^{d}\mathbf{u}_{i}\mathbf{v}_{i}$ ; it is the sum of products of i.i.d. standard normal r.v.  $(\sigma = 1)$ . Then, by lemma 1, each term in the sum is a sub-exponential r.v. with  $\psi_{1}$ -norm bounded as follows:
$$
K = \| \mathbf {u} _ {i} \mathbf {v} _ {i} \| _ {\psi_ {1}} \leq \| \mathbf {u} _ {i} \| _ {\psi_ {2}} \| \mathbf {u} _ {i} \| _ {\psi_ {2}} = G \times G = G ^ {2}. \tag {6}
$$
We can apply Bernstein inequality lemma 2 to sub-exponential r.v. to the inner product and then upper bound the probability by replacing  $K$  with the larger  $G^2$  in eq. (6)
$$
p \left(| \mathbf {u} ^ {\top} \mathbf {v} | > t\right) \leq 2 \exp \left(- c \min \left\{\frac {t ^ {2}}{K ^ {2} d}, \frac {t}{K} \right\}\right) \leq 2 \exp \left(- c \min \left\{\frac {t ^ {2}}{G ^ {4} d}, \frac {t}{G ^ {2}} \right\}\right)
$$
Substituting  $t = \epsilon \sqrt{d}$  in the above gives us:
$$
p \left(| \mathbf {u} ^ {\top} \mathbf {v} | > \epsilon \sqrt {d}\right) \leq 2 \exp \left(- c \min  \left\{\frac {\epsilon^ {2} d}{G ^ {4} d}, \frac {\epsilon \sqrt {d}}{G ^ {2}} \right\}\right)
$$
Using the fact that  $\epsilon \leq G^2\sqrt{d}$  to achieve the minimum concludes the proof:
$$
\epsilon \leq G ^ {2} \sqrt {d} \Rightarrow \epsilon^ {2} \leq \epsilon G ^ {2} \sqrt {d} \Rightarrow \frac {\epsilon^ {2}}{G ^ {4}} \leq \frac {\epsilon \sqrt {d}}{G ^ {2}} \Rightarrow \min \left\{\frac {\epsilon^ {2} d}{G ^ {4} d}, \frac {\epsilon \sqrt {d}}{G ^ {2}} \right\} = \frac {\epsilon^ {2}}{G ^ {4}}
$$
Lemma 4. Let  $\mathbf{x}$  be a Gaussian vector of size  $d$  where each element is a standard normal, meaning that  $\| \mathbf{x}_i\|_{\psi_2} = G$ . Then, for any  $t > 0$  and a fixed constant  $c = \frac{1}{(2e)^2}$ , the norm of the vector concentrates around  $\sqrt{d}$  according to
$$
p \left(\left| \| \mathbf {x} \| - \sqrt {d} \right| > t\right) \leq 2 \exp \left(- c t ^ {2} / G ^ {4}\right).
$$
Proof. Equation 3.3 from the proof of theorem 3.1.1 in [Vershynin, 2018] shows that
$$
p \left(\left| \left\| \mathbf {x} \right\| - \sqrt {d} \right| > t\right) \leq 2 \exp \left(- c t ^ {2} / \left(\max  _ {i} \left\| \mathbf {x} _ {i} \right\| _ {\psi_ {2}}\right) ^ {4}\right).
$$
As  $\mathbf{x}$  has i.i.d standard normal entries,  $\max_i\| \mathbf{x}_i\|_{\psi_2} = G$  , concluding the proof.
A.1.2 Concentration of norms of sums of random vectors and their inner products
This is the main lemma that we will use in proving theorem 1.
Lemma 5. Consider a set of vectors  $V = \{\pmb{\delta}_i\}$  where  $\pmb{\delta}_i \in \mathbf{R}^d$  of size  $T_V \geq 1$  where each element of each vector is drawn independently from the standard normal distribution  $\mathcal{N}(0,1)$ . Then, for a fixed constant  $c = \frac{1}{(2e)^2}$  and any  $\epsilon \in (0,G^2\sqrt{d})$  with probability  $\geq 1 - 2\exp(-\epsilon^2\frac{c}{G^4})$
$$
\left\| \frac {1}{\sqrt {T _ {V}}} \sum_ {i \in V} \boldsymbol {\delta} _ {i} \right\| \leq \sqrt {d} + \epsilon \tag {7}
$$
and with probability  $\geq 1 - 4T_V\exp (-\epsilon^2\frac{c}{G^4})$
$$
\forall \boldsymbol {\delta} _ {j} \in V \quad \left\langle \boldsymbol {\delta} _ {j}, \sum_ {i \in V} \boldsymbol {\delta} _ {i} \right\rangle \geq d - 3 \epsilon \sqrt {T _ {V} d} \tag {8}
$$
Further, consider any set  $U$  of vectors  $U = \{\pmb{\delta}_i\}$  of size  $T_U$ , where each vector also has coordinates drawn i.i.d from the standard normal distribution  $\mathcal{N}(0,1)$ . Then, with probability  $\geq 1 - 2T_u\exp (-\epsilon^2\frac{c}{G^4})$
$$
\forall \boldsymbol {\delta} _ {j} \in U \quad \left| \left\langle \boldsymbol {\delta} _ {j}, \sum_ {i \in V} \boldsymbol {\delta} _ {i} \right\rangle \right| \leq \epsilon \sqrt {T _ {V}} d, \tag {9}
$$
By union bound, the three events above hold at once with a probability at least  $1 - 2(2T_V + T_u + 1)\exp (-\epsilon^2\frac{c}{G^4})$
Proof. We split the proof into three parts one each for eqs. (7) to (9).
Proof of eq. (7). As  $\delta$  is a vector of random i.i.d standard normal random variables, note that  $\frac{1}{\sqrt{T_V}}\sum_i\delta_i$  is also a vector of i.i.d standard normal random variables. This follows from the fact that the sum of  $T_{V}$  standard normal random variables is a mean-zero Gaussian random variable with standard deviation  $\sqrt{T_V}$ . Thus dividing by the standard deviation makes the variance 1, making it standard normal.
Then, applying lemma 4 with  $t = \epsilon$  gives us the following bound:
$$
p \left(\left\| \frac {1}{\sqrt {T _ {V}}} \sum_ {i} \boldsymbol {\delta} _ {i} \right\| > \sqrt {d} + \epsilon\right) \leq p \left(\left| \left\| \frac {1}{\sqrt {T _ {V}}} \sum_ {i} \boldsymbol {\delta} _ {i} \right\| - \sqrt {d} \right| > \epsilon\right) \leq 2 \exp \left(- c \epsilon^ {2} / G ^ {4}\right)
$$
Proof of eq. (8) We split the inner product into two cases:  $T_V = 1$  and  $T_V \geq 2$ .
Case  $T_V = 1$ . First note that due to lemma 4,
$$
\forall j \in V, \qquad p \left(\| \boldsymbol {\delta} _ {j} \| <   \sqrt {d} - \epsilon\right) \leq p \left(\left| \left. \| \boldsymbol {\delta} _ {j} \| - \sqrt {d} \right| > \epsilon\right) \leq 2 \exp \left(- c \epsilon^ {2} / G ^ {4}\right). \right.
$$
Then, the following lower bound holds with probability at least  $1 - 2\exp \left(-c\epsilon^{2} / G^{4}\right)$
$$
\begin{array}{l} \forall j \in V, \quad \left\langle \boldsymbol {\delta} _ {j}, \sum_ {i \in V} \boldsymbol {\delta} _ {i} \right\rangle = \| \boldsymbol {\delta} _ {j} \| ^ {2} \\ \geq (\sqrt {d} - \epsilon) ^ {2} \\ \geq d - 2 \epsilon \sqrt {d} \\ \geq d - 3 \epsilon \sqrt {T _ {V} d}, \\ \end{array}
$$
To summarize this case, with the fact that  $1 - 2\exp (-c\epsilon^{2} / G^{4})\geq 1 - 4T_{V}\exp (-c\epsilon^{2} / G^{4})$ , we have that
$$
\forall j \in V, \quad \left\langle \boldsymbol {\delta} _ {j}, \sum_ {i \in V} \boldsymbol {\delta} _ {i} \right\rangle \geq d - 3 \epsilon \sqrt {T _ {V} d},
$$
with probability at least  $1 - 4T_{V}\exp (-c\epsilon^{2} / G^{4})$
Case  $T_V \geq 2$ . First note that,
$$
\forall j \in V \quad \left\langle \boldsymbol {\delta} _ {j}, \sum_ {i \in V} \boldsymbol {\delta} _ {i} \right\rangle = \| \boldsymbol {\delta} _ {j} \| ^ {2} + \left\langle \boldsymbol {\delta} _ {j}, \sum_ {i \in V, i \neq j} \boldsymbol {\delta} _ {i} \right\rangle
$$
For each of the  $T_V$  different  $\delta_j$ 's, using lemma 4 bounds the probability of the norm  $\|\delta_j\|$  being larger than  $\sqrt{d} - \epsilon$ :
$$
p \left(\| \boldsymbol {\delta} _ {j} \| <   \sqrt {d} - \epsilon\right) \leq p \left(\left| \left. \| \boldsymbol {\delta} _ {j} \| - \sqrt {d} \right| > \epsilon\right) \leq 2 \exp \left(- c \epsilon^ {2} / G ^ {4}\right). \right.
$$
In the case where  $T_V \geq 2$ , we express the inner product of a vector and a sum of vectors as follows
$$
\left\langle \boldsymbol {\delta} _ {j}, \sum_ {i \in V, i \neq j} \boldsymbol {\delta} _ {i} \right\rangle = \sqrt {T _ {V} - 1} \left\langle \boldsymbol {\delta} _ {j}, \frac {1}{\sqrt {T _ {V} - 1}} \sum_ {i \in V, i \neq j} \boldsymbol {\delta} _ {i} \right\rangle ,
$$
and noting that like above,  $\frac{1}{\sqrt{T_V - 1}}\sum_{i\in V,i\neq j}\delta_i$  is a vector of standard normal random variables, we apply lemma 3 to get
$$
\forall i \in V \quad p \left(\left| \left\langle \boldsymbol {\delta} _ {j}, \sum_ {i \in V, i \neq j} \boldsymbol {\delta} _ {i} \right\rangle \right| \geq \epsilon \sqrt {(T _ {V} - 1) d}\right) \leq 2 \exp \left(- c \frac {\epsilon^ {2}}{G ^ {4}}\right).
$$
Putting these together, by union bound over  $V$
$$
p \left[ \forall j \in V \quad \left(\| \boldsymbol {\delta} _ {j} \| <   \sqrt {d} - \epsilon\right) \text {o r} \left(\left| \left\langle \boldsymbol {\delta} _ {j}, \sum_ {i \in V, i \neq j} \boldsymbol {\delta} _ {i} \right\rangle \right| \geq \epsilon \sqrt {(T _ {V} - 1) d}\right) \right]
$$
$$
\begin{array}{l} \leq \sum_ {j \in V} p \left(\| \boldsymbol {\delta} _ {j} \| <   \sqrt {d} - \epsilon\right) + p \left(\left| \left\langle \boldsymbol {\delta} _ {j}, \sum_ {i \in V, i \neq j} \boldsymbol {\delta} _ {i} \right\rangle \right| \geq \epsilon \sqrt {\left(T _ {V} - 1\right) d}\right) \\ \leq \sum_ {j \in V} 2 \exp \left(- c \frac {\epsilon^ {2}}{G ^ {4}}\right) + 2 \exp \left(- c \frac {\epsilon^ {2}}{G ^ {4}}\right) \\ \leq 4 T _ {V} \exp \left(- c \frac {\epsilon^ {2}}{G ^ {4}}\right). \\ \end{array}
$$
Thus, with probability at least  $1 - 4T_V \exp \left(-c\frac{\epsilon^2}{G^4}\right)$ , none of the events happen and
$$
\begin{array}{l} \forall j \in V \quad \left\langle \boldsymbol {\delta} _ {j}, \sum_ {i \in V} \boldsymbol {\delta} _ {i} \right\rangle = \| \boldsymbol {\delta} _ {j} \| ^ {2} + \left\langle \boldsymbol {\delta} _ {j}, \sum_ {i \in V, i \neq j} \boldsymbol {\delta} _ {i} \right\rangle \\ \geq (\sqrt {d} - \epsilon) ^ {2} - \epsilon \sqrt {(T _ {V} - 1) d} \\ = d - 2 \epsilon \sqrt {d} + \epsilon^ {2} - \epsilon \sqrt {\left(T _ {V} - 1\right) d} \\ \geq d - 2 \epsilon \sqrt {(T _ {V} - 1) d} - \epsilon \sqrt {(T _ {V} - 1) d} \\ \geq d - 3 \epsilon \sqrt {T _ {V} d} \\ \end{array}
$$
Thus, putting the analysis in the two cases together, as long as  $T_V \geq 1$
$$
\forall j \in V \quad \left\langle \boldsymbol {\delta} _ {j}, \sum_ {i \in V} \boldsymbol {\delta} _ {i} \right\rangle \geq d - 3 \epsilon \sqrt {T _ {V}} d,
$$
with probability at least  $1 - 4T_V\exp \left(-c\frac{\epsilon^2}{G^4}\right)$
Proof of eq. (9) Next, we apply lemma 3 again to the inner product of two vectors of i.i.d standard normal random variables:
$$
\forall j \in U \quad p \left(\left| \left\langle \boldsymbol {\delta} _ {j}, \frac {1}{\sqrt {T _ {V}}} \sum_ {i \in V} \boldsymbol {\delta} _ {i} \right\rangle \right| \geq \epsilon \sqrt {d}\right) <   2 \exp \left(- c \epsilon^ {2} / G ^ {4}\right).
$$
By union bound over  $U$
$$
p \left[ \forall j \in U \quad \left(\left| \left\langle \boldsymbol {\delta} _ {j}, \frac {1}{\sqrt {T _ {V}}} \sum_ {i \in V} \boldsymbol {\delta} _ {i} \right\rangle \right| \geq \epsilon \sqrt {d}\right) \right] <   2 T _ {u} \exp \left(- c \epsilon^ {2} / G ^ {4}\right).
$$
Thus, with probability at least  $1 - 2T_{u}\exp \left(-c\frac{\epsilon^{2}}{G^{4}}\right)$ , the following holds, concluding the proof
$$
\forall j \in U \quad \left| \left\langle \boldsymbol {\delta} _ {j}, \frac {1}{\sqrt {T _ {V}}} \sum_ {i \in V} \boldsymbol {\delta} _ {i} \right\rangle \right| \leq \epsilon \sqrt {d}.
$$
Lemma 6. Let  $\{\mathbf{x}_i,\mathbf{y}_i\}_{i\leq n}$  be a collection of  $d$  dimensional covariates  $\mathbf{x}_i$  and label  $\mathbf{y}_i$  sampled according to  $p_{\rho}$  in eq. (1). The covariates  $\mathbf{x}_i = [\pm B\mathbf{y}_i,\mathbf{y}_i\boldsymbol {\delta}_i]$ , where  $+B$  in the middle coordinate for  $i\in S_{\text{shortcut}}$  and  $-B$  for  $i\in S_{\text{leftover}}$ . The dual formulation of the following norm-minimization problem
$$
\mathbf {w} _ {s t a b l e} = \underset {\mathbf {w}} {\arg \min } \quad \mathbf {w} _ {y} ^ {2} + \mathbf {w} _ {z} ^ {2} + \| \mathbf {w} _ {e} \| ^ {2}
$$
$$
s. t. i \in S _ {\text {s h o r t c u t}} \quad w _ {y} + B w _ {z} + \mathbf {w} _ {e} ^ {\top} \mathbf {y} _ {i} \boldsymbol {\delta} _ {i} > 1
$$
$$
s. t. i \in S _ {\text {l e f t o v e r}} w _ {y} - B w _ {z} + \mathbf {w} _ {e} ^ {\top} \mathbf {y} _ {i} \boldsymbol {\delta} _ {i} > 1
$$
$$
\mathbf {w} _ {y} \geq B \mathbf {w} _ {z}
$$
is the following with  $\zeta^{\top} = [-B,1,\mathbf{0}^{d - 2}],$
$$
\max  _ {\lambda \geq 0, \nu \geq 0} - \frac {1}{4} \| \zeta \nu + X ^ {\top} \lambda \| ^ {2} + \mathbf {1} ^ {\top} \lambda , \tag {10}
$$
where  $X$  is a matrix with  $\mathbf{y}_i\mathbf{x}_i$  as its rows.
Proof. We use Lagrange multipliers  $\lambda \in \mathbb{R}^n$ ,  $\nu \in \mathbb{R}$  to absorb the constraints and then use strong duality. Letting  $\zeta^\top = [-B,1,\mathbf{0}^{d - 2}]$ ,  $X$  be a matrix where the  $i$ th row is  $\mathbf{x}_i\mathbf{y}_i$ ,
$$
\min  _ {\mathbf {w}} \quad \| \mathbf {w} \| ^ {2} \qquad \text {s . t .} \qquad X \mathbf {w} - \mathbf {1} \geq 0 \qquad \zeta^ {\top} \mathbf {w} \geq 0
$$
has the same solution as
$$
\max  _ {\lambda \geq 0, \nu \geq 0} \min  _ {\mathbf {w}} \| \mathbf {w} \| ^ {2} - (X \mathbf {w} - \mathbf {1}) ^ {\top} \lambda - \nu \zeta^ {\top} \mathbf {w} \tag {11}
$$
Now, we solve the inner minimization to write the dual problem only in terms of  $\lambda, \nu$ . Solving the inner minimization involves solving a quadratic program, which is done by setting its gradient to zero,
$$
\begin{array}{l} \nabla_ {\mathbf {w}} \left(\| \mathbf {w} \| ^ {2} - (X \mathbf {w} - \mathbf {1}) ^ {\top} \lambda - \nu \zeta^ {\top} \mathbf {w}\right) = 2 \mathbf {w} - X ^ {\top} \lambda - \nu \zeta = 0 \\ \Longrightarrow \mathbf {w} = \frac {1}{2} (\zeta \nu + X ^ {\top} \lambda) \\ \end{array}
$$
Substituting  $\mathbf{w} = \frac{1}{2}\big(\zeta \nu +X^{\top}\lambda \big)$  in eq. (11)
$$
\begin{array}{l} \left\| \mathbf {w} \right\| ^ {2} - \left(X \mathbf {w} - \mathbf {1}\right) ^ {\top} \lambda - \nu \zeta^ {\top} \mathbf {w} = \\ \frac {1}{4} \| \zeta \nu + X ^ {\top} \lambda \| ^ {2} - \left(\frac {1}{2} (X (\zeta \nu + X ^ {\top} \lambda) - \mathbf {1}) ^ {\top} \lambda - \frac {1}{2} \nu \zeta^ {\top} (\zeta \nu + X ^ {\top} \lambda) \right. \\ = \frac {1}{4} \| \zeta \nu + X ^ {\top} \lambda \| ^ {2} - \left(\frac {1}{2} (X (\zeta \nu + X ^ {\top} \lambda) - \mathbf {1}) ^ {\top} \lambda - \frac {1}{2} \nu^ {2} \| \zeta \| ^ {2} - \frac {1}{2} \nu \zeta^ {\top} X ^ {\top} \lambda\right) \\ = \frac {1}{4} \| \zeta \nu + X ^ {\top} \lambda \| ^ {2} - \frac {1}{2} (X (X ^ {\top} \lambda)) ^ {\top} \lambda - \frac {1}{2} (X (\zeta \nu)) ^ {\top} \lambda + \mathbf {1} ^ {\top} \lambda - \frac {1}{2} \nu^ {2} \| \zeta \| ^ {2} - \frac {1}{2} \nu \zeta^ {\top} X ^ {\top} \lambda \\ = \frac {1}{4} \| \zeta \nu + X ^ {\top} \lambda \| ^ {2} - \left(\frac {1}{2} (X (X ^ {\top} \lambda)) ^ {\top} \lambda + \frac {1}{2} \nu^ {2} \| \zeta \| ^ {2} + \nu \zeta^ {\top} X ^ {\top} \lambda\right) + \mathbf {1} ^ {\top} \lambda \\ = \frac {1}{4} \| \zeta \nu + X ^ {\top} \lambda \| ^ {2} - \left(\frac {1}{2} (X ^ {\top} \lambda) ^ {\top} X ^ {\top} \lambda + \frac {1}{2} \nu^ {2} \| \zeta \| ^ {2} + \nu \zeta^ {\top} X ^ {\top} \lambda\right) + \mathbf {1} ^ {\top} \lambda \\ = \frac {1}{4} \| \zeta \nu + X ^ {\top} \lambda \| ^ {2} - \frac {1}{2} \left(\| X ^ {\top} \lambda \| ^ {2} + \| \nu \zeta \| ^ {2} + 2 \nu \zeta^ {\top} X ^ {\top} \lambda\right) + \mathbf {1} ^ {\top} \lambda \\ = \frac {1}{4} \| \zeta \nu + X ^ {\top} \lambda \| ^ {2} - \frac {1}{2} \| \zeta \nu + X ^ {\top} \lambda \| ^ {2} + \mathbf {1} ^ {\top} \lambda \\ = - \frac {1}{4} \| \zeta \nu + X ^ {\top} \lambda \| ^ {2} + \mathbf {1} ^ {\top} \lambda \\ \end{array}
$$
A.2 Shortcut learning in max-margin classification
We repeat the DGP from the linear perception task in eq. (1) here.
$$
\mathbf {y} \sim \operatorname {R a d}, \quad \mathbf {z} \sim \left\{ \begin{array}{l} p _ {\rho} (\mathbf {z} = y \mid \mathbf {y} = y) = \rho \\ p _ {\rho} (\mathbf {z} = - y \mid \mathbf {y} = y) = (1 - \rho) \end{array} , \quad \delta \sim \mathcal {N} (0, \mathbf {I} ^ {d - 2}), \quad \mathbf {x} = [ B * \mathbf {z}, \mathbf {y}, \delta ] \right. \tag {12}
$$
Theorem 1. Let  $\mathbf{w}^*$  be the max-margin predictor on  $n$  training samples from eq. (12) with a leftover group of size  $k$ . There exist constants  $C_1, C_2, N_0 > 0$  such that
$$
\forall \text {i n t e g e r s} k \in \left(0, \frac {n}{1 0}\right) \tag {13}
$$
$$
\forall d \geq C _ {1} k \log (3 n), \tag {14}
$$
$$
\forall B > C _ {2} \sqrt {d / k}, \tag {15}
$$
Before giving the proof of theorem 1, we first give the corollary showing overparameterization is not necessary for theorem 1 to hold.
Corollary 1. For all  $n > N_0$  — where the constant  $N_0$  is from theorem 1 — with scalar  $\tau \in (0,1)$  such that the dimension  $d = \tau n < n$ , theorem 1 holds.
$$
\forall k \leq n \times \min  \left\{\frac {1}{1 0}, \frac {\tau}{C _ {1} \log 3 n} \right\},
$$
a linear model trained via default-ERM yields a predictor  $\mathbf{w}^*$  such that  $B\mathbf{w}_z^* >\mathbf{w}_y^*$ .
Proof. We show that for a range of  $k$ , for all  $n \geq N_0$  theorem 1 holds for some  $d < n$ . Note that theorem 1 holds for  $n \geq N_0, d = C_1k\log (3n)$  and
$$
\forall k <   \frac {n}{1 0}.
$$
Setting  $d \leq \tau n$  for some  $\tau \in (0,1)$  such that  $d < n$  means that theorem 1 holds if
$$
C _ {1} k \log (3 n) = d \leq \tau n \Longrightarrow k \leq \frac {\tau n}{C _ {1} \log (3 n)}.
$$
Absorbing this new upper bound into the requirements on  $k$  for theorem 1 to hold, we get that for any scalar  $n > N_0$ ,  $\tau \in (0,1)$ ,  $d = \tau n$ , theorem 1 holds for
$$
\forall k <   n \times \min  \left\{\frac {1}{1 0}, \frac {\tau}{C _ {1} \log (3 n)} \right\}.
$$
In turn, even though  $d < n$ , a linear model trained via default-ERM converges in direction to a max-margin classifier such that  $\mathbf{w}^*$  with  $B\mathbf{w}_z^* > \mathbf{w}_y^*$ .
Proof. (of theorem 1) We consider two norm-minimization problems over  $\mathbf{w}$ , one under constraint  $\mathbf{w}_y \geq B\mathbf{w}_z$  and another under  $\mathbf{w}_y < B\mathbf{w}_z$ . We show that the latter achieves lower norm and therefore, max-margin will achieve solutions  $\mathbf{w}_y < B\mathbf{w}_z$ . The two minimization problems are as follows:
$$
\mathbf {w} _ {\text {s t a b l e}} = \underset {\mathbf {w}} {\arg \min } \quad w _ {y} ^ {2} + w _ {z} ^ {2} + \| \mathbf {w} _ {e} \| ^ {2} \qquad \qquad \mathbf {w} _ {\text {s h o r t c u t}} = \underset {\mathbf {w}} {\arg \min } \quad w _ {y} ^ {2} + w _ {z} ^ {2} + \| \mathbf {w} _ {e} \| ^ {2}
$$
$$
\text {s . t .} i \in S _ {\text {s h o r t c u t}} \quad w _ {y} + B w _ {z} + \mathbf {w} _ {e} ^ {\top} \mathbf {y} _ {i} \boldsymbol {\delta} _ {i} > 1 \quad \text {s . t .} i \in S _ {\text {s h o r t c u t}} \quad w _ {y} + B w _ {z} + \mathbf {w} _ {e} ^ {\top} \mathbf {y} _ {i} \boldsymbol {\delta} _ {i} > 1
$$
$$
s. t. i \in S _ {\text {l e f t o v e r}} w _ {y} - B w _ {z} + \mathbf {w} _ {e} ^ {\top} \mathbf {y} _ {i} \boldsymbol {\delta} _ {i} > 1 \quad i \in S _ {\text {l e f t o v e r}} w _ {y} - B w _ {z} + \mathbf {w} _ {e} ^ {\top} \mathbf {y} _ {i} \boldsymbol {\delta} _ {i} > 1
$$
$$
\mathbf {w} _ {y} \geq B \mathbf {w} _ {z} \quad \left(\mathrm {1 6}\right) \quad \mathbf {w} _ {y} <   B \mathbf {w} _ {z} \tag {17}
$$
From eq. (16), any  $\mathbf{w}$  that satisfy the constraints of the dual maximization problem will lower bound the value of the optimum of the primal,  $\| \mathbf{w}_{\mathrm{stable}}\| ^2\geq W_{\mathrm{stable}}$ . From the eq. (17), substituting a guess in  $\mathbf{w}_{\mathrm{shortcut}}$  that satisfies the constraints yields an upper bound,  $\| \mathbf{w}_{\mathrm{shortcut}}\| ^2\leq W_{\mathrm{shortcut}}$ . The actual computation of the bounds  $W_{\mathrm{shortcut}}$ ,  $W_{\mathrm{stable}}$  is in lemmas 7 and 8 which are proved in appendix A.3 and appendix A.4 respectively. We reproduce the lemmas here for convenience.
Lemma. (7) Consider the following optimization problem from eq. (16) where  $n$  samples of  $\mathbf{x}_i, \mathbf{y}_i$  come from eq. (1) where  $\mathbf{x}_i \in \mathbf{R}^d$ :
$$
\mathbf {w} _ {s t a b l e} = \underset {\mathbf {w}} {\arg \min } \quad w _ {y} ^ {2} + w _ {z} ^ {2} + \left\| \mathbf {w} _ {e} \right\| ^ {2}
$$
$$
s. t. i \in S _ {\text {s h o r t c u t}} \quad w _ {y} + B w _ {z} + \mathbf {w} _ {e} ^ {\top} \mathbf {y} _ {i} \boldsymbol {\delta} _ {i} > 1 \tag {18}
$$