SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Extracting  $S_{1}$ . After the update at time  $t$ , first, we would like to set  $Z = S_{1}^{-} \cup \{v\}$  or  $Z = S_{1}^{-} \setminus \{v\}$ , if the update is the insertion of an element  $v$  or the deletion of an element  $v$ , respectively, where  $S_{1}^{-}$  is the set  $S_{1}$  that instance  $\mathcal{I}_{1}$  maintains just before this update. To find set  $S_{1}^{-}$ , we just need to invoke subroutine  $\mathrm{EXTRACT}_{\mathcal{I}_1}$ . If the update is an insertion, we insert it into instance  $\mathcal{I}_1$  using  $\mathrm{INSERT}_{\mathcal{I}_1}(v, \tau)$ , and if the update is a deletion, we delete  $v$  from both  $\mathcal{I}_1$  and  $\mathcal{I}_2$  using  $\mathrm{DELETE}_{\mathcal{I}_1}(v)$  and  $\mathrm{DELETE}_{\mathcal{I}_2}(v)$ . We then invoke  $\mathrm{EXTRACT}_{\mathcal{I}_1}$  once again to return set  $S_{1}$ .
Extracting  $S_1'$ . Buchbinder et al. [11] developed a method to extract a subset  $S_1' \subseteq S_1$  whose submodular value is a good approximation of  $\max_{C \subseteq S_1} f(C)$ . In this algorithm, we start with two solutions  $\emptyset$  and  $S_1$ . The algorithm considers the elements (in arbitrary order) one at a time. For each element, it determines whether it should be added to the first solution or removed from the second solution. Thus, after a single pass over set  $S_1$ , both solutions completely coincide, which is the solution that the algorithm outputs. They show that a (deterministic) greedy choice in each step obtains 3-approximation of the best solution in  $S_1$ . However, if we combine this greedy choice with randomization, we can obtain a 2-approximate solution. Since we do a single pass over set  $S_1$ , the number of oracle queries is  $O(|S_1|)$ .
The second algorithm that we can use to extract  $S_1'$  is a random sampling algorithm proposed by Feige et al. [27], which choose every element in  $S_1$  with probability  $1/2$ . They show that this random sampling returns a set  $S_1'$  whose approximation factor is  $1/4$  of  $\max_{C \subseteq S_1} f(C)$ , and its number of oracle calls is  $O(1)$ . We denote either of these two methods by SUBSETSELECTION.
Extracting  $S_{2}$ . Next, we would like to update the set  $S_{2}$  that is maintained by instance  $\mathcal{I}_2$ . To do this, for every element  $u \in Z \backslash S_1$ , we add it to  $\mathcal{I}_2$  using INSERT  $\mathcal{I}_2(u, \tau)$ , and for every element  $u \in S_1 \backslash Z$ , we delete it from  $\mathcal{I}_2$  using DELETE  $\mathcal{I}_2(u, \tau)$ . Finally, when  $\mathcal{I}_2$  exactly includes all the current elements other than the ones in  $S_1$ , we call subroutine EXTRACT  $\mathcal{I}_2$  to return set  $S_{2}$ .
Corollary 2.2. We obtain the  $(8 + \varepsilon)$  approximation guaranty stated in the Metatheorem 1.2 by using the local search method for our SUBSETSELECTION, and we get the  $(10 + \varepsilon)$  approximation guaranty by utilizing the random sampling method for our SUBSETSELECTION subroutine.
Proof. These are immediate results of Lemma 2.1, and  $\alpha$  being  $\frac{1}{2}$  and  $\frac{1}{4}$  in the local search method and random sampling method, respectively.
Algorithm 1 Initialization  $(k, OPT)$
1:  $\tau \gets \frac{OPT}{k(3 + 1 / (2\alpha))}$ , where  $\alpha$  is  $\frac{1}{2}$  or  $\frac{1}{4}$  based on the selection of algorithm for SUBSETSELECTION.
2: Instantiate two independent instances  $\mathcal{I}_1$  and  $\mathcal{I}_2$  of DYNAMICTHRESHOLDING for monotone submodular maximization under cardinality constraint  $k$  using  $\tau$
Algorithm 2 UPDATE(v)
1:  $Z\gets \mathrm{EXTRACrT}_{\mathcal{I}_1}$    
2: if UPDATE(v) is an insertion then   
3:Invoke INSERTr  $\mathcal{I}_1(v)$ $Z\gets Z\cup \{v\}$    
4: else   
5:Invoke DELETE  $\mathcal{I}_1(v)$  , DELETE  $\mathcal{I}_2(v)$ $Z\gets Z\setminus \{v\}$    
6:  $S_{1}\gets \mathrm{EXTRACrT}_{\mathcal{I}_{1}}$    
7:  $S_1^{\prime}\gets$  SUBSETSELECTION(S1)   
8:for  $u\in S_1\backslash Z$  do   
9: DELETE  $\mathcal{I}_2(u)$    
10: for  $u\in Z\backslash S_1$  do   
11: INSERT  $\mathcal{I}_2(u)$    
12:  $S_{2}\gets \mathrm{EXTRACrT}_{\mathcal{I}_{2}}$    
13: Return arg maxC∈{S1,S1,S2}f(C)
Algorithm 3 SUBSETSELECTION(S)
1: function UNIFORMSUBSET(S)  
2:  $T \gets \emptyset$   
3: for  $s \in S$  do  
4: if  $\operatorname{Coin}\left(\frac{1}{2}\right)$  then  $\triangleright$  With probability  $\frac{1}{2}$   
5:  $T \gets T \cup \{s\}$   
6: return  $T$   
7: function LOCALSEARCHSUBSET(S)  
8:  $X_0 \gets \emptyset, Y_0 \gets S$ .  
9: for  $i = 1$  to  $|S|$  do  
10:  $a_i \gets f(X_{i-1} \cup \{s_i\}) - f(X_{i-1}), b_i \gets f(Y_{i-1} \setminus \{s_i\}) - f(Y_{i-1})$   
11:  $a_i' \gets \max(a_i, 0), b_i' \gets \max(b_i, 0)$   
12: if  $a_i' = b_i' = 0$  then  $a_i' / (a_i' + b_i') = 0$   
13: with probability  $a_i' / (a_i' + b_i')$  do:  
14:  $X_i \gets X_{i-1} \cup \{s_i\}, Y_i \gets Y_{i-1}$   
15: else do:  $X_i \gets X_{i-1}, Y_i \gets Y_{i-1} \setminus \{s_i\}$   
16: return  $X_{|S|\}$  (or equivalently  $Y_{|S|\})$
Analysis. In this section, we prove the correctness of our algorithms and analyze the number of oracle queries of our algorithms, which finishes the proof of Theorems 1.2.
Consider an arbitrary time  $t$ . Let  $S_{t}$  be the reported set of DYNAMICTHRESHOLDING at time  $t$ . Recall that  $V_{t}$  is the ground set at time  $t$ , and we drop the  $t$  for simplicity, so we use  $V$  and  $S$  to denote  $V_{t}$  and  $S_{t}$ . We first present Lemma 2.3 whose proof is given in the appendix. Then we proceed to prove Lemma 2.1 and Theorem 1.2
Lemma 2.3. Suppose that set  $S$  satisfies Property 1.b of Definition 1.1. It means that  $S$  has less than  $k$  elements and for any  $v \in V \setminus S$ , the marginal gain  $\Delta(v|S) < \tau$ . Then, for any arbitrary subset  $C \subseteq V$ , we have  $f(S) \geq f(S \cup C) - |C| \cdot \tau$ .
Proof of Lemma 2.1: Assume that at a fixed time  $t$ ,  $OPT^*$  and  $S^*$  are the optimal value and an optimal solution for the submodular maximization of function  $f$  under cardinality constraint  $k$ . This means that  $|S^*| \leq k$  and  $f(S^*) = OPT^*$ . Recall that  $\tau = \frac{OPT}{k(3 + \frac{1}{2\alpha})}$ , where  $OPT$  is our guess for the optimal value. Also, by assumption we have  $OPT^* \in [\frac{OPT}{1 + \epsilon'}, OPT]$ , or equivalently  $OPT \in [OPT^*, (1 + \epsilon') OPT^*]$ .
To prove the lemma, we claim that  $\max (\mathbf{E}[f(S_1)],\mathbf{E}[f(S_1')],\mathbf{E}[f(S_2)])\geq (1 - O(\varepsilon'))\frac{OPT^*}{6 + \frac{1}{\alpha}}.$
Suppose this claim is true. Using Jensen's inequality [23], we have  $\mathbf{E}[\max (f(S_1), f(S_1'), f(S_2))] \geq \max (\mathbf{E}[f(S_1)], \mathbf{E}[f(S_1')], \mathbf{E}[f(S_2)])$ , which yields  $\mathbf{E}[f(S)] \geq (1 - O(\varepsilon')) \frac{OPT^*}{6 + 1 / \alpha}$ .
To prove the claim, we consider two cases. The first case is when  $f(S_{1} \cap S^{*}) \geq \frac{\tau k}{2\alpha}$  and the second case is if  $f(S_{1} \cap S^{*}) < \frac{\tau k}{2\alpha}$ .
Suppose the first case is true. Then, the subset selection algorithm (either random sampling method or local search) returns  $S_1'$  for which  $\mathbf{E}[f(S_1')) \geq \alpha \cdot \max_{S \subseteq S_1} f(S)$ . Since  $S_1 \cap S^* \subseteq S_1$ , we have
For the latter case, we show that  $\mathbf{E}[f(S_1)] + \mathbf{E}[f(S_2)] \geq (1 - O(\varepsilon'))\frac{OPT^*}{3 + 1/2\alpha}$ , inferring  $\max \left(\mathbf{E}[f(S_1)], \mathbf{E}[f(S_2)]\right) \geq (1 - O(\varepsilon'))\frac{OPT^*}{6 + 1/\alpha}$ . Indeed, since  $S_1$  and  $S_2$  are reported by an  $\tau$ -thresholding algorithm, if  $|S_1| = k$  or  $|S_2| = k$ , then  $\max \left(\mathbf{E}[f(S_1)], \mathbf{E}[f(S_2)]\right)$  is at least  $\tau k = \frac{OPT}{3 + 1/2\alpha}$  by the first property of  $\tau$ -thresholding algorithms.
Now suppose that  $|S_1|, |S_2| < k$ , which means that Property 1.b of Definition 1.1 holds for  $S_1$  and  $S_2$ . Therefore, we have  $f(S_1) \geq f(S_1 \cup S^*) - \tau |S^*|$  and  $f(S_2) \geq f(S_2 \cup (S^* \setminus S_1)) - \tau |S^* \setminus S_1|$  by Lemma 2.3. Besides, we have  $f(S_1 \cap S^*) - \frac{\tau k}{2\alpha} < 0$ . Therefore,
$$
f (S _ {1}) + f (S _ {2}) \geq f (S _ {1} \cup S ^ {*}) - \tau | S ^ {*} | + f (S _ {2} \cup (S ^ {*} \setminus S _ {1})) - \tau | S ^ {*} \setminus S _ {1} | + f (S _ {1} \cap S ^ {*}) - \frac {\tau k}{2 \alpha}.
$$
Since  $|S^{*} \setminus S_{1}| \leq |S^{*}| \leq k$  we have
$$
f (S _ {1}) + f (S _ {2}) \geq f (S _ {1} \cup S ^ {*}) + f (S _ {2} \cup (S ^ {*} \setminus S _ {1})) + f (S _ {1} \cap S ^ {*}) - (2 + 1 / (2 \alpha)) \tau k.
$$
Since  $S_1 \cap S_2 = \emptyset$  and  $f$  is submodular, we have  $f(S_1 \cup S^*) + f(S_2 \cup (S^* \setminus S_1)) \geq f(S_1 \cup S_2 \cup S^*) + f(S^* \setminus S_1)$ . Additionally, by the submodularity and non-negativity of  $f$ , we have  $f(S_1 \cap S^*) \geq f(S^*) - f(S^* \setminus S_1)$ , because  $f(S^* \setminus S_1) + f(S_1 \cap S^*) \geq f(S^*) + f(\emptyset)$ . By adding the last two inequalities and using the non-negativity of  $f$  once again, we get  $f(S_1 \cup S^*) + f(S_2 \cup (S^* \setminus S_1)) + f(S_1 \cap S^*) \geq f(S_1 \cup S_2 \cup S^*) + f(S^*) \geq f(S^*) = OPT^*$ . By putting everything together we have,
$$
f \left(S _ {1}\right) + f \left(S _ {2}\right) \geq O P T ^ {*} - (2 + 1 / (2 \alpha)) \tau k = O P T ^ {*} - (\frac {4 \alpha + 1}{2 \alpha}) (\frac {O P T (2 \alpha)}{6 \alpha + 1}).
$$
By using the assumption that  $OPT \leq (1 + \epsilon') OPT^*$ , we have,
$$
f \left(S _ {1}\right) + f \left(S _ {2}\right) \geq O P T ^ {*} \left(1 - \left(\frac {\left(4 \alpha + 1\right) \left(1 + \epsilon^ {\prime}\right)}{6 \alpha + 1}\right)\right) \geq O P T ^ {*} \left(\frac {2 \alpha - \epsilon^ {\prime} \left(4 \alpha + 1\right)}{6 \alpha + 1}\right) = \left(1 - O \left(\varepsilon^ {\prime}\right)\right) \frac {O P T ^ {*}}{3 + 1 / (2 \alpha)}.
$$
Proof of Theorem 1.2:
As previously discussed, we've established in Lemma 2.1 and Corollary 2.2 that utilizing the local search method for the SUBSETSELECTION subroutine results in an approximation ratio of  $(8 + \varepsilon)$ , whereas the random sampling method achieves an approximation ratio of  $(10 + \varepsilon)$ . Thus, the only remaining aspect to address in proving this theorem is proving the query complexity of our proposed algorithm. In Lemma 2.4, we bound the number of queries made in each run of our algorithm per update, proving the bounds given in Theorem 1.2 by considering the extra  $O(\varepsilon^{-1}\log k)$ -factor caused by our parallel runs.
Lemma 2.4. Let the random variable  $Q_{t}$  denote the number of oracle calls that our algorithm in Theorem 1.2 makes at time  $t$  in each of the parallel runs. Depending on whether the expected or expected amortized number of oracle calls made by the thresholding algorithm DYNAMICTHRESHOLD per each update is  $O(g(n, k))$ , if we choose the local search method as our SUBSETSELECTION subroutine, we have
$$
\mathbf {E} [ Q _ {t} ] \in O (\min  (k \cdot g (n, k), g (n, k) ^ {2})) + O (k) ,
$$
$$
\mathbf {E} [ \sum_ {t = 1} ^ {T} Q _ {t} ] \in O (T \cdot \min  (k \cdot g (n, k), g (n, k) ^ {2})) + O (k) ,
$$
and if we choose the random sampling method as our SUBSETSELECTION subroutine, we have
$$
\mathbf {E} [ Q _ {t} ] \in O (\min (k \cdot g (n, k), g (n, k) ^ {2})) ,
$$
$$
\mathbf {E} \left[ \sum_ {t = 1} ^ {T} Q _ {t} \right] \in O (T \cdot \min  (k \cdot g (n, k), g (n, k) ^ {2}))
$$
Proof. Consider the case where the expected number of oracle calls made by the thresholding algorithm DYNAMICTHRESHOLD per each update is  $O(g(n, k))$ . Per each update, our algorithm makes an update in instance  $\mathcal{I}_1$  causing  $O(g(n, k))$  oracle queries. Next, we make either  $O(k)$  or 0 oracle queries for the SUBSETSELECTION subroutine, depending on the used method. We also make a series of updates in instance  $\mathcal{I}_2$ , each causing  $O(g(n, k))$  oracle queries. The number of such updates is bounded by the number of changes in the output of instance  $\mathcal{I}_1$ , which is bounded by both  $k$  and  $O(g(n, k))$  (according to the second property of Definition 1.1). These comprise all the oracle queries made by our algorithm at time  $t$ . Therefore, the given bounds for this case hold. A detailed proof for the remaining bounds is provided in the appendix.
3 Empirical results
In this section, we empirically study our  $(8 + \varepsilon)$ -approximation dynamic algorithm. We implement our codes in C++ and run them on a MacBook laptop with 8 GB RAM and M1 processor. We empirically study the performance of our algorithm for video summarization and the Max-Cut problem.
Video summarization. Here, we use the Determinantal Point Process (DPP) which is introduced by [42], and combine it with our algorithm to capture a video summarization. We run our experiments on YouTube and Open Video Project (OVP) datasets from [20].
For each video, we use the linear method of [33] to extract a subset of frames and find a positive semi-definite kernel  $L$  with size  $n \times n$  where  $n$  is the number of extracted frames. Then, we try to find a subset  $S$  of frames such that it maximizes  $\frac{\det(L_S)}{\det(I + L)}$  where  $L_S$  is the sub-matrix of  $L$  restricted to indices corresponding to frames  $S$ . Since  $L$  is a positive semi-definite matrix, we have  $\det(L_S) \geq 0$ . Interestingly, [39] showed that  $\log(\det(L_S))$  is a non-monotone function. We use these properties and set  $f(S) := \log(\det(L_S) + 1)$  to make  $f$  a non-monotone non-negative submodular function. Then we run our  $(8 + \varepsilon)$ -approximate dynamic algorithm to find the best  $S$  to maximize  $f(S)$  such that  $|S| \leq k$  for  $k \in [10]$ .
Figure 1: Video summarization of Susan Boyle's performance on Britain's Got Talent show (video 106) from YouTube.
Figure 2: Video summarization for "Senses And Sensitivity, Introduct. to Lecture 1 presenter" (video 36) from OVP.
First, we insert all frames to observe the quality of our algorithm. Figure 1 and 2 are the selected frames by our algorithm for Video 106 from YouTube and Video 36 from OVP, respectively, when we limit the number of selected frames to 4. Then, we create a sequence  $\Xi$  of updates of frames of each video. Similar to [40], we define the sequence as a sliding window model. That is, given a window of size  $W$  for a parameter  $W\in \mathbb{N}$ , a frame is inserted at a time  $t$  and will be alive for a window of size  $W$  and then we delete that frame.
To evaluate the performance of our algorithm, we benchmark (See Figure 3) the total number of query calls and the submodular value of set  $S$  of our algorithm and the streaming algorithm proposed for non-monotone submodular maximization so-called SAMPLE-STREAMING proposed in [28]. This algorithm works as follows: Upon arrival of an element  $u$ , with probability  $(1 - q)$ , for a parameter  $0 < q < 1$ , we ignore  $u$ , otherwise (i.e., with probability  $q$ ), we do the following. If the size of set  $S$  that we maintain is less than  $k$ , i.e.,  $|S| < k$  and  $\Delta(u|S) > 0$ , we add  $u$  to  $S$ . However, if  $|S| = k$ , we select an element  $v \in S$  for which  $\Delta(v : S)$  is minimum possible, where  $\Delta(u : S)$  equals to  $\Delta(u|S_u)$  where  $S_u$  are elements that arrived before  $u$  in sequence  $\Xi$ . If  $\Delta(u|S) \geq (1 + c)\Delta(v : S)$  for a constant  $c$ , we replace  $v$  by  $u$ ; otherwise, we do nothing. Now we convert this streaming algorithm into a dynamic algorithm. To accomplish this, we restart SAMPLE-STREAMING after every deletion that deletes an element of solution set  $S$  that is reported by SAMPLE-STREAMING's outputs. That is, if a deletion does not touch any element in set  $S$ , we do nothing; otherwise we restart the streaming algorithm.
(b)
Figure 3: We plot the total number of query calls and the average output of our dynamic algorithm and SAMPLE-STREAMING on video 106 from YouTube and video 36 from OVP. In this figure, from left to right, Sub-figures (a) and (b) are the total oracle calls for video 106 and 36, respectively. Similarly, Sub-figures (c) and (d) are average submodular value for video 106 and 36, respectively.
We run our algorithm for  $\varepsilon = k / 2$  and compare the total oracle calls and average output of our algorithm and SAMPLE-STREAMING in Figure 3. To prove the approximation guarantee of our dynamic algorithm, we assumed  $\varepsilon \leq 1$ . However, in practice, it is possible to increase  $\varepsilon$  up to a certain level without affecting the output of the algorithm significantly. On the other hand, increasing  $\varepsilon$  reduces the total oracle calls and makes the algorithm faster. As you can see in Figure 3 plots (b) and (d), the submodular value of our algorithm is not worse than the SAMPLE-STREAMING algorithm whose approximation factor is  $3 + 2\sqrt{2} \approx 5.828$  which is better than our approximation factor. Thus, our algorithm has an outcome better than our expectation, while its total oracle calls are better than SAMPLE-STREAMING algorithm (look at Figure 3 plots (a) and (c)).
We also empirically study the celebrated Max-Cut problem which is a non-monotone submodular maximization function (See [27]). These experiments are given in the appendix.
In this paper, we studied non-monotone submodular maximization subject to cardinality constraint  $k$  in the dynamic setting by providing a reduction from this problem to maximizing monotone submodular functions under the cardinality constraint  $k$  with a certain kind of algorithms ( $\tau$ -thresholding algorithms). Moreover, we used our reduction to develop the first dynamic algorithms for this problem. In particular, both our algorithms maintain a solution set whose submodular value is a  $(8 + \varepsilon)$ -approximation of the optimal value and require  $O(\varepsilon^{-3}k^{3}\log^{3}(n)\log(k))$  and  $O(\varepsilon^{-1}k^{2}\log^{3}(k))$  oracle queries per update, respectively.
This work is partially supported by DARPA QuICC NSF AF:Small #2218678, and NSF AF:Small #2114269.