SlowGuess commited on
Commit
fa5de79
·
verified ·
1 Parent(s): ac5bc5a

Add Batch c2ddbeb7-30f6-4f38-9f90-8187ee90d316

Browse files
Files changed (24) hide show
  1. robustandprivatestochasticlinearbandits/b5782a59-d206-4647-9bfb-e3ea716a9fb1_content_list.json +3 -0
  2. robustandprivatestochasticlinearbandits/b5782a59-d206-4647-9bfb-e3ea716a9fb1_model.json +3 -0
  3. robustandprivatestochasticlinearbandits/b5782a59-d206-4647-9bfb-e3ea716a9fb1_origin.pdf +3 -0
  4. robustandprivatestochasticlinearbandits/full.md +963 -0
  5. robustandprivatestochasticlinearbandits/images.zip +3 -0
  6. robustandprivatestochasticlinearbandits/layout.json +3 -0
  7. robustandscalablebayesianonlinechangepointdetection/0d8ea497-d454-453b-b472-d9baeeeb0419_content_list.json +3 -0
  8. robustandscalablebayesianonlinechangepointdetection/0d8ea497-d454-453b-b472-d9baeeeb0419_model.json +3 -0
  9. robustandscalablebayesianonlinechangepointdetection/0d8ea497-d454-453b-b472-d9baeeeb0419_origin.pdf +3 -0
  10. robustandscalablebayesianonlinechangepointdetection/full.md +777 -0
  11. robustandscalablebayesianonlinechangepointdetection/images.zip +3 -0
  12. robustandscalablebayesianonlinechangepointdetection/layout.json +3 -0
  13. robustspeechrecognitionvialargescaleweaksupervision/b3f20327-83e0-4044-9a41-bbdeea913ab0_content_list.json +3 -0
  14. robustspeechrecognitionvialargescaleweaksupervision/b3f20327-83e0-4044-9a41-bbdeea913ab0_model.json +3 -0
  15. robustspeechrecognitionvialargescaleweaksupervision/b3f20327-83e0-4044-9a41-bbdeea913ab0_origin.pdf +3 -0
  16. robustspeechrecognitionvialargescaleweaksupervision/full.md +0 -0
  17. robustspeechrecognitionvialargescaleweaksupervision/images.zip +3 -0
  18. robustspeechrecognitionvialargescaleweaksupervision/layout.json +3 -0
  19. robustweightsignaturesgainingrobustnessaseasyaspatchingweights/9d953e7c-7753-4ab0-8358-39ad3f14a591_content_list.json +3 -0
  20. robustweightsignaturesgainingrobustnessaseasyaspatchingweights/9d953e7c-7753-4ab0-8358-39ad3f14a591_model.json +3 -0
  21. robustweightsignaturesgainingrobustnessaseasyaspatchingweights/9d953e7c-7753-4ab0-8358-39ad3f14a591_origin.pdf +3 -0
  22. robustweightsignaturesgainingrobustnessaseasyaspatchingweights/full.md +340 -0
  23. robustweightsignaturesgainingrobustnessaseasyaspatchingweights/images.zip +3 -0
  24. robustweightsignaturesgainingrobustnessaseasyaspatchingweights/layout.json +3 -0
