SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Kiarash Banihashem\* kiarash@umd.edu University of Maryland
Leyla Biabani\* l.biabani@tue.nl TU Eindhoven
Samira Goudarzi\* samirag@umd.edu University of Maryland
MohammadTaghi Hajiaghayi\* hajiagha@cs.umd.edu University of Maryland
Peyman Jabbarzade*† peymanj@umd.edu University of Maryland
Morteza Monemizadeh\* m.monemizadeh@tue.nl TU Eindhoven
Maximizing submodular functions has been increasingly used in many applications of machine learning, such as data summarization, recommendation systems, and feature selection. Moreover, there has been a growing interest in both submodular maximization and dynamic algorithms. In 2020, Monemizadeh [46] and Lattanzi, Mitrovic, Norouzi-Fard, Tarnawski, and Zadimoghaddam [40] initiated developing dynamic algorithms for the monotone submodular maximization problem under the cardinality constraint  $k$ . In 2022, Chen and Peng [15] studied the complexity of this problem and raised an important open question: "Can we extend [fully dynamic] results (algorithm or hardness) to non-monotone submodular maximization?" We affirmatively answer their question by demonstrating a reduction from maximizing a non-monotone submodular function under the cardinality constraint  $k$  to maximizing a monotone submodular function under the same constraint. Through this reduction, we obtain the first dynamic algorithms solving the non-monotone submodular maximization problem under the cardinality constraint  $k$ . We've derived two algorithms, both maintaining an  $(8 + \epsilon)$ -approximate of the solution. The first algorithm requires  $\mathcal{O}(\epsilon^{-3}k^3\log^3(n)\log(k))$  oracle queries per update, while the second one requires  $\mathcal{O}(\epsilon^{-1}k^2\log^3(k))$ . Furthermore, we showcase the benefits of our dynamic algorithm for video summarization and max-cut problems on several real-world data sets.
Submodular functions are powerful tools for solving real-world problems as they provide a theoretical framework for modeling the famous "diminishing returns" [30] phenomenon arising in a variety of practical settings. Many theoretical problems such as those involving graph cuts, entropy-based clustering, coverage functions, and mutual information can be cast in the submodular maximization framework. As a result, submodular functions have been increasingly used in many applications of machine learning such as data summarization [52, 51, 50], feature selection [17, 19, 18, 38], and recommendation systems [24]. These applications include both the monotone and non-monotone versions of the maximization of submodular functions.
Applications of non-monotone submodular maximization. The general problem of non-monotone submodular maximization has been studied extensively in [27, 12, 11, 43, 5, 47]. This
\*equal contribution Department of Computer Science, University of Maryland, College Park, MD, USA.  $\ddagger$ Department of Mathematics and Computer Science, Eindhoven University of Technology, the Netherlands.
problem has numerous applications in video summarization, movie recommendation [43], and revenue maximization in viral marketing  $[35]^4$ . An important application of this problem appears in maximizing the difference between a monotone submodular function and a linear function that penalizes the addition of more elements to the set (e.g., the coverage and diversity trade-off). An illustrative example of this application is the maximum facility location in which we want to open a subset of facilities and maximize the total profit from served clients plus the cost of facilities we did not open [21]. Another important application occurs when expressing learning problems such as feature selection using weakly submodular functions [17, 38, 25, 49].
Our contribution. In this paper, we consider the non-monotone submodular maximization problem under cardinality constraint  $k$  in the fully dynamic setting. In this model, we have a universal ground set  $V$ . At any time  $t$ , ground set  $V_{t} \subseteq V$  is the set of elements that are inserted but not deleted after their last insertion till time  $t$ . More formally, we assume that there is a sequence of "updates" such that each update either inserts an element to  $V_{t-1}$  or deletes an element from  $V_{t-1}$  to form  $V_{t}$ .
We assume that there is a (non-monotone) submodular function  $f$  that is defined over the universal ground set  $V$ . Our goal is to maintain, at each point in time, a set of size at most  $k$  whose submodular value is maximum among any subset of  $V_{t}$  of size at most  $k$ .
Since calculating such a set is known to be NP-hard [27] even in the offline setting (where you get all the items at the same time), we focus on providing algorithms with provable approximation guarantees, while maintaining fast update time. This is challenging as elements may be inserted or deleted, possibly in an adversarial order. While several dynamic algorithms exist for monotone submodular maximization, non-monotone submodular maximization is a considerably more challenging problem as adding elements to a set may decrease its value.
In STOC 2022, Chen and Peng [15] raised the following open question:
Open problem: "Can we extend [fully dynamic] results (algorithm or hardness) to non-monotone submodular maximization?"
In this paper, we answer their question affirmatively by providing the first dynamic algorithms for non-monotone submodular maximization.
To emphasize the significance of our result, it should be considered that although monotone submodular maximization under cardinality constraint has a tight  $\frac{e}{e - 1}$  approximation algorithm in the offline mode and nearly tight  $(2 + e)$  approximation algorithms for both streaming and dynamic settings, there is a hardness result for the non-monotone version stating that it is impossible to obtain a 2.04 (i.e., 0.491) approximation algorithm for this problem even in the offline setting[31], and to the best of our knowledge, the current state of the art algorithms for this problem have 2.6 and 3.6 (i.e., 0.385 and 0.2779) approximation guarantees for offline [10] and streaming settings [2], respectively.
We obtain our result, by proposing a general reduction from the problem of dynamically maintaining a non-monotone submodular function under cardinality constraint  $k$  to developing a dynamic thresholding algorithm for maximizing monotone submodular functions under the same constraint. We first define  $\tau$ -thresholding dynamic algorithms that we use in our reduction.
Definition 1.1 ( $\tau$ -Thresholding Dynamic Algorithm). Let  $\tau > 0$  be a parameter. We say a dynamic algorithm is  $\tau$ -thresholding if at any time  $t$  of sequence  $\Xi$ , it reports a set  $S_t \subseteq V_t$  of size at most  $k$  such that
- Property 1: either a)  $S_{t}$  has  $k$  elements and  $f(S_{t}) \geq k\tau$ , or b)  $S_{t}$  has less than  $k$  elements and for any  $v \in V_{t} \setminus S_{t}$ , the marginal gain  $\Delta(v|S_{t}) < \tau$ .
- Property 2: The number of elements changed in any update, i.e.,  $|S_{t+1} \backslash S_t| + |S_t \backslash S_{t+1}|$ , is not more than the number of queries made by the algorithm during the update.
In the above definition, the first property reflects the main intuition of threshold-based algorithms, while the last property is a technical condition required in our analysis. It's worth noting that the thresholding technique has been used widely for optimizing submodular functions [46, 41, 26, 40, 16]. We next state our main result, which is a general reduction.
<sup>4</sup>The problem of selecting a subset of people in a social network to maximize their influence in a viral marketing campaign can be modeled as a constrained submodular maximization problem. When we introduce a cost, then the influence minus the cost is modeled as non-monotone submodular maximization problems [9, 8, 34].
Theorem 1.2 (Reduction Metatheorem). Suppose that  $f: 2^V \to \mathbb{R}_{\geq 0}$  is a (possibly non-monotone) submodular function defined on subsets of a ground set  $V$  and let  $k \in \mathbb{N}$  be a parameter.
Assume that for any given value of  $\tau$ , there exists a  $\tau$ -thresholding dynamic algorithm with an expected (amortized)  $O(g(n, k))$  oracle queries per update. Then, there exist the following dynamic algorithms:
- A dynamic algorithm with an approximation guarantee of  $(8 + \varepsilon)$  using an expected (amortized)  $O(k + \min(k, g(n, k)) \cdot g(n, k) \cdot \varepsilon^{-1} \log(k))$  oracle queries per update.
- A dynamic algorithm maintaining a  $(10 + \varepsilon)$ -approximate solution of the optimal value of  $f$  using an expected (amortized)  $O(\min(k, g(n, k)) \cdot g(n, k) \cdot \varepsilon^{-1} \log(k))$  oracle calls per update.
In [46], Monemizadeh developed a dynamic algorithm for monotone submodular maximization under cardinality constraint  $k$ , which requires an amortized  $O(\varepsilon^{-2}k^2\log^3 (n))$  number of oracle queries per update. Interestingly, in the appendix, we show that this algorithm is indeed  $\tau$ -thresholding (for any given  $\tau$ ). Now, if we use this  $\tau$ -thresholding dynamic algorithm inside our reduction Metatheorem 1.2, we obtain a dynamic algorithm that maintains a  $(8 + \varepsilon)$ -approximate solution using an expected amortized  $O(\varepsilon^{-3}k^{3}\log^{3}(n)\log (k))$  oracle queries per update.
The recent paper [6] of Banihashem, Biabani, Goudarzi, Hajiaghayi, Jabbarzade, and Monemizadeh develops a new dynamic algorithm for monotone submodular maximization under cardinality constraint  $k$ , which uses an expected  $O(\varepsilon^{-1}k\log^2 (k))$  number of oracle queries per update. A similar proof shows that this new algorithm is  $\tau$ -thresholding as well. We have provided its pseudocode and a detailed explanation on why this algorithm is indeed  $\tau$ -thresholding in the appendix. By exploiting this algorithm in our Reduction Metatheorem 1.2, we can reduce the number of oracle queries mentioned to an expected number of  $O(\varepsilon^{-2}k^{2}\log^{3}(k))$  per update.
The second result in Theorem 1.2 is also of interest as it can be used to devise a dynamic algorithm for non-monotone submodular maximization with polylogarithmic query complexity if one can provide a  $\tau$ -thresholding dynamic algorithm for maximizing monotone submodular functions (under the cardinality constraint  $k$ ) with polylogarithmic query complexity.
Submodular maximization. Let  $V$  be a ground set of elements. We say a function  $f:2^{V}\to \mathbb{R}_{\geq 0}$  is a submodular function if for any  $A,B\subseteq V$ ,  $f(A) + f(B)\geq f(A\cup B) + f(A\cap B)$ . Equivalently,  $f$  is a submodular function if for any subsets  $A\subseteq B\subseteq V$  and for any element  $e\in V\backslash B$ , it holds that  $f(A\cup \{e\}) - f(A)\geq f(B\cup \{e\}) - f(B)$ . We define  $\Delta (e|A)\coloneqq f(A\cup \{e\}) - f(A)$  the marginal gain of adding the element  $e$  to set  $A$ . Similarly, we define  $\Delta (B|A)\coloneqq f(A\cup B) - f(A)$  for any sets  $A,B\subseteq V$ . Function  $f$  is monotone if  $f(A)\leq f(B)$  holds for any  $A\subseteq B\subseteq V$ , and it is nonmonotone if it is not necessarily the case. In the submodular maximization problem under cardinality constraint  $k$ , we seek to compute a set  $S^*$  such that  $|S^{*}|\leq k$  and  $f(S^{*}) = \max_{|S|\leq k}f(S)$ , where  $f$  is a submodular function and  $k\in \mathbb{N}$  is a given parameter.
Query access model. Similar to recent dynamic works [40, 15], we assume the access to a submodular function  $f$  is given by an oracle. The oracle allows set queries such that for every subset  $A \subseteq V$ , one can query the value  $f(A)$ . In this query access model, the marginal gain  $\Delta_f(e|A) \doteq f(A \cup \{e\}) - f(A)$  for every subset  $A \subseteq V$  and an element  $e \in V \setminus A$ , can be computed using two set queries. To do so, we first query  $f(A \cup \{e\})$  and then  $f(A)$ .
Dynamic model. Let  $\Xi$  be a sequence of inserts and deletes of an underlying universe  $V$ . We assume that  $f:2^{V}\to \mathbb{R}_{\geq 0}$  is a (possibly non-monotone) submodular function defined on subsets of the universe  $V$ . We define time  $t$  to be the  $t^{\mathrm{th}}$  update (i.e., insertion or deletion) of sequence  $\Xi$ . We let  $\Xi_{t}$  be the sub-sequence of updates from the beginning of sequence  $\Xi$  till time  $t$  and denote by  $V_{t}\subseteq V$  the set of elements that are inserted but not deleted from the beginning of the sequence  $\Xi$  till any time  $t$ . That is,  $V_{t}$  is the current ground set of elements. We let  $OPT_{t} = \max_{S\subseteq V_{t}:|S|\leq k}f(S)$ .
Query complexity. The query complexity of a dynamic  $\alpha$ -approximate algorithm is the number of oracle queries that the algorithm must make to compute a solution  $S_{t}$  with respect to ground set  $V_{t}$ .
whose submodular value is an  $\alpha$ -approximation of  $OPT_{t}$ . That is,  $|S_{t}| \leq k$  and  $f(S_{t}) \geq \alpha \cdot OPT_{t}$ . Observe that the dynamic algorithm remembers every query it has made so far. Thus results of queries made in previous times may help find  $S_{t}$  in current time  $t$ .
Oblivious adversarial model. The dynamic algorithms that we develop in this paper are in the oblivious adversarial model as is common for analysis of randomized data structures such as universal hashing [13]. The model allows the adversary, who is aware of the submodular function  $f$  and the algorithm that is going to be used, to determine all the arrivals and departures of the elements in the ground set  $V$ . However, the adversary is unaware of the random bits used in the algorithm and so cannot choose updates adaptively in response to the randomly guided choices of the algorithm. Equivalently, we can suppose that the adversary prepares the full input (insertions and deletions) before the algorithm runs.
Offline algorithms. The offline version of non-monotone submodular maximization was first studied by Feige, Mirrokni, and Vondrak in [27]. They studied unconstrained non-monotone submodular maximization and developed constant-factor approximation algorithms for this problem. In the offline query access model, they showed that a subset  $S$  chosen uniformly at random has a submodular value which is a 4-approximation of the optimal value for this problem. In addition, they also described two local search algorithms. The first uses  $f$  as the objective function, and provides 3-approximation and the second uses a noisy version of  $f$  as the objective function and achieves an improved approximation guarantee 2.5 for maximizing unconstrained non-monotone non-negative submodular functions. Interestingly, they showed  $(2 - \varepsilon)$ -approximation for symmetric submodular functions would require an exponential number of queries for any fixed  $\varepsilon > 0$ .
Oweis Gharan and Vondrak [32] showed that an extension of the 2.5-approximation algorithm can be seen as simulated annealing method which provides an improved approximation of roughly 2.4. Later, Buchbinder, Feldman, Naor, and Schwartz [11] at FOCS'12, presented a randomized linear time algorithm achieving a tight approximation guarantee of 2 that matches the known hardness result of [27]. Bateni, Hajiaghayi, and Zadimoghaddam [9, 8] and Gupta, Roth, Schoenebeck, and Talwar [34] independently studied non-monotone submodular maximization subject to cardinality constraint  $k$  in the offline and secretary settings. In particular, Gupta et al. [34] obtained an offline 6.5-approximation for this problem.
All of the aforementioned approximation algorithms are offline, where the whole input is given in the beginning, whereas the need for real-time analysis of rapidly changing data streams motivates the study of this problem in settings such as the dynamic model that we study in this paper.
Streaming algorithms. The dynamic model that we study in this paper is closely related to the streaming model [3, 36]. However, the difference between these two models is that in the streaming model, we maintain a data structure using which we compute a solution at the end of the stream and so, the time to extract the solution is not important as we do it once. However, in the dynamic model, we need to maintain a solution after every update, thus, the update time of a dynamic algorithm should be as fast as possible.
The known streaming algorithms [44, 28, 29] work in the insertion-only streaming model and they do not support deletions as well as insertions. Indeed, there are streaming algorithms [37, 45] for the monotone submodular maximization problem that support deletions, but the space and the update time of these algorithms depend on the number of deletions which could be  $\Omega(n)$ , where  $n = |V|$  is the size of ground set  $V$ .
For monotone submodular maximization, Badanidiyuru, Mirzasoleiman, Karbasi, and Krause [4] proposed an insertion-only streaming algorithm with a  $(2 + \varepsilon)$ -approximation guarantee under a cardinality constraint  $k$ . Chekuri, Gupta, and Quanrud [14] presented (insertion-only) streaming algorithms for maximizing monotone and non-monotone submodular functions subject to  $p$ -matchoid constraint<sup>5</sup>. Later, Mirzasoleiman, Jegelka, and Krause [44] and Feldman, Karbasi, and Kazemi [28] devel-
For non-monotone submodular maximization subject to cardinality constraint  $k$ , Chekuri, Gupta, and Quanrud [14] claimed that they obtained 4.7-approximation algorithm. However, Alaluf, Ene, Feldman, Nguyen, and Suh [1] found an error in the proof of this approximation guarantee.
oped streaming algorithms with better approximation guarantees for maximizing a non-monotone function under a  $p$ -matchoid constraint. Currently, the best streaming algorithm for maximizing a non-monotone submodular function subject to a cardinality constraint is due to Alaluf, Ene, Feldman, Nguyen, and Suh [1] whose approximation guarantee is  $3.6 + \varepsilon$ , improving the 5.8-approximation guarantee that was proposed by Feldman et al. [28].
Dynamic algorithms. At NeurIPS 2020, Lattanzi, Mitrovic, Norouzi-Fard, Tarnawski, and Zadimoghaddam [40] and Monemizadeh [46] initiated the study of submodular maximization in the dynamic model. They presented dynamic algorithms that maintain  $(2 + \varepsilon)$ -approximate solutions for maximizing a monotone submodular function subject to cardinality constraint  $k$ . Later, at STOC 2022, Chen and Peng [15] studied the complexity of this problem and they proved that developing a  $c$ -approximation dynamic algorithm for  $c < 2$  is not possible unless we use a number of oracle queries polynomial in the size of ground set  $V$ . In 2023, Banihashem, Biabani, Goudarzi, Hajiaghayi, Jabbarzade, and Monemizadeh[7] developed an algorithm for monotone submodular maximization problem under cardinality constraint  $k$  using a polylogarithmic amortized update time. Concurrent works of Banihashem, Biabani, Goudarzi, Hajiaghayi, Jabbarzade, and Monemizadeh[6] and Duettig, Fusco, Lattanzi, Norouzi-Fard, and Zadimoghaddam[22] developed the first dynamic algorithms for monotone submodular maximization under a matroid constraint. Authors of [6] also improve the algorithm of [46] for monotone submodular maximization subject to cardinality constraint  $k$ . There are also studies on the dynamic model of influence maximization, which shares similarities with submodular maximization [48].
In this paper, for the first time, we study the generalized version of their problem by presenting an algorithm for maximizing the non-monotone submodular functions in the dynamic setting.
2 Dynamic algorithm
In this section, we explain the algorithm that we use in the reduction that we stated in Metatheorem 1.2. The pseudocode of our algorithm is given in Algorithm 1, Algorithm 2, and Algorithm 3.
Such reductions were previously proposed in the offline model by [34], and later works extended this idea to the streaming model [14, 44]. We develop a reduction in the dynamic model inspired by these works, though in our proof, we require a tighter analysis to obtain the approximation guarantee in our setting.
We consider an arbitrary time  $t$  of sequence  $\Xi$  where  $V_{t}$  is the set of elements inserted before time  $t$ , but not deleted after their last insertion. Let  $OPT_{t}^{*} = \max_{S \subseteq V_{t}: |S| \leq k} f(S)$ . For simplicity, we drop  $t$  from  $V_{t}$  and  $OPT_{t}^{*}$ , when it is clear from the context.
In the following, we assume that the value of  $OPT$  is known. Although the exact value of  $OPT^*$  is unknown, we can maintain parallel runs of our dynamic algorithm for different guesses of the optimal value. By using  $(1 + \varepsilon')^i$ , where  $i \in \mathbb{Z}$  as our guesses for the optimal value, one of our guesses  $(1 + \varepsilon')$ -approximates the value of  $OPT^*$ . We show that the output of our algorithm satisfies the approximation guarantee in the run whose  $OPT(1 + \varepsilon')$ -approximates the value of  $OPT^*$ . Later, in the appendix, we show that it is enough to consider each element  $e$  only in runs  $i$  for which we have  $\frac{\varepsilon'}{k} \cdot (1 + \varepsilon')^i \leq f(e) \leq (1 + \varepsilon')^i$ . This method increases the query complexity of our dynamic algorithm by only a factor of  $O(\varepsilon^{-1} \log k)$ .
Our approach for solving the non-monotone submodular maximization is to first run the thresholding algorithm with input set  $V$  to find a set  $S_{1}$  of at most  $k$  elements. Since  $f$  is non-monotone, subsets of  $S_{1}$  might have a higher submodular value than  $f(S_{1})$ . Then, we use an  $\alpha$ -approximation algorithm (for  $0 < \alpha \leq 1$ ) to choose a set  $S_{1}' \subseteq S_{1}$  with guarantee  $\mathbf{E}[f(S_1')) \geq \alpha \cdot \max_{C \subseteq S_1} f(C)$ . Next, we run the thresholding algorithm with the input set  $V \backslash S_{1}$  and compute a set  $S_{2}$ . At the end, we return set  $S = \arg \max_{C \in \{S_{1}, S_{1}', S_{2}\}} f(C)$ . Intuitively, for an optimal solution  $S^{*}$ , if  $f(S_{1} \cap S^{*})$  is a good approximation of  $OPT$ , then  $f(S_{1}')$  is a good approximation of  $OPT$ . On the other hand, if both  $f(S_{1})$  and  $f(S_{1} \cap S^{*})$  are small with respect to  $OPT$ , then we can ignore the elements of  $S_{1}$  and show that we can find a set  $S_{2} \subseteq V \backslash S_{1}$  of size at most  $k$  whose submodular value is a good approximation of  $OPT$ . The following lemma proves that the submodular value of  $S$  is a reliable approximation of the optimal solution. The formal proof of this lemma can be found in Section 2.
Lemma 2.1 (Approximation Guarantee). Assuming that  $OPT^{*} \in [\frac{OPT}{1 + \varepsilon'}, OPT]$ , the expected submodular value of set  $S$  is  $\mathbf{E}[f(S)] \geq (1 - O(\varepsilon')) \frac{OPT^{*}}{6 + \frac{1}{\alpha}}$ .
Next, we explain the steps of our reduction in detail.
Let us first fix the threshold  $\tau = \frac{OPT}{k(3 + 1 / (2\alpha))}$ . Then, we fix a  $\tau$ -thresholding dynamic algorithm (for example, [46] or [6]) and suppose we denote it by DYNAMICTHRESHOLDING. Before sequence  $\Xi$  of updates starts, we create two independent instances  $\mathcal{I}_1$  and  $\mathcal{I}_2$  of DYNAMICTHRESHOLDING. The first instance will maintain set  $S_{1}$  and the second instance will maintain set  $S_{2}$ . For instance  $\mathcal{I}_i$  where  $i \in \{1,2\}$ , we consider the following subroutines:
- INSERT  $\mathcal{I}_i(v)$ : This subroutine inserts an element  $v$  to instance  $\mathcal{I}_i$ .
- DELETE $\mathcal{I}_i(v)$ : Invoking this subroutine will delete the element  $v$  from instance  $\mathcal{I}_i$ .
-  $\mathrm{EXTRACT}_{\mathcal{I}_i}$ : This subroutine returns the maintained set (of size at most  $k$ ) of  $\mathcal{I}_i$ .