SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Grim-trigger strategies. Similarly to the other related models and papers Fiat et al. [2007], Chionas et al. [2023], we will also use the following Grim-Trigger (GT) mechanisms in agents' strategies. When the algorithm, run by an agent (who is not deviating), discovers certain state that may suggest deviation of other agents, it (repeatedly) includes itself in subsequent queries for a long period. This is done to discourage agents from creating deviations to the CGT algorithm. We will call such behavior persistent inclusions (of the agent). Strategies with the GT mechanism are called Grim-Trigger strategies. The notion of Grim-trigger strategies were also used in a similar context in repeated games, see [Axelrod and Hamilton, 1981, Nisan et al., 2007, Sec. 27.2]. It plays the role of a punishment mechanism, which is necessary for the existence of equilibria.
Search trees and (ambiguous) queries. For the purpose of designing algorithms which are AE's, we will study binary trees whose leaves are uniquely labeled with elements of the universe  $[n]$  and the internal nodes correspond to queries that could be generated by a search algorithm. More specifically, for such given binary tree and its vertex  $v$ , a query  $Q_v$  contains all leaves in the subtree rooted at  $v$ . Let  $\phi$  be a given feedback history. We say that a query  $Q_v$  is  $\phi$ -ambiguous iff there are at least two different configurations  $K_1, K_2 \in \mathcal{F}_n^k$  compatible with  $\phi$  such that  $\mathrm{Feedback}(Q_v \cap K_1) \neq \mathrm{Feedback}(Q_v \cap K_2)$ . We could omit parameter  $\phi$  whenever it is clear from the context. If the query  $Q_v$  associated with vertex  $v$  is ambiguous, we also call vertex  $v$  ambiguous - all this with respect to some family of configurations  $\mathcal{K}$ .
Eulerian tour. For a given binary tree, we will be often referring to a left-to-right Eulerian tour along the tree (or an Eulerian tour, for short). This is a standard procedure that lists vertices of the tree in the left-to-right recursive order, that is, it lists the root, then recursively vertices in the left sub-tree, followed by recursive enlisting of vertices in the right sub-tree.
2.3 Binary tree search algorithms
Tree algorithms have been extensively studied to solve the combinatorial group testing and contention resolution problems. These algorithms can be thought of as a short version of an Eulerian tour on the (complete) binary tree in which the leaves correspond 1-1 to the  $n$  elements and stations in the literature of CGT and contention resolution, respectively, or agents in our game theoretic framework. As a warm-up, we study the algorithm proposed by Capetanakis [1979a] and we shall call it Binary Search, or BS for short. This algorithm is based on a simple divide and conquer technique. Firstly, as said, consider that the total number of agents correspond 1-1 to  $n$  leaves of a (complete) binary tree. Let  $Q_{v}$  denote the agents that correspond to the leaves of the subtree with root  $v$ . We shall call  $v$  vertex with token, or a token for short (we will formalize the appropriate notation in Section 3 where we analyze our more sophisticated algorithm). At each time  $t$ , agents  $Q_{v}$  form the query, and afterwards  $v$  changes its location depending on the feedback  $\phi$ . Initially,  $v$  is the root of the tree and  $v$  changes its position as follows. At each round  $t$  if  $Q_{v}$  results in no collision, i.e.,  $\phi[t] \in \{\emptyset\} \cup \{i\}$ , where  $i \in K$ , then token  $v$  moves to the next-right subtree where collisions are not yet resolved. If  $Q_{v}$  results in a collision, then token  $v$  moves to the left subtree in order to resolve the collision. Essentially, the algorithm BS traverses the left-to-right Eulerian tour of the binary tree by doing some shortcuts. In order to understand the shortcuts of the token in the algorithm BS compared to the Eulerian tour see Figure 1(a). Note that if  $k = n$ , the tour of the token is exactly the Eulerian tour of the binary tree.
BS runs in  $\Theta (k + k\log (n / k))$  time. This algorithm was proposed in the classical setting of contention resolution without deviations. It is easy to see that BS is  $(n,k)$ -CGT but it is not a  $(n,k)$ -AE. We modify BS by adding the grim trigger strategies as follows. If agent  $i$  is not revealed as long as token  $v$  is the root of a subtree that it belongs to, it will start including itself in the queries persistently in every following round (we may also set up a cap, say, to these persistent inclusions in the next  $4n$  rounds, just to make sure that it is longer than the search algorithm's maximum revealing time without deviation). Let us call this algorithm Grim Trigger Binary Search or GT_BS for short. Even with this modification BS is not an  $(n,k)$ -AE.
Lemma 1. GT_BS is not an  $(n,k)$ -AE.
In the example in Figure 1(a), in the given configuration, agent 7 could deviate by including itself in the query after the second active agent is selected (i.e., the feedback is equal to the id of this agent). It improves its revealing time compared to the one by following BS. By following this simple strategy,
(a) In BS the tour of the token is  $(w_{1},w_{2},w_{3},w_{6},w_{7},6,7)$
(b) In BS_Jumps the tour of token, with the appropriate shortcuts, is  $(w_{2},w_{6},6,7)$
Figure 1: Here,  $n = 8$ ,  $k = 3$ , and active agents are  $K = \{0,6,7\}$ . (a): In BS agents are present in the queries with the following sequence according to the token and feedback:  $\{0,1,2,3,4,5,6,7\} \to \bot$ ,  $\{0,1,2,3\} \to 0$ ,  $\{4,5,6,7\} \to \bot$ ,  $\{4,5\} \to \emptyset$ ,  $\{6,7\} \to \bot$ ,  $\{6\} \to 6$ ,  $\{7\} \to 7$ . Note that the tour of the token was  $((w_1), w_2, w_3, w_6, w_7, 6, 7)$ , whereas the Eulerian tour is  $(w_1, w_2, w_4, 0, 1, w_5, 2, 3, w_3, w_6, 4, 5, w_7, 6, 7)$ . (b): Illustration of BS_Jumps.
the agent will either be better off or will have the same revealing time compared to BS. This leads us to the following important observation that will help us construct our next algorithm (in Section 3): In order for an algorithm to be an  $(n,k)$ -AE, an active agent who has not been selected should be included in the query immediately after the revealing of the  $(k-1)$ 'st active agent.
3 Efficient equilibrium with known size  $k$
The algorithm, called Binary Search with Jumps (or BS_Jumps, for short), is based on a binary tree, in which leaves correspond 1-1 to agents (this correspondence is part of the input to every agent, thus it is common). More specifically, we enumerate leaves from left to right, using consecutive numbers in  $[n] = \{0, 1, \dots, n - 1\}$ , and  $i$ -th leaf corresponds to agent  $i$ . The tree is complete, if  $n$  is a power of 2, or almost complete otherwise, in the sense that all leaves are at the same distance from the root, if possible, or their distances may differ only by 1, respectively.
Vertex with token and definition of queries. In each round, an agent maintains a distinguished vertex of the tree, called vertex with token, or a token for short. The query consists of ids of all leaves that are descendants of the vertex with token. Here a descendant means that the token vertex is located on the path from the leaf to the root, including both ends. From the perspective of an agent, it finds itself included in the query if its corresponding leaf is a descendant of the current vertex with token – we call it an (algorithmic) query inclusion rule.
The initial position of the token, in round 1, is in the leftmost child of the root of the tree. The current (round) position of the vertex with token is computed based only on feedback history and the agent id  $i$ . The token update rule, described later, is based on the concept of feedback-compatible configurations and ambiguous queries, defined in Section 2 and 2.2, respectively.
Updating token location. The location of the token is calculated at the beginning of each round  $t$  as follows. Consider an execution of the algorithm by an agent  $i$ . Let  $\alpha_{i}[t']$  be the location (vertex of the binary tree) of the token at the beginning of step  $t'$  of the considered execution, for  $1 \leq t' \leq t - 1$ , stored by agent  $i$ . We define  $\alpha_{i}[t]$  to be the earliest of the following two vertices on the left-to-right Eulerian tour on the binary tree starting at  $\alpha_{i}[t - 1]$ :
- the first internal (i.e., non-leaf) vertex  $v$  of the tree in that tour such that query  $Q_{v}$  is ambiguous with respect to the set of configurations  $\mathcal{K}_{\phi}|_i$
- the first leaf in that tour that is in every configuration in  $\mathcal{K}_{\phi}|_{i}$ .
Note that if the vertex defined in the first bullet does not exist, it means that all configurations in  $\mathcal{K}_{\phi}|_{i}$  have the same feedback at each subsequent internal vertex of the Eulerian tour. Then,  $\alpha_{i}[t]$  is
Algorithm 1: BS_Jumps  $(n,k)$ , pseudo-code for active agent  $j$
Output  $K$
$\begin{array}{rl} & v\leftarrow \text{root} // \text{Initialization of the token}\\ & K\leftarrow \emptyset // \text{Initialization of the set of revealed active agents}\\ & \text{for } t = 1,2,\ldots k\log n\text{ do}\\ & \text{if } j\in \text{Right}(v)\text{ then}\\ & \text{else if } j\in \text{Child}(v)\text{ then}\\ & \text{else}\\ & \text{if } j\notin K\text{ then}\\ & \text{else}\\ & \text{if } j\in Q_v// \text{Persistent inclusions if } j\text{ has not yet revealed}\\ & \text{if }\phi [t] = \{i\}\text{ then}\\ & \text{if } K\leftarrow K\cup \{i\} // \text{Agent } i\text{ is revealed from feedback }\phi [t]\text{ in current}\\ & \text{round } t\\ & v\leftarrow \text{update_token}(v,\phi) \end{array}$
defined in the second bullet as the first leaf  $j$  in the tour such that the corresponding agent  $j$  is in every  $K \in \mathcal{K}_{\phi}|_{i}$ .
Grim-trigger sequence. If the computed token location  $\alpha_{i}[t]$  is after the leaf corresponding to agent  $i$ , according to the Eulerian tour, and agent  $i$  has not been revealed, it starts including itself persistently in the following queries.
Termination rule. The algorithm for agent  $i$  finishes its algorithm execution immediately after it is revealed, if it occurs before starting the grim-trigger sequence by this agent. If such revealing does not occur and the agent (eventually) starts its grim-trigger sequence, it continues transmitting until the end of the sequence and then it switches off.
The Algorithm 1 shows how BS_Jumps works. We use three functions:
- Right(\cdot) - which takes as an argument the current token location and returns the set of leaves of a right subtree;
- Child(\cdot) - which takes as an argument the token location and returns the set of leaves that are descendants of the token;
- update_token(\cdot, \cdot) - which takes as arguments the current token location and the feedback history and returns the next token location according to the token update rule (see the two bullets in the "Updating token location" paragraph).
Efficient implementation of BS_Jumps. In this work, the main metric of consideration is the revealing time (or query complexity), in which the last agent was revealed. In this paragraph, we briefly discuss other metrics of efficiency of our protocol, such as the computational and communication complexity. The most time-consuming part of algorithm BS_Jumps is the token update. Because of the structure of binary tree, identifying ambiguous internal vertices or leaves that are in every  $\phi$ -compatible configuration could be done fast by each agent, in each step. In short, the agent simulates locally the Binary-Search-like process and evaluates whether the number of "remaining" leaves is large enough compared to the number of remaining active agents (the latter could be computed from the feedback  $\phi$ ). If it is, it yields ambiguity, as the number of active leaves/agents in the subtree of the currently considered vertex could be 0 or larger. As this local procedure is built on the top of Binary Search (simulated locally), it is efficient, in the sense that the number of local computational time in any agent is  $O(k + k\log(n / k))$ , which is  $O(1)$  amortized per round. More details of efficient implementation and analysis of correctness and efficiency are given in the Supplementary Material. Regarding the communication complexity of the protocol, it can be derived as a function of the revealing time of the protocol. In each round, each active agent communicates a single bit. The output of the ternary feedback can be encoded by  $\log n$  bits. Let revtime be the revealing time of the protocol. Thus, total communication complexity of a protocol is  $(k + \log n)\cdot \text{revtime}$  bits. The total number of local steps during the protocol could be upper bounded by  $\log n\cdot \text{revtime}$ , because each
step/round of algorithm BS_Jumps requires updating of the token, which is a logarithmic operation (see the Supplementary Materials, Section 3). Lastly, the memory needed in each agent is logarithmic, mainly due to the simple recursion in the main algorithm and the token update, and a constant number of variables. This is under assumption that any basic arithmetic operation on variables/values, represented by logarithmic numbers of bits, could be done in a single local step, while these numbers could be stored in a unit of memory.
Theorem 3.1. Algorithm BS_Jumps  $(n,k)$  is an  $(n,k)$ -AE, for any  $2\leq k\leq n$ , and has revealing time  $O(k\log (2n / k))$
4 Equilibria for unknown size  $k$
We first show in Section 4.1 that in the restricted feedback - with collision detection only - universal  $n$ -AE come at a high cost in performance measures. Intuitively, the high cost in that setting occurs because the adversary has even more power, since it does not only select the configuration but also the size of it and the agents are agnostic to it. We then give a universal  $(n, k')$ -AE which is an  $(n, k)$ -CGT with maximum revealing time  $O(n^{k-1})$ , for any  $2 \leq k \leq k' \leq n$ . Here,  $k$  is the actual number of active agents, unknown to the agents, while  $k'$  is the known upper bound. In particular, the maximum revealing time is polynomial for constant-size configurations.
4.1 Equilibria characteristics and lower bounds
We start from proving that universal adversarial equilibria require (at least some) dense queries.
Lemma 2. For any  $3 \leq k' \leq n$ , no algorithm with first query of size different from  $n - 1$  is a universal  $(n, k')$ -AE.
Intuitively, by applying Lemma 2 to the first  $n/2$  queries (assuming that the feedback is collision), we either get impossibility at some point or all these queries have to be of size  $n - 1$ . This intuition cannot be extended much beyond the first  $n/2$  queries produced by an algorithm, because each query of size  $n - 1$  somehow restricts the family of configurations of size 2 that we could use in the proof of Lemma 2.
Theorem 4.1. Any algorithm that is an  $(n, k')$ -CGT and universal  $(n, k')$ -AE has the maximum revealing time  $\Omega(n)$ , for any  $k' \geq 3$ . Moreover, the total number of elements in the queries in some executions is  $\Omega(n^2)$ .
4.2 Equilibrium algorithm for unknown  $k$
We now present the algorithm called Block Builder with Grim Trigger (or BB_GR for short), see Algorithm 2 for a pseudo-code. The structure of algorithm BB_GR(n,  $k^{\prime}$ ), where  $k^{\prime} \leq n$  is the known upper bound on  $k$ , consists of some  $x^{\prime} \leq k^{\prime}$  subsequent blocks of queries. In each block of queries  $B_{x}$ , for an integer  $x$  such that  $1 \leq x < x^{\prime}$ , there are  $y_{x} = \binom{n}{n-x} = \binom{n}{x}$  queries, while the last block,  $x^{\prime}$ , contains only one query. To simplify the notation for the sake of this algorithm, but with some abuse of the notation used in previous sections, here we denote the  $r$ th query of block  $B_{x}$  as  $Q_{r}^{x}$ . Until the first selection of an element, we define a query  $Q_{r}^{x}$  as the  $r$ -th set from the family  $\mathcal{F}_{n}^{n-x}$  (where the order of these sets could be fixed arbitrarily by the algorithm). When the first successful selection happens, say for some query  $Q_{r}^{x^{*}}$  in block  $x^{*}$  such that  $x^{*} = x^{\prime} - 2$  (or  $x^{*} = k^{\prime} - 1$  in some cases when  $x^{\prime} = k^{\prime}$ , see the second part of the pseudo-code when the value of  $x$  has been set to  $k^{\prime} - 1$ ), the hidden set  $K$  is revealed as
$$
K = \left\{\text {F e e d b a c k} \left(Q _ {r} ^ {x ^ {*}} \cap K\right) \right\} \cup \left([ n ] \backslash Q _ {r} ^ {x ^ {*}}\right).
$$
After the first selection, the selected agent with  $id = \text{Feedback}(Q_r^{x^*} \cap K)$  includes itself persistently in the following queries up to query  $Q_1^{x'}$ , which is the first query of the last block  $B_{x'}$  executed by the algorithm in the current game. Then, the algorithm stops following the block structure and terminates.
In the analysis of  $\mathbb{B}\mathbb{B}_{-}\mathbb{G}\mathbb{R}(n,k^{\prime})$  below, we show that the block number of the revealing time,  $x^{*}$  satisfies  $x^{*} = k - 1$ , where  $k$  is the actual size of a configuration. Consequently, the number of blocks in the game execution is  $x^{\prime} = k + 1$  or  $x^{\prime} = k$ , where the latter occurs when  $k = k^{\prime}$  (see the second part of the algorithm's pseudo-code, with these two cases).
Algorithm 2: BB_GR(n,  $k^{\prime}$ ), pseudo-code for active agent  $j$
for  $x = 1,\ldots ,k^{\prime} - 1$  do   
// We execute blocks  $B_{x}$  , until first selection   
for  $r = 1,2,\dots ,\binom{n}{n-x}$  do   
 $Q_r^x\gets r$  th query in  $\mathcal{F}_n^{n - x}$  (arbitrarily ordered) if Feedback  $(Q_r^x\cap K) = i$  for some  $i\in K$  then  $t^{*}\gets r$ $K\leftarrow \{i\} \cup ([n]\setminus Q_r^x)$  // Hidden set revealed break   
if Feedback  $(Q_r^x\cap K) = j$  then   
for  $r = t^{*} + 1,\ldots ,\binom{n}{n - x}$  do   
// We continue in block  $B_{x}$  but with grim trigger   
 $Q_r^x\gets \{j\}$  // Persistent inclusions   
if  $x <   k^{\prime} - 1$  then   
for  $r = 1,2,\ldots ,\binom{n}{n-(x+1)}$  do // We run one more block  $B_{x + 1}$  with grim trigger when  $x <   k^{\prime} - 1$ $Q_{r}^{x + 1}\gets \{j\}$  // Persistent inclusions   
 $Q_1^{x + 2}\gets \{j\}$  // Last persistent inclusion when  $x <   k^{\prime} - 1$    
else   
 $Q_1^{x + 1}\gets \{j\}$  // Last persistent inclusion when  $x = k^{\prime} - 1$    
Output  $K$
Lemma 3. BB_GR is an  $(n,k)$ -CGT, for any  $2 \leq k \leq k'$ , with maximum revealing time  $O(n^{k-1})$ .
Lemma 4. BB_GR is a universal  $(n,k')$ -AE.
Theorem 4.2. BB_GR is universal  $(n,k')$ -AE with maximum revealing time  $O(n^{k-1})$  for any number  $k$  of active agents, such that  $k \leq k' \leq n$ .
5 Discussion and further directions
We initiated a study of combinatorial group testing algorithms that are also adversarial equilibria – no agent/element has an incentive to deviate under the presence of an adversary. Our solution in case of known size  $k$  of the hidden set is almost optimal, in the sense that the price of stability is  $O(\log k)$ , i.e., the ratio between our result and the absolute lower bound on revealing time  $\Omega(k \frac{\log n}{\log k})$  by Greenberg and Winograd [1985]. Closing this gap, and more importantly, devising an efficient equilibrium for less complex feedback function is an interesting direction. If negative results could be proved for deterministic solutions, then the question about efficient mixed equilibria (i.e., using randomized algorithms as strategies) would be interesting.
Another interesting question would be to try to close the gap between the bounds on maximum revealing time where the number  $k$  of active agents is known, that is  $O(k\log n)$ , and the bounds where  $k$  is unknown, which is  $O(n^{k - 1})$ .
Other potential areas of application include: considering different feedbacks (e.g., full quantitative) and other related problems, e.g., discovering hidden multi-sets or transmissions of packets on a multiple-access channel without collisions. One may also consider weaker "risk averseness" in the definition of AE, and how it influences efficiency of CGT.
Finally, it would be interesting to study connections of our games to repeated games, see, e.g., Osborne and Rubinstein [1994], where each agent has to transmit more than one packet.
The work of Dariusz R. Kowalski was partially supported by the NSF grant 2131538. The work of Piotr Krysta has been partially supported by the Network Sciences and Technologies (NeST) initiative of the University of Liverpool.
Ned Augenblick, Jonathan T Kolstad, Ziad Obermeyer, and Ao Wang. Group testing in a pandemic: The role of frequent testing, correlated risk, and machine learning. Technical report, National Bureau of Economic Research, 2020.
Robert Axelrod and William D. Hamilton. The evolution of cooperation. Science, 211(4489): 1390-1396, 1981.
Sadegh Bolouki, Mohammad Hossein Manshaei, Vida Ravanmehr, Angela Nedic, and Tamer Başar. Group testing game. IFAC-PapersOnLine, 50(1):9668-9673, 2017. ISSN 2405-8963. 20th IFAC World Congress.
John I. Capetanakis. Tree algorithms for packet broadcast channels. IEEE Transactions on Information Theory, 25(5):505-515, 1979a. doi: 10.1109/TIT.1979.1056093.
John I. Capetanakis. Generalized tdma: The multi-accessing tree protocol. IEEE Transactions on Communications, 27(10):1476-1484, 1979b.
Giorgos Chionas, Bogdan S. Chlebus, Dariusz R. Kowalski, and Piotr Krysta. Adversarial contention resolution games. In Proceedings of the 32nd International Joint Conference on Artificial Intelligence (IJCAI), 2023.
George Christodoulou, Katrina Ligett, and Evangelia Pyrga. Contention resolution under selfishness. Algorithmica, 70(4):675-693, 2014.
Andrea E. F. Clementi, Angelo Monti, and Riccardo Silvestri. Selective families, superimposed codes, and broadcasting on unknown radio networks. In Proceedings of the Twelfth Annual Symposium on Discrete Algorithms, January 7-9, 2001, Washington, DC, USA, pages 709-718. ACM/SIAM, 2001.
Graham Cormode and Marios Hadjieleftheriou. Finding frequent items in data streams. Proceedings of the VLDB Endowment, 1(2):1530-1541, 2008.
Graham Cormode and Shan Muthukrishnan. What's hot and what's not: tracking most frequent items dynamically. ACM Transactions on Database Systems (TODS), 30(1):249-278, 2005.
Graham Cormode, Flip Korn, Shanmugavelayutham Muthukrishnan, and Divesh Srivastava. Finding hierarchical heavy hitters in data streams. In Proceedings 2003 VLDB Conference, pages 464-475. Elsevier, 2003.
Graham Cormode, Minos Garofalakis, Shanmugavelayutham Muthukrishnan, and Rajeev Rastogi. Holistic aggregates in a networked world: Distributed tracking of approximate quantiles. In Proceedings of the 2005 ACM SIGMOD international conference on Management of data, pages 25-36, 2005.
Robert Dorfman. The detection of defective members of large populations. The Annals of Mathematical Statistics, 14(4):436-440, 1943.
Dingzhu Du, Frank K Hwang, and Frank Hwang. Combinatorial group testing and its applications, volume 12. World Scientific, 2000.
Joshua Engels, Benjamin Coleman, and Anshumali Shrivastava. Practical near neighbor search via group testing. In M. Ranzato, A. Beygelzimer, Y. Dauphin, P.S. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, volume 34, pages 9950-9962. Curran Associates, Inc., 2021.
Shashanka Ubaru, Sanjeeb Dash, Arya Mazumdar, and Oktay Gunluk. Multilabel classification by hierarchical partitioning and data-dependent grouping. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 22542-22553. Curran Associates, Inc., 2020.
Jeffrey Xu Yu, Zhihong Chong, Hongjun Lu, and Aoying Zhou. False positive or false negative: Mining frequent itemsets from high speed transactional data streams. In VLDB, volume 4, pages 204-215, 2004.