robustandprivatestochasticlinearbandits/b5782a59-d206-4647-9bfb-e3ea716a9fb1_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:564474fed6d05f3fa52c75425a8b40aadfafb307f65a81dc6ed063ca964b8b48
3
+ size 159072
robustandprivatestochasticlinearbandits/b5782a59-d206-4647-9bfb-e3ea716a9fb1_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1aaeb49f328157e94f0ffe7b1679713174189c129bcea988df2fa0f60f2be115
3
+ size 187066
robustandprivatestochasticlinearbandits/b5782a59-d206-4647-9bfb-e3ea716a9fb1_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fbf4a9722099cc62bf2d7924ca8de5721a96cbb97af0f840f1c3ad6e04153d34
3
+ size 500453
robustandprivatestochasticlinearbandits/full.md ADDED
@@ -0,0 +1,963 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Robust and private stochastic linear bandits
2
+
3
+ Vasileios Charisopoulos<sup>1</sup> Hossein Esfandiari<sup>2</sup> Yahab Mirrokni<sup>2</sup>
4
+
5
+ # Abstract
6
+
7
+ In this paper, we study the stochastic linear bandit problem under the additional requirements of differential privacy, robustness and batched observations. In particular, we assume an adversary randomly chooses a constant fraction of the observed rewards in each batch, replacing them with arbitrary numbers. We present differentially private and robust variants of the arm elimination algorithm using logarithmic batch queries under two privacy models and provide regret bounds in both settings. In the first model, every reward in each round is reported by a potentially different client, which reduces to standard local differential privacy (LDP). In the second model, every action is "owned" by a different client, who may aggregate the rewards over multiple queries and privatize the aggregate response instead. To the best of our knowledge, our algorithms are the first simultaneously providing differential privacy and adversarial robustness in the stochastic linear bandits problem.
8
+
9
+ # 1. Introduction
10
+
11
+ Bandits model is a popular formulation for online learning, wherein a learner interacts with her environment by choosing a sequence of actions, each of which presents a reward to the learner, from an available (potentially infinite) set of actions. The goal of the learner is to minimize her regret, defined as the difference between the rewards obtained by the chosen sequence of actions and the best possible action in hindsight. To achieve this, the learner must balance between exploration (choosing actions that reveal information about the action set) and exploitation (repeating actions that offered the highest rewards in previous rounds).
12
+
13
+ <sup>1</sup>Operations Research & Information Engineering, Cornell University. Part of this work was completed while the author was with Google. <sup>2</sup>Google Research. Correspondence to: Vasileios Charisopoulos <vc333@cornell.edu>.
14
+
15
+ Proceedings of the $40^{th}$ International Conference on Machine Learning, Honolulu, Hawaii, USA. PMLR 202, 2023. Copyright 2023 by the author(s).
16
+
17
+ In theory, deciding the next action sequentially is easiest. However, there are several obstacles to overcome when it comes to practice. The first obstacle is that the rewards in bandit algorithms are often the result of interactions with physical entities (Bouneffouf et al., 2020) (e.g., recommendation systems, clinical trials, advertising, etc.), raising concerns about the privacy of participating entities. For example, responses of an individual to medical treatments can inadvertently reveal privacy-sensitive health information. Therefore, it is essential to design learning algorithms that preserve the privacy of reward sequences.
18
+
19
+ Furthermore, observations collected from multiple users or external resources are prone to failures or corruptions. These corruptions are modeled by adversaries, which can tamper with a fraction of the observed rewards. Adversarial corruptions can be strategic, (e.g., simultaneously hijacking the devices of multiple users), or random (such as misclicks in the context of an ad campaign). Regardless of their nature, they highlight the need for developing robust learning algorithms that succeed in the presence of such corruptions. Developing robust private policies has drawn considerable attention in the past couple of years ((Esfandiari et al., 2022; Liu et al., 2021; Kothari et al., 2022; Ghazi et al., 2021; Dimitrakakis et al., 2014; Li et al., 2022b)). However, despite the importance of the bandits model, we are not aware of any provably robust and private policy for this model.
20
+
21
+ Lastly, in practice, it is often desirable or even necessary for the learner to perform actions in parallel. For example, ad campaigns present an assortment of advertisements to multiple users at the same time and are only periodically recalibrated (Bertsimas & Mersereau, 2007). Consequently, batch policies must optimally balance between parallelization, which can offer significant time savings, and information exchange, which must happen frequently enough to allow for exploration of the action space (Esfandiari et al., 2021).
22
+
23
+ In this paper, we develop a learning policy that addresses both privacy and robustness challenges, while enjoying the benefits of parallelization. Specifically, our policy protects the privacy of reward sequences by respecting the standard differential privacy measure, whilewithstanding an adversary that changes a constant fraction of the observed rewards in each batch. In the remainder of this section, we formally
24
+
25
+ introduce the problem and survey related work in the bandit literature.
26
+
27
+ # 1.1. Problem formulation and provable guarantees
28
+
29
+ We study the stochastic linear bandit problem: given an action space $\mathcal{A} \subset \mathbb{R}^d$ with $K$ elements satisfying $\max_{a \in \mathcal{A}} \|a\|_2 \leq 1$ , a learner "plays" actions $a \in \mathcal{A}$ and receives rewards
30
+
31
+ $$
32
+ r _ {a} := \langle a, \theta^ {\star} \rangle + \eta , \quad \eta \sim \operatorname {S u b G} (1), \tag {1}
33
+ $$
34
+
35
+ where $\theta^{\star}$ is an unknown vector in $\mathbb{R}^d$ and $\mathrm{SubG}(1)$ denotes a zero-mean subgaussian random variable. Our assumption that $|\mathcal{A}| \leq K$ is without loss of generality, since our results extend to the infinite case by a standard covering argument (Lattimore & Szepesvári, 2020, Chapter 20). For simplicity, we also assume that $\| \theta^{\star} \| \leq 1$ . Given a budget of $T$ total actions, the goal of the learner is to minimize her expected regret:
36
+
37
+ $$
38
+ \mathbb {E} \left[ R _ {T} \right] := \max _ {a \in \mathcal {A}} \sum_ {t = 1} ^ {T} \langle a - a _ {t}, \theta^ {\star} \rangle \tag {2}
39
+ $$
40
+
41
+ Batched observations. In bandits problems with batch policies, the learner commits to a sequence (i.e., a batch) of actions and observes the rewards of the actions only after the entire batch of actions has been played. The learner may play multiple batches of actions, whose sizes may be chosen adaptively, subject to the requirement that the total number of batches does not exceed $B$ (in addition to the total number of actions played not exceeding the budget $T$ ). We assume that $B$ is also known to the learner.
42
+
43
+ Robustness. We require that our algorithm is robust under possibly adversarial corruptions suffered. In particular, we assume that an adversary replaces every observation by an arbitrary number with some small probability $\alpha$ . Thus, during each batch, the observed rewards will satisfy
44
+
45
+ $$
46
+ r _ {i} = \left\{ \begin{array}{l l} \langle a _ {i}, \theta^ {\star} \rangle + \eta_ {i}, & \text {w . p .} 1 - \alpha , \\ * \text {,} & \text {w . p .} \alpha \end{array} , \quad i = 1, \dots , n, \right. \tag {3}
47
+ $$
48
+
49
+ where $*$ is an arbitrary value, $\alpha \in [0,1/4)$ is the corruption probability, and $n$ is the size of the batch.
50
+
51
+ Diffential privacy. Our other requirement is that the algorithm is differentially private (DP).
52
+
53
+ Definition 1.1 (Differential Privacy for Bandits (Basu et al., 2019)). A randomized mechanism $\mathcal{M}$ for stochastic linear bandits is called $(\varepsilon_{\mathrm{priv}},\delta_{\mathrm{priv}})$ -differentially private if, for any two neighboring sequences of rewards $\mathcal{R} = (r_1,\dots,r_T)$ and $\mathcal{R}' = (r_1',\ldots,r_T')$ where $r_i \neq r_i'$ for at most one index $i$ , and any subset of outputs $O \in \mathcal{M}^T$ , it satisfies
54
+
55
+ $$
56
+ \mathbb {P} \left(\mathcal {M} (\mathcal {R}) \in O\right) \leq e ^ {\varepsilon_ {\text {p r i v}}} \cdot \mathbb {P} \left(\mathcal {M} \left(\mathcal {R} ^ {\prime}\right) \in O\right) + \delta_ {\text {p r i v}}. \tag {4}
57
+ $$
58
+
59
+ The main contribution of our paper is a batched arm elimination algorithm that satisfies both desiderata, presented in detail in Section 2. We assume a distributed setting where a central server takes on the role of the learner, connected with several clients that report back rewards. The clients do not trust the central server and therefore choose to privatize their reward sequences; this model is better known as local differential privacy (LDP) (Kasiviswanathan et al., 2011). Our algorithm addresses the following client response models:
60
+
61
+ (M1) Each reward $\bar{r}_i$ may be solicited from a different client $i$ .
62
+ (M2) Each client "owns" an action $a \in \mathcal{A}$ and may report multiple rewards in each batch.
63
+
64
+ Remark 1.2. In Model (M1), we may assume without loss of generality that every reward $\bar{r}_i$ is solicited from a different client, and thus every client returns at most 1 response.
65
+
66
+ Below, we provide informal statements for the expected regret that our algorithms achieve under each model. While the regret under (M1) has better dependence on the dimension $d$ , (M2) leads to a better dependence on the privacy parameter $\varepsilon_{\mathrm{priv}}$ . The improved dependence on $\varepsilon_{\mathrm{priv}}$ in the latter should not come as a complete surprise, since model (M2) can be viewed as interpolating between the local and central models of differential privacy. For simplicity, we focus on the case where $B$ scales logarithmically in $T$ , although our analysis can be easily modified for general $B$ . Figure 1 illustrates the qualitative behavior of our regret bounds.
67
+
68
+ Theorem 1.3 (Informal). Under Model $(\mathbf{M}1)$ , there is an $\varepsilon_{\mathrm{priv}}$ -locally differentially private algorithm that is robust to adversarial corruptions with expected regret satisfying
69
+
70
+ $$
71
+ \mathbb {E} \left[ R _ {T} \right] = \tilde {O} \left(\left[ \sqrt {d T} + T \max \left\{\sqrt {\alpha d}, \alpha d \right\} \right] \left(1 + \frac {1}{\varepsilon_ {\text {p r i v}}}\right)\right)
72
+ $$
73
+
74
+ It is worth noting that in the non-private setting, the regret bound above scales as $\tilde{O}(T\sqrt{\alpha d} + \sqrt{dT})$ when $\alpha < \frac{1}{d}$ and $\tilde{O}(T\alpha d + \sqrt{dT})$ when $\alpha \geq \frac{1}{d}$ . Note that the total amount of corruption injected by the adversary is upper bounded by $C = \alpha T$ . Interestingly, our result shaves off a factor of at least $\sqrt{d}$ compared to the regret bound of the best previous work on robust stochastic linear bandits (Bogunovic et al., 2021), which scales as $\tilde{O}(\sqrt{dT} + Cd^{3/2})$ .
75
+
76
+ Theorem 1.4 (Informal). Under Model (M2), there is an $\varepsilon_{\mathrm{priv}}$ -differentially private algorithm that is robust to adversarial corruptions with expected regret satisfying
77
+
78
+ $$
79
+ \begin{array}{l} \mathbb {E} \left[ R _ {T} \right] = \tilde {O} \left(d \sqrt {T} + \frac {d}{\varepsilon_ {\text {p r i v}}}\right) \\ + \tilde {O} \left(d ^ {3 / 2} \sqrt {\alpha} \left(T + d \sqrt {T} + \frac {d}{\varepsilon_ {\mathrm {p r i v}}}\right)\right) + \alpha T. \\ \end{array}
80
+ $$
81
+
82
+ Compared to Theorem 1.3, Theorem 1.4 yields an improved dependence on $T$ in the "private" part of the regret at the expense of an additional $\sqrt{d}$ factor in the non-private part.
83
+
84
+ # 1.2. Related work
85
+
86
+ In this section, we survey related work in the bandit literature that addresses differential privacy and/or robustness to corruptions. We note that, to the best of our knowledge, our work is the first to simultaneously provide robustness and differential privacy guarantees for the stochastic linear bandit setting. While preparing the camera-ready version of this manuscript we were made aware of the work of (Wu et al., 2023), which studies private and robust multi-armed bandits.
87
+
88
+ Differential privacy in linear bandits. Differential privacy has been well-studied in the context of bandit learning. In the central DP model, which is the focus of this paper, (Shariff & Sheffet, 2018) proved a lower bound of $\Omega (\sqrt{T} +\frac{\log(T)}{\varepsilon_{\mathrm{priv}}})$ on the expected regret and proposed a private variant of the LinUCB algorithm with additive noise that achieves expected regret of $\tilde{O} (\sqrt{T} +\sqrt{T} /\varepsilon_{\mathrm{priv}})$ . In recent work, (Li et al., 2022a; Hanna et al., 2022) proposed a private variant of the arm elimination algorithm that obtains a regret bound of $O(\sqrt{T\log T} +\frac{\log^2(T)}{\varepsilon_{\mathrm{priv}}})$ which is tight up to logarithmic factors; in particular, the work of (Li et al., 2022a) achieves $(\epsilon ,\delta)$ -differential privacy using the Gaussian mechanism while (Hanna et al., 2022) achieve $\epsilon$ -differential privacy (also known as pure differential privacy) via the Laplace mechanism. While conceptually similar to that of (Li et al., 2022a; Hanna et al., 2022), our algorithm guarantees differential privacy and robustness to corrupted observations simultaneously and maintains an order-optimal regret bound.
89
+
90
+ In the local DP model, (Zheng et al., 2020) used a reduction to private bandit convex optimization to achieve expected regret $\tilde{O}(T^{3/4}/\varepsilon_{\mathrm{priv}})$ . Under additional distributional assumptions on the action set, this was improved to $\tilde{O}(T^{1/2}/\varepsilon_{\mathrm{priv}})$ by (Han et al., 2021). The same rate was obtained by (Hanna et al., 2022), who removed the requirement that actions are generated from a distribution. Finally, a recent line of work focused on so-called shuffle differential privacy (Bittau et al., 2017; Cheu, 2021), wherein a trusted shuffler can preprocess client responses before transmitting them to the central server. A sequence of works (Tenenbaum et al., 2021; Chowdhury & Zhou, 2022; Garcelon et al., 2022; Hanna et al., 2022) proposed shuffle-DP algorithms for linear bandits, with (Li et al., 2022a; Hanna et al., 2022) achieving essentially the same regret bound as in the central DP setting.
91
+
92
+ Robustness to adversarial attacks. Recent work proposed various adversarial attacks in the bandit setting, as well as algorithms to protect against them. (Lykouris et al., 2018) (and (Gupta et al., 2019) in a follow-up work) study multi-armed bandits with adversarial scaling, wherein an adversary can shrink the means of the arm distributions in each round, and propose robust algorithms for this setting. The corruption in this work differs from our setting, where the adversary can replace a random fraction of rewards arbitrarily. The works of (Jun et al., 2018; Liu & Shroff, 2019; Garcelon et al., 2020) study multi-armed and contextual bandit algorithms from the attacker perspective, demonstrating how an adversary can induce linear regret with logarithmic effort.
93
+
94
+ (Li et al., 2019) and (Bogunovic et al., 2021) study additive adversarial corruptions in contextual bandits. In particular, they assume that the observed reward in round $i$ suffers an additive perturbation by $c_{i}(a_{i})$ , where $a_{i}$ is the $i^{\text{th}}$ context and $c_{i}: \mathcal{A} \to [-1,1]$ is a context-dependent corruption function. Crucially, the adversary is subject to a budget constraint given some budget $C$ unknown to the learner:
95
+
96
+ $$
97
+ \sum_ {i = 1} ^ {T} \max _ {a \in \mathcal {A}} | c _ {i} (a) | \leq C. \tag {5}
98
+ $$
99
+
100
+ In (Li et al., 2019), the authors present a robust exploration algorithm for contextual bandits using the Loeowner ellipsoid. Letting $\Delta$ denote the gap between the highest and lowest expected rewards, their algorithm achieves a regret of $O\left(\frac{d^{5/2}C\log T}{\Delta} + \frac{d^6\log^2T}{\Delta^2}\right)$ , under the key assumption that the action space $\mathcal{A}$ is a full-dimensional polytope, and requires no knowledge of the corruption budget $C$ .
101
+
102
+ On the other hand, the work of (Bogunovic et al., 2021) introduces a robust variant of the phased arm elimination algorithm for stochastic linear bandits that achieves an expected regret of $\tilde{O} (\sqrt{dT} +Cd^{3 / 2})$ , assuming the budget $C$ is known to the learner; for unknown budgets, an additional $C^2$ factor appears in the regret bound. Our work deviates from that of (Bogunovic et al., 2021) in the sense that we measure corruption using the probability $\alpha$ of an adversary interfering with each observation; moreover, assuming that $C$ scales as $\alpha T$ , our work shaves off a $\sqrt{d}$ factor from the result of (Bogunovic et al., 2021) in certain regimes, while it also ensures differential privacy.
103
+
104
+ # 1.3. Notation
105
+
106
+ We let $\langle x,y\rangle \coloneqq x^{\mathsf{T}}y$ denote the Euclidean inner product with induced norm $\| x\| = \sqrt{\langle x,x\rangle}$ and write $\mathbb{S}^{d - 1}\coloneqq \{x\in \mathbb{R}^d\mid \| x\| _2 = 1\}$ for the unit sphere in $d$ dimensions. When $M$ is a positive-definite matrix, we write $\| x\| _M\coloneqq \sqrt{\langle x,Mx\rangle}$ for the norm induced by $M$ . Finally, we write
107
+
108
+ ![](images/922d78f0af3bf7d52499c8fa10cf829d815947cd785ddac6e0e11bb3b8a3419f.jpg)
109
+ Figure 1. Demonstration of regret bounds. Left: private vs. non-private regret bounds under (M1). Center: scaling of private regret bound under (M1) and (M2). Right: effect of corruption parameter $\alpha$ under model (3).
110
+
111
+ ![](images/fc699c5010bc6ad02cc57413df54c4e9027d7bab9d04cfb621ffc1a453fb51af.jpg)
112
+
113
+ ![](images/4483df021cf118aebedace23e3face0f96af22b19d1b56262982f1307da13780.jpg)
114
+
115
+ $\| A \|_{\mathrm{op}} \coloneqq \sup_{x \in \mathbb{S}^{n-1}} \| Ax \|$ for the $\ell_2 \to \ell_2$ operator norm of a matrix $A \in \mathbb{R}^{m \times n}$ .
116
+
117
+ # 1.4. Coresets and G-optimal designs
118
+
119
+ Our algorithms make use of coresets, which in turn are formed with the help of a concept called $G$ -optimal design. We formally define this concept below.
120
+
121
+ Definition 1.5 (G-optimal design). Let $\mathcal{A} \subset \mathbb{R}^d$ be a finite set of vectors and let $\pi : \mathcal{A} \to [0,1]$ be a probability distribution on $\mathcal{A}$ satisfying $\sum_{a \in \mathcal{A}} \pi(a) = 1$ . Then $\pi$ is called a $G$ -optimal design for $\mathcal{A}$ if it solves the following optimization problem:
122
+
123
+ $$
124
+ \text {m i n i m i z e} \left\{\max _ {a \in \mathcal {A}} \| a \| _ {M ^ {- 1} (\pi)} ^ {2} \right\}, \tag {6}
125
+ $$
126
+
127
+ where $M^{-1}(\pi)\coloneqq \left(\sum_{a\in \mathcal{A}}\pi (a)aa^{\mathsf{T}}\right)^{-1}$ .
128
+
129
+ A standard result in experiment design (Lattimore & Szepesvári, 2020, Theorem 21.1) shows that the optimal value of (6) is equal to $d$ . Moreover, it is possible to find a probability distribution $\pi$ satisfying the following:
130
+
131
+ Definition 1.6 (Approximate G-optimal design). Let $\mathcal{A} \subset \mathbb{R}^d$ be a finite set of vectors and let $\pi : \mathcal{A} \to [0,1]$ be a probability distribution on $\mathcal{A}$ . We call $\pi$ an approximate G-optimal design for $\mathcal{A}$ if it satisfies
132
+
133
+ $$
134
+ \max _ {a \in \mathcal {A}} \| a \| _ {M ^ {- 1} (\pi)} ^ {2} \leq 2 d, \quad | \operatorname {s u p p} (\pi) | \leq C d \log \log d \tag {7}
135
+ $$
136
+
137
+ for a universal constant $C > 0$ .
138
+
139
+ In particular, an approximate G-optimal design $\pi$ in the sense of Definition 1.6 can be found in time $O(d\log \log d)$ .
140
+
141
+ Given a (approximate) G-optimal design $\pi$ in the sense of Definition 1.5 or Definition 1.6, a coreset $\mathcal{S}_{\mathcal{A}}$ of total size $n$ is a multiset $\{a_1,\ldots ,a_n\}$ where each action $a\in \operatorname {supp}(\pi)$ appears a total of $n_a\coloneqq \lceil \pi (a)\cdot n\rceil$ times.
142
+
143
+ # 2. Algorithm and main results
144
+
145
+ To minimize the regret of the learner, we use a variation of the standard arm elimination algorithm (Lattimore & Szepesvári, 2020). In this algorithm, the learner uses batches of actions to construct confidence intervals for the optimal rewards and eliminates a set of suboptimal arms in each round based on their performance on the current batch. While the vanilla arm elimination algorithm is neither robust nor differentially private, we develop a variant that simultaneously ensures both these properties. An additional attractive property of our algorithm is that its implementation only requires a simple modification.
146
+
147
+ # 2.1. Our approach
148
+
149
+ To motivate our approach, we first sketch a naive attempt at modifying the arm elimination algorithm and briefly explain why it is unable to achieve good regret guarantees.
150
+
151
+ Recall that in the standard arm elimination algorithm, the learner first forms a so-called coreset of the action space $\mathcal{A}$ , which is a multiset of vectors $a_1, \ldots, a_n \in \mathcal{A}$ , and plays all the actions $a_j$ receiving rewards $r_j$ . To prune the action space, the learner first computes the least-squares estimate:
152
+
153
+ $$
154
+ \widehat {\theta} := \left(\sum_ {j = 1} ^ {n} a _ {j} a _ {j} ^ {\top}\right) ^ {- 1} \sum_ {j = 1} ^ {n} a _ {j} r _ {j}, \tag {8}
155
+ $$
156
+
157
+ and chooses a suitable threshold $\gamma$ to eliminate arms with
158
+
159
+ $$
160
+ \left\langle a, \widehat {\theta} \right\rangle < \max _ {j = 1, \dots , n} \left\langle a _ {j}, \widehat {\theta} \right\rangle - 2 \gamma .
161
+ $$
162
+
163
+ Clearly, the arm elimination algorithm interacts with the rewards directly only when forming the least squares estimate $\widehat{\theta}$ . Therefore, estimating $\widehat{\theta}$ with a differentially private algorithm is sufficient to protect the privacy of rewards. Likewise, computing $\widehat{\theta}$ robustly will ensure robustness of the overall algorithm.
164
+
165
+ The main idea behind our arm elimination variant is the following. First, let us dispense with the differential privacy requirement. Notice that in the absence of corruptions, $\widehat{\theta}$ is the empirical mean of the sequence of variables $\{Z_1,\ldots ,Z_n\}$ :
166
+
167
+ $$
168
+ Z _ {j} := \left(\sum_ {i = 1} ^ {n} a _ {i} a _ {i} ^ {\mathsf {T}}\right) ^ {- 1} r _ {j} a _ {j}.
169
+ $$
170
+
171
+ To compute $\widehat{\theta}$ robustly, one may attempt to run an algorithm such as the geometric median. However, the approximation guarantee of the geometric median method scales proportionally to $\max_{j\in [n]}\| Z_j - \widehat{\theta}\|$ , for which worst-case bounds are overly pessimistic. Indeed, letting $M$ denote the Gram matrix of the coreset used in the current arm elimination round, a tedious but straightforward calculation shows that these bounds scale as $\kappa_2(M)$ , the condition number of $M$ . In turn, the latter quantity depends on the geometry of the maintained action set and is difficult to control in general. For example, even if the original action set is "well-conditioned", that property will not necessarily hold throughout the algorithm.
172
+
173
+ To work around this issue, we take advantage of the probabilistic nature of the adversary. The main idea is that, in expectation, the least-squares estimate computed over the subset of non-corrupted rewards, $\mathcal{I}_{\mathrm{good}}$ , and given by
174
+
175
+ $$
176
+ \widehat {\theta} _ {\mathcal {I} _ {\text {g o o d}}} = \left(\sum_ {i = 1} ^ {n} a _ {i} a _ {i} ^ {\top}\right) ^ {- 1} \sum_ {j \in \mathcal {I} _ {\text {g o o d}}} a _ {j} r _ {j}, \tag {9}
177
+ $$
178
+
179
+ is close to the true least-squares estimate in the absence of any corruptions. While the set $\mathcal{I}_{\mathrm{good}}$ is not known a-priori to the learner, we may still estimate $\widehat{\theta}_{\mathcal{I}_{\mathrm{good}}}$ from Eq. (9) using a well-known spectral filtering algorithm from the robust statistics literature. In doing so, we reduce the problem of robust linear regression (with a fixed design matrix) to that of robust mean estimation (over an appropriately weighted set of inputs). We mention in passing that the work of (Chen et al., 2022) also develop a distribution-free algorithm for robust linear regression which applies to a more general class of problems. However, their algorithm requires repeatedly solving a semidefinite program, while our spectral filtering-based method is simpler to implement.
180
+
181
+ In what follows, we describe our robust linear regression primitive and state its theoretical approximation guarantees, and finally sketch how to take advantage of it to design a robust and diffentially private algorithm for batched bandits.
182
+
183
+ # 2.2. Robust linear regression with fixed designs
184
+
185
+ In this section, we describe an efficient algorithm for Huber-robust linear regression with a fixed design matrix. In particular, we let the (clean) set of observations satisfy
186
+
187
+ $$
188
+ y _ {i} = \left\langle a _ {i}, \theta^ {\star} \right\rangle + \eta_ {i}, \quad i = 1, \dots , n. \tag {10}
189
+ $$
190
+
191
+ where $\eta_{i}$ are independent noise realizations and $a_1,\ldots ,a_n$ are design vectors. The least-squares estimate of $\theta^{\star}$ is given by
192
+
193
+ $$
194
+ \widehat {\theta} := M _ {n} ^ {- 1} \sum_ {i = 1} ^ {n} y _ {i} a _ {i}, \quad M _ {n} := \sum_ {i = 1} ^ {n} a _ {i} a _ {i} ^ {\mathsf {T}}.
195
+ $$
196
+
197
+ Now, suppose that an adversary corrupts each $y_{i}$ independently with probability $\alpha \in (0,1 / 2)$ , so the learner observes
198
+
199
+ $$
200
+ \hat {y} _ {i} = \left\{ \begin{array}{l l} y _ {i}, & \text {i f} Z _ {i} = 1, \\ *, & \text {o t h e r w i s e} \end{array} , \quad Z _ {i} \sim \operatorname {B e r} (1 - \alpha). \right. \tag {11}
201
+ $$
202
+
203
+ The goal is to estimate the least-squares solution $\widehat{\theta}$ robustly. Our strategy will be to first estimate the least-squares solution over the subset of "good" indices $G_0$ :
204
+
205
+ $$
206
+ \theta_ {G _ {0}} = \sum_ {i \in G _ {0}} M _ {n} ^ {- 1} a _ {i} y _ {i}, \quad G _ {0} = \{i \mid Z _ {i} = 1 \}. \tag {12}
207
+ $$
208
+
209
+ To estimate $\theta_{G_0}$ , we will apply the well-known (randomized) spectral filtering algorithm for robust mean estimation (see, e.g., (Diakonikolas & Kane, 2019; Prasad et al., 2019)), provided in Algorithm 2 for completeness, to the components of the least-squares solution after an appropriate reweighting. In particular, we will estimate
210
+
211
+ $$
212
+ \gamma_ {\{a _ {i} \} _ {i = 1} ^ {n}} := \frac {\max _ {a \in \mathcal {A}} \| a \| _ {M _ {n} ^ {- 1}} ^ {2} \sum_ {i = 1} ^ {n} y _ {i} ^ {2}}{n};
213
+ $$
214
+
215
+ $$
216
+ \widetilde {w} := \mathrm {F i l t e r} \left(\left\{M _ {n} ^ {- 1 / 2} a _ {i} y _ {i} \right\} _ {i = 1} ^ {n}, \gamma_ {\{a _ {i} \} _ {i = 1} ^ {n}}\right);
217
+ $$
218
+
219
+ $$
220
+ \widetilde {\theta} := n M _ {n} ^ {- 1 / 2} \widetilde {w} \tag {13}
221
+ $$
222
+
223
+ We prove the following guarantee for this method. The proof of this proposition is deferred to Appendix A. We use this proposition in the next section to design robust and differentially private algorithms for stochastic linear bandits.
224
+
225
+ Proposition 2.1. Fix $a\delta \in (0,1)$ , $a\in \mathcal{A}$ and let $e_i = y_i - \langle a_i,\theta^\star \rangle$ . Then with probability at least $1 - 2\delta$ , we have
226
+
227
+ $$
228
+ \begin{array}{l} \left| \langle a, \widetilde {\theta} - \theta^ {\star} \rangle \right| \lesssim \\ \max _ {a \in \mathcal {A}} \| a \| _ {M _ {n} ^ {- 1}} ^ {2} \sqrt {n \sum_ {i = 1} ^ {n} y _ {i} ^ {2}} \left(\alpha + \frac {\log (1 / \delta)}{n}\right) ^ {1 / 2} \\ + \max _ {a \in \mathcal {A}} \| a \| _ {M _ {n} ^ {- 1}} ^ {2} \sqrt {\sum_ {i = 1} ^ {n} y _ {i} ^ {2}} + \sqrt {\alpha \log (1 / \delta)} \tag {14} \\ + \sum_ {i = 1} ^ {n} e _ {i} \left\langle a, M _ {n} ^ {- 1} a _ {i} \right\rangle + \alpha , \\ \end{array}
229
+ $$
230
+
231
+ $$
232
+ w h e r e M _ {n} := \sum_ {i = 1} ^ {n} a _ {i} a _ {i} ^ {\top}.
233
+ $$
234
+
235
+ # Algorithm 1 Robust arm elimination
236
+
237
+ 1: Input: action space $\mathcal{A}$ , $T$ , $B$ , failure prob. $\delta$ , corruption prob. $\alpha \in (0, 1/4)$ , truncation parameter $\nu > 0$ .
238
+ 2: Set $\mathcal{A}_0\coloneqq \mathcal{A}$ $q = T^{1 / B}$
239
+ 3: for $i = 1, \dots, B - 1$ do
240
+ 4: Compute approximate $G$ -optimal design $\pi$ with $|\operatorname{supp}(\pi)| \lesssim d \log \log d$ .
241
+ 5: Form a coreset $S_{A_{i-1}}$ by playing each distinct $a \in \operatorname{supp}(\pi)$ a total of
242
+
243
+ $$
244
+ n _ {a} = \left\{\begin{array}{l l}\left\lceil q ^ {i} \pi (a) \right\rceil ,&\text {u n d e r M o d e l (M 1)};\\\left\lceil q ^ {i} \max \left\{\pi (a), \nu \right\}\right\rceil ,&\text {u n d e r M o d e l (M 2)}.\end{array}\right..
245
+ $$
246
+
247
+ 6: Play actions $a_{j} \in S_{A_{i-1}}$ and collect rewards $r_{j}$ according to (3).
248
+ 7: Compute $\widetilde{w}_i\coloneqq \text{Filter}\left(\left\{M_n^{-1 / 2}a_ir_i\right\}_{i = 1}^n,\frac{\max_{a\in\mathcal{A}}\|a\|_{M_n^{-1}}^2\sum_{i = 1}^n r_i^2}{n}\right)$ , where $M_{n}\coloneqq \sum_{i = 1}^{n}a_{i}a_{i}^{\mathsf{T}}$
249
+ 8: Compute $\widetilde{\theta}_i\coloneqq nM_n^{-1 / 2}\widetilde{w}$
250
+ 9: Set the elimination threshold
251
+
252
+ $$
253
+ \gamma_ {i} := \left\{ \begin{array}{l l} \sqrt {d} \left(\sqrt {\log (q ^ {i} / \delta)} + \frac {\log (q ^ {i} / \delta)}{\varepsilon_ {\text {p r i v}}}\right) (\sqrt {\alpha} + \alpha \sqrt {d}) + \alpha + \sqrt {\frac {d \log (1 / \delta)}{q ^ {i}}} \left(1 + \frac {\sqrt {\log (1 / \delta)}}{\varepsilon_ {\text {p r i v}}}\right), & \text {u n d e r (M 1) ;} \\ \sqrt {\frac {d \log (1 / \delta)}{\nu m}} \left(1 + \frac {1}{\varepsilon_ {\text {p r i v}}} \sqrt {\frac {\log (1 / \delta)}{\nu m}}\right) + 2 d \left(1 + \sqrt {\frac {\log (k / \delta)}{\nu m}} + \frac {\log (k / \delta)}{\nu m \varepsilon_ {\text {p r i v}}}\right) \left(\sqrt {k \alpha} + \sqrt {\alpha \log (1 / \delta)}\right) + \alpha , & \text {u n d e r (M 2) ,} \end{array} \right.
254
+ $$
255
+
256
+ where $k\coloneqq |\mathrm{supp}(\pi)|$ in the second option.
257
+
258
+ 10: Eliminate suboptimal arms:
259
+
260
+ $$
261
+ \mathcal {A} _ {i} := \left\{a \in \mathcal {S} _ {\mathcal {A} _ {i - 1}} \mid \langle a, \widetilde {\theta} _ {i} \rangle \geq \max _ {a ^ {\prime} \in \mathcal {S} _ {\mathcal {A} _ {i - 1}}} \langle a ^ {\prime}, \widetilde {\theta} _ {i} \rangle - 2 \gamma_ {i}. \right\},
262
+ $$
263
+
264
+ 11: end for
265
+ 12: Play the "best" action in $S_{A_{B-1}}$ in the last round.
266
+
267
+ # Algorithm 2 Filter $(S\coloneqq \{X_i\}_{i = 1}^m,\lambda)$
268
+
269
+ $$
270
+ \theta_ {S} := \frac {1}{| S |} \sum_ {i \in S} X _ {i}, \Sigma_ {S} := \frac {1}{| S |} \sum_ {i \in S} (X _ {i} - \theta_ {S}) (X _ {i} - \theta_ {S}) ^ {\mathsf {T}}.
271
+ $$
272
+
273
+ 1: Compute empirical mean and covariance:
274
+ 2: Compute leading eigenpair $(\mu, v)$ of $\Sigma_S$ .
275
+ 3: if $\mu < 4\lambda$ then
276
+ 4: return $\theta_{S}$
277
+ 5: else
278
+ 6: Compute outlier scores $\tau_{i}\coloneqq \langle v,X_{i} - \theta_{S}\rangle^{2}$ for all $i$
279
+ 7: Sample an element $Y$ with $\mathbb{P}(Y = X_i) \propto \tau_i$
280
+ 8: return Filter $(S\setminus \{Y\} ,\lambda)$
281
+ 9: end if
282
+
283
+ # 3. Robust differentially private bandits
284
+
285
+ In this section, we consider the requirement of differential privacy. In particular, we assume that the learner is an untrusted server; every client must therefore privatize their rewards before reporting them to the learner. Recall that we consider two different models for generating client
286
+
287
+ # responses:
288
+
289
+ (M1) Every reward is obtained from a distinct client.
290
+ (M2) All rewards associated with a distinct action $a$ are obtained from the same client.
291
+
292
+ Algorithm 1 documents the parameter choices under each of the models above. For our regret analysis, we rely on the following facts for each round $i$ .
293
+
294
+ Fact 1: The optimal arm is not eliminated. Let $a^{\star}$ denote the "optimal" action in the sense of maximizing the inner products $\langle a, \theta \rangle$ . Then, with high probability,
295
+
296
+ $$
297
+ \begin{array}{l} \langle a, \widetilde {\theta} \rangle - \langle a ^ {\star}, \widetilde {\theta} \rangle = \langle a, \theta^ {\star} \rangle + \langle a, \widetilde {\theta} - \theta^ {\star} \rangle \\ - \langle a ^ {\star}, \theta^ {\star} \rangle - \langle a ^ {\star}, \widetilde {\theta} - \theta^ {\star} \rangle \\ \leq \langle a - a ^ {\star}, \theta^ {\star} \rangle + 2 \gamma_ {i} \\ \leq 2 \gamma_ {i}, \\ \end{array}
298
+ $$
299
+
300
+ using the bound on the difference in the penultimate inequality and the fact that $\langle a, \theta^{\star} \rangle \leq \langle a^{\star}, \theta^{\star} \rangle$ in the last inequality.
301
+
302
+ Thus, $a^{\star}$ always satisfies the condition of the algorithm and is not eliminated.
303
+
304
+ Fact 2: Surviving arms have bounded gap. Fix an arm $a$ and let $\Delta := \langle a^{\star} - a, \theta^{\star} \rangle$ be its gap. We have
305
+
306
+ $$
307
+ \begin{array}{l} \langle a ^ {\star} - a, \widetilde {\theta} \rangle \geq \langle a ^ {\star}, \theta^ {\star} \rangle - \gamma_ {i} - (\langle a, \theta^ {\star} \rangle + \gamma_ {i}) \\ \geq \Delta - 2 \gamma_ {i}. \\ \end{array}
308
+ $$
309
+
310
+ Now, let $i$ be the smallest positive integer such that $\gamma_{i} < \Delta / 4$ . Then the above implies that
311
+
312
+ $$
313
+ \langle a ^ {\star} - a, \widetilde {\theta} \rangle \geq 2 \gamma_ {i}.
314
+ $$
315
+
316
+ Consequently, any arm $a$ with gap $\Delta_{a} > 4\gamma_{i}$ for some index $i$ will be eliminated at the end of that round. Therefore, all arms that are active at the beginning of round $i$ will necessarily satisfy $\Delta_{a} \leq 4\gamma_{i-1}$ .
317
+
318
+ # 3.1. Local differential privacy under (M1)
319
+
320
+ In this setting, we can achieve pure LDP using the Laplace mechanism (Dwork & Roth, 2014). In particular, we define
321
+
322
+ $$
323
+ \mathcal {M} (r) = r + \xi , \quad \xi \sim \operatorname {L a p} \left(\frac {2}{\varepsilon_ {\text {p r i v}}}\right),
324
+ $$
325
+
326
+ where $\varepsilon_{\mathrm{priv}}$ is a desired privacy parameter. Then, when queried for a response, client $i$ reports the privatized reward:
327
+
328
+ $$
329
+ \hat {r} _ {i} = \mathcal {M} \left(r _ {i}\right) = \left\langle a _ {i}, \theta^ {\star} \right\rangle + \eta_ {i} + \xi_ {i}, \quad \xi_ {i} \sim \operatorname {L a p} \left(\frac {2}{\varepsilon_ {\text {p r i v}}}\right). \tag {15}
330
+ $$
331
+
332
+ The three forthcoming lemmata control different terms appearing in the confidence interval from Eq. (14). Lemma 3.1 below controls the contribution of the additive noise.
333
+
334
+ Lemma 3.1. Under the model (M1), with probability at least $1 - 2\delta$ we have
335
+
336
+ $$
337
+ \begin{array}{l} \sum_ {i = 1} ^ {n} e _ {i} \left< a, M _ {n} ^ {- 1} a _ {i} \right> \leq \\ \left\| a \right\| _ {M _ {n} ^ {- 1}} \sqrt {\log (1 / \delta)} \left(c _ {1} + \frac {c _ {2} \sqrt {\log (1 / \delta)}}{\varepsilon_ {\mathrm {p r i v}}}\right). \tag {16} \\ \end{array}
338
+ $$
339
+
340
+ Two of the three terms in Eq. (14) depend on the maximal weighted norm $\|a\|_{M_n^{-1}}^2$ over the action set; Lemma 3.2 bounds that norm for an arbitrary round of the arm elimination algorithm.
341
+
342
+ Lemma 3.2. Under Model (M1), we have the bound:
343
+
344
+ $$
345
+ \max _ {a \in \mathcal {A}} \| a \| _ {M _ {n} ^ {- 1}} ^ {2} \leq \frac {2 d}{n}. \tag {17}
346
+ $$
347
+
348
+ Finally, Lemma 3.3 below controls the contribution of $\sqrt{\sum_{i=1}^{n} y_i^2}$ to the robust confidence interval.
349
+
350
+ Lemma 3.3. With probability at least $1 - \delta$ , we have
351
+
352
+ $$
353
+ \sqrt {\sum_ {i = 1} ^ {n} y _ {i} ^ {2}} \lesssim \sqrt {n} \left(1 + \sqrt {\log (n / \delta)} + \frac {\log (n / \delta)}{\varepsilon_ {\text {p r i v}}}\right). \tag {18}
354
+ $$
355
+
356
+ With control over the confidence interval (14) at hand, we arrive at the regret bound in Theorem 3.4 below. The proof follows standard arguments (see, e.g., (Esfandiari et al., 2021, Theorem 5.1)) and can be found in Appendix B.1.4.
357
+
358
+ Theorem 3.4. Under Model (M1), the expected regret of Algorithm 1 is at most
359
+
360
+ $$
361
+ \begin{array}{l} \sqrt {T d \log (T / \delta)} \left(1 + \frac {\sqrt {\log (T / \delta)}}{\varepsilon_ {\text {p r i v}}}\right) \\ + T \sqrt {\log (T / \delta)} \max \left\{\sqrt {\alpha d}, \alpha d \right\} \left(1 + \frac {\log (T / \delta)}{\varepsilon_ {\text {p r i v}}}\right), \tag {19} \\ \end{array}
362
+ $$
363
+
364
+ up to a dimension-independent multiplicative constant.
365
+
366
+ # 3.2. Local differential privacy under (M2)
367
+
368
+ In this setting, every client achieves differential privacy by aggregating their responses before transmitting them to the server. In particular, let $n_a$ denote the number of times action $a$ is played during the current round. The parameter $n_a$ can be considered public, since it is known to the untrusted server. Then, client $a$ may report
369
+
370
+ $$
371
+ \begin{array}{l} \hat {r} _ {a} = \mathcal {M} \left(\frac {1}{n _ {a}} \sum_ {i = 1} ^ {n _ {a}} \langle a, \theta^ {\star} \rangle + \eta_ {i}\right) \tag {20} \\ = \frac {1}{n _ {a}} \sum_ {i = 1} ^ {n _ {a}} \left\langle a, \theta^ {\star} \right\rangle + \eta_ {i} + \xi_ {a}, \\ \end{array}
372
+ $$
373
+
374
+ where $\eta_{i}\sim \mathrm{SubG}(1)$ and $\xi_{a}$ is Laplace noise. The amount of noise needed to achieve privacy scales inversely with $n_a$ .
375
+
376
+ Lemma 3.5. With $\xi_{a} \sim \mathsf{Lap}\left(\frac{2}{n_{a}\varepsilon_{\mathsf{priv}}}\right)$ , the mechanism $\mathcal{M}$ in (20) is $\varepsilon_{\mathsf{priv}}$ -differentially private for client $a$ .
377
+
378
+ Recall that in this model, the arm elimination algorithm follows the modifications below:
379
+
380
+ 1. We receive $|\operatorname{supp}(\pi)|$ distinct responses in each round, where $\pi$ is an approximately G-optimal design.
381
+ 2. Every action $a \in \operatorname{supp}(\pi)$ is played a total of $n_a = \lceil m \max \{\pi(a), \nu\} \rceil$ times for fixed $m$ and $\nu > 0$ .
382
+
383
+ Our proof for this setting is analogous to the proof under Model (M1). We have the following analogue of Lemma 3.1:
384
+
385
+ Lemma 3.6. Under the model (M2), with probability at least $1 - 2\delta$ we have
386
+
387
+ $$
388
+ \begin{array}{l} \sum_ {v \in \operatorname {s u p p} (\pi)} e _ {v} \left\langle a, M ^ {- 1} v \right\rangle \leq \\ \frac {\left\| a \right\| _ {M ^ {- 1}}}{\sqrt {\nu m}} \sqrt {\log (1 / \delta)} \left(c _ {1} + \frac {c _ {2}}{\varepsilon_ {\mathrm {p r i v}}} \sqrt {\frac {\log (1 / \delta)}{\nu m}}\right), \tag {21} \\ \end{array}
389
+ $$
390
+
391
+ where $e_v = \mathcal{M}(r_v) - \langle v, \theta^\star \rangle$ and $M = \sum_{a \in \operatorname{supp}(\pi)} aa^{\top}$ .
392
+
393
+ Lemma 3.7. Under Model (M2), we have the bound:
394
+
395
+ $$
396
+ \max _ {a \in \mathcal {A}} \| a \| _ {M ^ {- 1}} ^ {2} \leq 2 d. \tag {22}
397
+ $$
398
+
399
+ We also have the following analogue of Lemma 3.3.
400
+
401
+ Lemma 3.8. With probability at least $1 - \delta$ , we have
402
+
403
+ $$
404
+ \begin{array}{l} \sqrt {\sum_ {v \in \operatorname {s u p p} (\pi)} y _ {v} ^ {2}} \lesssim \tag {23} \\ 1 + \sqrt {\frac {\log (| \mathrm {s u p p} (\pi) | / \delta)}{\nu m}} + \frac {\log (| \mathrm {s u p p} (\pi) | / \delta)}{\nu m \varepsilon_ {\mathrm {p r i v}}}. \\ \end{array}
405
+ $$
406
+
407
+ Putting everything together, we arrive at Theorem 3.9 below, whose proof can be found in Appendix B.2.4.
408
+
409
+ Theorem 3.9. Under Model (M2), the expected regret of Algorithm 1 is at most
410
+
411
+ $$
412
+ \begin{array}{l} \nu d \log \log d \left(\sqrt {\frac {d T \log (1 / \delta)}{\nu}} + \frac {\log (1 / \delta) \log (T) \sqrt {d}}{\varepsilon_ {\text {p r i v}} \sqrt {\nu}}\right) \\ + 2 d \left(\sqrt {\alpha d \log \log d} + \sqrt {\alpha \log (1 / \delta)}\right) \times \\ \left(T + \sqrt {\frac {T d \log \log d / \delta}{\nu}} + \frac {\log \left(\frac {d \log \log d}{\delta}\right) \log T}{\nu \varepsilon_ {\mathrm {p r i v}}}\right) \\ + \alpha T, \tag {24} \\ \end{array}
413
+ $$
414
+
415
+ up to a dimension-dependent multiplicative constant.
416
+
417
+ # 4. Conclusion
418
+
419
+ In this paper we presented a robust and $\varepsilon_{\mathrm{priv}}$ -LDP policy for batched stochastic linear bandits with an expected regret
420
+
421
+ $$
422
+ \mathbb {E} \left[ R _ {T} \right] = \tilde {O} \left(\left[ \sqrt {d T} + T \max \{\sqrt {\alpha d}, \alpha d \} \right] \left(1 + ^ {1} / _ {\varepsilon_ {\text {p r i v}}}\right)\right),
423
+ $$
424
+
425
+ where $\alpha$ is the probability of corruption of each reward, which only requires a logarithmic number of batch queries. In the absence of corruption $(\alpha = 0)$ , our regret matches that of the best-known non-robust differentially private algorithm (Hanna et al., 2022). On the other hand, when no differential privacy is required, our regret bounds shaves off
426
+
427
+ a factor of $\sqrt{d}$ compares to previous work on robust linear bandits (Bogunovic et al., 2021). In addition, a variant of our policy is immediately applicable to a differential privacy model that interpolates between the local and central settings and achieves improved dependence on the privacy parameter $\varepsilon_{\mathrm{priv}}$ .
428
+
429
+ While simple to implement, our algorithms require the learner to provide an upper bound on the corruption probability $\alpha$ , which may be difficult to estimate in practice. We leave the task of designing an adaptive policy as exciting future work. At the same time, it is unclear if our regret bounds for the privacy model (M2) are tight (in terms of the dependence on $\varepsilon_{\mathrm{priv}}$ and $d$ ). A natural question left open by our work is constructing tight lower bounds in this setting.
430
+
431
+ # References
432
+
433
+ Basu, D., Dimitrakakis, C., and Tossou, A. Differential Privacy for Multi-armed Bandits: What Is It and What Is Its Cost? arXiv e-prints, art. arXiv:1905.12298, May 2019.
434
+ Bertsimas, D. and Mersereau, A. J. A learning approach for interactive marketing to a customer segment. Operations Research, 55(6):1120-1135, 2007. doi: 10.1287/opre.1070.0427.
435
+ Bittau, A., Erlingsson, U., Maniatis, P., Mironov, I., Raghunathan, A., Lie, D., Rudominer, M., Kode, U., Tinnes, J., and Seefeld, B. Prochlo: Strong Privacy for Analytics in the Crowd. In Proceedings of the 26th Symposium on Operating Systems Principles, SOSP '17, pp. 441-459, New York, NY, USA, 2017. Association for Computing Machinery. ISBN 9781450350853. doi: 10.1145/3132747.3132769.
436
+ Bogunovic, I., Losalka, A., Krause, A., and Scarlett, J. Stochastic Linear Bandits Robust to Adversarial Attacks. In Banerjee, A. and Fukumizu, K. (eds.), Proceedings of The 24th International Conference on Artificial Intelligence and Statistics, volume 130 of Proceedings of Machine Learning Research, pp. 991-999. PMLR, 13-15 Apr 2021.
437
+ Bouneffouf, D., Rish, I., and Aggarwal, C. Survey on applications of multi-armed and contextual bandits. In 2020 IEEE Congress on Evolutionary Computation (CEC), pp. 1-8. IEEE, 2020.
438
+ Chen, S., Koehler, F., Moitra, A., and Yau, M. Online and distribution-free robustness: Regression and contextual bandits with huber contamination. In 2021 IEEE 62nd Annual Symposium on Foundations of Computer Science (FOCS), pp. 684-695. IEEE, 2022.
439
+
440
+ Cheu, A. Differential Privacy in the Shuffle Model: A Survey of Separations. arXiv e-prints, art. arXiv:2107.11839, 2021.
441
+ Chowdhury, S. R. and Zhou, X. Shuffle private linear contextual bandits. arXiv e-prints, art. arXiv:2202.05567, 2022.
442
+ Diakonikolas, I. and Kane, D. M. Recent Advances in Algorithmic High-Dimensional Robust Statistics. arXiv e-prints, art. arXiv:1911.05911, November 2019.
443
+ Dimitrakakis, C., Nelson, B., Mitrokotsa, A., and Rubinstein, B. I. Robust and private bayesian inference. In International Conference on Algorithmic Learning Theory, pp. 291-305. Springer, 2014.
444
+ Dwork, C. and Roth, A. The algorithmic foundations of differential privacy. Foundations and Trends® in Theoretical Computer Science, 9(3-4):211-407, 2014.
445
+ Esfandiari, H., Karbasi, A., Mehrabian, A., and Mirrokni, V. Regret bounds for batched bandits. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 7340-7348, 2021.
446
+ Esfandiari, H., Mirrokni, V., and Narayanan, S. Tight and robust private mean estimation with few users. In Proceedings of the 39th International Conference on Machine Learning, volume 162 of Proceedings of Machine Learning Research, pp. 16383-16412. PMLR, 17-23 Jul 2022.
447
+ Garcelon, E., Roziere, B., Meunier, L., Tarbouriech, J., Teytaud, O., Lazaric, A., and Pirotta, M. Adversarial attacks on linear contextual bandits. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M., and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 14362-14373. Curran Associates, Inc., 2020.
448
+ Garcelon, E., Chaudhuri, K., Perchet, V., and Pirotta, M. Privacy amplification via shuffling for linear contextual bandits. In Dasgupta, S. and Haghtalab, N. (eds.), Proceedings of The 33rd International Conference on Algorithmic Learning Theory, volume 167 of Proceedings of Machine Learning Research, pp. 381-407. PMLR, 29 Mar-01 Apr 2022.
449
+ Ghazi, B., Kumar, R., Manurangsi, P., and Nguyen, T. Robust and private learning of halfspaces. In International Conference on Artificial Intelligence and Statistics, pp. 1603-1611. PMLR, 2021.
450
+ Gross, D. Recovering low-rank matrices from few coefficients in any basis. IEEE Transactions on Information Theory, 57(3):1548-1566, 2011.
451
+
452
+ Gupta, A., Koren, T., and Talwar, K. Better algorithms for stochastic bandits with adversarial corruptions. In Beygelzimer, A. and Hsu, D. (eds.), Proceedings of the Thirty-Second Conference on Learning Theory, volume 99 of Proceedings of Machine Learning Research, pp. 1562-1578. PMLR, 25-28 Jun 2019.
453
+ Han, Y., Liang, Z., Wang, Y., and Zhang, J. Generalized linear bandits with local differential privacy. In Ranzato, M., Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J. W. (eds.), Advances in Neural Information Processing Systems, volume 34, pp. 26511-26522. Curran Associates, Inc., 2021.
454
+ Hanna, O. A., Girgis, A. M., Fragouli, C., and Diggavi, S. Differentially Private Stochastic Linear Bandits: (Almost) for Free. arXiv e-prints, art. arXiv:2207.03445, July 2022.
455
+ Jun, K.-S., Li, L., Ma, Y., and Zhu, J. Adversarial attacks on stochastic bandits. In Bengio, S., Wallach, H., Larochelle, H., Grauman, K., Cesa-Bianchi, N., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018.
456
+ Kasiviswanathan, S. P., Lee, H. K., Nissim, K., Raskhodnikova, S., and Smith, A. What can we learn privately? SIAM Journal on Computing, 40(3):793-826, 2011.
457
+ Kothari, P., Manurangsi, P., and Velingker, A. Private robust estimation by stabilizing convex relaxations. In Conference on Learning Theory, pp. 723-777. PMLR, 2022.
458
+ Lattimore, T. and Szepesváři, C. Bandit algorithms. Cambridge University Press, 2020.
459
+ Li, F., Zhou, X., and Ji, B. Differentially private linear bandits with partial distributed feedback. In 2022 20th International Symposium on Modeling and Optimization in Mobile, Ad hoc, and Wireless Networks (WiOpt), pp. 41-48. IEEE, 2022a.
460
+ Li, M., Berrett, T. B., and Yu, Y. On robustness and local differential privacy. arXiv preprint arXiv:2201.00751, 2022b.
461
+ Li, Y., Lou, E. Y., and Shan, L. Stochastic Linear Optimization with Adversarial Corruption. arXiv e-prints, art. arXiv:1909.02109, 2019.
462
+ Liu, F. and Shroff, N. Data poisoning attacks on stochastic bandits. In Chaudhuri, K. and Salakhutdinov, R. (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 4042-4050. PMLR, 09-15 Jun 2019.
463
+
464
+ Liu, X., Kong, W., Kakade, S., and Oh, S. Robust and differentially private mean estimation. Advances in Neural Information Processing Systems, 34:3887-3901, 2021.
465
+ Lykouris, T., Mirrokni, V., and Paes Leme, R. Stochastic bandits robust to adversarial corruptions. In Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2018, pp. 114-122, New York, NY, USA, 2018. Association for Computing Machinery. ISBN 9781450355599. doi: 10.1145/3188745.3188918.
466
+ Prasad, A., Balakrishnan, S., and Ravikumar, P. A unified approach to robust mean estimation. arXiv preprint arXiv:1907.00927, 2019.
467
+ Shariff, R. and Sheffet, O. Differentially private contextual linear bandits. In Bengio, S., Wallach, H., Larochelle, H., Grauman, K., Cesa-Bianchi, N., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018.
468
+ Tenenbaum, J., Kaplan, H., Mansour, Y., and Stemmer, U. Differentially Private Multi-Armed Bandits in the Shuffle Model. In Ranzato, M., Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J. W. (eds.), Advances in Neural Information Processing Systems, volume 34, pp. 24956-24967. Curran Associates, Inc., 2021.
469
+ Vershynin, R. High-Dimensional Probability: An introduction with applications in data science, volume 47 of Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge University Press, 2018.
470
+ Wu, Y., Zhou, X., Tao, Y., and Wang, D. On Private and Robust Bandits. arXiv e-prints, art. arXiv:2302.02526, 2023. doi: 10.48550/arXiv.2302.02526.
471
+ Zheng, K., Cai, T., Huang, W., Li, Z., and Wang, L. Locally differentially private (contextual) bandits learning. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M., and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 12300-12310. Curran Associates, Inc., 2020.
472
+
473
+ # A. Proofs from Section 2.2
474
+
475
+ We will work with the empirical second moment and covariance matrices defined below:
476
+
477
+ $$
478
+ \widetilde {\Sigma} _ {G _ {0}} := \frac {1}{| G _ {0} |} \sum_ {i \in G _ {0}} M _ {n} ^ {- 1 / 2} y _ {i} ^ {2} a _ {i} a _ {i} ^ {\mathsf {T}} M _ {n} ^ {- 1 / 2}, \quad \Sigma_ {G _ {0}} := \widetilde {\Sigma} _ {G _ {0}} - \theta_ {G _ {0}} \theta_ {G _ {0}} ^ {\mathsf {T}}, \tag {25a}
479
+ $$
480
+
481
+ $$
482
+ \widetilde {\Sigma} _ {n} := \frac {1}{n} \sum_ {i = 1} ^ {n} M _ {n} ^ {- 1 / 2} y _ {i} ^ {2} a _ {i} a _ {i} ^ {\mathsf {T}} M _ {n} ^ {- 1 / 2}, \quad \Sigma_ {n} := \widetilde {\Sigma} _ {n} - \theta_ {n} \theta_ {n} ^ {\mathsf {T}}. \tag {25b}
483
+ $$
484
+
485
+ In addition, we will use the vector notation below:
486
+
487
+ $$
488
+ \boldsymbol {y} = \left( \begin{array}{c} y _ {1} \\ \vdots \\ y _ {n} \end{array} \right), \quad \text {a n d} \quad \boldsymbol {\sigma} = \left( \begin{array}{c} \sigma_ {1} \\ \vdots \\ \sigma_ {n} \end{array} \right). \tag {26}
489
+ $$
490
+
491
+ Our guarantees will depend on the maximal weighted norm of the elements $a_{i}$ , which we will denote by
492
+
493
+ $$
494
+ \mu := \max _ {i = 1, \dots , n} \| a _ {i} \| _ {M _ {n} ^ {- 1}} ^ {2}. \tag {27}
495
+ $$
496
+
497
+ Finally, we make the following assumption:
498
+
499
+ Assumption A.1. Fix $\delta$ to be a desired failure probability. The corruption probability $\alpha$ satisfies $\alpha \gtrsim \frac{\log(1 / \delta)}{n}$ .
500
+
501
+ To approximate $\theta_{G_0}$ , we will first reduce the above problem to robust mean estimation and apply the spectral filtering algorithm from the robust statistics literature. In (Prasad et al., 2019), the authors provide the following guarantee:
502
+
503
+ Theorem A.2 (Prasad et al. (2019, Theorem 4)). Suppose that $\lambda \geq \| \Sigma_{G_0}\|_{\mathrm{op}}$ and that the set of inliers, $G_0$ , satisfies $\frac{n - |G_0|}{n} + \frac{\log(1 / \delta)}{n} \leq c$ , where $c$ is a dimension-independent constant. Then with probability at least $1 - \delta$ , the spectral filtering algorithm for robust mean estimation terminates in at most $O((n - |G_0|) + \log(1 / \delta))$ steps and returns an estimate $\widetilde{\theta}$ satisfying
504
+
505
+ $$
506
+ \left\| \widetilde {\theta} - \theta_ {G _ {0}} \right\| \leq C \sqrt {\lambda} \left(\frac {n - | G _ {0} |}{n} + \frac {\log (1 / \delta)}{n}\right) ^ {1 / 2}. \tag {28}
507
+ $$
508
+
509
+ In light of Theorem A.2, we will control the quantities involved. Before we proceed, we state the following bound for the size of $G_{0}$ that we will repeatedly appeal to throughout:
510
+
511
+ Lemma A.3. Let $n \gtrsim \frac{\log(1 / \delta)}{\alpha}$ . Then with probability at least $1 - \delta$ , we have
512
+
513
+ $$
514
+ \left| \frac {\left| G _ {0} \right|}{n} - (1 - \alpha) \right| \leq \sqrt {\frac {\alpha \log (1 / \delta)}{n}} \tag {29}
515
+ $$
516
+
517
+ Proof. Let $S_{n} = \sum_{i=1}^{n} \mathbf{1}\{i \notin G_{0}\}$ , which is a sum of i.i.d. Bernoulli random variables with parameter $\alpha$ . From the Chernoff bound (Vershynin, 2018, Exercise 2.3.5), it follows that for $\delta \in (0,1]$ , we have
518
+
519
+ $$
520
+ \mathbb {P} \left(| S _ {n} - n \alpha | \geq \sqrt {n \alpha \log (1 / \delta)}\right) \leq \delta , \tag {30}
521
+ $$
522
+
523
+ after setting $\delta = \sqrt{\frac{\log(1 / \delta)}{\alpha n}}\leq 1$ in (30). The claim follows since
524
+
525
+ $$
526
+ \frac {| G _ {0} |}{n} = 1 - \frac {S _ {n}}{n} \in (1 - \alpha) \pm \sqrt {\frac {\alpha \log (1 / \delta)}{n}}.
527
+ $$
528
+
529
+ ![](images/6848e03467219aca5865f08a41417f3b1bb58917dd9a51b9d5260233aaab24e8.jpg)
530
+
531
+ # A.1. Controlling the empirical mean
532
+
533
+ We now control the deviation of $\theta_{G_0}$ from the mean of the dataset absent any corruptions.
534
+
535
+ Lemma A.4. With probability at least $1 - \delta$ , we have
536
+
537
+ $$
538
+ \left\| \theta_ {G _ {0}} - \frac {n (1 - \alpha)}{| G _ {0} |} \theta_ {n} \right\| \lesssim \frac {\| \boldsymbol {y} \|}{| G _ {0} |} \sqrt {\mu \alpha (1 - \alpha) \log (1 / \delta)}. \tag {31}
539
+ $$
540
+
541
+ Proof. Define the following collection of random variables:
542
+
543
+ $$
544
+ Q _ {i} := \left(Z _ {i} - \mathbb {E} \left[ Z _ {i} \right]\right) M _ {n} ^ {- 1 / 2} y _ {i} a _ {i}, \quad \text {w i t h} Z _ {i} = \mathbf {1} \left\{i \in G _ {0} \right\}. \tag {32}
545
+ $$
546
+
547
+ Clearly, we have $\mathbb{E}[Q_i] = 0$ . At the same time,
548
+
549
+ $$
550
+ \mathbb {E} \left[ \| Q _ {i} \| ^ {2} \right] = \operatorname {V a r} (Z _ {i}) y _ {i} ^ {2} \| a _ {i} \| _ {M _ {n} ^ {- 1}} ^ {2} \leq \alpha (1 - \alpha) y _ {i} ^ {2} \mu .
551
+ $$
552
+
553
+ Applying the vector Bernstein inequality (Gross, 2011, Theorem 12), we obtain
554
+
555
+ $$
556
+ \mathbb {P} \left(\left\| \sum_ {i = 1} ^ {n} Q _ {i} \right\| \geq \| \boldsymbol {y} \| \sqrt {\mu \alpha (1 - \alpha)} + t\right) \leq \exp \left(- \frac {t ^ {2}}{\mu \alpha (1 - \alpha) \| \boldsymbol {y} \| ^ {2}}\right).
557
+ $$
558
+
559
+ Consequently, we may set $t = \| \pmb{y} \| \sqrt{\mu \alpha (1 - \alpha) \log(1 / \delta)}$ to obtain the claimed probability. Finally, we note that
560
+
561
+ $$
562
+ \sum_ {i = 1} ^ {n} Q _ {i} = \sum_ {i \in G _ {0}} M _ {n} ^ {- 1 / 2} y _ {i} a _ {i} - (1 - \alpha) \sum_ {i = 1} ^ {n} M _ {n} ^ {- 1 / 2} y _ {i} a _ {i} = | G _ {0} | \theta_ {G _ {0}} - n (1 - \alpha) \theta_ {n}.
563
+ $$
564
+
565
+ # A.2. Putting everything together
566
+
567
+ We now combine the bounds from Appendix A.1 and Theorem A.2. We first note that
568
+
569
+ $$
570
+ \begin{array}{l} \Sigma_ {G _ {0}} = \widetilde {\Sigma} _ {G _ {0}} - \theta_ {G _ {0}} \theta_ {G _ {0}} ^ {\mathsf {T}} \preceq \widetilde {\Sigma} _ {G _ {0}} \\ = \frac {1}{\left| G _ {0} \right|} \sum_ {i \in G _ {0}} y _ {i} ^ {2} M _ {n} ^ {- 1 / 2} a _ {i} a _ {i} ^ {\mathsf {T}} M _ {n} ^ {- 1 / 2} \\ \preceq \frac {1}{| G _ {0} |} \sum_ {i \in G _ {0}} y _ {i} ^ {2} \left\| M _ {n} ^ {- 1 / 2} a _ {i} a _ {i} ^ {\mathsf {T}} M _ {n} ^ {- 1 / 2} \right\| _ {\mathrm {o p}} I _ {d} \\ \preceq \frac {1}{| G _ {0} |} \sum_ {i \in G _ {0}} y _ {i} ^ {2} \| M _ {n} ^ {- 1 / 2} a _ {i} \| ^ {2} I _ {d} \\ \preceq \frac {1}{| G _ {0} |} \sum_ {i \in G _ {0}} y _ {i} ^ {2} \| a _ {i} \| _ {M _ {n} ^ {- 1}} ^ {2} I _ {d}, \\ \end{array}
571
+ $$
572
+
573
+ which implies that the spectral norm of $\Sigma_{G_0}$ is bounded from above by
574
+
575
+ $$
576
+ \left\| \Sigma_ {G _ {0}} \right\| _ {\mathrm {o p}} \leq \frac {\left\| \boldsymbol {y} _ {G _ {0}} \right\| ^ {2}}{\left| G _ {0} \right|} \cdot \max _ {i} \left\| a _ {i} \right\| _ {M _ {n} ^ {- 1}} ^ {2} \leq \frac {\mu \left\| \boldsymbol {y} \right\| ^ {2}}{\left| G _ {0} \right|}. \tag {33}
577
+ $$
578
+
579
+ At the same time, we appeal to Lemma A.3 to deduce that
580
+
581
+ $$
582
+ \left| G _ {0} \right| \geq (1 - \alpha) n - 3 \sqrt {n \log (1 / \delta)} \geq \frac {(1 - \alpha) n}{2}, \quad \text {f o r} n \geq \frac {1 8 \log (1 / \delta)}{(1 - \alpha) ^ {2}}.
583
+ $$
584
+
585
+ Consequently, we can replace the previous upper bound with $\| \Sigma_{G_0}\|_{\mathrm{op}}\leq \frac{2\mu\|\pmb{y}\|^2}{n(1 - \alpha)}$
586
+
587
+ We now appeal to Theorem A.2. Note that Lemma A.3 yields
588
+
589
+ $$
590
+ \frac {n - | G _ {0} |}{n} = 1 - \frac {| G _ {0} |}{n} \leq 1 - (1 - \alpha) + \sqrt {\frac {\alpha \log (1 / \delta)}{n}} = \alpha + \sqrt {\frac {\alpha \log (1 / \delta)}{n}}.
591
+ $$
592
+
593
+ Therefore, the estimate $\tilde{\theta}$ computed by the spectral filtering algorithm satisfies
594
+
595
+ $$
596
+ \left\| \widetilde {\theta} - \theta_ {G _ {0}} \right\| \lesssim \| \boldsymbol {y} \| \sqrt {\frac {2 \mu}{n (1 - \alpha)}} \left(\alpha + \sqrt {\frac {\alpha \log (1 / \delta)}{n}} + \frac {\log (1 / \delta)}{n}\right) ^ {1 / 2}. \tag {34}
597
+ $$
598
+
599
+ Taking a union bound over Lemmas A.3 and A.4, we deduce that (34) holds with probability at least $1 - 2\delta$
600
+
601
+ # A.3. Application to phased elimination
602
+
603
+ Let $\theta_{\mathrm{LS}} \coloneqq M_n^{-1} \sum_{i=1}^n y_i a_i$ denote the least squares solution from an approximate G-optimal design, and define
604
+
605
+ $$
606
+ \bar {\theta} _ {G _ {0}} = M ^ {- 1} \sum_ {i \in G _ {0}} y _ {i} a _ {i} = M ^ {- 1 / 2} | G _ {0} | \theta_ {G _ {0}}, \tag {35a}
607
+ $$
608
+
609
+ $$
610
+ \bar {\theta} = n M ^ {- 1 / 2} \widetilde {\theta}. \tag {35b}
611
+ $$
612
+
613
+ Note that $\bar{\theta}$ can be computed from the output of Algorithm 2, while $\bar{\theta}_{G_0}$ only serves for the analysis. With these at hand, we have the following decomposition:
614
+
615
+ $$
616
+ \left\langle a, \bar {\theta} - \theta^ {\star} \right\rangle = \left\langle a, \bar {\theta} - \bar {\theta} _ {G _ {0}} \right\rangle + \left\langle a, \bar {\theta} _ {G _ {0}} - \theta_ {\mathrm {L S}} \right\rangle + \left\langle a, \theta_ {\mathrm {L S}} - \theta^ {\star} \right\rangle \tag {36}
617
+ $$
618
+
619
+ In what follows, we bound each term in (36) separately.
620
+
621
+ # A.3.1. BOUNDING THE FIRST TERM IN (36)
622
+
623
+ The first term in (36) is equal to
624
+
625
+ $$
626
+ \begin{array}{l} \left\langle M ^ {- 1 / 2} a, M ^ {1 / 2} (\bar {\theta} - \bar {\theta} _ {G _ {0}}) \right\rangle = \left\langle M ^ {- 1 / 2} a, n \widetilde {\theta} - | G _ {0} | \theta_ {G _ {0}} \right\rangle = \left\langle M ^ {- 1 / 2} a, n (\widetilde {\theta} - \theta_ {G _ {0}}) \right\rangle + (n - | G _ {0} |) \left\langle M ^ {- 1 / 2} a, \theta_ {G _ {0}} \right\rangle \\ \leq \| a \| _ {M ^ {- 1}} \left\| n \left(\widetilde {\theta} - \theta_ {G _ {0}}\right) \right\| + (n - | G _ {0} |) \left\langle M ^ {- 1 / 2} a, \theta_ {G _ {0}} \right\rangle \tag {37} \\ \end{array}
627
+ $$
628
+
629
+ In particular, the second term in (37) is given by
630
+
631
+ $$
632
+ \begin{array}{l} \left\langle M ^ {- 1 / 2} a, \theta_ {G _ {0}} \right\rangle = \frac {1}{| G _ {0} |} \left\langle M ^ {- 1 / 2} a, M ^ {- 1 / 2} \sum_ {i \in G _ {0}} y _ {i} a _ {i} \right\rangle \\ \leq \frac {1}{| G _ {0} |} \| a \| _ {M ^ {- 1}} \left\| \sum_ {i \in G _ {0}} y _ {i} a _ {i} \right\| _ {M ^ {- 1}} \\ \leq \frac {1}{| G _ {0} |} \| a \| _ {M ^ {- 1}} \left\| \left(\sum_ {i \in G _ {0}} a _ {i} a _ {i} ^ {\mathrm {T}}\right) ^ {- 1 / 2} \sum_ {i \in G _ {0}} y _ {i} a _ {i} \right\|, \tag {38} \\ \end{array}
633
+ $$
634
+
635
+ using the fact that $\sum_{i\in G_0}a_i a_i^\top \preceq \sum_{i = 1}^n a_i a_i^\top$ . Let $A_{G_0}$ be a matrix whose rows are the vectors $\{a_i\mid i\in G_0\}$ . We have
636
+
637
+ $$
638
+ \sum_ {i \in G _ {0}} a _ {i} a _ {i} ^ {\mathsf {T}} = A _ {G _ {0}} ^ {\mathsf {T}} A _ {G _ {0}}, \quad \text {a n d} \quad \sum_ {i \in G _ {0}} y _ {i} a _ {i} = A _ {G _ {0}} ^ {\mathsf {T}} \boldsymbol {y} _ {G _ {0}}.
639
+ $$
640
+
641
+ Letting $A_{G_0} = U\Sigma V^{\mathsf{T}}$ denote the economic SVD of $A_{G_0}$ , we thus have
642
+
643
+ $$
644
+ \left\| \left(\sum_ {i \in G _ {0}} a _ {i} a _ {i} ^ {\mathsf {T}}\right) ^ {- 1 / 2} \sum_ {i \in G _ {0}} y _ {i} a _ {i} \right\| = \left\| \left(A _ {G _ {0}} ^ {\mathsf {T}} A _ {G _ {0}}\right) ^ {- 1 / 2} A _ {G _ {0}} ^ {\mathsf {T}} \boldsymbol {y} _ {G _ {0}} \right\| = \left\| V \Sigma^ {- 1} V ^ {\mathsf {T}} V \Sigma U ^ {\mathsf {T}} \boldsymbol {y} _ {G _ {0}} \right\| \leq \| \boldsymbol {y} \|. \tag {39}
645
+ $$
646
+
647
+ Plugging Eq. (39) into Eq. (38) and the result into Eq. (37), we obtain
648
+
649
+ $$
650
+ \left\langle M ^ {- 1 / 2} a, M ^ {1 / 2} \left(\bar {\theta} - \bar {\theta} _ {G _ {0}}\right) \right\rangle \leq \| a \| _ {M ^ {- 1}} \left(\left\| n \left(\widetilde {\theta} - \theta_ {G _ {0}}\right) \right\| + \frac {n - | G _ {0} |}{| G _ {0} |} \| \boldsymbol {y} \|\right)
651
+ $$
652
+
653
+ Using Eq. (34), the bound $\|a\|_{M^{-1}} \leq \sqrt{\mu}$ , and Lemma A.3 with $\alpha \gtrsim \frac{\log(1 / \delta)}{n}$ , the above becomes:
654
+
655
+ $$
656
+ \left\langle M ^ {- 1 / 2} a, M ^ {1 / 2} \left(\bar {\theta} - \bar {\theta} _ {G _ {0}}\right) \right\rangle \lesssim \mu \| \boldsymbol {y} \| \sqrt {n} \left(\alpha + \frac {\log (1 / \delta)}{n}\right) ^ {1 / 2} \tag {40}
657
+ $$
658
+
659
+ # A.3.2. BOUNDING THE SECOND TERM IN (36)
660
+
661
+ Recall that $\bar{\theta}_{G_0} = M^{-1/2}|G_0| \theta_{G_0}$ . We further decompose the second term in (36) into
662
+
663
+ $$
664
+ \begin{array}{l} \left\langle a, \bar {\theta} _ {G _ {0}} - \theta_ {\mathrm {L S}} \right\rangle = \left\langle M ^ {- 1 / 2} a, M ^ {1 / 2} \left(\bar {\theta} _ {G _ {0}} - \theta_ {\mathrm {L S}}\right) \right\rangle \\ = \left\langle M ^ {- 1 / 2} a, M ^ {- 1 / 2} \left(\sum_ {i \in G _ {0}} y _ {i} a _ {i} - \sum_ {i = 1} ^ {n} y _ {i} a _ {i}\right) \right\rangle \\ = \left\langle M ^ {- 1 / 2} a, | G _ {0} | \left(\theta_ {G _ {0}} - \frac {n}{| G _ {0} |} \theta_ {n}\right) \right\rangle \\ = \left\langle M ^ {- 1 / 2} a, | G _ {0} | \left(\theta_ {G _ {0}} - \frac {n (1 - \alpha)}{| G _ {0} |} \theta_ {n}\right) \right\rangle + \left\langle M ^ {- 1 / 2} a, n \alpha \theta_ {n} \right\rangle \tag {41} \\ \end{array}
665
+ $$
666
+
667
+ The first term in (41) can be upper bounded using Lemma A.4. Indeed,
668
+
669
+ $$
670
+ \left\langle M ^ {- 1 / 2} a, \left| G _ {0} \right| \left(\theta_ {G _ {0}} - \frac {n (1 - \alpha)}{\left| G _ {0} \right|} \theta_ {n}\right) \right\rangle \leq \| a \| _ {M ^ {- 1}} \| \boldsymbol {y} \| \sqrt {\mu \alpha \log (1 / \delta)} \leq \mu \| \boldsymbol {y} \| \sqrt {\alpha \log (1 / \delta)}.
671
+ $$
672
+
673
+ We now simplify the second term in (41). With $e_i = r_i - \langle a_i, \theta^\star \rangle$ , we obtain
674
+
675
+ $$
676
+ \begin{array}{l} \left\langle M ^ {- 1 / 2} a, n \alpha \theta_ {n} \right\rangle = \alpha \left\langle a, \sum_ {i = 1} ^ {n} M ^ {- 1} y _ {i} a _ {i} \right\rangle \\ = \alpha \left\langle a, \sum_ {i = 1} ^ {n} M ^ {- 1} a _ {i} (\langle a _ {i}, \theta^ {\star} \rangle + e _ {i}) \right\rangle \\ = \alpha \left\langle a, M ^ {- 1} \left(\sum_ {i = 1} ^ {n} a _ {i} a _ {i} ^ {\mathsf {T}}\right) \theta^ {\star} \right\rangle + \alpha \sum_ {i = 1} ^ {n} \left\langle a, M ^ {- 1} a _ {i} \right\rangle e _ {i} \\ = \alpha \left\langle a, \theta^ {\star} \right\rangle + \alpha \sum_ {i = 1} ^ {n} \left\langle a, M ^ {- 1} a _ {i} \right\rangle e _ {i}. \\ \end{array}
677
+ $$
678
+
679
+ Since $\max_{a\in \mathcal{A}}|\langle a,\theta^{\star}\rangle |\leq 1$ , combining the two bounds above yields
680
+
681
+ $$
682
+ \left\langle a, \bar {\theta} _ {G _ {0}} - \theta_ {\mathrm {L S}} \right\rangle \lesssim \mu \| \boldsymbol {y} \| \sqrt {\alpha \log (1 / \delta)} + \alpha \left(1 + \sum_ {i = 1} ^ {n} \left\langle a, M ^ {- 1} a _ {i} \right\rangle e _ {i}\right). \tag {42}
683
+ $$
684
+
685
+ # A.3.3. BOUNDING THE THIRD TERM IN (36)
686
+
687
+ The last term is straightforward to bound. Let $e_i = y_i - \langle a_i, \theta^\star \rangle$ and note that
688
+
689
+ $$
690
+ \theta_ {\mathrm {L S}} - \theta^ {\star} = M ^ {- 1} \sum_ {i = 1} ^ {n} y _ {i} a _ {i} - \theta^ {\star} = M ^ {- 1} \sum_ {i = 1} ^ {n} a _ {i} \left(\left\langle a _ {i}, \theta^ {\star} \right\rangle + e _ {i}\right) - \theta^ {\star} = M ^ {- 1} \sum_ {i = 1} ^ {n} a _ {i} e _ {i}. \tag {43}
691
+ $$
692
+
693
+ # A.3.4. PUTTING EVERYTHING TOGETHER
694
+
695
+ Combining Eqs. (40), (42) and (43) yields the following robust confidence intervals:
696
+
697
+ $$
698
+ \left| \langle a, \bar {\theta} - \theta^ {\star} \rangle \right| \lesssim \mu \| \boldsymbol {y} \| \left[ \sqrt {n} \left(\alpha + \frac {\log (1 / \delta)}{n}\right) ^ {1 / 2} + \sqrt {\alpha \log (1 / \delta)} \right] + \sum_ {i = 1} ^ {n} e _ {i} \left\langle a, M ^ {- 1} a _ {i} \right\rangle + \alpha . \tag {44}
699
+ $$
700
+
701
+ # B. Missing proofs from Section 3
702
+
703
+ # B.1. Missing proofs from Section 3.1
704
+
705
+ # B.1.1. PROOF OF LEMMA 3.1
706
+
707
+ Proof. We write $e_i = \mathcal{M}(r_i) - \langle a_i, \theta^{\star} \rangle = \eta_i + \xi_i$ , $\eta_i \sim \mathrm{SubG}(1)$ , $\xi_i \sim \mathrm{Lap}\left(\frac{2}{\varepsilon_{\mathrm{priv}}}\right)$ . Now, define the random variables
708
+
709
+ $$
710
+ X _ {i} := \eta_ {i} \left\langle a, M ^ {- 1} a _ {i} \right\rangle ; \qquad Y _ {i} := \xi_ {i} \left\langle a, M ^ {- 1} a _ {i} \right\rangle .
711
+ $$
712
+
713
+ The family $\{X_i\}$ is subgaussian with $\| X_i\|_{\psi_2} \leq |\langle a, M^{-1}a_i \rangle|$ . Consequently,
714
+
715
+ $$
716
+ \begin{array}{l} \sum_ {i = 1} ^ {n} \left\| X _ {i} \right\| _ {\psi_ {2}} ^ {2} \leq \sum_ {i = 1} ^ {n} \left\langle a, M ^ {- 1} a _ {i} \right\rangle^ {2} \\ = \sum_ {i = 1} ^ {n} \operatorname {T r} \left(a ^ {\mathsf {T}} M ^ {- 1} a _ {i} a _ {i} ^ {\mathsf {T}} M ^ {- 1} a\right) \\ = \left\langle M ^ {- 1} a, \sum_ {i = 1} ^ {n} a _ {i} a _ {i} ^ {\mathsf {T}} M ^ {- 1} a \right\rangle \\ = \left\langle a, M ^ {- 1} a \right\rangle \\ = \| a \| _ {M ^ {- 1}} ^ {2}. \\ \end{array}
717
+ $$
718
+
719
+ Therefore, applying the Hoeffding inequality (Vershynin, 2018, Theorem 2.6.2) yields:
720
+
721
+ $$
722
+ \mathbb {P} \left(\left| \sum_ {i = 1} ^ {n} \eta_ {i} \left\langle a, M ^ {- 1} a _ {i} \right\rangle \right| \geq c _ {1} \| a \| _ {M ^ {- 1}} \sqrt {\log (1 / \delta)}\right) \leq \delta \tag {45}
723
+ $$
724
+
725
+ On the other hand, when $\xi_{i}\sim \mathrm{Lap}(2 / \varepsilon_{\mathrm{priv}})$ , we have the Bernstein-style bound
726
+
727
+ $$
728
+ \begin{array}{l} \mathbb {E} \left[ e ^ {\lambda \sum_ {i = 1} ^ {n} \xi_ {i} \left\langle a, M ^ {- 1} a _ {i} \right\rangle} \right] = \prod_ {i = 1} ^ {n} \mathbb {E} \left[ \exp \left(\lambda \xi_ {i} \left\langle a, M ^ {- 1} a _ {i} \right\rangle\right) \right] \\ \leq \prod_ {i = 1} ^ {n} \exp \left(\frac {\lambda^ {2} \left\langle a , M ^ {- 1} a _ {i} \right\rangle^ {2}}{2 \varepsilon_ {\mathrm {p r i v}} ^ {2}}\right), \quad \forall \lambda \in \left(0, \frac {b}{\| \alpha \| _ {\infty}} \right], \\ \end{array}
729
+ $$
730
+
731
+ using (Vershynin, 2018, Proposition 2.7.1(e)) in the last step. Collecting terms we obtain
732
+
733
+ $$
734
+ \prod_ {i = 1} ^ {n} \exp \left(\frac {\lambda^ {2} \left\langle a , M ^ {- 1} a _ {i} \right\rangle^ {2}}{2 \varepsilon_ {\mathrm {p r i v}} ^ {2}}\right) = \exp \left(\lambda^ {2} \frac {\sum_ {i = 1} ^ {n} \left\langle a , M ^ {- 1} a _ {i} \right\rangle^ {2}}{\varepsilon_ {\mathrm {p r i v}} ^ {2}}\right) \leq \exp \left(\lambda^ {2} c _ {1} \left(\frac {\| a \| _ {M ^ {- 1}}}{\varepsilon_ {\mathrm {p r i v}}}\right) ^ {2}\right).
735
+ $$
736
+
737
+ Now, appealing to (Vershynin, 2018, Proposition 2.7.1(a)), we obtain the concentration bound
738
+
739
+ $$
740
+ \mathbb {P} \left(\left| \sum_ {i = 1} ^ {n} \xi_ {i} \left\langle a, M ^ {- 1} a _ {i} \right\rangle \right| \geq c _ {2} \frac {\left\| a \right\| _ {M ^ {- 1}} \log (1 / \delta)}{\varepsilon_ {\mathrm {p r i v}}}\right) \leq \delta . \tag {46}
741
+ $$
742
+
743
+ Combining the two bounds yields the result.
744
+
745
+ # B.1.2. PROOF OF LEMMA 3.3
746
+
747
+ Proof. Let $\pi$ below denote an approximate G-optimal design in the sense of Definition 1.6. We have
748
+
749
+ $$
750
+ \begin{array}{l} M = \sum_ {i = 1} ^ {n} a _ {i} a _ {i} ^ {\mathsf {T}} \\ = \sum_ {a \in \operatorname {s u p p} (\pi)} n _ {a} a a ^ {\mathsf {T}} \\ = n \cdot \sum_ {a \in \operatorname {s u p p} (\pi)} \pi (a) a a ^ {\mathsf {T}} \\ = n M (\pi). \\ \end{array}
751
+ $$
752
+
753
+ Consequently, we have the inequality
754
+
755
+ $$
756
+ \begin{array}{l} \left\| a \right\| _ {M ^ {- 1}} ^ {2} = \langle a, M ^ {- 1} a \rangle \\ = \left\langle a, (n M (\pi)) ^ {- 1} a \right\rangle \\ = \frac {1}{n} \left\langle a, M ^ {- 1} (\pi) a \right\rangle \\ = \frac {\left\| a \right\| _ {M ^ {- 1} (\pi)} ^ {2}}{n} \\ \leq \frac {2 d}{n}, \\ \end{array}
757
+ $$
758
+
759
+ using the fact that $\pi$ is an approximate G-optimal design in the last inequality.
760
+
761
+ ![](images/526c2e0d2b6e5e060ab86bc4c1d4d99f5d2eb9e23005960deca8c8b371ffe04e.jpg)
762
+
763
+ # B.1.3. PROOF OF LEMMA 3.3
764
+
765
+ Proof. With $\mathbf{y} = \left[y_1\quad \ldots \quad y_n\right]^{\top}$ , we have $\| \pmb {y}\| \leq \sqrt{n}\| \pmb {y}\|_{\infty}$ . To control the latter, we note
766
+
767
+ $$
768
+ \max _ {i} | \langle a _ {i}, \theta^ {\star} \rangle + \eta_ {i} + \xi_ {i} | \leq \max _ {i} \left\{| \langle a _ {i}, \theta^ {\star} \rangle | + | \eta_ {i} | + | \xi_ {i} | \right\} \leq 1 + \max _ {i} | \eta_ {i} | + \max _ {i} | \xi_ {i} |.
769
+ $$
770
+
771
+ Since $\eta_{i}\sim \mathrm{SubG}(1)$ , standard concentration inequalities for subgaussian maxima yield
772
+
773
+ $$
774
+ \mathbb {P} \left(\max _ {i} | \eta_ {i} | \geq C \sqrt {\log (n / \delta)}\right) \leq \delta . \tag {47}
775
+ $$
776
+
777
+ Similarly, $\xi_{i}$ are subexponential with parameter $2 / \varepsilon_{\mathrm{priv}}$ . By a union bound and (Vershynin, 2018, Proposition 2.7.1),
778
+
779
+ $$
780
+ \mathbb {P} \left(\max _ {i} | \xi_ {i} | \geq t\right) \leq \sum_ {i = 1} ^ {n} \mathbb {P} \left(| \xi_ {i} | \geq t\right) \leq n \exp \left(- \min \left\{\frac {\varepsilon_ {\text {p r i v}} ^ {2} t ^ {2}}{8}, \frac {\varepsilon_ {\text {p r i v}} t}{4} \right\}\right)
781
+ $$
782
+
783
+ Setting $t \coloneqq \frac{4\log(n / \delta)}{\varepsilon_{\mathrm{priv}}}$ above yields $\max_i|\xi_i| \leq \frac{4\log(n / \delta)}{\varepsilon_{\mathrm{priv}}}$ with probability at least $1 - \delta$ .
784
+
785
+ Finally, taking a union bound and relabelling yields the result.
786
+
787
+ ![](images/63be6f5fc086655b85aba644c8cc5ba37b67290e00e4173f3c771aaeb8e45c25.jpg)
788
+
789
+ # B.1.4. PROOF OF THEOREM 3.4
790
+
791
+ Proof. We perform a regret analysis under the LDP model (M1). First, we simplify Proposition 2.1 using Lemmas 3.1 and 3.3 and the assumption $\alpha \gtrsim \log(1/\delta)/n$ . Letting $\mu := \max_{a \in \mathcal{A}} \|a\|_{M^{-1}}^2$ , we have
792
+
793
+ $$
794
+ \left| \langle a, \widetilde {\theta} - \theta^ {\star} \rangle \right| \lesssim \mu \left(n \sqrt {\alpha} + \sqrt {\alpha n \log (1 / \delta)}\right) \left(1 + \sqrt {\log (n / \delta)} + \frac {\log (n / \delta)}{\varepsilon_ {\text {p r i v}}}\right) + \sqrt {\mu \log (1 / \delta)} \left(1 + \frac {\sqrt {\log (1 / \delta)}}{\varepsilon_ {\text {p r i v}}}\right) + \alpha , \tag {48}
795
+ $$
796
+
797
+ for any fixed $a$ with probability at least $1 - \delta$ by suitably adjusting constants.
798
+
799
+ In particular, when $a_1,\ldots ,a_n$ are drawn from an approximate G-optimal design, Lemma 3.3 implies that
800
+
801
+ $$
802
+ \mu \equiv \max _ {a \in \mathcal {A}} \| a \| _ {M _ {n} ^ {- 1}} ^ {2} \leq \frac {2 d}{n}, \tag {49}
803
+ $$
804
+
805
+ so the bound in (48) can be written as
806
+
807
+ $$
808
+ \left| \langle a, \widetilde {\theta} - \theta^ {\star} \rangle \right| \lesssim d \left(\sqrt {\alpha} + \sqrt {\frac {\alpha \log (1 / \delta)}{n}}\right) \left(1 + \sqrt {\log (n / \delta)} + \frac {\log (n / \delta)}{\varepsilon_ {\mathrm {p r i v}}}\right) + \sqrt {\frac {d \log (1 / \delta)}{n}} \left(1 + \frac {\sqrt {\log (1 / \delta)}}{\varepsilon_ {\mathrm {p r i v}}}\right), \tag {50}
809
+ $$
810
+
811
+ By standard arguments (see, e.g., the proof of (Esfandiari et al., 2021, Theorem 5.1)), we may focus on bounding the regret conditioned on the "good" event where all the invocations to the coreset construction and robust filtering algorithms succeed. This requires us to choose failure probability $\delta$ proportional to $\delta' / (KT^2)$ , where $T$ is the number of rounds, $K$ is the size of the action space, and $\delta'$ is an overall desired failure probability. To ease notation, we relabel $\delta$ in this manner below.
812
+
813
+ Now, recalling the width of the confidence interval
814
+
815
+ $$
816
+ \gamma_ {i} := \sqrt {d} \left(\sqrt {\log (q ^ {i} / \delta)} + \frac {\log (q ^ {i} / \delta)}{\varepsilon_ {\mathrm {p r i v}}}\right) (\sqrt {\alpha} + \alpha \sqrt {d}) + \alpha + \sqrt {\frac {d \log (1 / \delta)}{q ^ {i}}} \left(1 + \frac {\sqrt {\log (1 / \delta)}}{\varepsilon_ {\mathrm {p r i v}}}\right),
817
+ $$
818
+
819
+ we have the following expression for the regret:
820
+
821
+ \[
822
+ \text{Regret} = \sum_{i=1}^{B} (\text{arms pulled}) \times (\text{instantaneous regret})
823
+ \]
824
+
825
+ $$
826
+ \begin{array}{l} \leq \sum_ {i = 1} ^ {B} q ^ {i} 4 \gamma_ {i - 1} \\ \lesssim \sum_ {i = 1} ^ {B} q ^ {i} \sqrt {\frac {d \log (1 / \delta)}{q ^ {i - 1}}} \left(1 + \frac {\sqrt {\log (1 / \delta)}}{\varepsilon_ {\mathrm {p r i v}}}\right) + \sqrt {d} (\sqrt {\alpha} + \alpha \sqrt {d}) \sum_ {i = 1} ^ {B} q ^ {i} \left(\sqrt {\log \left(q ^ {i - 1} / \delta\right)} + \frac {\log \left(q ^ {i - 1} / \delta\right)}{\varepsilon_ {\mathrm {p r i v}}}\right) \tag {51} \\ \end{array}
827
+ $$
828
+
829
+ To bound the first sum above, we notice that
830
+
831
+ $$
832
+ \sum_ {i = 1} ^ {B} q ^ {i} \sqrt {\frac {1}{q ^ {i - 1}}} = q \sum_ {i = 0} ^ {B - 1} \sqrt {q ^ {i}} = q \cdot \frac {q ^ {B / 2} - 1}{q ^ {1 / 2} - 1}.
833
+ $$
834
+
835
+ For the second sum, we first bound $\log (q^{i - 1} / \delta) \leq \log (T^{\frac{B - 1}{B}} / \delta) \leq \log (T / \delta)$ , followed by
836
+
837
+ $$
838
+ \sum_ {i = 1} ^ {B} q ^ {i} \left(\sqrt {\log (q ^ {i - 1} / \delta)} + \frac {\log (q ^ {i - 1} / \delta)}{\varepsilon_ {\mathrm {p r i v}}}\right) \leq \left(\sqrt {\log (T / \delta)} + \frac {\log (T / \delta)}{\varepsilon_ {\mathrm {p r i v}}}\right) T.
839
+ $$
840
+
841
+ Finally, we note that when $B \geq \log (T)$ we have $\frac{q^{B/2} - 1}{q^{1/2} - 1} \lesssim \sqrt{T}$ and $q = T^{1/B} \leq e$ . Therefore,
842
+
843
+ $$
844
+ \operatorname {R e g r e t} \lesssim \sqrt {T d \log (1 / \delta)} \left(1 + \frac {\sqrt {\log (1 / \delta)}}{\varepsilon_ {\mathrm {p r i v}}}\right) + T \max \left\{\sqrt {\alpha d}, \alpha d \right\} \left(\sqrt {\log (T / \delta)} + \frac {\log (T / \delta)}{\varepsilon_ {\mathrm {p r i v}}}\right).
845
+ $$
846
+
847
+ # B.2. Missing proofs from Section 3.2
848
+
849
+ # B.2.1. PROOF OF LEMMA 3.6
850
+
851
+ Proof. We have $e_v = \mathcal{M}(r_v) - \langle v, \theta^\star \rangle = \eta_v + \xi_v$ , where $\eta_v \sim \mathrm{SubG}(1 / n_a)$ and $\xi_v \sim \mathrm{Lap}(2 / n_a \varepsilon_{\mathrm{priv}})$ . Therefore,
852
+
853
+ $$
854
+ \eta_ {v} + \xi_ {v} \stackrel {(d)} {=} \frac {1}{\sqrt {n _ {a}}} \tilde {\eta} _ {v} + \frac {1}{n _ {a}} \tilde {\xi} _ {v}, \quad \tilde {\eta} _ {v} \sim \operatorname {S u b G} (1), \tilde {\xi} _ {v} \sim \operatorname {L a p} (2 / \varepsilon_ {\mathrm {p r i v}}).
855
+ $$
856
+
857
+ Consequently, we may trace the proof of Lemma 3.1 to arrive at
858
+
859
+ $$
860
+ \sum_ {v \in \mathcal {H}} \eta_ {v} \left\langle a, M ^ {- 1} v \right\rangle \lesssim \| a \| _ {M ^ {- 1}} \sqrt {\log (1 / \delta)} \left(\frac {c _ {1}}{\sqrt {n _ {a}}} + \frac {c _ {2} \sqrt {\log (1 / \delta)}}{n _ {a} \varepsilon_ {\text {p r i v}}}\right). \tag {52}
861
+ $$
862
+
863
+ This completes the proof after noticing that $n_a \geq \nu m$ .
864
+
865
+ ![](images/1b3db890d6d8c31aef5cb5b6002e327dd040dcde20e7707729be7ffcfa3c1d02.jpg)
866
+
867
+ # B.2.2. PROOF OF LEMMA 3.7
868
+
869
+ Proof. Recall that $M = \sum_{v\in \mathcal{H}}vv^{\top}$ . In particular, we have
870
+
871
+ $$
872
+ \sum_ {v \in \mathcal {H}} v v ^ {\mathsf {T}} = \sum_ {v \in \operatorname {s u p p} (\hat {\pi})} \succeq \sum_ {v \in \mathcal {H}} \hat {\pi} (v) v v ^ {\mathsf {T}} \Rightarrow \| a \| _ {M ^ {- 1}} ^ {2} \leq \| a \| _ {M ^ {- 1} (\hat {\pi})} ^ {2} \leq 2 d, \tag {53}
873
+ $$
874
+
875
+ where the last inequality follows since $\pi$ is an approximate G-optimal design.
876
+
877
+ ![](images/895aee96a985719c26dc5a423a6b91772799d234048fae764768031d9982326d.jpg)
878
+
879
+ # B.2.3. PROOF OF LEMMA 3.8
880
+
881
+ Proof. Let $k = |\operatorname{supp}(\hat{\pi})|$ and let $y_1, \ldots, y_k$ be an enumeration of the elements $y_v$ , $v \in \operatorname{supp}(\hat{\pi})$ . With $\mathbf{y} = [y_1 \ldots y_k]^\top$ , we have $\| \mathbf{y} \| \leq \sqrt{k} \| \mathbf{y} \|_\infty$ . To control the latter, we note
882
+
883
+ $$
884
+ \max _ {v} | \langle v, \theta^ {\star} \rangle + \eta_ {v} + \xi_ {v} | \leq \max _ {v} \left\{| \langle v, \theta^ {\star} \rangle | + | \eta_ {v} | + | \xi_ {v} | \right\} \leq 1 + \max _ {v} | \eta_ {v} | + \max _ {i} | \xi_ {v} |.
885
+ $$
886
+
887
+ Since $\eta_v \sim \mathrm{SubG}(1 / n_v)$ , standard concentration inequalities for subgaussian maxima yield
888
+
889
+ $$
890
+ \mathbb {P} \left(\max _ {v} | \eta_ {v} | \geq C \sqrt {\frac {\log (k / \delta)}{n _ {v}}}\right) \leq \delta . \tag {54}
891
+ $$
892
+
893
+ Similarly, $\xi_v$ are subexponential with parameter $\frac{2}{n_v\varepsilon_{\mathrm{priv}}}$ . By a union bound and (Vershynin, 2018, Proposition 2.7.1),
894
+
895
+ $$
896
+ \begin{array}{l} \mathbb {P} \left(\max _ {v} | \xi_ {v} | \geq t\right) \leq \sum_ {v \in \operatorname {s u p p} (\hat {\pi})} \mathbb {P} \left(| \xi_ {v} | \geq t\right) \\ \leq \sum_ {v \in \operatorname {s u p p} (\hat {\pi})} \mathbb {P} \left(\left| \xi_ {v} \right| \geq t\right) \\ \leq k \exp \left(- \min \left\{\frac {\operatorname* {m i n} _ {v} n _ {v} ^ {2} \varepsilon_ {\mathrm {p r i v}} ^ {2} t ^ {2}}{8}, \frac {\operatorname* {m i n} _ {v} n _ {v} \varepsilon_ {\mathrm {p r i v}} t}{4} \right\}\right) \\ \leq k \exp \left(- \min \left\{\frac {\nu^ {2} m ^ {2} \varepsilon_ {\mathrm {p r i v}} ^ {2} t ^ {2}}{8}, \frac {\nu m \varepsilon_ {\mathrm {p r i v}} t}{4} \right\}\right). \\ \end{array}
897
+ $$
898
+
899
+ Setting $t \coloneqq \frac{4\log(k / \delta)}{\nu m\varepsilon_{\mathrm{priv}}}$ above yields $\max_v|\xi_v| \leq \frac{4\log(k / \delta)}{\nu m\varepsilon_{\mathrm{priv}}}$ with probability at least $1 - \delta$ .
900
+
901
+ Finally, taking another union bound and relabelling yields the result.
902
+
903
+ ![](images/d8a5ff4746922695cc07c11e71c3e1abf11dd3029776aa17f17d54ba1c3f4e33.jpg)
904
+
905
+ # B.2.4. PROOF OF THEOREM 3.9
906
+
907
+ Proof. We proceed with deriving an expression for the robust confidence interval from Proposition 2.1 under (M2). Indeed, with probability at least $1 - \delta$ , for any fixed $a \in \mathcal{A}$ we have:
908
+
909
+ $$
910
+ \begin{array}{l} \left| \langle a, \widetilde {\theta} - \theta^ {\star} \rangle \right| \lesssim \sqrt {\frac {d \log (1 / \delta)}{\nu m}} \left(1 + \frac {1}{\varepsilon_ {\text {p r i v}}} \sqrt {\frac {\log (1 / \delta)}{\nu m}}\right) \tag {55} \\ + 2 d \left(1 + \sqrt {\frac {\log (k / \delta)}{\nu m}} + \frac {\log (k / \delta)}{\nu m \varepsilon_ {\mathrm {p r i v}}}\right) \left(\sqrt {k \alpha} + \sqrt {\alpha \log (1 / \delta)}\right) \\ + \alpha , \\ \end{array}
911
+ $$
912
+
913
+ where $k\coloneqq |\mathrm{supp}(\pi)|$ . Recall we can find (in poly-time) an approximate G-optimal design $\pi$ satisfying
914
+
915
+ $$
916
+ k := \left| \operatorname {s u p p} (\pi) \right| \lesssim d \log \log d. \tag {56}
917
+ $$
918
+
919
+ Therefore, we may proceed with the regret analysis. Similarly to the proof of Theorem 3.4, we condition on the case where all randomized algorithms and invocations to random events succeed with high probability.
920
+
921
+ Then, with $m = q^i$ at round $i$ , we have the following bound:
922
+
923
+ $$
924
+ \begin{array}{l} n _ {i} = \sum_ {v \in \operatorname {s u p p} (\pi)} n _ {v} \\ = \sum_ {v \in \operatorname {s u p p} (\pi)} \left[ q ^ {i} \max \left\{\pi (v), \nu \right\} \right] \\ \leq \sum_ {v \in \operatorname {s u p p} (\pi)} q ^ {i} \max \left\{\pi (v), \nu \right\} + 1 \\ = \operatorname {s u p p} (\pi) + q ^ {i} \sum_ {v} \max \left\{\pi (v), \nu \right\} \\ \lesssim q ^ {i} (1 + \nu d \log \log d). \\ \end{array}
925
+ $$
926
+
927
+ In particular, we have the following property for the sum $\sum_{i}q^{i}$ :
928
+
929
+ $$
930
+ \sum_ {i = 1} ^ {B} q ^ {i} = \frac {1}{1 + \nu d \log \log d} \sum_ {i = 1} ^ {B} n _ {i} = \frac {T}{1 + \nu d \log \log d}. \tag {57}
931
+ $$
932
+
933
+ Consequently, the regret of the algorithm conditioned on the good event is given by
934
+
935
+ $$
936
+ \operatorname {R e g r e t} \leq 4 \sum_ {i = 1} ^ {B} n _ {i} \gamma_ {i - 1} \lesssim q (1 + \nu d \log \log d) \sum_ {i = 0} ^ {B - 1} q ^ {i} \gamma_ {i}, \tag {58}
937
+ $$
938
+
939
+ where $\gamma_{i}$ is the width of the confidence interval at round $i$ . The first term in the sum $\sum_{i}q^{i}\gamma_{i}$ is
940
+
941
+ $$
942
+ \begin{array}{l} \sum_ {i = 0} ^ {B - 1} q ^ {i} \sqrt {\frac {d \log (1 / \delta)}{\nu q ^ {i}}} + q ^ {i} \frac {\sqrt {d} \log (1 / \delta)}{\nu q ^ {i} \varepsilon_ {\mathrm {p r i v}}} \leq \sqrt {\frac {d \log (1 / \delta)}{\nu}} \left(\sum_ {i = 0} ^ {B - 1} q ^ {i / 2} + \frac {\sqrt {\log (1 / \delta)}}{\varepsilon_ {\mathrm {p r i v}} \sqrt {\nu}} \sum_ {i = 0} ^ {B - 1}\right) \\ \leq \sqrt {\frac {d \log (1 / \delta)}{\nu}} \left(\frac {q ^ {B / 2} - 1}{q ^ {1 / 2} - 1} + \sqrt {\frac {\log (1 / \delta)}{\nu}} \frac {B - 1}{\varepsilon_ {\text {p r i v}}}\right), \tag {59} \\ \end{array}
943
+ $$
944
+
945
+ which is a term independent of the corruption fraction. The second group of summands in $\sum_{i}q^{i}\gamma_{i}$ is
946
+
947
+ $$
948
+ \begin{array}{l} \sum_ {i = 0} ^ {B - 1} q ^ {i} \left(1 + \sqrt {\frac {\log (d \log \log d / \delta)}{\nu q ^ {i}}} + \frac {\log (d \log \log d / \delta)}{\nu q ^ {i} \varepsilon_ {\text {p r i v}}}\right) \\ = \frac {T}{1 + \nu d \log \log d} + \sqrt {\frac {\log (d \log \log d / \delta)}{\nu}} \cdot \frac {q ^ {B / 2} - 1}{q ^ {1 / 2} - 1} + \frac {\log (d \log \log d / \delta)}{\nu} \cdot \frac {B - 1}{\varepsilon_ {\mathrm {p r i v}}}. \tag {60} \\ \end{array}
949
+ $$
950
+
951
+ Finally, summing over $i$ using the last term of the confidence interval yields
952
+
953
+ $$
954
+ \sum_ {i = 0} ^ {B - 1} q ^ {i} \alpha = \frac {\alpha T}{1 + \nu d \log \log d}. \tag {61}
955
+ $$
956
+
957
+ Putting everything together, we arrive at the claimed regret bound:
958
+
959
+ $$
960
+ \begin{array}{l} \operatorname {R e g r e t} \lesssim (1 + \nu d \log \log d) \left(\sqrt {\frac {d T \log (1 / \delta)}{\nu}} + \frac {\log (1 / \delta) \log (T) \sqrt {d}}{\varepsilon_ {\text {p r i v}} \sqrt {\nu}}\right) \tag {62} \\ + 2 d \left(\sqrt {\alpha d \log \log d} + \sqrt {\alpha \log (1 / \delta)}\right) \left(T + \sqrt {\frac {T d \log \log d / \delta}{\nu}} + \frac {\log (d \log \log d / \delta)}{\nu} \frac {\log T}{\varepsilon_ {\mathrm {p r i v}}}\right) \\ + \alpha T. \\ \end{array}
961
+ $$
962
+
963
+ ![](images/20c60fa5da784bdc2b7005fb14920693ba0ed00cd4516e9188661597ffc392cf.jpg)
robustandprivatestochasticlinearbandits/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2a63b62d27f4f72326dd4703d377d502bf0c2c512c61d8232cfcaaa4eb760013
3
+ size 1131440
robustandprivatestochasticlinearbandits/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5118298bb94f70ab436284f87fca324c7f271a97a571bdf2bb78360ab3871ea8
3
+ size 905617
robustandscalablebayesianonlinechangepointdetection/0d8ea497-d454-453b-b472-d9baeeeb0419_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e4a308228d7025495c0c2c86be64c44e613294b32e419cab49d956e53c918a8
3
+ size 165779
robustandscalablebayesianonlinechangepointdetection/0d8ea497-d454-453b-b472-d9baeeeb0419_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2dc9d772f379dad3d80f3d3784b313cc6c0bdcf760b2dabbd55014a756c4da94
3
+ size 199602
robustandscalablebayesianonlinechangepointdetection/0d8ea497-d454-453b-b472-d9baeeeb0419_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:426e800d573ded11d79debe68f8ac4054b237d57a18c7cea1809636eb50c9215
3
+ size 1584142
robustandscalablebayesianonlinechangepointdetection/full.md ADDED
@@ -0,0 +1,777 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Matias Altamirano $^{1}$ François-Xavier Briel $^{1,2}$ Jeremias Knoblauch $^{1}$
2
+
3
+ # Abstract
4
+
5
+ This paper proposes an online, provably robust, and scalable Bayesian approach for changepoint detection. The resulting algorithm has key advantages over previous work: it provides provable robustness by leveraging the generalised Bayesian perspective, and also addresses the scalability issues of previous attempts. Specifically, the proposed generalised Bayesian formalism leads to conjugate posteriors whose parameters are available in closed form by leveraging diffusion score matching. The resulting algorithm is exact, can be updated through simple algebra, and is more than 10 times faster than its closest competitor.
6
+
7
+ # 1. Introduction
8
+
9
+ Changepoint (CP) detection is the task of identifying sudden changes in the statistical properties of a data stream. The methods to detect CPs are used in applications including systems health monitoring (Stival et al., 2022; Yang et al., 2006), financial data (Kim et al., 2022; Kummerfeld & Danks, 2013), climate change (Reeves et al., 2007; Itoh & Kurths, 2010), and cyber security (Hallgren et al., 2022). Existing approaches include likelihood ratio methods such as the parametric method CUSUM (Page, 1954) or Change Finder methods (Kawahara & Sugiyama, 2009), to Bayesian methods such as in Chib (1998); Fearnhead (2006).
10
+
11
+ Detecting CPs in an online fashion is an even more challenging task, but can allow practitioners to act on these systems in real-time. In a Bayesian context, the most popular method is Bayesian online changepoint detection (BOCD) (Adams & MacKay, 2007; Fearnhead & Liu, 2007). Here, the data stream is assumed to come from one of several different underlying distributions; and the goal is to quantify our
12
+
13
+ $^{1}$ Department of Statistical Science, University College London, London, United Kingdom $^{2}$ The Alan Turing Institute, London, United Kingdom. Correspondence to: Matias Altamirano <matias.altamirano.22@ucl.ac.uk>, François Xavier Briol <f.briol@ucl.ac.uk>, Jeremias Knoblauch <j.knoblauch@ucl.ac.uk>.
14
+
15
+ Proceedings of the $40^{th}$ International Conference on Machine Learning, Honolulu, Hawaii, USA. PMLR 202, 2023. Copyright 2023 by the author(s).
16
+
17
+ ![](images/a976f96cae077bb4ae32b4c395f768cbd4b19f44d7744ad925d577eaddd82dec.jpg)
18
+ Figure 1. Twitter Flash Crash. The run-length is the time since the last changepoint (CP). Top: Jow Dones Index with Maximum a posteriori CPs detected by standard BOCD marked as $\triangle$ . Middle & Bottom: run-length posteriors of $D_{m}$ -BOCD with most likely run-length in blue and of standard BOCD in green. Standard BOCD incorrectly detects a CP, $D_{m}$ -BOCD does not.
19
+
20
+ uncertainty over the most recent time at which the data distribution changed. BOCD has many desirable properties: it is suitable for multivariate data and has the capacity to quantify uncertainty. However, it also has a significant flaw inherited from Bayesian inference: it is not robust under outliers or model misspecification. This can lead to failures, where most data points inferred to be CPs are simply mild heterogeneities in the data. This is a significant problem, and can causes practitioners to act on safety-critical systems based upon an erroneously declared CPs.
21
+
22
+ The lack of robustness in Bayesian methods has recently come to the forefront, and various strategies have been proposed to address it. Arguably the most successful amongst these have been generalised Bayesian methods (see e.g. Bissiri et al., 2016; Jewson et al., 2018; Knblauch et al., 2022). Building on these ideas, Knblauch et al. (2018) introduced the first robust version of BOCD using generalised Bayesian inference based on $\beta$ -divergences ( $\beta$ -BOCD).
23
+
24
+ While the resulting algorithm is generally applicable and provides robustness, it has a major drawback that has severely impeded its broader use: it is not scalable. This is mainly due to the intractability of the generalised posterior and predictive distributions, which require multiple variational approximations to be performed at each time point. As a result, $\beta$ -BOCD is practically infeasible if one is interested in online methods for high-frequency data, or if one deals with a constrained computational budget.
25
+
26
+ This paper proposes a new generalised Bayesian inference scheme based on diffusion score matching (Barp et al., 2019), which is effectively a weighted version of the original score-matching divergence of Hyvarinen (2006). If the weights are chosen appropriately, the resulting posteriors are provably robust, and the corresponding CP detection algorithm, denoted $\mathcal{D}_m$ -BOCD, is also robust to outliers. This is illustrated in Figure 1 on the value of the Dow Jones Industrial Average (DJIA) on the day of the 'Twitter flash crash' on 17/04/2013: standard BOCD falsely identifies 3 CPs, whilst $\mathcal{D}_m$ -BOCD correctly identifies no CPs.
27
+
28
+ Additionally—and unlike posteriors based on the $\beta$ -divergence— $\mathcal{D}_m$ -posteriors also have a conjugacy property for likelihoods of the exponential family so long as the prior is chosen to be a normal, truncated normal, or any other squared exponential distribution. This makes $\mathcal{D}_m$ -BOCD very fast: specifically, it ensures that all posteriors used in the algorithm can be updated exactly and efficiently through elementary vector and matrix calculations. If one uses the pruning strategies for the CP posterior proposed in Adams & MacKay (2007), the computational complexity of our algorithm is $\mathcal{O}(T(d^2 + p^2))$ ; where $T$ is the length of the data stream, $d$ is the dimension of the observations, and $p$ is the number of model parameters. This is the same computational complexity as the original BOCD algorithm. This also makes $\mathcal{D}_m$ -BOCD more than 10 times faster than $\beta$ -BOCD in our numerical experiments.
29
+
30
+ Beyond that, $\mathcal{D}_m$ -BOCD has benefits that make it more attractive than standard BOCD even from a purely computational point of view in certain settings. For example, when modelling $d$ -dimensional observations with non-Gaussian exponential family distributions, we can obtain conjugate $\mathcal{D}_m$ -posteriors, even though no conjugate posteriors exist in the standard Bayesian case.
31
+
32
+ In summary, we make two key contributions:
33
+
34
+ (1) We derive and propose the $\mathcal{D}_m$ -posterior; proving its robustness and closed form updates in the process;
35
+ (2) We use this posterior for BOCD, leading to the first algorithm that is both robust and scalable.
36
+
37
+ The remainder of the paper is structured as follows: Section 2 reviews BOCD and generalised Bayesian inference. Section 3 derives the robustness and scalability properties of $\mathcal{D}_m$ -posteriors, and integrates them with BOCD. We then validate our approach experimentally in Section 4.
38
+
39
+ # 2. Background
40
+
41
+ Our method merges generalised Bayesian posteriors based on diffusion score matching with the BOCD algorithm. Here, we provide a short explanation of the concepts relevant for understanding this interface.
42
+
43
+ # 2.1. Bayesian Online Changepoint Detection (BOCD)
44
+
45
+ Let $x_{1:T}$ be a sequence of observations $x_{1}, x_{2}, \ldots, x_{T}$ , where $x_{t} \in \mathcal{X} \subseteq \mathbb{R}^{d}$ for the time index $t \in \{1, \ldots, T\}$ . Throughout, $x_{1:T}$ follows the product partition model of Barry & Hartigan (1993): the data is partitioned through a sequence of changepoints (CPs) $0 = \tau_{1} < \tau_{2} < \ldots$ so that the $i$ -th segment is $x_{\tau_{i}: \tau_{i+1}-1}$ , and data within the $i$ -th segment is independently and identically distributed (i.i.d.) conditional on $\tau_{i}, \tau_{i+1}$ . In the model underlying BOCD, the data in each segment is modelled with the same model class $\{p_{\theta} : \theta \in \Theta\}$ , but with a different parameter for each segment. The key insight for this model, reached independently by both Adams & MacKay (2007) and Fearnhead & Liu (2007), is that Bayesian inference can be made online and efficiently if, at time $t$ , one only tracks a posterior distribution over the most recent CP. Instead of defining a prior and posterior over the CPs directly, BOCD therefore seeks to infer the so-called run-length $r_{t}$ of the current segment—the amount of time since the most recent CP.
46
+
47
+ The remainder of this section details the hierarchical Bayesian model underlying the BOCD construction. Firstly, the approach uses a conditional prior on the run-length:
48
+
49
+ $$
50
+ r _ {t} \mid r _ {t - 1} \sim H \left(r _ {t} \mid r _ {t - 1}\right). \quad (\text {C o n d i t i o n a l p r i o r o n r u n - l e n g t h})
51
+ $$
52
+
53
+ Since at time $t$ we either have a new CP $(r_t = 0)$ or the current segment continues $(r_t = r_{t - 1} + 1)$ , $H(r_t|r_{t - 1})$ has positive probability mass only for $r_t\in \{0,r_{t - 1} + 1\}$ . See Wilson et al. (2010) for a broader discussion of prior selection. Conditional on $r_t$ , all data points $x_{t'}$ from the same segment $(t - r_t):t$ so that $t'\in \{t - r_t,t - r_t + 1,\dots ,t\}$ are then modelled as i.i.d. from $p_\theta$ via
54
+
55
+ $$
56
+ \begin{array}{l} \theta \sim \pi (\theta) \quad \text {(P a r a m e t e r p r i o r)}, \\ x _ {t ^ {\prime}} \mid \theta \sim p _ {\theta} \left(x _ {t ^ {\prime}}\right) \quad (\text {P r o b a b i l i t y m o d e l f o r d a t a}). \\ \end{array}
57
+ $$
58
+
59
+ The quantity of interest is the posterior over $r_t$ , which is
60
+
61
+ $$
62
+ p (r _ {t} | x _ {1: t}) = \frac {p (r _ {t} , x _ {1 : t})}{p (x _ {1 : t})} = \frac {p (r _ {t} , x _ {1 : t})}{\sum_ {r _ {t} = 0} ^ {t} p (r _ {t} , x _ {1 : t})}.
63
+ $$
64
+
65
+ This shows that the run-length posterior is tractable whenever the joint distribution between run-length and observations given by $p(r_t, x_{1:t})$ is also tractable. Intriguingly, these terms can be computed efficiently via an online recursion whenever the posterior predictive is tractable:
66
+
67
+ $$
68
+ p(r_{t},x_{1:t}) = \sum_{r_{t - 1} = 0}^{t - 1}\underbrace{p\left(x_{t}|x_{t - 1}^{(r_{t})}\right)}_{\text{Predictive Posterior}}\underbrace{H(r_{t}|r_{t - 1})}_{\text{CP prior}}p(r_{t - 1},x_{1:t - 1}),
69
+ $$
70
+
71
+ where $x_{t-1}^{(r_t)} = x_{t-r_t:t-1}$ is the segment with run-length $r_t$ except the most recent observation $x_t$ , and the predictive of $x_t$ constructed from $x_{t-1}^{(r_t)}$ is
72
+
73
+ $$
74
+ p \left(x _ {t} \mid x _ {t - 1} ^ {\left(r _ {t}\right)}\right) = \int_ {\Theta} p _ {\theta} \left(x _ {t}\right) \pi^ {\mathrm {B}} \left(\theta \mid x _ {t - 1} ^ {\left(r _ {t}\right)}\right) d \theta , \tag {1}
75
+ $$
76
+
77
+ where $\pi^{\mathrm{B}}(\theta |x_{t - 1}^{(r_t)})\propto \prod_{i = 1}^{r_t}p_\theta (x_{t - i})\pi (\theta)$ is the Bayes posterior over $\theta$ in the current segment. To ensure that this integral is tractable in closed form, BOCD algorithms usually use prior densities $\pi (\theta)$ and models $p_{\theta}(x)$ forming a conjugate likelihood-prior pair.
78
+
79
+ Since the standard BOCD method was proposed, it has been extended in a wide range of directions. A full literature review is beyond the scope of this paper, but we highlight extensions to Gaussian processes models (Saatci et al., 2010), non-exponential families (Turner et al., 2013), multiple models in different segments (Knblauch & Damoulas, 2018; Knblauch et al., 2022), observations with multiple fidelity levels (Gundersen et al., 2021), and prediction (Agudelo-Espana et al., 2020). We also note that while BOCD only quantifies uncertainty about the most recent CP, an efficient maximum a-posteriori Viterbi-style recursion can be used to efficiently update point estimates of all CP locations (see e.g. Fearnhead & Liu, 2007).
80
+
81
+ Unfortunately, BOCD is not robust: it finds spurious CPs whenever the model is a poor description of data. To address this issue, one can replace the standard Bayesian parameter posterior in (1) with a robust generalised Bayesian posterior.
82
+
83
+ # 2.2. Generalised Bayesian (GB) inference
84
+
85
+ If the statistical model $p_{\theta}$ is well-specified so that for some $\theta_0 \in \Theta$ , the true data-generating mechanism is $p_{\theta_0}$ , standard Bayesian updating is the optimal way of integrating prior information with data (Zellner, 1988). Crucially, this no longer holds if the model is misspecified. In this setting, uncertainties are miscalibrated, posterior inferences are sensitive to outliers and heterogeneity, and the Bayesian update may no longer be the best way of processing information. To address these issues, a recent line of research has advocated for the use of generalised Bayesian inference (see e.g. Grünwald, 2012; Bissiri et al., 2016; Jewson et al., 2018; Knoblauch et al., 2022; Fong et al., 2021; Jewson & Rossell, 2022; Matsubara et al., 2022b) which, once conditioned on some data $x_{1:T}$ , is based on a belief distribution of the form
86
+
87
+ $$
88
+ \pi_ {\omega} ^ {\mathcal {D}} (\theta | x _ {1: T}) \propto \pi (\theta) \exp \{- \omega T \cdot \widehat {\mathcal {D}} (\theta) \}. \tag {2}
89
+ $$
90
+
91
+ While $\widehat{\mathcal{D}} (\theta)$ could in principle represent any loss function, we consider a narrowed scope. Specifically, for $\mathcal{D}$ being a discrepancy measure on the space of probability measures on $\mathcal{X}$ , and $p_0$ being the true data-generating process, $\widehat{\mathcal{D}}:\Theta \to \mathbb{R}$ uses $x_{1:T}$ to estimate the part of the discrepancy $\mathcal{D}(p_0,p_\theta)$ that depends on $\theta$ . Here, $\omega >0$ is called the learning rate and acts as a scaling parameter that determines how quickly the posterior learns from the data. While the choice of $\omega$ may depend on various other considerations (Grunwald, 2012; Holmes & Walker, 2017), it is typically chosen to provide approximate frequentist coverage (Lyddon et al., 2019; Martin & Syring, 2022). Neither of these
92
+
93
+ techniques are suitable for the online setting; and we will therefore propose a new way of choosing $\omega$ in Section 3.4.
94
+
95
+ The posteriors in (2) are called generalised posteriors because for $\omega = 1$ , and $\widehat{\mathcal{D}}(\theta) = \frac{1}{T}\sum_{t=1}^{T} -\log p(x_t|\theta)$ estimating the Kullback-Leibler divergence between the model and the data-generating process, one recovers the standard Bayes posterior. Using such generalisations is usually done for two main arguments: to provide robustness, and to improve computation. For example, Chernozhukov & Hong (2003) are the first to suggest them for estimation when computing a minimum is hard. Rather than focusing on computational aspects, Hooker & Vidyashankar (2014), Ghosh & Basu (2016) and Bissiri et al. (2016) advocated for their use to improve robustness. This has led to a flurry of papers proposing particular discrepancy measures that induce robustness (e.g. Chérief-Abdellatif & Alquier, 2020), and their various applications in sequential Monte Carlo (Boustati et al., 2020), deep Gaussian processes (Knoblauch, 2019), and Bayesian neural networks (Futami et al., 2018). More recently, a line of work has exploited generalised posteriors both for computational gain and robustness: Matsubara et al. (2022b;a) showcased their use for robust inference in unnormalised models with both continuous and discrete data. Similarly, Schmon et al. (2020); Dellaporta et al. (2022); Pacchiardi & Dutta (2021); Legramanti et al. (2022) have used them for robustness in simulation-based and likelihood-free settings.
96
+
97
+ # 2.3. Generalised Bayesian Inference in BOCD
98
+
99
+ Knoblach et al. (2018) first proposed a robustification of BOCD based on (2) and the $\beta$ -divergence, which is robust and well-defined for $\beta \in (0,\infty)$ when $p_{\theta}$ is uniformly bounded on $\mathcal{X}$ , and whose natural estimator was derived by Basu et al. (1998) and is given by
100
+
101
+ $$
102
+ \widehat {\mathcal {D}} _ {\beta} (\theta) = \frac {1}{T} \sum_ {t = 1} ^ {T} \frac {1}{1 + \beta} \int_ {\mathcal {X}} p _ {\theta} (x) ^ {1 + \beta} d x + \frac {1}{\beta} p _ {\theta} (x _ {t}) ^ {\beta}.
103
+ $$
104
+
105
+ While the resulting method can be made robust, it has several key failures that make it computationally infeasible in most settings. Firstly, the loss depends on $\int_{\mathcal{X}}p_{\theta}(x)^{1 + \beta}dx$ . Unless this integral is available in closed form, using $\widehat{\mathcal{D}}_{\beta}$ will introduce the same challenges as working with an intractable likelihood in a standard Bayesian setting. Secondly, the hyperparameter $\beta$ enters the loss as the exponent of a likelihood. Numerically, this makes the loss extremely sensitive to even very minor changes in $\beta$ , which makes it very difficult to tune $\beta$ and counteracts the very robustness one hopes to achieve. This numerical instability is compounded by the fact that (2) depends on the exponentiation of $\widehat{\mathcal{D}}_{\beta}$ if $p_{\theta}$ is an exponential family member, then even if one ignores the integral term, $\exp \{-\omega T\widehat{\mathcal{D}}_{\beta}(\theta)\}$ is a double exponential. Thirdly, posteriors based on $\widehat{\mathcal{D}}_{\beta}$ often have to be approximated using variational methods. Since this has to
106
+
107
+ be done for all run-lengths $r_t$ at each time step $t$ for the recursive relationship powering the algorithm, this represents a substantive computational overhead.
108
+
109
+ Taken together, these issues often render posteriors based on the $\beta$ -divergence computationally infeasible; especially in high-dimensional settings. In principle, one could replace the $\beta$ -divergence with various robust alternatives whose numerical issues are less substantive and whose hyperparameters are easier to tune—such as $\alpha$ -divergences (Hooker & Vidyashankar, 2014), $\gamma$ -divergences (Knblauch, 2019), or maximum mean discrepancies (Chérief-Abdellatif & Alquier, 2020). Unfortunately, none of these alternatives alleviate the problem of computationally expensive variational approximations. This is an issue, since ultimately, it is the conjugate forms that can be updated in terms of sufficient statistics that make BOCD computationally attractive.
110
+
111
+ In the face of this, it may be tempting to postulate an inherent trade-off between robustness and computational tractability for generalised Bayes. But this is not so; recently, it was shown that robust posteriors based on kernel Stein discrepancies have a conjugacy property (Proposition 2 of Matsubara et al., 2022b). These generalised posteriors however are not suitable for BOCD: Updating them from $t - 1$ to $t$ observations takes $\mathcal{O}(t)$ operations—as opposed to the $\mathcal{O}(1)$ operations required for standard Bayesian posteriors. Such updates would lead to an algorithm whose computational demands per iteration increase linearly the longer it is run, leading to an 'online' algorithm in name only. This is why the current paper proposes a new class of generalised posteriors based on diffusion score matching (Barp et al., 2019): we prove that they are robust, and lead to conjugacy, with closed forms updates that take $\mathcal{O}(1)$ operations.
112
+
113
+ # 3. Methodology
114
+
115
+ We present the methodological innovations of the current paper in three steps: After an exposition of diffusion score matching, we first explain how the resulting generalised Bayesian posterior yields closed form updates. In a second step, we provide formal robustness guarantees for these posteriors. In the last step, we show how to integrate them into the BOCD framework, yielding $\mathcal{D}_m$ -BOCD; and how to choose its hyperparameters.
116
+
117
+ # 3.1. Diffusion Score Matching Bayes
118
+
119
+ Notation. We write the divergence operator on a vector field $f$ as $\nabla \cdot f$ . This condenses the formulae derived in this paper, but we provide all uncondensed versions in Appendix A. The $d$ -dimensional vector (and $d \times p$ sized matrix) of partial derivatives for $f: \mathcal{X} \to \mathbb{R}$ (and $g: \mathcal{X} \to \mathbb{R}^p$ ) evaluated at $x \in \mathcal{X}$ is written as $\nabla f(x)$ (and $\nabla g(x)$ ).
120
+
121
+ Score Matching. Score matching is a discrepancy-based method for estimating parameters first proposed by Hyvarinen (2006). The key idea is to approximately minimise the Fisher divergence between the statistical model $\{p_{\theta} : \theta \in \Theta\}$ and the data-generating process $p_0$ . This method takes its name from the fact that for a density $p$ on $\mathcal{X}$ and $s_p(x) = \nabla \log p(x)$ —the so-called score function of the density $p$ —the Fisher divergence is
122
+
123
+ $$
124
+ \mathcal {D} _ {I _ {d}} (p _ {0} | | p _ {\theta}) = \mathbb {E} _ {X \sim p _ {0}} \left[ \| s _ {p _ {\theta}} (X) - s _ {p _ {0}} (X) \| _ {2} ^ {2} \right].
125
+ $$
126
+
127
+ This divergence is therefore minimised by matching the scores of the model to that of the data-generating process $p_0$ . This objective is convenient for two main reasons: Firstly, for the density $p = \tilde{p} \frac{1}{Z}$ with normaliser $Z > 0$ , $s_p = s_{\tilde{p}}$ , so that the objective is attractive when working with likelihoods whose normaliser $Z$ is unknown. Secondly, the objective can be rewritten so that the scores of $p_0$ do not have to be estimated to compute it.
128
+
129
+ Score matching has been used widely, including for data on manifolds or other complex domains (Mardia et al., 2016; Liu et al., 2022; Scealy & Wood, 2022), energy-based models (Vincent, 2011), anomaly detection (Zhai et al., 2016), nonparametric density estimation (Sriperumbudur et al., 2017), score-based generative modelling (Song & Ermon, 2019), and even for Bayesian model selection (Dawid & Musio, 2015; Shao et al., 2019; Jewson & Rossell, 2022) or as a scoring rule (Parry et al., 2012). In recent work, Wu et al. (2023) used score matching for change point detection. This work differs from ours in three major ways: they consider a frequentist setting based on the CUSUM statistic, they only consider standard score matching, and they are not concerned with robustness. Building on these successes, various generalised forms of score matching have been proposed over the years to address some of its shortcomings (e.g. Lyu, 2009; Xu et al., 2022; Yu et al., 2022; Matsubara et al., 2022a).
130
+
131
+ Diffusion Score Matching. The particular generalisation we consider hereafter is diffusion score matching, which was introduced in Barp et al. (2019) and amounts to a weighted version of the Fisher divergence given as
132
+
133
+ $$
134
+ \mathcal {D} _ {m} (p _ {0} \| p _ {\theta}) = \mathbb {E} _ {X \sim p _ {0}} \left[ \| m ^ {\top} (X) (s _ {p _ {\theta}} (X) - s _ {p _ {0}} (X)) \| _ {2} ^ {2} \right],
135
+ $$
136
+
137
+ for a pointwise invertible matrix-valued function $m:\mathcal{X}\to \mathbb{R}^{d\times d}$ . The function $m$ is also known as diffusion matrix due to the construction of this distance as a Stein discrepancy with a pre-conditioned diffusion Stein operator; see Anastasiou et al. (2023) for full details.
138
+
139
+ Like $\mathcal{D}_{I_d}$ , $\mathcal{D}_m$ is a statistical divergence between densities $p_0$ and $p_\theta$ on $\mathcal{X} = \mathbb{R}^d$ whenever $\int_{\mathcal{X}} |s_{p_\theta}(x) - s_{p_0}(x)|^2 p_0(x) dx < \infty$ . Under appropriate smoothness and boundary conditions, this can be extended to the case where $\mathcal{X}$ is a connected subset of $\mathbb{R}^d$ (Liu et al., 2022;
140
+
141
+ Zhang et al., 2022). More generally, $\mathcal{D}_m$ recovers $\mathcal{D}_{I_d}$ for $m(x) = I_{d}$ (the $d$ -dimensional identity matrix), the estimator in Hyvarinen (2007) for $m(x) = x$ , and the generalised h-score matching method for $m(x) = \mathrm{diag}(h^{1/2}(x))$ , where $h$ is defined in Yu et al. (2018; 2019). The function $m$ can be thought of as up-weighting areas of $\mathcal{X}$ on which matching the scores of the model to that of the data-generating process is most important. For the purposes of the current paper, we will choose this weight to ensure that the constructed generalised posteriors are provably robust (see Section 3.3 for details).
142
+
143
+ Estimating $\mathcal{D}_m$ directly is challenging, as it would require estimating the unknown score $s_{p_0}$ . Fortunately, under the aforementioned smoothness and boundary conditions (Appendix B.5) (Liu et al., 2022), we can expand the above equation and use integration by parts. Then, up to a constant that does not depend on $\theta$ , we can rewrite $\mathcal{D}_m(p_0 \| p_\theta)$ as
144
+
145
+ $$
146
+ \mathbb {E} _ {X \sim p _ {0}} [ \| (m ^ {\top} s _ {p _ {\theta}}) (X) \| _ {2} ^ {2} + (2 \nabla \cdot (m m ^ {\top} s _ {p _ {\theta}})) (X) ]. \tag {3}
147
+ $$
148
+
149
+ Crucially, the quantity above no longer features $s_{p_0}$ , and only depends on $p_0$ through an expectation. This leads to a natural estimator which for $x_{1:T}$ is given by
150
+
151
+ $$
152
+ \widehat {\mathcal {D}} _ {m} (\theta) = \frac {1}{T} \sum_ {t = 1} ^ {T} d _ {m} (\theta , x _ {t}), \quad \text {w h e r e}
153
+ $$
154
+
155
+ $$
156
+ d _ {m} (\theta , x _ {t}) = \left\| \left(m ^ {\top} s _ {p _ {\theta}}\right) (x _ {t}) \right\| _ {2} ^ {2} + \left(2 \nabla \cdot \left(m m ^ {\top} s _ {p _ {\theta}}\right)\right) (x _ {t}).
157
+ $$
158
+
159
+ Diffusion Score Matching Bayes. Based on the estimator $\widehat{\mathcal{D}}_m$ for the part of $\mathcal{D}_m$ that depends on $\theta$ , we can construct
160
+
161
+ $$
162
+ \pi_ {\omega} ^ {\mathcal {D} _ {m}} (\theta | x _ {1: T}) \propto \pi (\theta) \exp (- \omega T \widehat {\mathcal {D}} _ {m} (\theta)). \qquad (4)
163
+ $$
164
+
165
+ Using score matching for a generalised Bayes posterior was first discussed in passing in Section 4.2 of Giummolè et al. (2019), though the context is about reference priors for objective Bayesian inference, and the method is only briefly mentioned. This previous work also does not robustify the resulting posterior through the introduction of a weighting matrix $m$ , or derive its conjugate posteriors.
166
+
167
+ # 3.2. Conjugacy for Exponential Family Models
168
+
169
+ The conjugacy of posteriors of the form (4) make them more attractive than potential alternatives. For exponential family likelihoods, these posteriors depend on two parameters available in closed form. The exponential family is given the collection of models with a probability density function
170
+
171
+ $$
172
+ p _ {\theta} (x) = \exp (\eta (\theta) ^ {\top} r (x) - a (\theta) + b (x)), \qquad (5)
173
+ $$
174
+
175
+ where $\eta : \Theta \to \mathbb{R}^p$ , $r : \mathcal{X} \to \mathbb{R}^p$ , $a : \Theta \to \mathbb{R}$ , and $b : \mathcal{X} \to \mathbb{R}$ . When $\eta(\theta) = \theta$ , we say that the exponential family model is in natural form, and one can reparametrize a model to natural form by reparameterising with the map $\eta^{-1}$ . Exponential family class of distributions includes the Gaussian, exponential, Gamma, and Beta distributions.
176
+
177
+ ![](images/521d9e750d86d7a4d8918ee77ab821f6218ffb8a0a7beccbde7daa7959a5c82b.jpg)
178
+ Figure 2. Impact of misspecification in posteriors. The robust $\mathcal{D}_m$ -posterior and non-robust standard Bayes posterior predictive when the data are incorrectly modelled as Gaussian, but follow an $\varepsilon$ -contamination model $\mathbb{P} = 0.95\mathcal{N}(0,1) + 0.05\delta_{10}$ .
179
+
180
+ Proposition 3.1. If $p_{\theta}$ is given by (5), then
181
+
182
+ $$
183
+ \pi_ {\omega} ^ {\mathcal {D} _ {m}} (\theta | x _ {1: T}) \propto \pi (\theta) \exp (- \omega T [ \eta (\theta) ^ {\top} \Lambda_ {T} \eta (\theta) + \eta (\theta) ^ {\top} \nu_ {T} ]),
184
+ $$
185
+
186
+ for $\Lambda_T = \frac{1}{T}\sum_{t=1}^T \Lambda(x_t)$ , $\nu_T = \frac{2}{T}\sum_{t=1}^T \nu(x_t)$ , and
187
+
188
+ $$
189
+ \Lambda (x) = (\nabla r ^ {\top} m m ^ {\top} \nabla r) (x),
190
+ $$
191
+
192
+ $$
193
+ \nu (x) = \left(\nabla r ^ {\top} m m ^ {\top} \nabla b + \nabla \cdot (m m ^ {\top} \nabla r)\right) (x).
194
+ $$
195
+
196
+ Taking $\eta (\theta) = \theta$ and choosing a squared exponential prior $\pi (\theta)\propto \exp \left(-\frac{1}{2} (\theta -\mu)^{\top}\Sigma^{-1}(\theta -\mu)\right)$ , also makes $\pi_{\omega}^{\mathcal{D}_m}(\theta |x_{1:T})$ a (truncated) normal of the form
197
+
198
+ $$
199
+ \pi_ {\omega} ^ {\mathcal {D} _ {m}} (\theta | x _ {1: T}) \propto \exp \left(- \frac {1}{2} (\theta - \mu_ {T}) ^ {\top} \Sigma_ {T} ^ {- 1} (\theta - \mu_ {T})\right),
200
+ $$
201
+
202
+ $$
203
+ f o r \Sigma_ {T} ^ {- 1} = \Sigma^ {- 1} + 2 \omega T \Lambda_ {T} a n d \mu_ {T} = \Sigma_ {T} (\Sigma^ {- 1} \mu - \omega T \nu_ {T}).
204
+ $$
205
+
206
+ The proof is in Appendix B.1. The natural exponential family allows us to recover a form of Gaussian conjugacy, since the diffusion score matching squared becomes a quadratic form in this case. This renders DSM-Bayes scalable; as we will elaborate upon in Section 3.4, $\Sigma_T^{-1}$ and $\mu_T$ can be updated with a new observation in $\mathcal{O}(p^2 + d^2)$ operations.
207
+
208
+ # 3.3. Global Bias-Robustness
209
+
210
+ Building a BOCD algorithm based on $\pi_{\omega}^{\mathcal{D}_m}(\theta |x_{1:T})$ is attractive not only computationally, but also due to its robustness. We prove this robustness formally by using the classical framework of $\varepsilon$ -contamination models (see, e.g. Huber, 1981). Given a distribution $\mathbb{P}$ , we consider its $\varepsilon$ -contaminated counterpart $\mathbb{P}_{\varepsilon,y} = (1 - \varepsilon)\mathbb{P} + \varepsilon \delta_y$ , where $\delta_y$ is the dirac-measure at some $y \in \mathcal{X}$ , and $\varepsilon \in [0,1]$ . The classical perspective on robustness proceeds by defining a point estimator $E: \mathcal{P}(\mathcal{X}) \to \Theta$ that maps from $\mathcal{P}(\mathcal{X})$ , the space of distributions on $\mathcal{X}$ , to $\Theta$ . One then investigates its robustness via $\lim_{\varepsilon \to 0} \frac{1}{\varepsilon} \| E(\mathbb{P}) - E(\mathbb{P}_{\varepsilon,y}) \|_2$ , which under mild conditions is equivalent to the derivative $\left. \frac{\partial}{\partial \varepsilon} \| E(\mathbb{P}_{\varepsilon,y}) \|_2 \right|_{\varepsilon=0}$ . This limit is the so-called influence function. It quantifies the impact of an infinitesimal contamination at $y$ on the estimator, and is a classical tool to measure outlier robustness.
211
+
212
+ The Bayesian case is slightly more complicated and depicted in Figure 2: we are not concerned by estimators on $\Theta$ , but on $\mathcal{P}(\Theta)$ . The estimates under study are thus infinite-dimensional objects that vary over $\Theta$ . To get a
213
+
214
+ handle on this, we first define an influence function pointwise for each $\theta \in \Theta$ . To this end, note that $\widehat{\mathcal{D}}_m(\theta) = \mathbb{E}_{X \sim \mathbb{P}_T}[d_m(\theta, X)]$ . We can now define the density-valued estimator $\pi_{\omega}^{\mathcal{D}^m}(\theta | \mathbb{P}) \propto \pi(\theta) \exp\{-\omega T \mathbb{E}_{X \sim \mathbb{P}}[d_m(\theta, X)]\}$ , noting $\pi_{\omega}^{\mathcal{D}^m}(\theta | \mathbb{P}_T) = \pi_{\omega}^{\mathcal{D}^m}(\theta | x_{1:T})$ for $\mathbb{P}_T = \frac{1}{T} \sum_{t=1}^{T} \delta_{x_t}$ . Its pointwise posterior influence function (PIF) is
215
+
216
+ $$
217
+ \operatorname {P I F} (y, \theta , \mathbb {P}) = \frac {d}{d \varepsilon} \pi_ {\omega} ^ {\mathcal {P} ^ {m}} (\theta | \mathbb {P} _ {\varepsilon , y}) \big | _ {\varepsilon = 0}.
218
+ $$
219
+
220
+ Since this is a definition of sensitivity that is local to both $\theta$ and $y$ , making a global statement for all of $\pi_{\omega}^{\mathcal{D}m}(\theta |x_{1:T})$ requires that we aggregate a notion of sensitivity over both arguments. The easiest way to do this is to investigate $\sup_{\theta \in \Theta ,y\in \mathcal{X}}\mathrm{PIF}(y,\theta ,\mathbb{P}_T)$ . If this double supremum is bounded, we call a posterior globally bias-robust, which means that the impact of contamination on the posterior density is uniformly bounded—both over the parameter space, and the location of said contamination in the data space. This way of studying the robustness of generalised posteriors was pioneered in Ghosh & Basu (2016), and extended by Matsubara et al. (2022b). We build on these advances, and provide a simple condition on $m$ for global bias-robustness of $\pi_{\omega}^{\mathcal{D}m}(\theta |x_{1:T})$ in some exponential family models.
221
+
222
+ Proposition 3.2. If $p_{\theta}$ is as in (5) so that $\eta(\theta) = \theta$ and $\nabla b = 0$ , and if the prior is a squared exponential as in Proposition 3.1, then $\pi_{\omega}^{\mathcal{D}_m}(\theta | x_{1:T})$ is globally bias-robust if $m: \mathcal{X} \to \mathbb{R}^{d \times d}$ is chosen so that $\theta^{\star} \neq 0_p$ and
223
+
224
+ $$
225
+ m _ {i j} (x) = \left\{ \begin{array}{l l} \frac {1}{\sqrt {1 + (\nabla r (x) \theta^ {\star}) _ {i} ^ {2}}} & i f i = j, \\ 0 & i f i \neq j. \end{array} \right.
226
+ $$
227
+
228
+ While $m$ could in principle depend on $\theta$ , this would break the conjugacy presented in Proposition 3.1. The above choice of $m$ does not depend on $\theta$ , and therefore maintains the computational advantages of $\pi_{\omega}^{\mathcal{D}_m}(\theta | x_{1:T})$ . The result's conditions are also mild: we can always ensure that $\eta(\theta) = \theta$ by re-parameterising. Similarly, most distributions of interest satisfy $\nabla b = 0$ . Examples include Gaussians, exponentials, (inverse) Gamma, and Beta distributions. Note also that $m$ is only applicable to models with support $\mathcal{X} = \mathbb{R}^d$ , as the expansion in (3) is otherwise not valid without additional boundary conditions. However, we prove that the proposed weight matrix $m$ also leads to a well-defined discrepancy measure for various distributions defined on subsets of $\mathcal{X}$ , including the Gamma and the exponential distribution (see Appendix B.5).
229
+
230
+ # 3.4. $\mathcal{D}_m$ -BOCD
231
+
232
+ Using our robust posterior within BOCD is straightforward, as its only appearance is in the posterior predictive via
233
+
234
+ $$
235
+ p \left(x _ {t} \mid x _ {t - 1} ^ {(r)}\right) = \int_ {\Theta} p _ {\theta} \left(x _ {t}\right) \pi_ {\omega} ^ {\mathcal {D} _ {m}} \left(\theta \mid x _ {t - 1} ^ {(r)}\right) d \theta .
236
+ $$
237
+
238
+ If $p_{\theta}$ is a natural exponential family with a squared exponential prior, then $\pi_{\omega}^{\mathcal{D}_m}(\theta | x_{t-1}^{(r)})$ is a normal distribution parameterised by inverse covariance matrix $\Sigma_{t-1,r}^{-1}$ and mean $\mu_{t-1,r}$ by virtue of 3.1. This makes the predictive easy to compute—either in closed form or by sampling from $\pi_{\omega}^{\mathcal{D}_m}$ —which is a significant advantage over the $\beta$ -BOCD framework. For the latter, the posterior will generally be intractable so that the algorithm relies on variational approximations. Importantly, there is no way to both efficiently and exactly update variational approximations based on $x_{1:t}$ once observation $x_{t+1}$ arrives: one either uses cheap updates that lead to subpar variational approximations of the posterior, or one re-computes the approximation from scratch at the expense of a substantive computational overhead.
239
+
240
+ In contrast, our approach allows for a cheap and exact update: if we store $\Sigma_{t - 1,r}^{-1}$ and $\mu_{t - 1,r}$ , we can perform the update $\pi_{\omega}^{\mathcal{D}^m}(\theta |x_{t - 1}^{(r)})\mapsto \pi_{\omega}^{\mathcal{D}^m}(\theta |x_t^{(r + 1)})$ that adds $x_{t}$ into the parameter posterior of the segment $x_{t - 1}^{(r)}$ via
241
+
242
+ $$
243
+ \Sigma_ {t, r + 1} ^ {- 1} = \Sigma_ {t - 1, r} ^ {- 1} + 2 \omega \Lambda (x _ {t}),
244
+ $$
245
+
246
+ $$
247
+ \mu_ {t, r + 1} = \Sigma_ {t, r + 1} \left(\Sigma_ {t - 1, r} ^ {- 1} \mu_ {t - 1, r} - 2 \omega \nu (x _ {t})\right).
248
+ $$
249
+
250
+ If we have access to the un-inverted matrix $\Sigma_{t,r + 1}$ , all of these operations are basic matrix and vector additions or multiplications that take $\mathcal{O}(p^2 +d^2)$ operations to execute. While naively computing $\Sigma_{t,r + 1}$ from $\Sigma_{t,r + 1}^{-1}$ would take $\mathcal{O}(p^3)$ operations, we can apply the Sherman-Morrison formula to the update of $\Sigma_{t,r + 1}^{-1}$ to reduce this to $\mathcal{O}(p^2)$ , maintaining the overall complexity of $\mathcal{O}(p^2 +d^2)$ . This is also the complexity of standard BOCD with the Gaussian likelihood and conjugate prior (Adams & MacKay, 2007). In CP methods for high-frequency data, both the number of parameters $p$ and the data dimension $d$ are typically small, so that an update of $\mathcal{O}(p^2 +d^2)$ is attractive.
251
+
252
+ Run-length pruning. A naive implementation of $\mathcal{D}_m$ -BOCD would keep a posterior over all possible run-lengths $r_t = \{0,1\ldots ,t - 1\}$ , but this would lead to an algorithm with overall complexity $\mathcal{O}(\sum_{t = 1}^{T}t(d^{2} + p^{2})) = \mathcal{O}(T^{2}(d^{2} + p^{2}))$ for a time series of length $T$ . To prevent this, authors have proposed to 'prune' the run-length posterior to a constant length (Adams & MacKay, 2007; Fearnhead & Liu, 2007). Here, we follow the most popular strategy (e.g. Adams & MacKay, 2007; Saatci et al., 2010; Knoblauch & Damoulas, 2018) by keeping only the $k$ most probable run-lengths. For all experiments, we take $k = 50$ .
253
+
254
+ Choice of $m$ Throughout, we choose $m$ as per Proposition 3.2, as it ensures robustness—even for certain distributions with boundaries (see Appendix B.5). Regarding $\theta^{\star}$ , we found that $\mathcal{D}_m$ -BOCD was not very sensitive to this choice; likely because tuning $\omega$ offsets any sensitivity to it. In all experiments, we thus picked $\theta^{\star}$ as the maximum likelihood estimate computed on the full data set. We note that one
255
+
256
+ ![](images/6443901c6992208588fef7b2ae76d039e6de609ad603d806d37717495c6c1271.jpg)
257
+ Figure 3. Well-log data. MAP segmentation indicated by blue dashed lines for $\mathcal{D}_m$ -BOCD, $\nabla$ for $\beta$ -BOCD, and $\triangle$ for standard BOCD. Standard BOCD mistakenly labels outliers as CPs, while both $\mathcal{D}_m$ -BOCD and $\beta$ -BOCD are robust and identify lasting changes.
258
+
259
+ ![](images/a97a6a00e4904bf9687fcac9ae9bb2aa36a9c31634710ab3c82431b07c5ff958.jpg)
260
+ Figure 4. Crypto-crash. MAP segmentation indicated by blue dashed lines for $\mathcal{D}_m$ -BOCD, and by $\triangle$ for standard BOCD. There are no outliers, so both methods identify the correct CP.
261
+
262
+ known issue with robust CP detection method is that they can experience a latency when it comes to detecting actual CPs. Interestingly, this is not something we observe in our experiments with this choice of $m$ and $\theta^{*}$ .
263
+
264
+ Choice of $\omega$ How to choose $\omega$ is an important question for generalised Bayesian inference, and has more than one answer (Lyddon et al., 2019; Syring & Martin, 2019; Matsubara et al., 2022a; Bochkina, 2022; Wu & Martin, 2023). Previous methods are computationally expensive, asymptotically motivated, and focus on tuning the learning rate to provide asymptotically correct frequentist coverage. As the computational overhead of these methods is substantial and their asymptotic arguments generally do not apply to the CP setting, we pursue a different strategy: we match the uncertainty of the generalised posterior to that of its standard counterpart on the first $t^{\star}$ observations of the data stream. To operationalise this, we choose
265
+
266
+ $$
267
+ \omega^ {\star} = \arg \min _ {\omega > 0} \mathrm {K L} \left(\pi_ {\omega} ^ {\mathcal {D} _ {m}} (\theta | x _ {1: t ^ {*}}) \| \pi^ {\mathrm {B}} (\theta | x _ {1: t ^ {*}})\right).
268
+ $$
269
+
270
+ Computing $\omega^{\star}$ is implemented using automatic differentiation via jax (Bradbury et al., 2018). This is possible even if the standard Bayes posterior $\pi^{\mathrm{B}}$ is intractable, since $\pi_{\omega}^{D_m}$ has a conjugacy property (see Proposition 3.1). Since the standard Bayes posterior is reliable in the absence of outliers and heterogeneity, this yields reasonable uncertainty quantification if the degree of misspecification is mild at the beginning of the data stream. Our experiments confirm this: the uncertainty is well-calibrated, both predictively and with regards to the run-length posterior.
271
+
272
+ # 4. Experiments
273
+
274
+ We investigate $\mathcal{D}_m$ -BOCD empirically in several numerical experiments. In doing so, we highlight its computational and inferential advantages over standard BOCD and
275
+
276
+ $\beta$ -BOCD. In all experiments, we choose conjugate priors as in Proposition 3.1, and $m$ and $\omega$ as in Section 3.4. All code and data is publicly available at https://github.com/maltamiranomontero/DSM-bocd.
277
+
278
+ Computational complexity. We compare the complexity of the three BOCD methods in different settings and show that $\mathcal{D}_m$ -BOCD is considerably faster than $\beta$ -BOCD, even when sampling is needed. Moreover, Figure 5 shows that $\mathcal{D}_m$ is as fast as standard BOCD when $d = 1$ and the predictive posterior is available in closed form. See Appendix C.1 for details.
279
+
280
+ ![](images/e0d3699e9b651f1717cad141ef0a19167a55919dbe7f0c3d0adde1e082ad7b28.jpg)
281
+ Figure 5. Overall time in seconds versus number of observations. We observe that both methods are equally fast for any number of observations.
282
+
283
+ Accuracy and detection delay. We quantify the method's performance advantage by comparing detection delay and accuracy on artificially generated data with outliers. We generate 600 samples with $2\%$ of outliers and 6 CPs; then, we report the positive predictive value (PPV), true positive rate (TPR), and detection delay. See Appendix C.3 for the exact expression of the metrics. Table 1 shows that our method detects the same amount of true positives as the standard BOCD while not detecting many false positives, showing the strength of our method. Moreover, the detection delay shows that in spite of being robust to outliers, $\mathcal{D}_m$ -BOCD does not cause any delay in the detection of CP.
284
+
285
+ <table><tr><td>Method</td><td>PPV</td><td>TPR</td><td>Delays</td></tr><tr><td>Dm-BOCD</td><td>0.907±0.154</td><td>0.883±0.13</td><td>1.643±0.475</td></tr><tr><td>Standard BOCD</td><td>0.6±0.128</td><td>0.833±0.149</td><td>1.05±1.545</td></tr></table>
286
+
287
+ Table 1. Performance indices-mean and standard deviation-using the positive predictive value (PPV), true positive rate (TPR), and the detection delays over 10 realisations. For PPV and TPR, the nearest to 1, the better. For delays, the lower, the better.
288
+
289
+ ![](images/8bff34911e4c71147a9d1ebf03ff784c8a9a1016bbdcff4ffbfa49ac3cad86ff.jpg)
290
+ Figure 6. UK's 10 year government bond yield 2018-2023. The MAP-segmentation resulting from $\mathcal{D}_m$ -BOCD is indicated in dashed blue lines. The bottom panel displays the corresponding run-length posterior, with the most likely run-length marked in blue. A series of political events of national importance closely track the segmentation, and are marked with solid gray lines: 1. Theresa May announces her resignation from her position as prime minister; 2. Boris Johnson sworn in as prime minister; 3. the first Covid case recorded in EU; 4. the first Covid wave in the UK is officially declared; 5. the third Covid wave in the UK is officially declared; 6. the legal limits on social contact removed in UK; 7. Covid 'Plan B' measures are implemented in UK in response to the spread of the Omicron variant; 8. Liz Truss is sworn in as prime minister.
291
+
292
+ Twitter flash crash & Cryptocrash. A robust CP detection algorithm must not be fooled by outliers while detecting CP correctly. We show that $\mathcal{D}_m$ -BOCD has this capability on two real-world examples: the first is the Dow Jones Industrial Average (DJIA) index every minute on 17/04/2013, the day of the Twitter flash crash. The data is publicly available on FirstRate Data. $^1$ That day, the Associated Press' Twitter account was hacked and falsely tweeted that explosions at the White House had injured then-president Barack Obama. In response, the DJIA dropped by 150 points in a matter of seconds before bouncing back. As Figure 1 shows, this is a clear outlier. Modelling the time series with a Gaussian, the plot shows that $\mathcal{D}_m$ -BOCD successfully ignores this blip, while standard BOCD incorrectly labels it as a CP. The second example tracks the average daily value of FTT and Bitcoin between 10/2022 and 12/2022, data which is publicly available on Yahoo finance. $^2$ FTT was the token issued by FTX, one of the biggest crypto-exchanges before it failed due to a liquidity crisis on November 11th 2022. The ensuing collapse of FTX marked a crash in the value of various crypto-currencies, including Bitcoin. Using a two-dimensional Gaussian distribution for both $\mathcal{D}_m$ -BOCD and standard BOCD, Figure 4 shows that both methods correctly detect the CP. Figure 12 in Appendix C also displays the run-length posteriors, and shows that robustness does not lead to increased CP detection latency.
293
+
294
+ Well-log. The well-log data was introduced in Ruanaidh & Fitzgerald (1996), and consists in 4,050 nuclear magnetic resonance measurements recorded while drilling a well. CPs in the sequence correspond to changes in the sediment layers the drill is penetrating. On top of these clear changes, the data contains outliers and contaminants corresponding to more short-term events in geological history—such as flooding, earthquakes, or volcanic activity. When this data set is studied, its outliers have traditionally been removed before CP detection algorithms are run (see e.g. Adams &
295
+
296
+ MacKay, 2007; Ruggieri & Antonellis, 2016; Levy-leduc & Harchaoui, 2008). We leave them in, and Figure 3 shows that this is unproblematic for $\mathcal{D}_m$ -BOCD, but does lead to falsely labelled CPs with BOCD. We also compare the algorithm with $\beta$ -BOCD (Knblauch et al., 2018), and find that the detected changes are almost identical. On a machine with processor Intel i7-7500U 2.7 GHz, and 12GB of RAM, $\mathcal{D}_m$ -BOCD took about 10 times less than $\beta$ -BOCD.
297
+
298
+ Multivariate synthetic data. In certain settings, $\mathcal{D}_m$ -posteriors are conjugate when standard posteriors are not. An example is a multivariate time series whose dimensions follow different distributions belonging to the exponential family. To this end, we generate 1000 samples from a time series with CPs at $t = 250, 750$ . Conditional on the CPs, the data is generated independently from an exponential in the first dimension and Gaussian distribution in the second dimension. $\mathcal{D}_m$ -BOCD is immediately applicable, and Figure 7 shows that the algorithm functions reliably. We do not compare to BOCD in this setting: for this model, standard Bayesian posteriors would require expensive sampling algorithms or variational approximations to be employed, rendering the algorithm impractical.
299
+
300
+ UK 10 year government bond yield. Finally, we run the $\mathcal{D}_m$ -BOCD on the daily yield of 10 year UK government bonds from 2018 to 2022 (see Figure 6). The data is publicly available via the Bank of England database.<sup>3</sup> Since the 10-year yield has been positive throughout history, we model it using the gamma distribution. As shown in Figure 6, we detect changes in the yield curve that correspond to important political events in the UK. This distribution leads to a $\mathcal{D}_m$ -posterior that is a Gaussian truncated at zero. For standard Bayes, a conjugate prior exists, but it leads to a posterior with intractable normalisation constant. Like the multivariate synthetic data example, this constitutes another instance where $\mathcal{D}_m$ -posteriors have better computational properties than standard Bayes.
301
+
302
+ ![](images/ff924174429b9f23cb01e6c84de91c269504a9507e3ae70c8f8e3d3d69658f5b.jpg)
303
+ Figure 7. Multivariate synthetic example. A 2-dimensional CP problem. For the chosen model, $\mathcal{D}_m$ -BOCD is computationally efficient, but standard BOCD is computationally infeasible. The MAP segmentation is indicated by dashed blue lines, and the bottom panel shows the run-length distribution, with the most likely value in blue.
304
+
305
+ # 5. Conclusion
306
+
307
+ We proposed $\mathcal{D}_m$ -BOCD, a new version of BOCD that is both robust to outliers and scalable. The algorithm relies on a new generalised Bayesian inference scheme constructed with diffusion score-matching. These posteriors have closed form updates for models that are members of the exponential family, and provide robustness by appropriately tuning the diffusion matrix $m$ . For $T$ observations, $d$ -dimensional data, and $p$ model parameters, the overall run time of the method is $\mathcal{O}(T(p^2 + d^2))$ , and we demonstrate that it is just as fast as standard BOCD. By showcasing the various computational and inferential benefits of $\mathcal{D}_m$ -BOCD on a range of examples, we demonstrate that it is a powerful and needed addition to the literature. In the future, we will also investigate the applicability of $\mathcal{D}_m$ -BOCD to regression models. This is not trivial: the regression setting changes both the definition of valid score matching losses, as well as how to show their robustness (Xu et al., 2022).
308
+
309
+ $\mathcal{D}_m$ -posteriors also are of independent interest for computational challenges in Bayesian inference: like the generalised posterior in Matsubara et al. (2022b) and Matsubara et al. (2022a), they can be computed even without access to the normalising constant of the likelihood. This suggests that $\mathcal{D}_m$ -posteriors should be studied more broadly as a potential competitor to other Bayesian methods for intractable likelihood problems.
310
+
311
+ # Acknowledgements
312
+
313
+ We would like to thank Ayush Bharti for feedback on a first draft of this paper. JK was funded by EPSRC grant EP/W005859/1. FXB was supported by the Lloyd's Register Foundation Programme on Data-Centric Engineering and The Alan Turing Institute under EPSRC grant EP/N510129/1.
314
+
315
+ # References
316
+
317
+ Adams, R. P. and MacKay, D. J. Bayesian online change-point detection. arXiv:0710.3742, 2007.
318
+ Agudelo-Espana, D., Gomez-Gonzalez, S., Bauer, S., Schölkopf, B., and Peters, J. Bayesian online prediction of change points. In Conference on Uncertainty in Artificial Intelligence, pp. 320-329, 2020.
319
+ Anastasiou, A., Barp, A., Briol, F.-X., Ebner, B., Gaunt, R. E., Ghaderinezhad, F., Gorham, J., Gretton, A., Ley, C., Liu, Q., Mackey, L., Oates, C. J., Reinert, G., and Swan, Y. Stein's method meets computational statistics: A review of some recent developments. Statistical Science, 38: 120-139, 2023.
320
+ Barp, A., Briol, F.-X., Duncan, A., Girolami, M., and Mackey, L. Minimum Stein discrepancy estimators. In Advances in Neural Information Processing Systems, pp. 12964-12976, 2019.
321
+ Barry, D. and Hartigan, J. A. A Bayesian analysis for change point problems. Journal of the American Statistical Association, 88(421):309-319, 1993.
322
+ Basu, A., Harris, I. R., Hjort, N. L., and Jones, M. Robust and efficient estimation by minimising a density power divergence. Biometrika, 85(3):549-559, 1998.
323
+ Bissiri, P. G., Holmes, C. C., and Walker, S. G. A general framework for updating belief distributions. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 78(5):1103-1130, 2016.
324
+ Bochkina, N. Bernstein-von Mises theorem and misspecified models: a review. arXiv:2204.13614, 2022.
325
+ Boustati, A., Akyildiz, O. D., Damoulas, T., and Johansen, A. Generalised Bayesian filtering via sequential Monte Carlo. In Advances in Neural Information Processing Systems, pp. 418-429, 2020.
326
+ Bradbury, J., Frostig, R., Hawkins, P., Johnson, M. J., Leary, C., Maclaurin, D., Necula, G., Paszke, A., VanderPlas, J., Wanderman-Milne, S., and Zhang, Q. JAX: composable transformations of Python+NumPy programs, 2018. URL http://github.com/google/jax.
327
+ Chérief-Abdellatif, B.-E. and Alquier, P. MMD-Bayes: Robust Bayesian estimation via maximum mean discrepancy. In Symposium on Advances in Approximate Bayesian Inference, 2020.
328
+ Chernozhukov, V. and Hong, H. An MCMC approach to classical estimation. Journal of Econometrics, 115(2): 293-346, 2003.
329
+
330
+ Chib, S. Estimation and comparison of multiple change-point models. Journal of Econometrics, 86(2):221-241, 1998.
331
+ Dawid, A. P. and Musio, M. Bayesian model selection based on proper scoring rules. *Bayesian Analysis*, 10(2): 479-499, 2015.
332
+ Dellaporta, C., Knoblauch, J., Damoulas, T., and Briol, F.-X. Robust Bayesian inference for simulator-based models via the MMD posterior bootstrap. In International Conference on Artificial Intelligence and Statistics, pp. 943-970, 2022.
333
+ Fearnhead, P. Exact and efficient Bayesian inference for multiple changepoint problems. Statistics and Computing, 16(2):203-213, 2006.
334
+ Fearnhead, P. and Liu, Z. On-line inference for multiple changepoint problems. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 69(4):589-605, 2007.
335
+ Fong, E., Holmes, C., and Walker, S. G. Martingale posterior distributions. arXiv:2103.15671, 2021.
336
+ Futami, F., Sato, I., and Sugiyama, M. Variational inference based on robust divergences. In International Conference on Artificial Intelligence and Statistics, pp. 813-822, 2018.
337
+ Ghosh, A. and Basu, A. Robust Bayes estimation using the density power divergence. Annals of the Institute of Statistical Mathematics, 68(2):413-437, 2016.
338
+ Giummolè, F., Mameli, V., Ruli, E., and Ventura, L. Objective Bayesian inference with proper scoring rules. TEST, 28(3):728-755, 2019.
339
+ Grunwald, P. The safe Bayesian. In International Conference on Algorithmic Learning Theory, pp. 169-183, 2012.
340
+ Gundersen, G. W., Cai, D., Zhou, C., Engelhardt, B. E., and Adams, R. P. Active multi-fidelity Bayesian online changepoint detection. In Uncertainty in Artificial Intelligence, pp. 1916-1926, 2021.
341
+ Hallgren, K. L., Heard, N. A., and Adams, N. M. Changepoint detection in non-exchangeable data. Statistics and Computing, 32(6):1-19, 2022.
342
+ Holmes, C. C. and Walker, S. G. Assigning a value to a power likelihood in a general Bayesian model. Biometrika, 104(2):497-503, 2017.
343
+ Hooker, G. and Vidyashankar, A. Bayesian model robustness via disparities. TEST, 23(3):556-584, 2014.
344
+
345
+ Huber, P. J. Robust statistics. Wiley Series in Probability and Mathematical Statistics, 1981.
346
+ Hyvarinen, A. Estimation of non-normalized statistical models by score matching. Journal of Machine Learning Research, 6:695-708, 2006.
347
+ Hyvarinen, A. Some extensions of score matching. Computational Statistics and Data Analysis, 51(5):2499-2512, 2007.
348
+ Itoh, N. and Kurths, J. Change-point detection of climate time series by nonparametric method. In Proceedings of the World Congress on Engineering and Computer Science, volume 1, pp. 445-448, 2010.
349
+ Jewson, J. and Rossell, D. General Bayesian loss function selection and the use of improper models. Journal of the Royal Statistical Society Series B: Statistical Methodology, 84(5):1640-1665, 2022.
350
+ Jewson, J., Smith, J. Q., and Holmes, C. Principled Bayesian minimum divergence inference. Entropy, 20(6):442, 2018.
351
+ Kawahara, Y. and Sugiyama, M. Change-point detection in time-series data by direct density-ratio estimation. In Proceedings of the 2009 SIAM International Conference on Data Mining, pp. 389-400. SIAM, 2009.
352
+ Kim, K., Park, J. H., Lee, M., and Song, J. W. Unsupervised change point detection and trend prediction for financial time-series using a new CUSUM-based approach. IEEE Access, 10:34690-34705, 2022.
353
+ Knblauch, J. Robust deep Gaussian processes arXiv:1904.02303, 2019.
354
+ Knoblach, J. and Damoulas, T. Spatio-temporal Bayesian on-line changepoint detection with model selection. In International Conference on Machine Learning, pp. 2718-2727, 2018.
355
+ Knoblach, J., Jewson, J. E., and Damoulas, T. Doubly robust Bayesian inference for non-stationary streaming data with $\beta$ -divergences. In Advances in Neural Information Processing Systems, 2018.
356
+ Knoblach, J., Jewson, J., and Damoulas, T. An optimization-centric view on Bayes' rule: Reviewing and generalizing variational inference. Journal of Machine Learning Research, 23(132):1-109, 2022.
357
+ Kummerfeld, E. and Danks, D. Tracking time-varying graphical structure. Advances in Neural Information Processing Systems, 26, 2013.
358
+
359
+ Legramanti, S., Durante, D., and Alquier, P. Concentration and robustness of discrepancy-based ABC via Rademacher complexity. arXiv:2206.06991, 2022.
360
+ Levy-leduc, C. and Harchaoui, Z. Catching change-points with lasso. In Advances in Neural Information Processing Systems, pp. 617-624, 2008.
361
+ Liu, S., Kanamori, T., and Williams, D. J. Estimating density models with truncation boundaries using score matching. Journal of Machine Learning Research, 23(186):1-38, 2022.
362
+ Lyddon, S. P., Holmes, C. C., and Walker, S. G. General Bayesian updating and the loss-likelihood bootstrap. Biometrika, 106(2):465-478, 2019.
363
+ Lyu, S. Interpretation and generalization of score matching. In Uncertainty in Artificial Intelligence, pp. 359-366, 2009.
364
+ Mardia, K. V., Kent, J. T., and Laha, A. K. Score matching estimators for directional distributions. arXiv:1604.08470, 2016.
365
+ Martin, R. and Syring, N. Direct Gibbs posterior inference on risk minimizers: Construction, concentration, and calibration. Handbook of Statistics, 2022.
366
+ Matsubara, T., Knoblauch, J., Briol, F.-X., Oates, C., et al. Generalised Bayesian inference for discrete intractable likelihood. arXiv:2206.08420, 2022a.
367
+ Matsubara, T., Knoblauch, J., Briol, F.-X., and Oates, C. J. Robust generalised Bayesian inference for intractable likelihoods. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 84(3):997-1022, 2022b.
368
+ Pacchiardi, L. and Dutta, R. Generalized Bayesian likelihood-free inference using scoring rules estimators. arXiv:2104.03889, 2021.
369
+ Page, E. S. Continuous inspection schemes. Biometrika, 41 (1/2):100-115, 1954.
370
+ Parry, M., Dawid, A. P., and Lauritzen, S. Proper local scoring rules. Annals of Statistics, 40(1):561-592, 2012.
371
+ Reeves, J., Chen, J., Wang, X. L., Lund, R., and Lu, Q. Q. A review and comparison of changepoint detection techniques for climate data. Journal of Applied Meteorology and Climatology, 46(6):900-915, 2007.
372
+ Ruanaidh, J. J. O. and Fitzgerald, W. J. Numerical Bayesian methods applied to signal processing. Springer Science & Business Media, 1996.
373
+ Ruggieri, E. and Antonellis, M. An exact approach to Bayesian sequential change point detection. Computational Statistics & Data Analysis, 97:71-86, 2016.
374
+
375
+ Saatci, Y., Turner, R. D., and Rasmussen, C. E. Gaussian process change point models. In International Conference on Machine Learning, 2010.
376
+ Scealy, J. L. and Wood, A. T. A. Score matching for compositional distributions. Journal of the American Statistical Association, to appear, 2022.
377
+ Schmon, S. M., Cannon, P. W., and Knoblauch, J. Generalized posteriors in approximate Bayesian computation. In Symposium on Advances in Approximate Bayesian Inference, 2020.
378
+ Shao, S., Jacob, P. E., Ding, J., and Tarokh, V. Bayesian model comparison with the Hyvarinen score: computation and consistency. Journal of the American Statistical Association, 114(528):1826-1837, 2019.
379
+ Song, Y. and Ermon, S. Generative modeling by estimating gradients of the data distribution. Neural Information Processing Systems, 32, 2019.
380
+ Sriperumbudur, B. K., Fukumizu, K., Gretton, A., and Hyvarinen, A. Density estimation in infinite dimensional exponential families. Journal of Machine Learning Research, 18(57):1-59, 2017.
381
+ Stival, M., Bernardi, M., and Dellaportas, P. Doubly-online changepoint detection for monitoring health status during sports activities. arXiv:2206.11578, 2022.
382
+ Syring, N. and Martin, R. Calibrating general posterior credible regions. Biometrika, 106(2):479-486, 2019.
383
+ Turner, R. D., Bottone, S., and Stanek, C. J. Online variational approximations to non-exponential family change point models: with application to radar tracking. In Advances in Neural Information Processing Systems, 2013.
384
+ Vincent, P. A connection between score matching and denoising autoencoders. Neural Computation, 1674:1661-1674, 2011.
385
+ Wilson, R. C., Nassar, M. R., and Gold, J. I. Bayesian online learning of the hazard rate in change-point problems. Neural Computation, 22(9):2452-2476, 2010.
386
+ Wu, P.-S. and Martin, R. A comparison of learning rate selection methods in generalized Bayesian inference. Bayesian Analysis, 18(1):105-132, 2023.
387
+ Wu, S., Diao, E., Banerjee, T., Ding, J., and Tarokh, V. Quickest change detection for unnormalized statistical models. arXiv:2302.00250, 2023.
388
+ Xu, J., Scealy, J. L., Wood, A. T., and Zou, T. Generalized score matching for regression. arXiv:2203.09864, 2022.
389
+
390
+ Yang, P., Dumont, G., and Ansermino, J. M. Adaptive change detection in heart rate trend monitoring in anesthetized children. IEEE Transactions on Biomedical Engineering, 53(11):2211-2219, 2006.
391
+ Yu, S., Drton, M., and Shojaie, A. Graphical models for non-negative data using generalized score matching. In International Conference on Artificial Intelligence and Statistics, pp. 1781-1790, 2018.
392
+ Yu, S., Drton, M., and Shojaie, A. Generalized score matching for non-negative data. Journal of Machine Learning Research, 20:1-70, 2019.
393
+ Yu, S., Drton, M., and Shojaie, A. Generalized score matching for general domains. Information and Inference, 11 (2):739-780, 2022.
394
+ Zellner, A. Optimal information processing and Bayes's theorem. The American Statistician, 42(4):278-280, 1988.
395
+ Zhai, S., Cheng, Y., Lu, W., and Zhang, Z. Deep structured energy based models for anomaly detection. In International Conference on Machine Learning, volume 3, pp. 1742-1751, 2016.
396
+ Zhang, M., Key, O., Hayes, P., Barber, D., Paige, B., and Briol, F.-X. Towards healing the blindness of score matching. NeurIPS 2022 workshop on score-based methods, arXiv:2209.07396, 2022.
397
+
398
+ # Supplementary Materials
399
+
400
+ In Appendix A, we provide mathematical background. In Appendix B, we present the proofs and derivations of all the theoretical results in our paper, while Appendix C contains additional details regarding our experiments.
401
+
402
+ # A. Background
403
+
404
+ Let $\nabla = (\partial/\partial x_1, \ldots, \partial/\partial x_d)^\top$ , $f: \mathcal{X} \to \mathbb{R}^d$ and $g: \mathcal{X} \to \mathbb{R}^{d \times p}$ ; the divergence operator is defined as follows:
405
+
406
+ $$
407
+ (\nabla \cdot f) (x) = \sum_ {i = 1} ^ {d} \frac {\partial f _ {i}}{\partial x _ {i}} (x), \qquad (\nabla \cdot g) _ {j} (x) = \sum_ {i = 1} ^ {d} \frac {\partial g _ {i j}}{\partial x _ {i}} (x), \quad \forall j \in \{1, \dots , p \}.
408
+ $$
409
+
410
+ Expanding the term $\nabla \cdot mm^{\top}\nabla \log p_{\theta}(x)$ appearing as part of $d_m(\theta ,x)$ , we get
411
+
412
+ $$
413
+ \begin{array}{l} \nabla \cdot m m ^ {\top} \nabla \log p _ {\theta} (x) = \sum_ {i = 1} ^ {d} \frac {\partial}{\partial x _ {i}} (m m ^ {\top} \nabla \log p _ {\theta} (x)) _ {i} \\ = \sum_ {i = 1} ^ {d} \sum_ {j = 1} ^ {d} \frac {\partial}{\partial x _ {i}} \left((m m ^ {\top}) _ {i j} (\nabla \log p _ {\theta} (x)) _ {j}\right) \\ = \sum_ {i = 1} ^ {d} \sum_ {j = 1} ^ {d} \left(\frac {\partial}{\partial x _ {i}} (m m ^ {\top}) _ {i j}\right) (\nabla \log p _ {\theta} (x)) _ {j} + \sum_ {i = 1} ^ {d} \sum_ {j = 1} ^ {d} (m m ^ {\top}) _ {i j} \left(\nabla^ {2} \log p _ {\theta} (x)\right) _ {i j} \\ = \sum_ {i = 1} ^ {d} \sum_ {j = 1} ^ {d} \left(\frac {\partial}{\partial x _ {i}} (m m ^ {\top}) _ {i j}\right) (\nabla \log p _ {\theta} (x)) _ {j} + \sum_ {j = 1} ^ {d} \left(m m ^ {\top} \nabla^ {2} \log p _ {\theta} (x)\right) _ {j j} \\ = \sum_ {j = 1} ^ {d} \sum_ {i = 1} ^ {d} \left(\frac {\partial}{\partial x _ {i}} (m m ^ {\top}) _ {i j}\right) (\nabla \log p _ {\theta} (x)) _ {j} + \operatorname {T r} \left(m m ^ {\top} \nabla^ {2} \log p _ {\theta} (x)\right). \\ \end{array}
414
+ $$
415
+
416
+ Where $\nabla^2$ is the Hessian. The expression in the last line is more straightforward to implement in practice and it is therefore the one we use in our code.
417
+
418
+ The term $\nu (x)$ in Proposition 3.1 contains $(\nabla \cdot (mm^{\top}\nabla r)(x))$ . The $j$ -th index of this $p$ -dimensional vector equals
419
+
420
+ $$
421
+ \big (\nabla \cdot (m m ^ {\top} \nabla r) (x) \big) _ {j} = \sum_ {i = 1} ^ {d} \frac {\partial}{\partial x _ {i}} (m m ^ {\top} \nabla r (x)) _ {i j}.
422
+ $$
423
+
424
+ # B. Theoretical Results
425
+
426
+ In this section we present the derivation of the $\mathcal{D}_m$ -posterior, along with the proof of its robustness.
427
+
428
+ # B.1. Proof of Proposition 3.1
429
+
430
+ In this Subsection we present the proof of the main result of Section 3.2: the conjugacy for exponential family models.
431
+
432
+ Proof. Let $p_{\theta}$ be an exponential family model. Then $\nabla \log p_{\theta} = \nabla r(x)^{\top}\eta(\theta) + \nabla b(x)$ , and the DSM estimator has the following form:
433
+
434
+ $$
435
+ \widehat {\mathcal {D}} _ {m} (\theta) = \frac {1}{T} \sum_ {t = 1} ^ {T} \underbrace {\| m ^ {\top} (\nabla r (x _ {t}) \eta (\theta) + \nabla b (x _ {t})) \| _ {2} ^ {2}} _ {(1)} + 2 \underbrace {\nabla \cdot (m m ^ {\top} (\nabla r (x _ {t}) \eta (\theta) + \nabla b (x _ {t})))} _ {(2)}.
436
+ $$
437
+
438
+ Let $\stackrel{+C}{=}$ indicate equality up to an additive term that does not depend on $\theta$ .
439
+
440
+ $$
441
+ \begin{array}{l} (1) = \eta (\theta) ^ {\top} \nabla r (x _ {t}) ^ {\top} m m ^ {\top} \nabla r (x _ {t}) \eta (\theta) + \nabla b (x _ {t}) ^ {\top} m m ^ {\top} \nabla b (x _ {t}) + 2 \eta (\theta) ^ {\top} \nabla r (x _ {t}) ^ {\top} m m ^ {\top} \nabla b (x _ {t}) \\ \stackrel {+ C} {=} \eta (\theta) ^ {\top} \nabla r (x _ {t}) ^ {\top} m m ^ {\top} \nabla r (x _ {t}) \eta (\theta) + 2 \eta (\theta) ^ {\top} \nabla r (x _ {t}) ^ {\top} m m ^ {\top} \nabla b (x _ {t}), \\ \end{array}
442
+ $$
443
+
444
+ and
445
+
446
+ $$
447
+ \begin{array}{l} (2) = \nabla \cdot \left(m m ^ {\top} \nabla r \left(x _ {t}\right) \eta (\theta)\right) + \nabla \cdot \left(m m ^ {\top} \nabla b \left(x _ {t}\right)\right) \\ \stackrel {+ C} {=} \nabla \cdot (m m ^ {\top} \nabla r (x _ {t}) \eta (\theta)) \\ = \eta (\theta) ^ {\top} (\nabla \cdot (m m ^ {\top} \nabla r (x _ {t}))). \\ \end{array}
448
+ $$
449
+
450
+ Therefore, $\widehat{\mathcal{D}}_m(\theta) = \eta (\theta)^\top \Lambda_T\eta (\theta) + \eta (\theta)^\top \nu_T$ where
451
+
452
+ $$
453
+ \begin{array}{l} \Lambda_ {T} := \frac {1}{T} \sum_ {t = 1} ^ {T} \nabla r (x _ {t}) ^ {\top} m m ^ {\top} \nabla r (x _ {t}), \\ \nu_ {T} := \frac {2}{T} \sum_ {t = 1} ^ {T} \nabla r (x _ {t}) ^ {\top} m m ^ {\top} \nabla b (x _ {t}) + \nabla \cdot \left(m m ^ {\top} \nabla r (x _ {t})\right). \\ \end{array}
454
+ $$
455
+
456
+ Now, assuming the prior has a p.d.f. $\pi$ , the DSM-Bayes generalised posterior has a p.d.f.
457
+
458
+ $$
459
+ \pi_ {\omega} ^ {\mathcal {D} _ {m}} \propto \pi (\theta) \exp \left(- \omega T [ \eta (\theta) ^ {\top} \Lambda_ {T} \eta (\theta) + \eta (\theta) ^ {\top} \nu_ {T} ]\right).
460
+ $$
461
+
462
+ For $\eta (\theta) = \theta$ , and the prior $\pi (\theta)\propto \exp \left(-\frac{1}{2} (\theta -\mu)^{\top}\Sigma^{-1}(\theta -\mu)\right)$ , we obtain the generalised posterior by completing the square as follows:
463
+
464
+ $$
465
+ \begin{array}{l} \pi_ {\omega} ^ {\mathcal {D} _ {m}} (\theta) \propto \exp \left(- \frac {1}{2} (\theta - \mu) ^ {\top} \Sigma^ {- 1} (\theta - \mu_ {T})\right) \exp \left(- \omega T [ \theta^ {\top} \Lambda_ {T} \theta + \theta^ {\top} \nu_ {T} ]\right) \\ = \exp \left(- \frac {1}{2} \left(\theta^ {\top} \Sigma^ {- 1} \theta - 2 \theta^ {\top} \Sigma^ {- 1} \mu + \mu^ {\top} \Sigma^ {- 1} \mu + \theta^ {\top} 2 \omega T \Lambda_ {T} \theta + \theta^ {\top} 2 \omega n \nu_ {T}\right)\right) \\ \propto \exp \left(- \frac {1}{2} \left(\theta^ {\top} \left(\Sigma^ {- 1} + 2 \omega T \Lambda_ {T}\right) \theta - 2 \theta^ {\top} \left(\Sigma^ {- 1} \mu - \omega T \nu_ {T}\right)\right)\right) \\ \propto \exp \left(- \frac {1}{2} (\theta - \mu_ {T}) ^ {\top} \Sigma_ {T} ^ {- 1} (\theta - \mu_ {T})\right), \\ \end{array}
466
+ $$
467
+
468
+ where
469
+
470
+ $$
471
+ \begin{array}{l} \Sigma_ {T} ^ {- 1} := \Sigma^ {- 1} + 2 \omega T \Lambda_ {T}, \\ \mu_ {T} := \Sigma_ {T} \left(\Sigma^ {- 1} \mu - \omega T \nu_ {T}\right). \\ \end{array}
472
+ $$
473
+
474
+ # B.2. Update Parameters for online DSM-Bayes
475
+
476
+ In this Section we derive the efficient parameter updates presented in Section 3.4. To do so, we expand the expressions $\Lambda$ and $\nu$ as follows:
477
+
478
+ $$
479
+ \begin{array}{l} \Lambda_ {T + 1} := \frac {1}{T + 1} \sum_ {t = 1} ^ {T + 1} \nabla r (x _ {t}) ^ {\top} m m ^ {\top} \nabla r (x _ {t}) \\ = \frac {1}{T + 1} \left(\sum_ {t = 1} ^ {T} \nabla r (x _ {t}) ^ {\top} m m ^ {\top} \nabla r (x _ {t}) + \nabla r (x _ {T + 1}) ^ {\top} m m ^ {\top} \nabla r (x _ {T + 1})\right) \\ = \frac {1}{T + 1} \left(n \Lambda_ {T} + \nabla r (x _ {T + 1}) ^ {\top} m m ^ {\top} \nabla r (x _ {T + 1})\right) \\ \end{array}
480
+ $$
481
+
482
+ $$
483
+ \begin{array}{l} \nu_ {T + 1} := \frac {2}{T + 1} \sum_ {t = 1} ^ {T + 1} \nabla r (x _ {t}) ^ {\top} m m ^ {\top} \nabla b (x _ {t}) + \nabla \cdot \left(m m ^ {\top} \nabla r (x _ {t})\right) \\ = \frac {1}{T + 1} \left( \right.T v _ {T} + 2 \left(\nabla r \left(x _ {T + 1}\right) ^ {\top} m m ^ {\top} \nabla b \left(x _ {T + 1}\right) + \nabla \cdot \left(m m ^ {\top} \nabla r \left(x _ {T + 1}\right)\right)\right). \\ \end{array}
484
+ $$
485
+
486
+ Now, assuming the prior has the conjugate form of Proposition 3.1, the $\mathcal{D}_m$ -posterior is given by
487
+
488
+ $$
489
+ \pi_ {\omega} ^ {\mathcal {D} _ {M}} (\theta) \propto \exp \left(- \frac {1}{2} (\theta - \mu_ {T}) ^ {\top} \Sigma_ {T} ^ {- 1} (\theta - \mu_ {T})\right),
490
+ $$
491
+
492
+ where
493
+
494
+ $$
495
+ \begin{array}{l} \Sigma_ {T} ^ {- 1} := \Sigma^ {- 1} + 2 \omega n \Lambda_ {T}, \\ \mu_ {T} := \Sigma_ {T} \left(\Sigma^ {- 1} \mu - \omega n \nu_ {T}\right). \\ \end{array}
496
+ $$
497
+
498
+ So the parameter updates for $\Sigma_T$ and $\mu_T$ as $T$ increases are:
499
+
500
+ $$
501
+ \begin{array}{l} \Sigma_ {T + 1} ^ {- 1} := \Sigma^ {- 1} + 2 \omega (T + 1) \Lambda_ {T + 1} \\ = \Sigma^ {- 1} + 2 \omega \left(n \Lambda_ {T} + \nabla t (x _ {T + 1}) ^ {\top} m m ^ {\top} \nabla t (x _ {T + 1})\right) \\ = \Sigma_ {T} ^ {- 1} + 2 \omega \nabla r (x _ {T + 1}) ^ {\top} m m ^ {\top} \nabla r (x _ {T + 1}) \\ \end{array}
502
+ $$
503
+
504
+ $$
505
+ \begin{array}{l} \mu_ {T + 1} := \Sigma_ {T + 1} \left(\Sigma^ {- 1} \mu - \omega (T + 1) \nu_ {T + 1}\right) \\ = \Sigma_ {T + 1} \left(\Sigma^ {- 1} \mu - \omega \left(T v _ {T} + 2 (\nabla r (x _ {T + 1}) ^ {\top} m m ^ {\top} \nabla b (x _ {T + 1}) + \nabla \cdot (m m ^ {\top} \nabla r (x _ {T + 1}))\right)\right) \\ = \Sigma_ {T + 1} \left( \right.\Sigma_ {T} ^ {- 1} \mu_ {T} - 2 \omega \left(\nabla r (x _ {T + 1}) ^ {\top} m m ^ {\top} \nabla b (x _ {T + 1}) + \nabla \cdot (m m ^ {\top} \nabla r (x _ {T + 1}))\right). \\ \end{array}
506
+ $$
507
+
508
+ obtaining the desired expression.
509
+
510
+ # B.3. Global Bias-Robustness
511
+
512
+ In this Subsection, we present the theory necessary to prove that the generalized posterior presented in Section 3.1 is global bias-robust conditioned to the choice of $m$ .
513
+
514
+ We first need to review a result from Matsubara et al. (2022a) which states conditions for a discrepancy measure $\mathcal{D}(\theta)$ in order to prove that the corresponding generalised Bayes posterior $\pi_{\omega}^{\mathcal{D}}$ is globally robust to outliers. As in the original results, we will state our findings in terms of distributions $\mathbb{P}\in \mathcal{P}(\mathcal{X})$ , where $\mathcal{P}(\mathcal{X})$ denotes the set of probability distributions on $\mathcal{X}$ . To this end, we will build on the notation introduced in Section 3.3, and write
515
+
516
+ $$
517
+ \pi_ {\omega} ^ {\mathcal {D}} (\theta | \mathbb {P}) \propto \pi (\theta) \exp \{- \omega T \cdot \mathcal {D} (\theta ; \mathbb {P}) \} \quad \text {f o r} \quad \mathcal {D} (\theta ; \mathbb {P}) = \mathbb {E} _ {X \sim \mathbb {P}} [ d (\theta , X) ]. \tag {6}
518
+ $$
519
+
520
+ Here, the discrepancy-based loss $\mathcal{D}(\theta; \mathbb{P}) = \mathbb{E}_{X \sim \mathbb{P}}[d(\theta, X)]$ allows us to recover theoretical posteriors based on averaging some kind of discrepancy $d: \Theta \times \mathcal{X} \to \mathbb{R}$ for any measure $\mathbb{P}$ . This makes the results more general and more natural to derive. Note that all derived results apply to the $\mathcal{D}_m$ -posterior computed from data points $x_{1:T}$ , as we can recover it by considering $d = d_m$ , and the corresponding empirical measure $\mathbb{P}_T = \frac{1}{T} \sum_{t=1}^T \delta_{x_t}$ . In particular, for $d = d_m$ we have that $\mathcal{D}(\theta; \mathbb{P}_T) = \widehat{\mathcal{D}}_m(\theta)$ so that $\pi_\omega^\mathcal{D}(\theta | \mathbb{P}_T) = \pi_\omega^{\mathcal{D}^m}(\theta | x_{1:T})$ as defined in (4).
521
+
522
+ The original work of Matsubara et al. (2022b) constructed a proof of robustness for posteriors that did not depend on an averaged loss $\mathcal{D}(\theta; \mathbb{P}) = \mathbb{E}_{X \sim \mathbb{P}}[d(\theta, X)]$ , and so the conditions they derive do not exploit this averaged form. Instead, they showed in Lemma 5 of their paper that global bias-robustness holds if
523
+
524
+ $$
525
+ \sup _ {\theta \in \Theta} \sup _ {y \in \mathcal {X}} \left| \frac {d}{d \varepsilon} \mathcal {D} (\theta ; \mathbb {P} _ {\varepsilon , y}) | _ {\varepsilon = 0} (y, \theta , \mathbb {P}) \right| \pi (\theta) < \infty , \quad \text {a n d} \tag {7}
526
+ $$
527
+
528
+ $$
529
+ \int_ {\Theta} \sup _ {y \in \mathcal {X}} \left| \frac {d}{d \varepsilon} \mathcal {D} (\theta ; \mathbb {P} _ {\varepsilon , y}) | _ {\varepsilon = 0} (y, \theta , \mathbb {P}) \right| \pi (\theta) d \theta < \infty . \tag {8}
530
+ $$
531
+
532
+ Clearly, we can simplify this further because our loss is an average. As long as the function $d$ over which the loss is averaged is sufficiently regular, the below result shows that we obtain global bias-robustness.
533
+
534
+ Proposition B.1. For each $\theta \in \Theta$ . Suppose that $\pi$ is upper bounded over $\Theta$ . If there exists a function $\gamma : \Theta \to \mathbb{R}$ such that:
535
+
536
+ 1. $\sup_{y\in \mathcal{X}}|d(\theta ,y)|\leq \gamma (\theta)$
537
+ 2. $\sup_{\theta \in \Theta}\gamma (\theta)\pi (\theta) < \infty$ , and
538
+ 3. $\int_{\Theta}\gamma (\theta)\pi (\theta)d\theta < \infty$
539
+
540
+ Then the posterior influence function $\mathrm{PIF}(y,\theta ,\mathbb{P})$ of $\pi_{\omega}^{\mathcal{D}}(\theta |\mathbb{P})$ defined in (6) is bounded over both $\theta \in \Theta$ and $y\in \mathcal{V}$ , so that the $\pi_{\omega}^{\mathcal{D}}(\theta |\mathbb{P})$ is globally robust.
541
+
542
+ Proof. As outlined above, we simply have to show that the above conditions suffice to guarantee (7) and (8). Rewriting the loss function related to the contamination model would be:
543
+
544
+ $$
545
+ \mathcal {D} (\theta ; \mathbb {P} _ {\varepsilon , y}) = \mathbb {E} _ {x \sim \mathbb {P} _ {\varepsilon , y}} [ d (\theta , x) ] = (1 - \varepsilon) \mathbb {E} _ {x \sim \mathbb {P}} [ d (\theta , x) ] + \varepsilon \mathbb {E} _ {x \sim \delta_ {y}} [ d (\theta , x) ].
546
+ $$
547
+
548
+ Then, differentiating the last expression w.r.t. $\varepsilon$ , and evaluating $\varepsilon = 0$ , we obtain:
549
+
550
+ $$
551
+ \frac {d}{d \varepsilon} \mathcal {D} (\theta ; \mathbb {P} _ {\varepsilon , y}) | _ {\varepsilon = 0} = \mathbb {E} _ {x \sim \mathbb {P}} [ d (\theta , x) ] + \mathbb {E} _ {x \sim \delta_ {y}} [ d (\theta , x) ]
552
+ $$
553
+
554
+ Using Jensen's inequality, we bound the expression $\left| \frac{d}{d\varepsilon} \mathcal{D}(\theta; \mathbb{P}_{\varepsilon, y}) \right|_{\varepsilon = 0}$ as follows:
555
+
556
+ $$
557
+ \begin{array}{l} \left| \frac {d}{d \varepsilon} \mathcal {D} (\theta ; \mathbb {P} _ {\varepsilon , y}) \right| _ {\varepsilon = 0} | \leq \left| \mathbb {E} _ {x \sim \delta_ {y}} [ d (\theta , x) ] \right| + \left| \mathbb {E} _ {x \sim \mathbb {P}} [ d (\theta , x) ] \right| \\ \leq \mathbb {E} _ {x \sim \delta_ {y}} [ | d (\theta , x) | ] + \mathbb {E} _ {x \sim \mathbb {P}} [ | d (\theta , x) | ] \\ = | d (\theta , y) | + \mathbb {E} _ {x \sim \mathbb {P}} [ | d (\theta , x) | ] \\ \leq | d (\theta , y) | + \mathbb {E} _ {x \sim \mathbb {P}} [ \sup _ {y \in \mathcal {X}} | d (\theta , y) | ] \\ = | d (\theta , y) | + \sup _ {y \in \mathcal {X}} | d (\theta , y) |, \\ \end{array}
558
+ $$
559
+
560
+ and taking a supremum over $y$ we obtain the bound:
561
+
562
+ $$
563
+ \sup _ {y \in \mathcal {X}} | \frac {d}{d \varepsilon} \mathcal {D} (\theta ; \mathbb {P} _ {\varepsilon , y}) | \leq 2 \sup _ {y \in \mathcal {X}} | d (\theta , y) | \leq 2 \gamma (\theta),
564
+ $$
565
+
566
+ where the last inequality holds since $\gamma$ fulfil condition 1. Using this bound, we check the two conditions of Matsubara et al. (2022b).
567
+
568
+ 1. $\sup_{\theta \in \Theta}\sup_{y\in \mathcal{X}}|\frac{d}{d\varepsilon}\mathcal{D}(\theta ;\mathbb{P}_{\varepsilon ,y})|\pi (\theta)\leq \sup_{\theta \in \Theta}2\gamma (\theta)\pi (\theta) < \infty$ , and
569
+ 2. $\int_{\Theta}\sup_{y\in \mathcal{X}}|\frac{d}{d\varepsilon}\mathcal{D}(\theta ;\mathbb{P}_{\varepsilon ,y})|\pi (\theta)d\theta \leq \int_{\Theta}2\gamma (\theta)\pi (\theta)d\theta < \infty$
570
+
571
+ where the last inequalities hold because $\gamma$ meets conditions 2 and 3. Therefore, by virtue of Matsubara et al. (2022b) the posterior is globally bias-robust.
572
+
573
+ # B.4. Proof of Proposition 3.2
574
+
575
+ In this Subsection we provide the proof of Proposition 3.2. The strategy of the proof is simple: We show that $d = d_{m}$ admits a natural function $\gamma$ that satisfies the conditions of Proposition B.1.
576
+
577
+ Proof. From Proposition B.1, it is sufficient to find a function $\gamma$ such that:
578
+
579
+ $$
580
+ \sup_{y\in \mathcal{X}}|\underbrace{\|m^{\top}(y)\nabla\log p_{\theta}(y)\|_{2}^{2}}_{(1)} + 2\underbrace{\nabla\cdot m(y)m^{\top}(y)\nabla\log p_{\theta}(y)}_{(2)}|\leq \gamma (\theta).
581
+ $$
582
+
583
+ Now, following from the form of $m$ in Proposition 3.2 and the fact that $p_{\theta}$ is an exponential family member as in (5), we have:
584
+
585
+ $$
586
+ (1) = \| m ^ {\top} (y) \nabla \log p _ {\theta} (y) \| _ {2} ^ {2} = \sum_ {i = 1} ^ {d} (m ^ {\top} (y) \nabla \log p _ {\theta} (y)) _ {i} ^ {2} = \sum_ {i = 1} ^ {d} \frac {(\nabla r (x) \theta) _ {i} ^ {2}}{1 + (\nabla r (x) \theta^ {\star}) _ {i} ^ {2}} \leq \sum_ {i = 1} ^ {d} \frac {(\nabla r (x) \theta) _ {i} ^ {2}}{(\nabla r (x) \theta^ {\star}) _ {i} ^ {2}}.
587
+ $$
588
+
589
+ Using the fact that $\| x\| _2^2\leq \| x\| _1^2\leq d\| x\| _2^2$ for $x\in \mathbb{R}^d$ , we have:
590
+
591
+ $$
592
+ \sum_ {i = 1} ^ {d} \frac {(\nabla r (x) \theta) _ {i} ^ {2}}{(\nabla r (x) \theta^ {\star}) _ {i} ^ {2}} \leq \sum_ {i = 1} ^ {d} \frac {p \| \theta \| _ {2} ^ {2}}{\| \theta^ {\star} \| _ {2} ^ {2}} = \frac {d p \| \theta \| _ {2} ^ {2}}{\| \theta^ {\star} \| _ {2} ^ {2}} =: \gamma_ {1} (\theta).
593
+ $$
594
+
595
+ For the second expression, we have:
596
+
597
+ $$
598
+ \begin{array}{l} (2) = | \nabla \cdot m (y) m ^ {\top} (y) \nabla \log p _ {\theta} (y) | = \left| \sum_ {i = 1} ^ {d} \frac {\partial}{\partial x _ {t}} (m (y) m ^ {\top} (y) \nabla \log p _ {\theta} (y)) _ {i} \right| \\ = \left| \sum_ {i = 1} ^ {d} \frac {\partial}{\partial x _ {t}} \left(\frac {(\nabla r (x) \theta) _ {i}}{1 + (\nabla r (x) \theta^ {*}) _ {i} ^ {2}}\right) \right| \\ = \left| \sum_ {i = 1} ^ {d} \frac {(\nabla^ {2} r (x) \theta) _ {i i} (1 + (\nabla r (x) \theta^ {\star}) _ {i} ^ {2}) - 2 (\nabla r (x) \theta^ {\star}) _ {i} (\nabla r (x) \theta) _ {i} (\nabla^ {2} r (x) \theta^ {\star}) _ {i i}}{(1 + (\nabla r (x) \theta^ {\star}) _ {i} ^ {2}) ^ {2}} \right| \\ \leq \sum_ {i = 1} ^ {d} \left| \frac {(\nabla^ {2} r (x) \theta) _ {i i}}{1 + (\nabla r (x) \theta^ {\star}) _ {i} ^ {2}} \right| + 2 \left| \frac {(\nabla r (x) \theta^ {\star}) _ {i} (\nabla r (x) \theta) _ {i} (\nabla^ {2} r (x) \theta^ {\star}) _ {i i}}{(1 + (\nabla r (x) \theta^ {\star}) _ {i} ^ {2}) ^ {2}} \right|. \\ \end{array}
599
+ $$
600
+
601
+ For most distributions of interest, including Gaussians, exponentials, (inverse) Gamma, and Beta distributions, $\left|\frac{(\nabla^2r(x)\theta)_ii}{1 + (\nabla r(x)\theta^\star)_i^2}\right|$ is bounded for every $\theta \in \Theta$ , then:
602
+
603
+ $$
604
+ \begin{array}{l} \sum_ {i = 1} ^ {d} \left| \frac {(\nabla^ {2} r (x) \theta) _ {i i}}{1 + (\nabla r (x) \theta^ {\star}) _ {i} ^ {2}} \right| + 2 \left| \frac {(\nabla r (x) \theta^ {\star}) _ {i} (\nabla r (x) \theta) _ {i} (\nabla^ {2} r (x) \theta^ {\star}) _ {i i}}{(1 + (\nabla r (x) \theta^ {\star}) _ {i} ^ {2}) ^ {2}} \right| \leq d C (\theta) + 2 C (\theta) \sum_ {i = 1} ^ {d} \left| \frac {(\nabla r (x) \theta^ {\star}) _ {i} (\nabla r (x) \theta) _ {i}}{(1 + (\nabla r (x) \theta^ {\star}) _ {i} ^ {2}) ^ {2}} \right| \\ \leq d C (\theta) (1 + 2 d \frac {\| \theta \| _ {2} ^ {2}}{\| \theta^ {\star} \| _ {2} ^ {2}}) =: \gamma_ {2} (\theta). \\ \end{array}
605
+ $$
606
+
607
+ Defining $\gamma (\theta)\coloneqq \gamma_{1}(\theta) + \gamma_{2}(\theta)$ we have:
608
+
609
+ $$
610
+ \sup _ {y \in \mathcal {X}} | \| m ^ {\top} (y) \nabla \log p _ {\theta} (y) \| _ {2} ^ {2} + 2 \nabla \cdot m (y) m ^ {\top} (y) \nabla \log p _ {\theta} (y) | \leq \gamma (\theta).
611
+ $$
612
+
613
+ Now we are in a position to verify conditions (I) and (II) of Proposition B.1. Since $\gamma (\theta)$ is a polynomial function, $\pi (\theta)$ is a squared exponential prior, and the squared exponential has infinitely many moments, it is clear that:
614
+
615
+ $$
616
+ \sup _ {\theta \in \Theta} \pi (\theta) \gamma (\theta) < \infty ,
617
+ $$
618
+
619
+ $$
620
+ \int_ {\Theta} \pi (\theta) \gamma (\theta) d \theta < \infty ,
621
+ $$
622
+
623
+ which completes the proof.
624
+
625
+ # B.5. Boundary and smoothness conditions
626
+
627
+ In this subsection, we review the boundary and smoothness conditions discussed in Section 3.1, alongside the DSM extension to more general domains $\mathcal{X}$ .
628
+
629
+ The smoothness conditions needed to get the expansion of $\mathcal{D}_m$ as in Equation (3) for $\mathcal{X} = \mathbb{R}^d$ are the following:
630
+
631
+ Lemma B.2. If $p_{\theta}$ is twice-differentiable, and $p_0mm^\top \nabla \log p_\theta, \nabla \cdot (p_0mm^\top \nabla \log p_\theta) \in L^1(\mathbb{R}^d)$ , then we can rewrite $\mathcal{D}_m$ as in Equation (3).
632
+
633
+ Yu et al. (2019) extended the DSM to densities with non-negative support, i.e. $\mathcal{X} = \mathbb{R}_{\geq 0}^{d}$ .
634
+
635
+ Theorem B.3. Suppose that $\log p_0(x)$ and $m$ are continuously differentiable almost everywhere on $\mathbb{R}_+^d$ and $\log p_{\theta}$ is twice continuously differentiable with respect to $x$ on $\mathbb{R}_+^d$ . Furthermore, we assume the boundary condition,
636
+
637
+ $$
638
+ \lim _ {| x ^ {(i)} | \rightarrow \infty} p _ {0} (x) m _ {i i} ^ {2} (x) \partial_ {i} \log p _ {\theta} (x) - \lim _ {| x ^ {(i)} | \rightarrow 0 +} p _ {0} (x) m _ {i i} ^ {2} (x) \partial_ {i} \log p _ {\theta} (x) = 0, \forall i \in \{1, \dots , d \},
639
+ $$
640
+
641
+ where $x_{i}$ is the $i$ -dimension of $x$ . Then, we can rewrite $\mathcal{D}_m$ as in Equation (3)
642
+
643
+ Later, Liu et al. (2022) extended the DSM to densities with support in a Lipschitz Domain, which, intuitively speaking, are bounded connected open domains whose local boundary is a level set of some Lipschitz function.
644
+
645
+ Theorem B.4. Assume $\mathcal{X} \subset \mathbb{R}^d$ is a Lipschitz domain. Suppose $p_0, \partial_i \log p_\theta \in H^1(\mathcal{X})$ and that for any $z \in \partial \mathcal{X}$ it holds that
646
+
647
+ $$
648
+ \lim _ {x \rightarrow z} p _ {0} (x) m _ {i i} ^ {2} (x) \partial_ {i} \log p _ {\theta} (x) v _ {i} (z) = 0, \forall i \in \{1, \dots , d \},
649
+ $$
650
+
651
+ where $x \to z$ takes any point sequence converging to $z \in \partial \mathcal{X}$ into account, $v = (v_{1},\dots,v_{d})$ is the unit outward normal vector on $\partial \mathcal{X}$ , and $H^{1}(\mathcal{X})$ is the Sobolev-Hilbert space. Then, we can rewrite $\mathcal{D}_m$ as in Equation (3).
652
+
653
+ The Sobolev-Hilbert space is defined as follows:
654
+
655
+ $$
656
+ H ^ {1} (\mathcal {X}) = \left\{f \in L ^ {2} (\mathcal {X}) \mid \| f \| _ {L ^ {2} (\mathcal {X})} ^ {2} + \sum_ {i = 1} ^ {d} \| D _ {i} f \| _ {L ^ {2} (\mathcal {X})} ^ {2} < \infty \right\},
657
+ $$
658
+
659
+ where $D_{i}$ is the weak derivative corresponding to $\partial_i$ and $\| f\|_{L^2 (\mathcal{X})} = \sqrt{\int_{\mathcal{X}}|f(x)|^2dx}$ .
660
+
661
+ Gamma distribution Let $p_{\theta}$ be a gamma distribution, and $\mathcal{X} = \mathbb{R}_{+}$ . Assume $p_0$ bounded from above and that $\log p_0(x)$ is continuously differentiable almost everywhere on $\mathbb{R}_+$ . Then for $m$ as in Proposition 3.2, we have
662
+
663
+ $$
664
+ \begin{array}{l} \lim _ {| x | \rightarrow 0 +} p _ {0} (x) m ^ {2} (x) \partial \log p _ {\theta} (x) = \lim _ {| x | \rightarrow 0 +} p _ {0} (x) \frac {\nabla r (x) \theta + \nabla b (x)}{1 + (\nabla r (x) \theta^ {\star}) _ {i} ^ {2}} \\ = \lim _ {| x | \rightarrow 0 +} p _ {0} (x) \frac {\frac {\theta_ {1}}{x} - \theta_ {2}}{1 + (\frac {\theta_ {1} ^ {*}}{x} - \theta_ {2} ^ {*}) ^ {2}} \\ = \lim _ {| x | \rightarrow 0 +} p _ {0} (x) \frac {x \theta_ {1} - x ^ {2} \theta_ {2}}{x + (\theta_ {1} ^ {\star} - x \theta_ {2} ^ {\star}) ^ {2}} \\ = 0. \\ \end{array}
665
+ $$
666
+
667
+ The last equality holds since $p_0$ is bounded. Now, for the second boundary condition:
668
+
669
+ $$
670
+ \lim _ {| x | \to \infty} p _ {0} (x) m ^ {2} (x) \partial \log p _ {\theta} (x) = \lim _ {| x | \to \infty} p _ {0} (x) \frac {\nabla r (x) \theta + \nabla b (x)}{1 + (\nabla r (x) \theta^ {\star}) _ {i} ^ {2}} = \lim _ {| x | \to \infty} p _ {0} (x) \frac {\frac {\theta_ {1}}{x} - \theta_ {2}}{1 + (\frac {\theta^ {\star}}{1} - \theta_ {2} ^ {\star}) ^ {2}} = 0.
671
+ $$
672
+
673
+ The last equality holds since $p_0$ a density, therefore, $\lim_{|x| \to \infty} p_0(x) = 0$ . Then the $m$ proposed in Proposition 3.2 satisfies the boundary conditions in Theorem B.3 for the gamma distribution.
674
+
675
+ Exponential distribution Let $p_{\theta}$ be an exponential distribution, and $\mathcal{X} = \mathbb{R}_{+}$ . Assume $p_0$ bounded, such that $\log p_0(x)$ is continuously differentiable almost everywhere on $\mathbb{R}_+$ . Then for $m$ such as in Proposition 3.2:
676
+
677
+ $$
678
+ \lim _ {| x | \to 0 +} p _ {0} (x) m ^ {2} (x) \partial \log p _ {\theta} (x) = \lim _ {| x | \to 0 +} p _ {0} (x) \frac {\nabla r (x) \theta + \nabla b (x)}{1 + (\nabla r (x) \theta^ {\star}) _ {i} ^ {2}} = \lim _ {| x | \to 0 +} p _ {0} (x) = \frac {\theta}{1 + \theta^ {\star 2}} \lim _ {| x | \to 0 +} p _ {0} (x).
679
+ $$
680
+
681
+ The term for the second limit would be similar:
682
+
683
+ $$
684
+ \lim _ {| x | \to \infty} p _ {0} (x) m ^ {2} (x) \partial \log p _ {\theta} (x) = \frac {\theta}{1 + \theta^ {\star 2}} \lim _ {| x | \to \infty} p _ {0} (x).
685
+ $$
686
+
687
+ Therefore, the expression in Theorem B.3 looks as follows:
688
+
689
+ $$
690
+ \begin{array}{l} \lim _ {| x ^ {(i)} | \rightarrow \infty} p _ {0} (x) m _ {i i} ^ {2} (x) \partial_ {i} \log p _ {\theta} (x) - \lim _ {| x ^ {(i)} | \rightarrow 0 +} p _ {0} (x) m _ {i i} ^ {2} (x) \partial_ {i} \log p _ {\theta} (x) \\ = \frac {\theta}{1 + \theta^ {\star 2}} \left(\lim _ {| x | \to \infty} p _ {0} (x) - \lim _ {| x | \to 0 +} p _ {0} (x)\right). \\ \end{array}
691
+ $$
692
+
693
+ Then the $m$ proposed in Proposition 3.2 satisfies the boundary conditions in Theorem B.3 if
694
+
695
+ $$
696
+ \lim _ {| x | \rightarrow \infty} p _ {0} (x) = \lim _ {| x | \rightarrow 0 +} p _ {0} (x).
697
+ $$
698
+
699
+ # C. Additional Details on Numerical Experiments
700
+
701
+ In this section we give additional details on the numerical experiments of Section 4. We provide the exact prior and $\omega$ used in each experiment. Moreover, we present an extra numerical experiment to compare the computational complexity of standard BOCD and $\mathcal{D}_m$ -BOCD in Appendix C.1.
702
+
703
+ # C.1. Computational complexity
704
+
705
+ The computational complexity of both standard BOCD and $\mathcal{D}_m$ -BOCD is linear in the number of data points. To verify that this theoretical complexity mirrors the practical computational overhead, we generate samples from a Gaussian distribution with 1 CP where the mean varies. We vary the sample size from $T = 100$ up to $T = 20000$ . We fit a Gaussian distribution with the correct variance taken as fixed in both the $\mathcal{D}_m$ -BOCD and the standard BOCD. As shown in Figure 8a, both methods are equally fast for any number of observations.
706
+
707
+ Although the computational complexity of $\mathcal{D}_m$ -BOCD is linear in the data, it is quadratic in the dimension of the observations, in particular, is $\mathcal{O}(T(p^2 + d^2))$ . To observe this in practice, we consider the same settings as before, but now we fix the sample size to $T = 100$ and vary the data dimensions from $d = 1$ up to $d = 500$ . Figure 8b shows that both methods take practically the same time when $d$ is less than 100.
708
+
709
+ ![](images/1e71567c0b9a5cb6b6b42f1013730f093f583c78e28739fe5a0f8eb3fa844963.jpg)
710
+ (a) Overall time in seconds versus number of observations. We observe that both methods are equally fast for any number of observations.
711
+
712
+ ![](images/85e88309c8af3c9748248e0c586b4e542f1cfb2b4183dd00afa76a9d1f11e85a.jpg)
713
+ (b) Overall time in seconds versus the dimension of the observations. We observe that both methods are practically equally fast when the dimension of the observations is less than 100.
714
+ Figure 8. Comparison between $\mathcal{D}_m$ -BOCD and the standard BOCD. blue line for $\mathcal{D}_m$ -BOCD, and green line for standard BOCD.
715
+
716
+ The previous setting is where $\mathcal{D}_m$ -BOCD clearly shows its advantage over the $\beta$ -BOCD due to its completely closed form, making it nearly equivalent, in terms of computational overhead, to standard BOCD. In more complex settings, the posterior predictive may not be available in closed form; hence, we approximate it by sampling from $\pi_{\omega}^{\mathcal{D}_m}$ . It might not be obvious how this is a significant advantage over the $\beta$ -BOCD framework. To demonstrate that $\mathcal{D}_m$ -BOCD is faster than $\beta$ -BOCD, we generate samples from a Gaussian distribution with 1 CP, where the mean and the variance change. We vary the sample size from $T = 100$ to $T = 20000$ and fit a Gaussian distribution in the $\mathcal{D}_m$ -BOCD, $\beta$ -BOCD and the standard BOCD. In Figure 9, we observe that although the standard BOCD is faster than $\mathcal{D}_m$ -BOCD, our method is considerably faster than the $\beta$ -BOCD for any number of observations.
717
+
718
+ ![](images/1a99220897b2e2cc59c8248c1a1099c57d388f5b2b750dd7771fbcbe04360022.jpg)
719
+ Figure 9. Overall time in seconds versus the number of observations. blue line for $\mathcal{D}_m$ -BOCD, orange line for $\beta$ -BOCD, and green line for standard BOCD. We observe that our method is faster than $\beta$ -BOCD but is slower than the standard BOCD.
720
+
721
+ # C.2. Varying $m, k$ , and outliers intensity.
722
+
723
+ We have demonstrated that our method is insensitive to the scale of the outliers. To do so, we compare the performance of the standard BOCD with the $\mathcal{D}_m$ -BOCD in different contaminated datasets: while everything else stays the same, we scale the contamination points. We generate 600 samples with 6 CPs at $T \in \{200, 400\}$ , and 3 contaminated point at $T \in \{100, 300, 500\}$ . We contaminate the data by adding (or subtracting) 0, 5, 10, 20, and 40. For the $\mathcal{D}_m$ -BOCD, we choose two different $m$ functions: $m$ as proposed to assure robustness, and $m = I_d$ . In Figure 10, we observe that both Standard BOCD and $\mathcal{D}_m$ -BOCD with $m = I_d$ mistakenly label outliers as CPs, while $\mathcal{D}_m$ -BOCD with $m$ robust is robust and identifies lasting changes.
724
+
725
+ ![](images/aafb595a194359981f690c2d009f5780fd3a54101f271774e3a1610645385854.jpg)
726
+ Figure 10. Contamination point scaled by 0, 5, 10, 20, and 40, from top to bottom. MAP segmentation indicated by blue dashed lines for $\mathcal{D}_m$ -BOCD with $m$ robust, $\nabla$ for $\mathcal{D}_m$ -BOCD with $m = I_d$ , and $\triangle$ for standard BOCD. Both Standard BOCD and $\mathcal{D}_m$ -BOCD with $m = I_d$ mistakenly label outliers as CPs, while $DSM_m$ -BOCD with $m$ robust is robust and identifies lasting changes.
727
+
728
+ Finally, for contamination scaled by 10, we compared the performance and wall-clock time for $k \in \{1,50,600\}$ . In Figure 11, we observe that for $k = 1$ the method cannot detect any changepoint, while for $k = 50$ and $k = 600$ , the method successfully identifies the changepoints. However, in Table 2 for $k = 600$ , the method takes 6x more time. As we discussed in the main paper, $k$ is a parameter in all variants of BOCD and will make all algorithms more expensive if increased.
729
+
730
+ ![](images/37cffe3d9eb8d71fc6b75782cad0bacded6c37817a9a12a945581967e6188e5c.jpg)
731
+ Figure 11. MAP segmentation indicated by blue dashed lines for $\mathcal{D}_m$ -BOCD with $m$ robust. For $k = 1$ the method cannot detect any changepoint, while for $k = 50$ and $k = 600$ , the method successfully identifies the changepoints
732
+
733
+ <table><tr><td>k</td><td>time [s]</td></tr><tr><td>1</td><td>1</td></tr><tr><td>50</td><td>38</td></tr><tr><td>600</td><td>236</td></tr></table>
734
+
735
+ # C.3. Accuracy and detection delay
736
+
737
+ We quantify the method's performance advantage by comparing detection delay and accuracy on artificially generated data with outliers. In particular, We generate 600 samples with $2\%$ of outliers and 6 CPs; then, we report the positive predictive value (PPV), true positive rate (TPR), and the detection delays. These metrics are given by
738
+
739
+ $$
740
+ \mathrm {T P R} = \frac {\mathrm {T P}}{\mathrm {T P} + \mathrm {F N}}, \quad \mathrm {P P V} = \frac {\mathrm {T P}}{\mathrm {T P} + \mathrm {F P}},
741
+ $$
742
+
743
+ where TP, FP, and FN are true positives, false positives, and false negatives, respectively. We say the method detects a TP changepoint when the changepoint detected for the method is in a small neighbourhood of the true CP. In order to measure how far the predicted CP is from the true CP, we measure the time difference between both and call it detection delay. For both PPV and TPR, the nearest to 1, the better. For delays, the lower, the better. We run the experiment 10 times, varying the position of the outliers. The following table shows the mean and standard deviation for each metric:
744
+
745
+ Table 2. Wall-clock time for varying $k$
746
+
747
+ <table><tr><td>Method</td><td>PPV</td><td>TPR</td><td>Delays</td></tr><tr><td>DSM-BOCD</td><td>0.907±0.154</td><td>0.883±0.13</td><td>1.643±0.475</td></tr><tr><td>Standard BOCD</td><td>0.6±0.128</td><td>0.833±0.149</td><td>1.05±1.545</td></tr></table>
748
+
749
+ Table 3. Performance indices-mean and standard deviation-using the positive predictive value (PPV), true positive rate (TPR), and the detection delays over 10 realisations. For PPV and TPR, the nearest to 1, the better. For delays, the lower, the better.
750
+
751
+ In Table 3, we observe $\mathcal{D}_m$ -BOCD has a significantly better performance with respect to PPV, meaning that the rate of false positives is lower than standard BOCD. This is a consequence of the robustness of our method. Moreover, we see a similar result concerning TPR, which measures the amount of changepoint not detected for the methods. Overall, this means that our method detects the same amount of TP as the standard BOCD while not detecting many FP, showing the strength of our
752
+
753
+ method. Lastly, the detection delay shows that in spite of being robust to outliers, $\mathcal{D}_m$ -BOCD does not cause any delay in the detection of CP.
754
+
755
+ # C.4. Twitter flash crash & Cryptocrash
756
+
757
+ In the Twitter flash crash experiment, we model the data with a Gaussian distribution, modelling its natural parameters. For $\mathcal{D}_m$ -BOCD, we use a conjugate squared exponential prior $r$ with parameters $\mu = (0,1)^{\top}$ , and $\Sigma$ a diagonal matrix so that $\mathrm{diag}(\Sigma) = (10,1)$ for the natural parameters of said Gaussian. For standard BOCD, we use a Normal-inverse gamma prior with parameters $\mu_0 = 0$ , $\nu = 1$ , $\alpha = 2$ and $\beta = 10$ . We use the first 50 observations to select $\omega$ as in Section 3.4, with an obtained value of $\omega^{\star} \approx 0.0001$
758
+
759
+ In the Cryptcrash experiment, we model the data with a multivariate Gaussian distribution modelling its natural parameters, and use conjugate squared exponential prior with parameters $\mu = (0,1,0,1)^{\top}$ , and $\Sigma$ diagonal matrix such that $\mathrm{diag}(\Sigma) = (2,1,2,1)$ for the $\mathcal{D}_m$ -BOCD. For standard BOCD, we model mean and variance instead, and use a normal-inverse-Wishart prior with parameters $\nu = 0$ , $\kappa = 1$ , $\mu = (0,0)$ and $\Psi$ diagonal matrix such that $\mathrm{diag}(\Psi) = (1,1)$ . We manually fix $\omega = 0.01$ . Figure 12 shows the run-length posteriors and the Maximum A Posteriori (MAP) segmentations produced by each method. Since the most likely run-lengths are virtually identical, the below plot also shows that in spite of being robust to outliers, $\mathcal{D}_m$ -BOCD does not cause any delay in the detection of CPs.
760
+
761
+ ![](images/68c1b60534ad4df2a59c189c596fb0ae9873ae60bff37d700229726cc46a863d.jpg)
762
+ Figure 12. Maximum a posteriori (MAP) segmentation. In blue $\mathcal{D}$ -BOCD segmentation using dashed lines. In green Standard BOCD segmentation using $\triangle$ marks. In addition we plot the run-length posteriors of robust $\mathcal{D}_m$ -BOCD algorithm with most likely run-length in blue and of standard BOCD in green. We observe that robustness does not lead to increased CP detection latency: both methods detect the CP at the same time.
763
+
764
+ # C.5. Well-log
765
+
766
+ We model the data with a Gaussian distribution, modelling its natural parameters and using a conjugate squared exponential prior with parameters $\mu = (0,10)^{\top}$ , and $\Sigma$ diagonal matrix such that $\mathrm{diag}(\Sigma) = (100,100)$ . Figure 13 shows the run-length and the segmentation of each method. We use the first 200 observations to select $\omega$ as in Section 3.4, with an obtained value of $\omega^{\star} \approx 0.0004$
767
+
768
+ # C.6. Multivariate synthetic data
769
+
770
+ We generate 1000 samples from a time series with CPs at $t = 250, 750$ . Conditional on the CPs, the data is generated independently from an exponential in the first a and Gaussian distribution in the second dimension. Since both dimensions are exponential family members, their joint distribution is too. On the natural parameters of this joint distribution, we place a conjugate squared exponential prior with parameters $\mu = (1, 0, 0.5)^{\top}$ , and $\Sigma$ diagonal matrix such that $\mathrm{diag}(\Sigma) = (1, 1, 0.2)$ . As we do not compare against BOCD on this data set, we simply fix $\omega^{\star} = 0.15$ .
771
+
772
+ # C.7. UK 10 year government bond yield
773
+
774
+ We model the data with a Gamma distribution and use a conjugate squared exponential prior with parameters $\mu = (0,1)^{\top}$ and $\Sigma$ diagonal matrix such that $\mathrm{diag}(\Sigma) = (50,3)$ on its natural parameters. We use the first 100 observations to select $\omega$ as in 3.4. The obtained value is $\omega^{\star} \approx 0.05$ .
775
+
776
+ ![](images/fc24d2a7af455ec76dcd20f0719f556295138d6d1df4b4dcce7e9cdcf805fa95.jpg)
777
+ Figure 13. AP segmentation for the well-log indicated by blue dashed lines for $\mathcal{D}_m$ -BOCD, $\nabla$ for $\beta$ -BOCD, and $\triangle$ for standard BOCD. In addition we plot the run-length posteriors of robust $\mathcal{D}_m$ -BOCD algorithm with most likely run-length in blue, $\beta$ -BOCD in orange, and of standard BOCD in green. We observe that our method is more robust to outliers than the standard BOCD, but is more sensitive than $\beta$ -BOCD.
robustandscalablebayesianonlinechangepointdetection/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d716753554c1326edd7d664e1189113b20bfd4138ae168c092ff4bc08f4c2923
3
+ size 1138727
robustandscalablebayesianonlinechangepointdetection/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6aac910b0f56cdd168c8f6bc4ce970d5b41e2205773818a2ab1698f1bc0bd0c1
3
+ size 1104058
robustspeechrecognitionvialargescaleweaksupervision/b3f20327-83e0-4044-9a41-bbdeea913ab0_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc5810cb845b1df04e6ad0221880f659aa5ae78c9c9dae7213e756c85c2c8d21
3
+ size 176167
robustspeechrecognitionvialargescaleweaksupervision/b3f20327-83e0-4044-9a41-bbdeea913ab0_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d5df4fd7ffe25a825f0afe836c3308b0b9fdba905c667cf7ba59e8c02c097d0
3
+ size 214308
robustspeechrecognitionvialargescaleweaksupervision/b3f20327-83e0-4044-9a41-bbdeea913ab0_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2232845d3925fd310f4a93e9be449bac3dc0ab43165156550d0cdcadfeb3d682
3
+ size 902268
robustspeechrecognitionvialargescaleweaksupervision/full.md ADDED
The diff for this file is too large to render. See raw diff
 
robustspeechrecognitionvialargescaleweaksupervision/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa720f0afe1f4428aa399726543a5dad1b2f63a2971416d676e004925901be0e
3
+ size 2060419
robustspeechrecognitionvialargescaleweaksupervision/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e15c8d3b64820fd94ba3eec564ac04ad90eeca91969027a25a3b4164ed2b1e6f
3
+ size 676534
robustweightsignaturesgainingrobustnessaseasyaspatchingweights/9d953e7c-7753-4ab0-8358-39ad3f14a591_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:68972b0f532a3515fe9329171cc7b8e38d2858091dc3473baf05415671321eb1
3
+ size 95719
robustweightsignaturesgainingrobustnessaseasyaspatchingweights/9d953e7c-7753-4ab0-8358-39ad3f14a591_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8b38c3ee936f59881e0b33966f153c17cd37328cb0f09c12ba777eec64e24c83
3
+ size 117076
robustweightsignaturesgainingrobustnessaseasyaspatchingweights/9d953e7c-7753-4ab0-8358-39ad3f14a591_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:142db80d9f0afd4b2256ca8462fb05bd231d5ed9fc64dbf03d2897b8b3f98462
3
+ size 2488104
robustweightsignaturesgainingrobustnessaseasyaspatchingweights/full.md ADDED
@@ -0,0 +1,340 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Robust Weight Signatures: Gaining Robustness as Easy as Patching Weights?
2
+
3
+ Ruisi Cai<sup>1</sup> Zhenyu Zhang<sup>1</sup> Zhangyang Wang<sup>1</sup>
4
+
5
+ $^{1}$ VITA Group, University of Texas at Austin
6
+
7
+ https://github.com/VITA-Group/Robust.Weight_Signatures
8
+
9
+ # Abstract
10
+
11
+ Given a robust model trained to be resilient to one or multiple types of distribution shifts (e.g., natural image corruptions), how is that "robustness" encoded in the model weights, and how easily can it be disentangled and/or "zero-shot" transferred to some other models? This paper empirically suggests a surprisingly simple answer: linearly - by straightforward model weight arithmetic! We start by drawing several key observations: (i) assuming that we train the same model architecture on both a clean dataset and its corrupted version, a comparison between the two resultant models shows their weights to mostly differ in shallow layers; (ii) the weight difference after projection, which we call "Robust Weight Signature" (RWS), appears to be discriminative and indicative of different corruption types; (iii) perhaps most strikingly, for the same corruption type, the RWSs obtained by one model architecture are highly consistent and transferable across different datasets.
12
+
13
+ Based on those RWS observations, we propose a minimalistic model robustness "patching" framework that carries a model trained on clean data together with its pre-extracted RWSs. In this way, injecting certain robustness to the model is reduced to directly adding the corresponding RWS to its weight. We experimentally verify our proposed framework to be remarkably (1) lightweight. since RWSs concentrate on the shallowest few layers and we further show they can be painlessly quantized, storing an RWS is up to 13 $\times$ more compact than storing the full weight copy; (2) in-situ adjustable. RWSs can be appended as needed and later taken off to restore the intact clean model. We further demonstrate one can
14
+
15
+ linearly re-scale the RWS to control the patched robustness strength; (3) composable. Multiple RWSs can be added simultaneously to patch more comprehensive robustness at once; and (4) transferable. Even when the clean model backbone is continually adapted or updated, RWSs remain as effective patches due to their outstanding cross-dataset transferability.
16
+
17
+ # 1. Introduction
18
+
19
+ # 1.1. Background and Related Work
20
+
21
+ The robustness and safety of machine learning models have become prevailing concerns for practitioners. Among many other possible forms of safety risks such as adversarial attacks (Madry et al., 2017; Zhang et al., 2019) and backdoor attacks (Goldblum et al., 2022), one concern of particular significance is the model's resilience against various distribution shifts from training data (Koh et al., 2021). For example, a computer vision model for autonomous driving or video surveillance could be trained on relatively "clean" and constrained data to achieve high performance on standard benchmarks. However, they are vulnerable to unforeseen distributional changes including natural corruptions (e.g., due to camera noise, motion blur, adverse weather), sensory perturbations (e.g., sensor transient error, electromagnetic interference), and larger domain shift forms (e.g., summer $\rightarrow$ winter, daytime $\rightarrow$ night) - hence jeopardizing their trustworthiness and safe deployment.
22
+
23
+ Many solutions have since been examined to strengthen the models' robustness against unforeseen distribution shifts, in particular natural image corruptions - which would be the focus of this paper. Examples include data augmentation (Hendrycks et al., 2021; 2019b; Rusak et al., 2020; Wang et al., 2021), stability-aware training (Hein & Andriushchenko, 2017; Zheng et al., 2016), leveraging pretrained models (Hendrycks et al., 2019a; Chen et al., 2020; Jiang et al., 2020; Sun et al., 2021; Wortsman et al., 2022b) or training on larger and more diverse datasets (Taori et al., 2020; Nguyen et al., 2022). Among them, data augmentation is perhaps the most popular practice, as it is easy to
24
+
25
+ implement and plug in. It also remains as the most empirically effective approach to gain comprehensive robustness to various natural corruptions (Hendrycks et al., 2019b; Wang et al., 2021), though at the cost of training time overhead.
26
+
27
+ Further complicating the problem is the inherent "trade-off" between model standard accuracy and robustness, informally: the more "comprehensive" robustness that a model strives to cover, the less "focused" it can fit the standard clean data distribution. Firstly observed in (Tsipras et al., 2019), the authors pointed out that adversarial training (AT) (Madry et al., 2018), which utilizes adversarial samples as a special data augmentation method, has also shown to improve model robustness yet sacrificing the standard accuracy on clean images. The same trade-off observation holds generally true for other data augmentation and stability-aware training methods (Wang et al., 2021), essentially reflecting the "bias-variance" trade-off. Practically, most defense methods determine their accuracy-robustness trade-off by some empirically hyper-parameter pre-chosen at training, such as the coefficient weight between the standard and robust classification losses for AT, or the strength of data augmentations. Such methods will hence "pre-fix" achievable standard and robust accuracies at training time, leaving no flexibility to adjust for testing even if there is a demand.
28
+
29
+ In practical AI platforms especially at the edge, the desired trade-off between standard and robust accuracies often varies adaptively depending on contexts, which are not always met by the pre-fixed "default" settings. For example, an autonomous agent might perceive using its "standard" mode for normal-environment operations (most of the time), but switch to behaving more conservatively such as when placed in less familiar or adverse environments. Re-training the model, especially robustly, is notoriously resource-consuming and impossible for in-situ adjustment. Hence practitioners look for convenient means to explore and flexibly calibrate the accuracy-robustness trade-off at the testing time. Test-time adaption (Fleuret et al., 2021; Croce et al., 2022) or ensembling (Liu et al., 2018) methods, though effective, will turn impractical when memory and storage are in limited supply or the inference latency is sensitive. The recent "once-for-all" AT methods (Wang et al., 2020; Kundu et al., 2023) enable the network to adjust to different input distributions nearly free of overheads, by input-conditioning. However, all aforementioned methods would compromise the achievable clean accuracy more or less, in exchange for encapsulating more robustness in the same model. Also most of them focus on adversarial attacks.
30
+
31
+ # 1.2. Our Aim and Contributions
32
+
33
+ This paper targets the "in-situ" adaptive robustness similarly as defined in (Wang et al., 2020; Kundu et al., 2023), i.e., to painlessly calibrate on the accuracy-robustness trade-off at
34
+
35
+ ![](images/bab746066a863899cbd0134302fb563fe652db5e81e0b314fe7f33dba2cefcb5.jpg)
36
+ Figure 1. Overview of our pipeline: Step (I): Extract Robust Weight Signatures (RWSs) by comparing the difference between robust models and standard models of shallow layers in the weight space. Step (II): Patch non-robust models by RWSs as needed.
37
+
38
+ the test time, with minimal overhead in latency or memory. Our problem setting and goal will yet differ in (1) focusing on the comprehensive robustness against unforeseen natural image corruptions (not adversarial attacks); and (2) not impairing the standard accuracy on clean test images at all.
39
+
40
+ Our proposal is a minimalistic model robustness "patching" framework that differs remarkably from the aforementioned efforts. We are inspired by the recent findings on the linear interpolatability between model weights (such as pre-trained and fine-tuned) (Wortsman et al., 2022a; b; Li et al., 2022; Ilharco et al., 2022a). Contrary to the common wisdom of model output ensembling, (Wortsman et al., 2022a) pioneered averaging the weights of multiple fine-tuned models directly, without incurring any additional inference or memory costs, that yield significantly improved "zero-shot" and out-of-distribution generalization performance. Most relevantly, (Ilharco et al., 2022a) demonstrated that such model weight "arithmetic" can go beyond averaging: by computing the weight difference between a pre-trained model and its downstream-task fine-tuned version (called a "task vector"); the resulting task vectors are noted to meaningfully steer the behavior of neural networks: they can be modified and combined together through arithmetic operations such as negation and addition, e.g., adding multiple task vectors together can improve performance on multiple tasks at once.
41
+
42
+ In view of those, we ask: in a robust model, how is that "robustness" encoded in the model weight space, and how can it be decoded, combined, or transferred? How would that further help our in-situ adaptive robustness goal? Given a standard model (trained on clean data) and its robust counterpart (trained on corrupted versions of the same dataset), we compare their difference to extract the "Robust Weight Signature" (RWS). It turns out that RWS lends a surprisingly
43
+
44
+ ![](images/e88a4653e3babf7487209a2d4229526819193e85b213851211cbe6c4d52f1619.jpg)
45
+ Figure 2. On TinyImageNet and VGG-16, we visualize $\ell_2$ norms of RWSs for each convolutional layer, indicating the non-robust models and robust models mainly differ in the shallow layers.
46
+
47
+ effective, elegantly simple and flexible means to achieve in-situ robustness, due to the following novel findings:
48
+
49
+ - Assuming a model trained on clean data together with its pre-extracted RWSs to multiple image corruption types, "patching" certain robustness to the model is reduced to directly adding the corresponding RWS to its weight. Any appended RWS can be later taken off to switch back to the intact clean model: hence there is no compromise of standard accuracy.
50
+ - RWSs are highly compressible since their large-magnitude elements are dominantly in the lower layers. We further show them to be robust to quantization as well. Hence storing an RWS is up to $13 \times$ more compact than the full weight copy, mitigating the storage burden of carrying multiple pre-trained models.
51
+ - RWSs are extraordinarily controllable and combinable: one can linearly re-scale an RWS to control the patched robustness strength. Multiple RWSs can be added simultaneously to patch more comprehensive robustness at once. Essentially, we demonstrate the task "arithmetic" claims in (Ilharco et al., 2022a) to be generally valid for multiple robustness types as well.
52
+ - Lastly and uniquely, we find that an RWS is not tied with the standard model where it is subtracted. That is, when the standard model is updated, continually adapted, or even completely re-trained on a different dataset, the RWS seems to be the same applicable to the new model (same architecture). Such outstanding cross-data transferability decouples the standard model updating and robustness preservation, potentially saving training costs and boosting weight re-usability.
53
+
54
+ In what follows, we accompany our claims with experimental results, showing that RWSs extensively improve model robustness to various natural image corruptions in a plug-and-play manner, while demonstrating to be lightweight, in-situ adjustable, composable, and transferrable.
55
+
56
+ # 2. Robust Weight Signatures: Concept Proofs
57
+
58
+ # 2.1. Definition and Notations
59
+
60
+ We compare non-robust and robust models in the weight space, to investigate how robustness is encoded. To begin with, model providers train a standard model $\theta_{\mathrm{std}} \in \mathbb{R}^d$ on a clean dataset, and multiple robust counterparts $\theta_r^c \in \mathbb{R}^d$ , each with corruption type $c$ , from the same initialization $\theta_{\mathrm{init}} \in \mathbb{R}^d$ used by $\theta_{\mathrm{std}}$ . We denote $\theta_{\mathrm{std}} - \theta_{\mathrm{init}}$ as the base direction $v_{\mathrm{base}}$ , which contains knowledge of fitting standard dataset. For each corruption type $c$ , we similarly compute the robustifying direction $v_c = \theta_r^c - \theta_{\mathrm{init}}$ , which is assumed to contain the knowledge of resilience against corruption $c$ . We then disentangle the robustness-part knowledge with the standard dataset-fitting knowledge, by subtracting $v_c$ 's projection on $v_{\mathrm{base}}$ , from $v_c$ itself. We refer to the obtained residual vector as a robust weight signature (RWS):
61
+
62
+ $$
63
+ \mathbf {R W S} _ {c} = v _ {c} - P _ {v _ {\text {b a s e}}} \left(v _ {c}\right), \tag {1}
64
+ $$
65
+
66
+ where $P_{v_{base}}(v_c)$ denotes the projection operator from $v_c$ onto the column space of $v_{base}$ , implemented by matrix pseudoinverse. The process of extracting RWS is also illustrated in the upper Figure 1.
67
+
68
+ Note that the projection-residual idea implies the (somewhat gross) assumption that the "standard fitting knowledge" and "robustness knowledge" are encoded nearly orthogonally in the robust model weights. The use of projection $P_{v_{base}}$ also goes beyond the vanilla weight arithmetic regime in (Ilharco et al., 2022a) who simply subtract one weight from the other: we also tried the same and find it unable to extract effective RWSs (especially poor in composition). We conjecture that is because the weight gap between {pre-trained, fine-tuned} models (Ilharco et al., 2022a) is either smaller or more linearly connected, compared to the weight gap between {standard, robust} models in our case. We leave the verification of these two open thoughts as future work.
69
+
70
+ Besides the above, we point out two other substantial differences between our RWSs and "task vectors" in (Ilharco et al., 2022a). Firstly, RWSs exhibit a compact and compressible structure (Sec. 2.2) which was not observed in task arithmetic (Ilharco et al., 2022a). Secondly, we observe RWSs to be consistent and transferrable across datasets (Sec 2.4), echoing our conjecture that robustness is perhaps encoded relatively independently of standard dataset content: the finding has no counterpart in (Ilharco et al., 2022a) either.
71
+
72
+ Experimental Details. We use three datasets, CIFAR-10, CIFAR-100 (Krizhevsky et al., 2009) and Tiny-ImageNet (mnmoustafa, 2017), with two model architectures, VGG-16 (Simonyan & Zisserman, 2014) and ResNet-50 (He et al., 2016). By default, we obtain a robust model, by training with the corresponding type of data augmentations applied to the clean dataset. All VGG-16 models use a learning rate
73
+
74
+ ![](images/28d688e8a333b5621f113b50b8eadb59cb012c81c4bf8372e85bbcf0f6cc3dd5.jpg)
75
+ (1)
76
+
77
+ ![](images/33c1dc33635b4e860626460b192410845803b09e9659ac446a6c73196c8ccf9e.jpg)
78
+ (II)
79
+
80
+ ![](images/314338a79f366204bd931edc7bb15a4363db4fd7e3ed5002a7557f8e63e5f596.jpg)
81
+ (III)
82
+
83
+ ![](images/8d366ba85928ba83a935db2d92cb290ccd2a1cac9e46e0f58d5840339814d2ec.jpg)
84
+ (IV)
85
+
86
+ ![](images/a1fda7044e6128cdd851d343febaa4565923efdb025c2f0664d932387d1e624c.jpg)
87
+ (V)
88
+
89
+ ![](images/3307e1f857e891dd360a4401e4a2b3ebd58763ce49f9d3441cb46bb62da4a204.jpg)
90
+ (VI)
91
+
92
+ ![](images/259879055f6e4c8aaf9181fb6f1520b9a7910bf30d9a378d989e658e901c205b.jpg)
93
+ (VII)
94
+
95
+ ![](images/909b6e3c924101ef72138151025d0769ae6f76ed3cb42e3d8bc13c49cdafd4fe.jpg)
96
+ (VIII)
97
+
98
+ ![](images/6c8775ad2268814ba40707b0bfcdde4ef81c2489791320b2131a7e33cdcb545b.jpg)
99
+ (IX)
100
+ Figure 3. Based on TinyImageNet and VGG-16, we visualize cosine similarities between different types of corruptions, at different layers. Lighter colors indicate smaller cosine similarities. The roman numbers refer to the corresponding layer indexes. RWSs of different corruption types are significantly more diverse in shallow layers.
101
+
102
+ ![](images/66050b27c480e4f64ba2d15955359a3fe857b80a1dd21f73e6f3add71a0f003e.jpg)
103
+ (X)
104
+
105
+ ![](images/53f872c0035f1300bcffc30e136dc67421b39e3da0eab89734555b556741d68d.jpg)
106
+ (XI)
107
+
108
+ ![](images/e386723f38e797ffd73c986fca9323ff82bb7bc99b0e0fec37688e352cc77c3d.jpg)
109
+ (XII)
110
+
111
+ of 0.01, while all ResNet-50 models use 0.001. We follow the corruption types in (Hendrycks & Dietterich, 2019b) and the corruption severity levels are set to be 5 (strongest) for all experiments by default. Intentionally, neither adversarial training nor more compositional augmentation was involved, because we want to "purify" each RWS to cater to one corruption type, facilitating our later experiments to demonstrate their controllability and composition.
112
+
113
+ For the choice of common initialization $\theta_{\mathrm{init}}$ , we found that the same random initialization did not suffice to manifest the RWS phenomenon. That is understandable: compared to fine-tuning the same pre-trained model (Ilharco et al., 2022a), two models trained (standard or robustly) from scratch could be far away in their weight space, even using the same initialization and dataset, due to many randomness factors in the much longer training process. To "anchor" the standard and robust model weights to be meaningfully close for RWS extraction, we explored two strategies: (1) use an ImageNet pre-trained model as $\theta_{\mathrm{init}}$ , and train both standard and robust models from there; (2) first train a standard model from scratch, and use it as $\theta_{\mathrm{init}}$ to train all other robust models from. Both are found to expose RWSs much better and more stably, and we report results from the first option by default due to its superior cross-dataset transferrability.
114
+
115
+ # 2.2. RWSs are Concentrated in Shallow Layers
116
+
117
+ Intuitively, many image corruption artifacts interfere with the low-level features, inviting the natural guess: whether the corruption fragility of standard models, and correspondingly the robustness to them encoded by robust models, are mainly encoded in shallow layers. Prior works have presented relevant findings. For example, (Huang et al., 2021) observed that more parameters can improve robustness only
118
+
119
+ when added to the shallow layers. We experimentally validate the hypothesis to be explicitly true.
120
+
121
+ Figures 2 and 3 visualize the norms (normalized to the same layer's standard weight norm, averaged across all corruption types) and diversities (cosine similarity across different corruption types) of RWSs from each layer. Overall, RWSs at shallower layers are (i) significantly larger in norm. For example, the first five layers occupy more than $65\%$ of total norm energy for RWSs extracted from VGG-16 on TinyImagenet; (ii) significantly more diverse and discriminative between corruption types. Both observations imply that RWSs are more "informative" in shallow layers.
122
+
123
+ In all experiments hereinafter, we use RWSs in the shallowest five layers by default. This also leads us to aggressively compress RWSs in Sec 3.1 for lightweight patching.
124
+
125
+ # 2.3. RWSs Recover Corruption Relationships
126
+
127
+ We now take a deeper dive from Figure 3, noting that different natural corruption types are not irrelevant. Instead, corruptions are roughly categorized into four groups: noise, blur, weather and digital (Hendrycks & Dietterich, 2019b). (Yin et al., 2019) also found that different corruptions related to different frequency domains. Corruptions within the same group category or frequency range are more similar, and the robustness against one corruption tends to help defend its similar ones too. On the contrary, different categories of corruptions may even offset each other's robustness.
128
+
129
+ Interestingly, RWSs successfully recover the relations of different corruption types. Figure 4 (left) visualizes the cosine similarities between RWS of different corruption types, which reflect the grouping identified in (Hendrycks & Dietterich, 2019b). We also visualize the robust accuracy gains to all other corruptions, when a robust model is trained
130
+
131
+ solely on one corruption type and then directly tested on other types: the results in Figure 4 (right) echo the former.
132
+
133
+ ![](images/50e76e32ce4cdc081827348b7a06d4dc1e38fd82cf1a6b30a4814e1b53d15dbc.jpg)
134
+ Figure 4. Left: cosine similarities between RWSs of different corruption types. Right: the robust accuracy gains to all other corruptions, between a robust model trained solely on one corruption type and then tested on other types, and a standard model directly applied. For example, each element in the row 'defocus blur' denotes the robust model trained with defocus blur and tested on other corruption types (column) - how much accuracy improvement or loss it will exhibit compared to the standard model. We use TinyImageNet with VGG-16.
135
+
136
+ ![](images/053a80b0cfe5661cd315ed1c3086b885f5fb4a81d8995af4764fb58d29484f0b.jpg)
137
+ Figure 5. Same-corruption (orange circles) and cross-corruption cosine similarities (green circles) between RWSs extracted from: (left) CIFAR-10 & CIFAR-10; (middle) CIFAR-10 & CIFAR-100; (right) CIFAR-10 & TinyImageNet. The same-corruption similarity is computed between RWSs found on two datasets but of the same corruption type. The cross-corruption similarity is computed as the average of cosine similarities between the current corruption type's RWS, and every other type's RWS.
138
+
139
+ # 2.4. RWSs are Relatively Consistent across Datasets
140
+
141
+ Now one more step further: we compare RWSs generated from different datasets. We are hopeful because of the (gross) assumption made back in Sec. 2.1: the standard fitting and the robustness are relatively independent in weights. Figure 5 partially confirms our hypothesis that RWS found from different datasets are relatively consistent.
142
+
143
+ We first notice the same-corruption RWS cosine similarities across datasets to be consistently high. For example, between CIFAR-10 and CIFAR-100 (Figure 5 middle subfigure), all same-corruption similarities are larger than 0.5, and some reach 0.8. Even comparing CIFAR-10 and TinyImageNet (right) whose dataset statistics vary a lot, the same-corruption similarities are still all above 0.3 and sometimes reach 0.5. That implies the potential existence of
144
+
145
+ "universal model robustifying directions" which is even ag- nostic to standard model weights.
146
+
147
+ On the other hand, the cross-corruption similarities remain consistent in the value range (most between 0.1 and 0.2), and more importantly, seem to preserve the relative similarity "ranking" to some extent. For example, 'Impulse noise' and 'Saturate' have constantly the lowest cross-corruption similarities with others, while 'Zoom blur' 'Forst' 'Defocus Blur' 'Gaussian Blur' and 'JPEG compression' are some of the consistent top rankers. We should note that this ranking consistency is imperfect: for example, 'Gaussian Noise' is a high-ranker in the left and middle subfigures, but low on the right; while 'Contrast' makes a vice versa case.
148
+
149
+ # 3. An In-Situ Robustness Patching Framework
150
+
151
+ Back to the main problem: how to achieve in-situ robustness? The aforementioned characteristics indicate the RWS involves discriminative and generalizable robust features, lending itself a promising option for direct weight patching on non-robust standard models. Given a standard model (trained on clean data) and its multiple robust counterparts (each trained on a corrupted version of the same dataset), we can store a single standard model and multiple RWSs. When needed, the robustness patching could be done immediately, by adding an RWS on standard model weight to create a patched model $\theta_{\text{patch}}^c$ with extra robustness on corruption $c$ :
152
+
153
+ $$
154
+ \theta_ {\text {p a t c h}} ^ {c} = \theta_ {\text {s t d}} + \alpha * \mathbf {R W S} _ {c} \tag {2}
155
+ $$
156
+
157
+ The appended RWS can be taken off any time to switch back to the intact standard model: hence there is no compromise of standard accuracy. $\alpha$ is a coefficient to adjust the "strength" of the added robustness (Sec. 3.2), and the above equation could be extended to the weighted composition of multiple $\theta_{\mathrm{patch}}^c$ s with different corruptions $c$ (Sec. 3.3).
158
+
159
+ More Related Work on "Patching" We shall credit existing literature that has studied model patching or similar notions. In general, many efforts have been invested to efficiently for altering a model's behavior with post-training interventions, but without re-training. This stream of work may bear various names, such as patching (Goel et al., 2020; Ilharco et al., 2022b; Murty et al., 2022), editing (Mitchell et al., 2021; 2022; Santurkar et al., 2021), aligning (Askell et al., 2021; Kasirzadeh & Gabriel, 2022; Ouyang et al., 2022), debugging (Geva et al., 2022; Ribeiro & Lundberg, 2022; Ilyas et al., 2022), steering (Subramani et al., 2022), or reprogramming (Elsayed et al., 2018; Tsai et al., 2020; Hambardzumyan et al., 2021; Zhang et al., 2022). Those can operate on input, output, or weight levels, and many will take extra training or optimization steps. Several of them explored weight interpolation between a pre-trained model and its fine-tuned version, to either improve the fine-tuned model's distributional shift robustness (Wortsman et al.,
160
+
161
+ 2022b), or learn new specific tasks better without affecting other learned tasks (Ilharco et al., 2022b).
162
+
163
+ The most relevant work to us is the task vector arithmetic (Ilharco et al., 2022a), which uniquely adds, scales, deletes or composes model capabilities, by applying vectors in the weight space of pre-trained models. Their method is modular and efficient by re-using fine-tuned models, and does not modify the standard fine-tuning procedure. However, (Ilharco et al., 2022a) as well as (Wortsman et al., 2022b; Ilharco et al., 2022b) focus on the fine-tuning setting and rely on large pre-trained models, while ours dig into a brand-new context. In Sec. 2.1, we have also explained a few more differences between RWSs and task vectors in (Ilharco et al., 2022a), in both methodology and key findings.
164
+
165
+ Next, we present a series of experiments to demonstrate the key advantages of our patching, namely, lightweight, in-situ adjustable, composable, and transferrable.
166
+
167
+ # 3.1.Lightweight
168
+
169
+ The first sanity check question is: why not store multiple robust models directly, but their weight differences? The answer: those differences are much more compressible and incur much less storage overhead. The storage efficiency of RWS is achieved by two aspects: (1) as analyzed in Sec 2.2, we only use RWSs shallow layers, which usually contain much fewer parameters than latter layers; (2) we verify that RWS can further be compressed by quantization.
170
+
171
+ We follow the same setting in Sec 2.1 to construct RWSs and then follow Equation 2 to robustify the model. We set $\alpha$ as 1 by default. Our results are presented in Table 1. We provide several RWS options for patching standard models, including: (1) $\mathbf{RWS}_{\mathrm{full}}$ : RWSs from all layers are used. (2) $\mathbf{RWS}_{\mathrm{shallow}}$ : RWSs are only kept from the shallowest five layers (default). (3) $\mathbf{RWS}_{\mathrm{shallow},16\mathrm{bit}}$ : $\mathbf{RWS}_{\mathrm{shallow}}$ further quantized to 16 bit. (4) $\mathbf{RWS}_{\mathrm{shallow},8\mathrm{bit}}$ : $\mathbf{RWS}_{\mathrm{shallow}}$ further quantized to 8 bit. We also include three baselines: 'Standard' is the model trained on clean data only; 'Data Augmentation' is the robust model trained with all 19 corruption types seen as training data augmentations; and 'All Models' denotes the ensemble option, i.e., storing the standard model as well as 19 robust models (each dedicatedly trained with one corruption type) together. Note that 'All Models' baseline assumes always using the right dedicated model in each situation (clean, or one of the 19 corrupted). Hence it effectively makes the performance "upper bound" for all methods, though at the heaviest storage overhead. Meanwhile, 'Data Augmentation' substantially boosts the corruption robustness without any storage overhead, but sacrifices the clean data performance meanwhile.
172
+
173
+ All RWS variations show significant effectiveness in robustifying standard models while retaining/recovering the standard accuracy when taking off RWSs. $\mathbf{RWS}_{\mathrm{shallow},16\mathrm{bit}}$
174
+
175
+ achieve a decent trade-off between storage cost and robustness; with only $20\% \sim 40\%$ storage cost increment than 'Standard' or 'Data Augmentation', the method is able to (1) improve $30\% \sim 88\%$ averaged robustness gain across four cases, compared to the standard baseline; and (3) consistently outperform the 'Data Augmentation' baseline in achievable TA-RA trade-offs, $\mathbf{RWS}_{\mathrm{shallow},8\mathrm{bit}}$ further boosts the storage efficiency with small RA losses from 16-bit (especially, negligible on ResNet-50 + Tiny-ImageNet). More detailed comparisons and baseline results are in Appendix.
176
+
177
+ ![](images/8c649076da882f657ce5d5e6ad8c5a87602728a5f576af4e6e6bf40af9f80fce.jpg)
178
+
179
+ ![](images/13a59a1debd0de6524b1fb48810d7bc0adee16e5c6206126fe3a56610374402a.jpg)
180
+
181
+ ![](images/0293274462c9ae6821c5803b00785e8f5772d6fdc47a1c6a2cb0a8c29ae65a95.jpg)
182
+ Figure 6. Robustness trends (we select a few representative corruptions types) when altering the number of shallowest layers used for RWS construction. We also plot the used parameter ratios. We further alter the number of layers used for constructing RWS and plot the average robust accuracy of patched models (left bar of each subfigure), accompanied by the corresponding ratio of parameters participated (right bar). Figure 6 shows that: (1) the robustness of patched VGG models does not benefit from using more layers in extracting RWSs, and actually will be "backfired" when more latter layers are included; (2) ResNet models also see saturation effects on the robustness of most corruption types, after more than 5 layers are used. Both imply the high-level features have little to do with robustness encoding, and justify our design choice of using only the shallowest few layers.
183
+
184
+ ![](images/da2e5466cb978893a3e2138adaf73c2c4792aa60007cc03fb6183e0d737e5ab8.jpg)
185
+
186
+ # 3.2. In-Situ Adjustable
187
+
188
+ RWSs can be not only applied to patch a single robust model per corruption: they can even adapt to any corruption levels (e.g. different visibility in the fog weather) by linearly re-scaling, easily achieving the smooth trade-off between standard and robustness performances in one same model (note this is different from adding/taking off an RWS, which is essentially switching between two models). This can be achieved by adjusting the coefficient $\alpha \in [0,1]$ in Equation 2: essentially, that is interpolating the (shallow layers')
189
+
190
+ Table 1. Comparison of RWS-based methods and other options. We consider 19 corruption types in (Hendrycks & Dietterich, 2019b). "RA" refers to averaged accuracy on all kinds of corrupted data, while "TA" refers to the test accuracy in the standard setting. $N_{\mathrm{param}}$ denotes the total model storage size (in MBs). Note that in the RWS-based pipeline, we report "TA" for the model when the RWSs are taken off (hence fully recovering the standard model); and report "RA" when the corresponding RWS is patched per corruption. This is an ideal case of using RWS patching - and its rationale and limitations will be both discussed in Sec. 4. Similarly, as a fair comparison, the 'All Models' baseline assumes we always use the right dedicated standard/robust model in each clean/corrupted situation, too.
191
+
192
+ <table><tr><td rowspan="3">Methods</td><td colspan="3">CIFAR-10</td><td colspan="3">CIFAR-100</td><td colspan="6">Tiny-ImageNet</td></tr><tr><td colspan="3">VGG-16</td><td colspan="3">VGG-16</td><td colspan="3">VGG-16</td><td colspan="3">ResNet-50</td></tr><tr><td>Nparam (MB)</td><td>TA (%)</td><td>RA (%)</td><td>Nparam (MB)</td><td>TA (%)</td><td>RA (%)</td><td>Nparam (MB)</td><td>TA (%)</td><td>RA (%)</td><td>Nparam (MB)</td><td>TA (%)</td><td>RA (%)</td></tr><tr><td>Standard</td><td>58.8</td><td>92.59</td><td>65.44</td><td>58.8</td><td>71.44</td><td>36.76</td><td>59.2</td><td>61.28</td><td>23.58</td><td>95.7</td><td>65.72</td><td>29.65</td></tr><tr><td>Data Augmentation</td><td>58.8</td><td>89.58</td><td>84.34</td><td>58.8</td><td>67.34</td><td>56.95</td><td>59.2</td><td>52.11</td><td>43.64</td><td>95.7</td><td>59.17</td><td>47.96</td></tr><tr><td>All Models</td><td>1177.6 (20×)</td><td>92.59</td><td>88.97</td><td>1177.6 (20×)</td><td>71.44</td><td>64.72</td><td>1184.0 (20×)</td><td>61.28</td><td>51.55</td><td>1913.6 (20×)</td><td>65.72</td><td>55.97</td></tr><tr><td>Standard+RWSFull</td><td>1177.6 (20×)</td><td>92.59</td><td>75.35</td><td>1177.6 (20×)</td><td>71.44</td><td>52.58</td><td>1184.0 (20×)</td><td>61.28</td><td>43.63</td><td>1913.6 (20×)</td><td>65.72</td><td>53.64</td></tr><tr><td>Standard+RWSShallow</td><td>101.0 (1.7×)</td><td>92.59</td><td>84.86</td><td>101.0 (1.7×)</td><td>71.44</td><td>58.78</td><td>101.4 (1.7×)</td><td>61.28</td><td>44.66</td><td>131.4 (1.4×)</td><td>65.72</td><td>52.84</td></tr><tr><td>Standard+RWSShallow,16bits</td><td>79.9 (1.4×)</td><td>92.59</td><td>84.76</td><td>79.9 (1.4×)</td><td>71.44</td><td>58.62</td><td>80.3 (1.4×)</td><td>61.28</td><td>44.25</td><td>113.6 (1.2×)</td><td>65.72</td><td>52.81</td></tr><tr><td>Standard+RWSShallow,8bits</td><td>69.4 (1.2×)</td><td>92.59</td><td>82.99</td><td>69.4 (1.2×)</td><td>71.44</td><td>53.52</td><td>69.7 (1.2×)</td><td>61.28</td><td>39.40</td><td>104.7 (1.1×)</td><td>65.72</td><td>52.79</td></tr></table>
193
+
194
+ ![](images/d00d4c17759695e4c8f4109e65f836050ff212fb1d22a7b46cf749f282675b62.jpg)
195
+ Figure 7. Effect of $\alpha$ on the robustness of the patched model under different types and severity levels of corrupted data. Green bars, brown bars, dark brown bars represent clean accuracy, robust accuracy under the corruption of severity level 3, and robust accuracy under the corruption of severity level 5, respectively.
196
+
197
+ weights between the standard and robust models.
198
+
199
+ To validate, we test the patched model on corrupted data with different severity levels (as defined in (Hendrycks & Dietterich, 2019a)). As in Figure 7, for instance on CIFAR-10 and VGG-16, patched models always achieve the best performance at the severity level 5 (strongest corruptions) when $\alpha = 0.9$ or 1. When the severity level is set to 3, the patched model performs the best when $\alpha = 0.6$ . Meanwhile, the standard accuracy gracefully decays as $\alpha$ increases.
200
+
201
+ # 3.3. Composable
202
+
203
+ Usually, images do not just suffer from a single type of corruption. To resist compound natural corruptions, RWSs can also be linearly composed to form a model of multicorruption robustness, by extending Equation 2 to adding multiple RWSs, each with their own $\alpha$ s. The previous in
204
+
205
+ ![](images/e6a4555aaec612ba8937cce6b00d046395b8a9136f6edc1afd8e1e78714f4007.jpg)
206
+
207
+ ![](images/8f2c80c2e8f85affd2fd8224b0d5de0f031e180b032884d6b73b39d8335967a6.jpg)
208
+
209
+ ![](images/b468fdbeda37412e7ecac8970b679b888298a8c2fbcded3c51b5baa1aeab9945.jpg)
210
+ Figure 8. Visualization of robustness improvements when adding multiple RWSs together. On VGG-16 and Tiny-ImageNet, we add 4 different RWSs of "motion blur", "gaussian blur", "fog" and "contrast" together. By changing their coefficients, we can obtain robust models with different specialties, with minimal loss of clean accuracy and robustness on other corruption types.
211
+
212
+ ![](images/f628348f4fd48ab81239da0365d37e6ca739d7f0f788ab61c8ef5273d25989a0.jpg)
213
+
214
+ situ adjustment could also be seen as a special case. We can even control the linear combination coefficient to obtain models with different "robustness specialties". Figure 8 shows that by composing RWSs with different coefficients, one can construct a wide range of models with different strengths at simultaneously tackling diverse corruptions. That leads us to an "infinite pool" of possible models, by just re-composing a small pool of RWSs and no re-training.
215
+
216
+ The composable property of RWSs reminds the weight interpolation between two different models (Izmailov et al., 2018; Zhao et al., 2020; Ilharco et al., 2022b; Wortsman et al., 2022a;b; Choshen et al., 2022), yet composing natural corruption robustness seems a new theme. Note that though, the construction of RWSs needs to first remove the robust weight's projection onto the standard weight column space,
217
+
218
+ ![](images/3487c0749a6c49d7ff9eb7f96d0721cd2c1cb780b1fad6f9332ccd52e40de332.jpg)
219
+
220
+ ![](images/5f3ed8fd015eb9f1a7aef3bdcf0609ffe6d0133a41ea58dc9810cea6c2e6085e.jpg)
221
+
222
+ ![](images/1c1efce30219bbf65da9723bb040d5f49e915c522deaf5453123ffdcb2e930e1.jpg)
223
+ Figure 9. The comparison of the patched model and the standard model's feature maps given the same input sample shows our RWS patching method meaningfully equips the model with resistance to different types of corruptions.
224
+
225
+ ![](images/31c9e216fe53398868fb391de578a655454a0da9736382b65d127ad67b75ed4c.jpg)
226
+
227
+ Table 2. Robustness gains when applying RWSs extracted from small datasets (CIFAR-10, CIFAR-100, TinyImageNet) to full ImageNet models. Robust accuracy is evaluated on ImageNet and averaged on all kinds of corrupted data. All models use the VGG-16 architecture. DataAugmentation<sup>1</sup> use the same FLOPS as the overhead of extracting RWS based on CIFAR-10 models, while DataAugmentation<sup>2</sup> use the same FLOPS as the RWS extraction based on TinyImageNet models.
228
+
229
+ <table><tr><td>Method</td><td>Robust Accuracy (%)</td></tr><tr><td>Standard</td><td>11.14</td></tr><tr><td>DataAugmentation1</td><td>11.01 (↓ 0.13)</td></tr><tr><td>DataAugmentation2</td><td>14.52 (↑ 3.38)</td></tr><tr><td>Standard + RWS CIFAR-10</td><td>13.47 (↑ 2.33)</td></tr><tr><td>Standard + RWS CIFAR-100</td><td>14.55 (↑ 3.41)</td></tr><tr><td>Standard + RWS Tiny-Imagenet</td><td>17.53 (↑ 6.39)</td></tr></table>
230
+
231
+ hence composing RWSs does not naively equal interpolating their source robust model weights.
232
+
233
+ # 3.4. Transferable
234
+
235
+ Lastly, the cross-dataset consistency of RWSs as analyzed in Sec 2.4 motivates us to study if an RWS found from one dataset can be reused for the same architecture trained on a different dataset, to transfer robustness to the latter "for free". Table 3 confirms this possibility. Despite the training data domain shift of the standard model, RWSs stay effective for patching robustness in a "zero-shot" manner. Unsurprisingly also, smaller gaps will render the RWS
236
+
237
+ transfer more effective. For example, the robustness gain of CIFAR-100 by patching CIFAR-10 RWSs is clearly larger than the Tiny-ImageNet gain by patching the same.
238
+
239
+ In addition, the strong transferability implies the tantalizing possibility of gaining robustness efficiently by "transferring" RWSs from small to large datasets. Specifically, direct robust training with data augmentations on large datasets such as ImageNet can be resource-demanding. Instead, one can first extract RWSs by robust-training over smaller datasets (e.g. CIFAR-10 or TinyImageNet), and subsequently, transfer them to "patching" the same model architecture standard-trained on the target large dataset. The results, as presented in Table 2, demonstrate that the "out of the box" application of RWS can lead to significant gains in ImageNet robustness, especially when RWS is obtained from TinyImageNet (whose distribution is the most similar to ImageNet).
240
+
241
+ Table 3. Transferring RWSs across datasets. For three non-robust models trained on CIFAR-10, CIFAR-100 and Tiny/ImageNet (by columns), we patch RWSs generated from CIFAR-10, CIFAR-100, and Tiny/ImageNet (by rows), respectively, for injecting zero-shot robustness. The robust accuracies are averaged across 19 corruptions/19 RWSs. We use the VGG-16 model here.
242
+
243
+ <table><tr><td rowspan="2">Methods</td><td colspan="3">Robust Accuracy (%)</td></tr><tr><td>CIFAR-10</td><td>CIFAR-100</td><td>Tiny-ImageNet</td></tr><tr><td>Standard</td><td>65.44</td><td>36.76</td><td>23.58</td></tr><tr><td>Standard + RWS CIFAR-10</td><td>84.76 (↑ 19.32)</td><td>55.65 (↑ 18.89)</td><td>32.23 (↑ 8.65)</td></tr><tr><td>Standard + RWS CIFAR-100</td><td>83.01 (↑ 17.57)</td><td>58.62 (↑ 21.86)</td><td>33.17 (↑ 9.59)</td></tr><tr><td>Standard + RWS Tiny-ImageNet</td><td>71.43 (↑ 5.99)</td><td>44.94 (↑ 8.18)</td><td>44.25 (↑ 20.67)</td></tr></table>
244
+
245
+ # 3.5. Feature Map Visualization
246
+
247
+ Besides, we compare feature maps of standard and patched models in Figure 9, to understand what information is actually patched. Using TinyImageNet and VGG-16, we visualize feature maps after the second and third convolutional layers (denoted as "Layer I" and "Layer II", respectively). The visualizations show that RWSs bring in meaningful feature adjustments to be resilient to corruption types. For example, to tackle reduced contrast, the patched model becomes more sensitive to edges, while the model patched for impulse noise picks up less high-frequency outlier features.
248
+
249
+ # 4. Conclusion and Limitations
250
+
251
+ Our work is dedicated to investigating how natural corruption "robustness" is encoded in weights and how to disentangle/transfer them. We introduce "Robust Weight Signature"(RWS), which nontrivially generalizes the prior wisdom in model weight interpolation and arithmetic, to analyzing standard/robust models, with both methodological innovations and new key findings. RWSs lead to a powerful in-situ model patching framework to easily achieve on-demand robustness towards a wide range of corruptions.
252
+
253
+ Current RWS patching faces one limitation that we must point out: in Table 1, the superior TA/RA trade-offs achieved by RWS methods are based on the perfect "oracle" knowledge: (1) the type of corruption is being handled, i.e., when to add or take off the "correct" RWSs. (2) the corruption severity is being handled, i.e., the choice of hyperparameter $\alpha$ when applying RWSs. This assumption is in line with the "once-for-all" AT methods (Wang et al., 2020; Kundu et al., 2023), which requires a human oracle to control a test-time hyperparameter to implicitly state the desired RA-TA trade-offs in contexts. Practically, that can be implemented by referring to environment sensors or other domain classification change or detection methods. We also ensure our fair comparison with "All Models" baseline in Table 1 by using the same ideal oracle.
254
+
255
+ One future work of immediate interest would be to examine RWS patching under a practical imperfect oracle (e.g., a trained corruption domain classifier that might predict incorrectly, hence applying inexact RWSs). We hypothesize the overall performance drop will be mild though, since an RWS trained for one corruption type can boost robustness against other "similar" corruptions too (see Sec. 2.3).
256
+
257
+ # References
258
+
259
+ Askell, A., Bai, Y., Chen, A., Drain, D., Ganguli, D., Henighan, T., Jones, A., Joseph, N., Mann, B., DasSarma, N., et al. A general language assistant as a laboratory for alignment. arXiv preprint arXiv:2112.00861, 2021.
260
+ Chen, T., Liu, S., Chang, S., Cheng, Y., Amini, L.,
261
+
262
+ and Wang, Z. Adversarial robustness: From self-supervised pre-training to fine-tuning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 699-708, 2020.
263
+ Choshen, L., Venezuelan, E., Slonim, N., and Katz, Y. Fusing finetuned models for better pretraining. arXiv preprint arXiv:2204.03044, 2022.
264
+ Croce, F., Gowal, S., Brunner, T., Shelhamer, E., Hein, M., and Cemgil, T. Evaluating the adversarial robustness of adaptive test-time defenses. arXiv preprint arXiv:2202.13711, 2022.
265
+ Elsayed, G. F., Goodfellow, I., and Sohl-Dickstein, J. Adversarial reprogramming of neural networks. arXiv preprint arXiv:1806.11146, 2018.
266
+ Fleuret, F. et al. Test time adaptation through perturbation robustness. In NeurIPS 2021 Workshop on Distribution Shifts: Connecting Methods and Applications, 2021.
267
+ Geva, M., Caciularu, A., Dar, G., Roit, P., Sadde, S., Shlain, M., Tamir, B., and Goldberg, Y. Lm-debugger: An interactive tool for inspection and intervention in transformer-based language models. arXiv preprint arXiv:2204.12130, 2022.
268
+ Goel, K., Gu, A., Li, Y., and Ré, C. Model patching: Closing the subgroup performance gap with data augmentation. arXiv preprint arXiv:2008.06775, 2020.
269
+ Goldblum, M., Tsipras, D., Xie, C., Chen, X., Schwarzschild, A., Song, D., Madry, A., Li, B., and Goldstein, T. Dataset security for machine learning: Data poisoning, backdoor attacks, and defenses. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022.
270
+ Hambardzumyan, K., Khachatrian, H., and May, J. Warp: Word-level adversarial reprogramming. arXiv preprint arXiv:2101.00121, 2021.
271
+ He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016.
272
+ Hein, M. and Andriushchenko, M. Formal guarantees on the robustness of a classifier against adversarial manipulation. Advances in neural information processing systems, 30, 2017.
273
+ Hendrycks, D. and Dietterich, T. Benchmarking neural network robustness to common corruptions and perturbations. arXiv preprint arXiv:1903.12261, 2019a.
274
+
275
+ Hendrycks, D. and Dietterich, T. Benchmarking neural network robustness to common corruptions and perturbations. Proceedings of the International Conference on Learning Representations, 2019b.
276
+ Hendrycks, D., Lee, K., and Mazeika, M. Using pre-training can improve model robustness and uncertainty. In International Conference on Machine Learning, pp. 2712-2721. PMLR, 2019a.
277
+ Hendrycks, D., Mu, N., Cubuk, E. D., Zoph, B., Gilmer, J., and Lakshminarayanan, B. Augmix: A simple data processing method to improve robustness and uncertainty. In International Conference on Learning Representations, 2019b.
278
+ Hendrycks, D., Basart, S., Mu, N., Kadavath, S., Wang, F., Dorundo, E., Desai, R., Zhu, T., Parajuli, S., Guo, M., et al. The many faces of robustness: A critical analysis of out-of-distribution generalization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 8340-8349, 2021.
279
+ Huang, H., Wang, Y., Erfani, S., Gu, Q., Bailey, J., and Ma, X. Exploring architectural ingredients of adversarially robust deep neural networks. Advances in Neural Information Processing Systems, 34:5545-5559, 2021.
280
+ Ilharco, G., Ribeiro, M. T., Wortsman, M., Gururangan, S., Schmidt, L., Hajishirzi, H., and Farhadi, A. Editing models with task arithmetic. arXiv preprint arXiv:2212.04089, 2022a.
281
+ Ilharco, G., Wortsman, M., Gadre, S. Y., Song, S., Hajishirzi, H., Kornblith, S., Farhadi, A., and Schmidt, L. Patching open-vocabulary models by interpolating weights. arXiv preprint arXiv:2208.05592, 2022b.
282
+ Ilyas, A., Park, S. M., Engstrom, L., Leclerc, G., and Madry, A. Datamodels: Understanding predictions with data and data with predictions. In International Conference on Machine Learning, pp. 9525-9587. PMLR, 2022.
283
+ Izmailov, P., Podoprikhin, D., Garipov, T., Vetrov, D., and Wilson, A. G. Averaging weights leads to wider optima and better generalization. arXiv preprint arXiv:1803.05407, 2018.
284
+ Jiang, Z., Chen, T., Chen, T., and Wang, Z. Robust pretraining by adversarial contrastive learning. Advances in Neural Information Processing Systems, 33:16199-16210, 2020.
285
+ Kasirzadeh, A. and Gabriel, I. In conversation with artificial intelligence: aligning language models with human values. arXiv preprint arXiv:2209.00731, 2022.
286
+
287
+ Koh, P. W., Sagawa, S., Marklund, H., Xie, S. M., Zhang, M., Balsubramani, A., Hu, W., Yasunaga, M., Phillips, R. L., Gao, I., et al. Wilds: A benchmark of in-the-wild distribution shifts. In International Conference on Machine Learning, pp. 5637-5664. PMLR, 2021.
288
+ Krizhevsky, A., Hinton, G., et al. Learning multiple layers of features from tiny images. 2009.
289
+ Kundu, S., Sundaresan, S., Pedram, M., and Beerel, P. A. Float: Fast learnable once-for-all adversarial training for tunable trade-off between accuracy and robustness. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 2349-2358, 2023.
290
+ Li, M., Gururangan, S., Dettmers, T., Lewis, M., Althoff, T., Smith, N. A., and Zettlemoyer, L. Branch-train-merge: Embarrassingly parallel training of expert language models. arXiv preprint arXiv:2208.03306, 2022.
291
+ Liu, X., Cheng, M., Zhang, H., and Hsieh, C.-J. Towards robust neural networks via random self-ensemble. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 369-385, 2018.
292
+ Madry, A., Makelov, A., Schmidt, L., Tsipras, D., and Vladu, A. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017.
293
+ Madry, A., Makelov, A., Schmidt, L., Tsipras, D., and Vladu, A. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations, 2018.
294
+ Mitchell, E., Lin, C., Bosselut, A., Finn, C., and Manning, C. D. Fast model editing at scale. arXiv preprint arXiv:2110.11309, 2021.
295
+ Mitchell, E., Lin, C., Bosselut, A., Manning, C. D., and Finn, C. Memory-based model editing at scale. In International Conference on Machine Learning, pp. 15817-15831. PMLR, 2022.
296
+ mnmoustafa, M. A. Tiny imagenet, 2017. URL https://kaggle.com/competitions/tiny-imagenet.
297
+ Murty, S., Manning, C. D., Lundberg, S., and Ribeiro, M. T. Fixing model bugs with natural language patches. arXiv preprint arXiv:2211.03318, 2022.
298
+ Nguyen, T., Ilharco, G., Wortsman, M., Oh, S., and Schmidt, L. Quality not quantity: On the interaction between dataset design and robustness of clip. arXiv preprint arXiv:2208.05516, 2022.
299
+
300
+ Ouyang, L., Wu, J., Jiang, X., Almeida, D., Wainwright, C. L., Mishkin, P., Zhang, C., Agarwal, S., Slama, K., Ray, A., et al. Training language models to follow instructions with human feedback. arXiv preprint arXiv:2203.02155, 2022.
301
+ Ribeiro, M. T. and Lundberg, S. Adaptive testing and debugging of nlp models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 3253-3267, 2022.
302
+ Rusak, E., Schott, L., Zimmermann, R. S., Bitterwolf, J., Bringmann, O., Bethge, M., and Brendel, W. A simple way to make neural networks robust against diverse image corruptions. In European Conference on Computer Vision, pp. 53-69. Springer, 2020.
303
+ Santurkar, S., Tsipras, D., Elango, M., Bau, D., Torralba, A., and Madry, A. Editing a classifier by rewriting its prediction rules. Advances in Neural Information Processing Systems, 34:23359-23373, 2021.
304
+ Simonyan, K. and Zisserman, A. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
305
+ Subramani, N., Suresh, N., and Peters, M. E. Extracting latent steering vectors from pretrained language models. In Findings of the Association for Computational Linguistics: ACL 2022, pp. 566-581, 2022.
306
+ Sun, J., Cao, Y., Choy, C., Yu, Z., Xiao, C., Anandkumar, A., and Mao, Z. M. Improving adversarial robustness in 3d point cloud classification via self-supervisions. In International Conference on Machine Learning Workshop (ICMLW), volume 1, 2021.
307
+ Taori, R., Dave, A., Shankar, V., Carlini, N., Recht, B., and Schmidt, L. Measuring robustness to natural distribution shifts in image classification. Advances in Neural Information Processing Systems, 33:18583-18599, 2020.
308
+ Tsai, Y.-Y., Chen, P.-Y., and Ho, T.-Y. Transfer learning without knowing: Reprogramming black-box machine learning models with scarce data and limited resources. In International Conference on Machine Learning, pp. 9614-9624. PMLR, 2020.
309
+ Tsipras, D., Santurkar, S., Engstrom, L., Turner, A., and Madry, A. Robustness may be at odds with accuracy. In International Conference on Learning Representations, number 2019, 2019.
310
+ Wang, H., Chen, T., Gui, S., Hu, T., Liu, J., and Wang, Z. Once-for-all adversarial training: In-situ tradeoff between robustness and accuracy for free. Advances in Neural Information Processing Systems, 33:7449-7461, 2020.
311
+
312
+ Wang, H., Xiao, C., Kossaifi, J., Yu, Z., Anandkumar, A., and Wang, Z. Augmax: Adversarial composition of random augmentations for robust training. Advances in neural information processing systems, 34:237-250, 2021.
313
+ Wortsman, M., Ilharco, G., Gadre, S. Y., Roelofs, R., Gontijo-Lopes, R., Morcos, A. S., Namkoong, H., Farhadi, A., Carmon, Y., Kornblith, S., et al. Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time. In International Conference on Machine Learning, pp. 23965-23998. PMLR, 2022a.
314
+ Wortsman, M., Ilharco, G., Kim, J. W., Li, M., Kornblith, S., Roelofs, R., Lopes, R. G., Hajishirzi, H., Farhadi, A., Namkoong, H., et al. Robust fine-tuning of zero-shot models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7959-7971, 2022b.
315
+ Wu, H., Judd, P., Zhang, X., Isaev, M., and Micikevicius, P. Integer quantization for deep learning inference: Principles and empirical evaluation. arXiv preprint arXiv:2004.09602, 2020.
316
+ Yin, D., Gontijo Lopes, R., Shlens, J., Cubuk, E. D., and Gilmer, J. A fourier perspective on model robustness in computer vision. Advances in Neural Information Processing Systems, 32, 2019.
317
+ Zhang, G., Zhang, Y., Zhang, Y., Fan, W., Li, Q., Liu, S., and Chang, S. Fairness reprogramming. arXiv preprint arXiv:2209.10222, 2022.
318
+ Zhang, H., Yu, Y., Jiao, J., Xing, E., El Ghaoui, L., and Jordan, M. Theoretically principled trade-off between robustness and accuracy. In International conference on machine learning, pp. 7472-7482. PMLR, 2019.
319
+ Zhao, P., Chen, P.-Y., Das, P., Ramamurthy, K. N., and Lin, X. Bridging mode connectivity in loss landscapes and adversarial robustness. arXiv preprint arXiv:2005.00060, 2020.
320
+ Zheng, S., Song, Y., Leung, T., and Goodfellow, I. Improving the robustness of deep neural networks via stability training. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4480-4488, 2016.
321
+
322
+ # A. More Experimental Results
323
+
324
+ # A.1. Detailed Results on All 19 Corruption Types
325
+
326
+ To supplement Table 1, we provide the detailed experimental results of all corruption types in Table 4, which shows our consistent improvements in the RAs of all corruption types. We use $\mathbf{RWS}_{\mathrm{shallow},16\mathrm{bit}}$ for model patching: RWS are constructed by the shallowest five layers with 16-bit quantization.
327
+
328
+ Table 4. Detailed experimental results showing robustness improvements on all 19 corruption types in (Hendrycks & Dietterich, 2019b).
329
+
330
+ <table><tr><td rowspan="3">Corruptions</td><td colspan="3">CIFAR-10</td><td colspan="3">CIFAR-100</td><td colspan="6">Tiny-ImageNet</td></tr><tr><td colspan="3">VGG-16</td><td colspan="3">VGG-16</td><td colspan="3">VGG-16</td><td colspan="3">ResNet-50</td></tr><tr><td>w.o. RWS (%)</td><td>w. RWS (%)</td><td>Diff.</td><td>w.o. RWS (%)</td><td>w. RWS (%)</td><td>Diff.</td><td>w.o. RWS (%)</td><td>w. RWS (%)</td><td>Diff.</td><td>w.o. RWS (%)</td><td>w. RWS (%)</td><td>Diff.</td></tr><tr><td>Brightness</td><td>88.41</td><td>90.87</td><td>↑ 2.46</td><td>60.85</td><td>67.06</td><td>↑ 6.21</td><td>30.33</td><td>49.41</td><td>↑ 19.08</td><td>37.96</td><td>56.61</td><td>↑ 18.65</td></tr><tr><td>Contrast</td><td>41.29</td><td>78.77</td><td>↑ 37.48</td><td>16.11</td><td>60.72</td><td>↑ 44.61</td><td>1.88</td><td>19.30</td><td>↑ 17.42</td><td>1.88</td><td>28.55</td><td>↑ 26.67</td></tr><tr><td>Defocus Blur</td><td>66.92</td><td>87.14</td><td>↑ 20.22</td><td>37.55</td><td>61.51</td><td>↑ 23.96</td><td>7.01</td><td>34.91</td><td>↑ 27.90</td><td>26.09</td><td>51.03</td><td>↑ 24.94</td></tr><tr><td>elastic Transform</td><td>78.38</td><td>81.93</td><td>↑ 3.55</td><td>49.74</td><td>56.01</td><td>↑ 6.27</td><td>35.06</td><td>48.15</td><td>↑ 13.09</td><td>41.60</td><td>56.12</td><td>↑ 14.52</td></tr><tr><td>Fog</td><td>61.40</td><td>80.57</td><td>↑ 19.17</td><td>30.18</td><td>62.33</td><td>↑ 32.15</td><td>27.59</td><td>53.51</td><td>↑ 25.92</td><td>20.51</td><td>56.23</td><td>↑ 35.72</td></tr><tr><td>Frost</td><td>70.65</td><td>84.89</td><td>↑ 14.24</td><td>40.73</td><td>56.80</td><td>↑ 16.07</td><td>38.40</td><td>51.22</td><td>↑ 12.82</td><td>42.23</td><td>56.47</td><td>↑ 14.24</td></tr><tr><td>Gaussian Blur</td><td>56.63</td><td>86.71</td><td>↑ 30.08</td><td>30.80</td><td>60.91</td><td>↑ 30.11</td><td>8.82</td><td>40.75</td><td>↑ 31.93</td><td>29.28</td><td>54.07</td><td>↑ 24.79</td></tr><tr><td>Gaussian Noise</td><td>50.92</td><td>82.08</td><td>↑ 31.16</td><td>24.79</td><td>52.83</td><td>↑ 28.04</td><td>12.37</td><td>42.38</td><td>↑ 30.01</td><td>15.29</td><td>51.86</td><td>↑ 36.57</td></tr><tr><td>Glass Blur</td><td>56.36</td><td>78.55</td><td>↑ 22.19</td><td>25.54</td><td>48.48</td><td>↑ 22.94</td><td>5.92</td><td>20.89</td><td>↑ 14.97</td><td>15.39</td><td>39.11</td><td>↑ 23.72</td></tr><tr><td>Impulse Noise</td><td>39.82</td><td>77.24</td><td>↑ 37.42</td><td>12.01</td><td>49.35</td><td>↑ 37.34</td><td>6.36</td><td>37.77</td><td>↑ 31.41</td><td>7.98</td><td>46.22</td><td>↑ 38.24</td></tr><tr><td>Jpeg Compression</td><td>80.72</td><td>84.26</td><td>↑ 3.54</td><td>51.18</td><td>53.71</td><td>↑ 2.53</td><td>51.23</td><td>54.16</td><td>↑ 2.93</td><td>57.80</td><td>60.47</td><td>↑ 2.67</td></tr><tr><td>Motion Blur</td><td>68.98</td><td>86.88</td><td>↑ 17.90</td><td>40.88</td><td>61.42</td><td>↑ 20.54</td><td>23.63</td><td>47.35</td><td>↑ 23.72</td><td>34.59</td><td>57.58</td><td>↑ 22.99</td></tr><tr><td>Pixelate</td><td>63.92</td><td>87.24</td><td>↑ 23.32</td><td>36.09</td><td>62.05</td><td>↑ 25.96</td><td>48.84</td><td>53.41</td><td>↑ 4.57</td><td>53.48</td><td>60.51</td><td>↑ 7.03</td></tr><tr><td>Saturate</td><td>85.27</td><td>91.30</td><td>↑ 6.03</td><td>53.55</td><td>66.47</td><td>↑ 12.92</td><td>23.97</td><td>46.37</td><td>↑ 22.40</td><td>29.70</td><td>52.73</td><td>↑ 23.03</td></tr><tr><td>Shot Noise</td><td>54.38</td><td>84.97</td><td>↑ 30.59</td><td>27.57</td><td>54.81</td><td>↑ 27.24</td><td>16.17</td><td>46.38</td><td>↑ 30.21</td><td>18.74</td><td>53.98</td><td>↑ 35.24</td></tr><tr><td>Snow</td><td>78.42</td><td>87.49</td><td>↑ 9.07</td><td>48.18</td><td>59.75</td><td>↑ 11.57</td><td>34.92</td><td>50.94</td><td>↑ 16.02</td><td>37.98</td><td>56.06</td><td>↑ 18.08</td></tr><tr><td>Spatter</td><td>74.36</td><td>88.18</td><td>↑ 13.82</td><td>41.22</td><td>62.98</td><td>↑ 21.76</td><td>40.99</td><td>55.31</td><td>↑ 14.32</td><td>46.07</td><td>57.04</td><td>↑ 10.97</td></tr><tr><td>Speckle Noise</td><td>55.86</td><td>85.26</td><td>↑ 29.40</td><td>27.81</td><td>54.82</td><td>↑ 27.01</td><td>18.31</td><td>47.48</td><td>↑ 29.17</td><td>20.28</td><td>54.39</td><td>↑ 34.11</td></tr><tr><td>Zoom Blur</td><td>70.63</td><td>86.02</td><td>↑ 15.39</td><td>43.60</td><td>61.81</td><td>↑ 18.21</td><td>16.20</td><td>41.13</td><td>↑ 24.93</td><td>26.45</td><td>54.34</td><td>↑ 27.89</td></tr><tr><td>Average</td><td>65.44</td><td>84.76</td><td>↑ 19.32</td><td>36.76</td><td>58.62</td><td>↑ 21.86</td><td>23.58</td><td>44.25</td><td>↑ 20.67</td><td>29.65</td><td>52.81</td><td>↑ 23.16</td></tr></table>
331
+
332
+ # A.2. Compressibility: Full models versus RWSs under Quantization
333
+
334
+ As is shown in Table 5, full model weights are less compressible compared to RWSs, which suggests RWS-based methods to more easily achieve better storage efficiency. When applying the linear 16-bit quantization (Wu et al., 2020) to the full model weights, both the standard accuracy and natural corruption robustness have already degraded heavily. This is in stark contrast to RWSs which can retain most of their performance under the same quantization (16-bit) or even heavier (8-bit).
335
+
336
+ Note that we focus our study to provide the proof of concept that "RWSs are more easily amendable to quantization". We do not exclude the possibility that more sophisticated, robustness-aware quantization methods will sustain the robustness performance under heavy quantization, but further testing or developing such algorithms is out of this paper's scope.
337
+
338
+ Table 5. The standard and robust accuracy changes when applying different levels of quantization, showing the superior compressibility of RWS-based methods.
339
+
340
+ <table><tr><td rowspan="3">Methods</td><td colspan="3">CIFAR-10</td><td colspan="3">CIFAR-100</td><td colspan="6">Tiny-ImageNet</td></tr><tr><td colspan="3">VGG-16</td><td colspan="3">VGG-16</td><td colspan="3">VGG-16</td><td colspan="3">ResNet-50</td></tr><tr><td>\(N_{\text{param}}\)(MB)</td><td>TA (%)</td><td>RA (%)</td><td>\(N_{\text{param}}\)(MB)</td><td>TA (%)</td><td>RA (%)</td><td>\(N_{\text{param}}\)(MB)</td><td>TA (%)</td><td>RA (%)</td><td>\(N_{\text{param}}\)(MB)</td><td>TA (%)</td><td>RA (%)</td></tr><tr><td>Standard (32 bit)</td><td>58.8</td><td>92.59</td><td>65.44</td><td>58.8</td><td>71.44</td><td>36.76</td><td>59.2</td><td>61.28</td><td>23.58</td><td>95.7</td><td>65.72</td><td>29.65</td></tr><tr><td>Standard (16 bit)</td><td>29.4 (0.5×)</td><td>88.05</td><td>58.12</td><td>29.4 (0.5×)</td><td>53.60</td><td>21.17</td><td>29.6 (0.5×)</td><td>51.66</td><td>16.87</td><td>47.9 (0.5×)</td><td>40.27</td><td>20.26</td></tr><tr><td>Data Augmentation (32 bit)</td><td>58.8 (1×)</td><td>89.58</td><td>84.34</td><td>58.8 (1×)</td><td>67.34</td><td>56.95</td><td>59.2 (1×)</td><td>52.11</td><td>43.64</td><td>95.7 (1×)</td><td>59.17</td><td>47.96</td></tr><tr><td>Data Augmentation (16 bit)</td><td>29.4 (0.5×)</td><td>83.18</td><td>74.93</td><td>29.4 (0.5×)</td><td>60.58</td><td>51.19</td><td>29.6 (0.5×)</td><td>46.66</td><td>35.01</td><td>47.9 (0.5×)</td><td>39.19</td><td>26.03</td></tr><tr><td>All Models (32 bit)</td><td>1177.6 (20×)</td><td>92.59</td><td>88.97</td><td>1177.6 (20×)</td><td>71.44</td><td>64.72</td><td>1184.0 (20×)</td><td>61.28</td><td>51.55</td><td>1913.6 (20×)</td><td>65.72</td><td>55.97</td></tr><tr><td>All Models (16 bit)</td><td>588.8 (10×)</td><td>88.05</td><td>82.05</td><td>588.8 (10×)</td><td>53.60</td><td>52.96</td><td>592.0 (10×)</td><td>51.66</td><td>36.72</td><td>956.8 (10×)</td><td>40.27</td><td>23.00</td></tr><tr><td>\(Standard+RWS_{Full}\)</td><td>1177.6 (20×)</td><td>92.59</td><td>75.35</td><td>1177.6 (20×)</td><td>71.44</td><td>52.58</td><td>1184.0 (20×)</td><td>61.28</td><td>43.63</td><td>1913.6 (20×)</td><td>65.72</td><td>53.64</td></tr><tr><td>\(Standard+RWS_{Shallow}\)</td><td>101.0 (1.7×)</td><td>92.59</td><td>84.86</td><td>101.0 (1.7×)</td><td>71.44</td><td>58.78</td><td>101.4 (1.7×)</td><td>61.28</td><td>44.66</td><td>131.4 (1.4×)</td><td>65.72</td><td>52.84</td></tr><tr><td>\(Standard+RWS_{Shallow,16bits}\)</td><td>79.9 (1.4×)</td><td>92.59</td><td>84.76</td><td>79.9 (1.4×)</td><td>71.44</td><td>58.62</td><td>80.3 (1.4×)</td><td>61.28</td><td>44.25</td><td>113.6 (1.2×)</td><td>65.72</td><td>52.81</td></tr><tr><td>\(Standard+RWS_{Shallow,8bits}\)</td><td>69.4 (1.2×)</td><td>92.59</td><td>82.99</td><td>69.4 (1.2×)</td><td>71.44</td><td>53.52</td><td>69.7 (1.2×)</td><td>61.28</td><td>39.40</td><td>104.7 (1.1×)</td><td>65.72</td><td>52.79</td></tr></table>
robustweightsignaturesgainingrobustnessaseasyaspatchingweights/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f2602f168e73db0d4cab4a7ecf3ecc6d0740002b5341fe523455e0b8022e3d1
3
+ size 990468
robustweightsignaturesgainingrobustnessaseasyaspatchingweights/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e1a03edf8cf44f7ac688d3d944d936d29068f05363ed200a769b563d09b2487
3
+ size 422777