SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Osama A. Hanna
University of California, Los Angeles ohanna@ucla.edu
Lin F. Yang
University of California, Los Angeles linyang@ucla.edu
Christina Fragouli
christina.fragouli@ucla.edu
In this paper, we provide the first efficient batched algorithm for contextual linear bandits with large action spaces. Unlike existing batched algorithms that rely on action elimination, which are not implementable for large action sets, our algorithm only uses a linear optimization oracle over the action set to design the policy. The proposed algorithm achieves a regret upper bound  $\tilde{O} (\sqrt{T})$  with high probability, and uses  $O(\log \log T)$  batches, matching the lower bound on the number of batches [13]. When specialized to linear bandits, our algorithm can achieve a high probability gap-dependent regret bound of  $\tilde{O}(1 / \Delta_{\mathrm{min}})$  with the optimal log  $T$  number of batches, where  $\Delta_{\mathrm{min}}$  is the minimum reward gap between a suboptimal arm and the optimal. Our result is achieved via a novel soft elimination approach, that entails "shaping" the action sets at each batch so that we can efficiently identify (near) optimal actions.
In contextual linear bandits, a learner interacts with an environment over  $T$  rounds: in each round  $t$  the learner observes a (possibly different due to context change) set of actions  $\mathcal{A}_t \subseteq \mathbb{R}^d$ , plays one of them, and receives a reward that follows a noisy linear function parametrized by an unknown vector in  $\mathbb{R}^d$ . The objective of the learner is to minimize regret - how much reward it loses over the  $T$  rounds by not always playing the "highest reward" (optimal) action. To achieve this, the learner at each round updates its policy (its method to select what action to play) based on what it has learned from all past actions played and rewards observed. Linear bandits form the special case where the action set is always the same, i.e.,  $\mathcal{A}_t = \mathcal{A}$  for all rounds  $t$ . Contextual linear and linear bandits have been widely investigated due to their significance in both theory and practice (eg., see [24]).
Batched Setting. In numerous real-world use cases, the learner may be restricted to change the policy a limited (small) number of times. This constraint may stem from factors such as computation or communication considerations, or may be imposed by the nature of the application, as is the case in multi-stage clinical trials or online marketing campaigns with high response rates, where it is not feasible to update the policy after each response. Similarly, the use of crowdsourcing platforms or the need to conduct time-consuming simulations in reinforcement learning may require policies with limited adaptivity. As a result, there has been significant interest in designing algorithms that can achieve the optimal regret with limited policy switches [30, 31, 13, 12, 21, 32, 16]. This setup is known as the batched contextual linear bandit problem: the  $T$  rounds are partitioned into batches, and the learner can collect rewards and update the action selection policy only at the end of each batch.
Large Action Space. Contextual linear bandit applications frequently need to explore an extremely large (even continuous) set of actions, e.g., millions of products to be recommended. As other examples, in the classical bandit problem of clinical trials, each decision involves selecting a treatment option from a potentially infinite set of mixed treatments [15]. In manufacturing problems, the goal is often to maximize revenue by selecting from a very large set of decisions, with the revenue associated with each decision being unknown [36]. Additionally, in applications where actions correspond to images in a database or high-dimensional embeddings of complex documents like webpages, the set of actions can be vast [26, 5]. As a result, there is a strong interest in algorithms that can be efficiently implemented when the action space is large or infinite [11, 7, 19, 39, 41].
While computationally-efficient batched algorithms exist for contextual linear bandits with small action sets, and efficient ones that are not batched exist for contextual linear bandits with large action sets, to date, there are no efficient batched algorithms that can handle large action spaces. Existing batched algorithms for contextual linear bandits [32,16] rely on action elimination that requires a linear scan of the action set; while efficient non-batched algorithms for large action spaces do not extend to the batched setting [32,16] (see related work in the following for more details).
Our Contributions. In this paper, we provide the first efficient batched algorithm for contextual linear bandits with nearly optimal regret upper bound of  $\tilde{O}(d^{3/2}\sqrt{T})$  with high probability, while using  $O(\log \log T)$  batches, which matches the lower bound on the number of batches required to achieve  $\sqrt{T}$ -type regret bounds [13]. For linear bandits, our algorithm can attain a high probability gap-dependent regret bound of  $\tilde{O}(d^3/\Delta_{\min})$  with the optimal log  $T$  number of batches [13], where  $\Delta_{\min}$  represents the minimum reward gap between a suboptimal arm and the optimal.
Our algorithm for linear bandits, that we term SoftBatch, builds on a form of "soft elimination". Our observation is that, a good algorithm should be able to approximate the gap  $\Delta(a)$  between each action  $a \in \mathcal{A}$  and the optimal one with  $O(\Delta(a))$  accuracy; and if we can do that, then we can use this knowledge to limit the number of times we play suboptimal actions, as well as use this knowledge to select which actions we want to play at all. As essentially all batched algorithms do, at each batch we select and play (a small number of) actions that enable to estimate well the unknown parameter vector without incurring large regret. In particular, for each batch, we choose a set of well-behaved basis actions (e.g., a barycentric spanner [7]), established by calling an optimization oracle polynomial times. However, instead of selecting at batch  $m$ , vectors from the "true" action set  $\mathcal{A}$ , we consider virtual "weighted" sets  $\tilde{\mathcal{A}}_m$ , where each action's magnitude is weighted inversely proportional to the estimated gap  $\Delta(a)$ , and select vectors guided by these weighted action sets. Then we play each basis action  $a$  a number of times inversely proportional to the square of the estimated gap  $\Delta(a)$  to preserve small regret. This in return provides us an accurate estimator for the optimal parameter by the benign properties of the basis actions. Thus our approach implements a form of soft elimination (shaping) of the action set, where the actions closest to the optimal become increasingly dominant. A crucial part in our design is that we never actually calculate the gaps  $\Delta(a)$  for all actions  $a \in \mathcal{A}$  (only for the basis actions). The exploration policy we propose uses solely a linear optimization oracle applied to the original action set.
Our contextual bandit algorithm utilizes a recent reduction technique [18, 17] to transform the problem into a linear bandit problem. We incorporate the reduction into our batched linear bandit algorithm, by constructing an efficient linear optimization oracle for the exponentially large action set in the reduced problem using a linear optimization oracle for the original action sets (contexts).
Our proof techniques may be of independent interest. We develop a novel approach to bound regret in linear bandits, we design an efficient exploration policy using inverse squared gap weighting, and a simple method to handle the case where the action set does not span  $\mathbb{R}^d$ , where  $d$  is the problem dimension. Our approach avoids the necessity of imposing assumptions, such as the one in [41], which entails having a subset of  $d$  actions forming a matrix with determinant at least  $r^d$  for a constant  $r$ . These assumptions can be strong, particularly when dealing with changing action sets, and may not hold after modifying the action set, for instance, by eliminating or weighting actions.
Related Work. Contextual linear and linear bandits have had significant impact both in theory and practice [1, 11, 28, 27, 24, 26, 37, 4, 8, 10]). The best performing algorithms achieve a regret bound  $\tilde{O}(d\sqrt{T})$  [11, 11], matching the regret lower bound  $\Omega(d\sqrt{T})$  [24]. The same algorithms achieve a
$^1\tilde{O}$  hides log factors.
nearly optimal regret upper bound  $\tilde{O}\left(\frac{d^2}{\Delta_{\min}}\right)$  if the minimum gap of suboptimal arms is lower bounded by  $\Delta_{\mathrm{min}}$ . However, the resulting policies require updates at every time step and involve solving a non-convex optimization problem, which is not practical for large action spaces [33, 11].
Batched algorithms. Existing batched algorithms for contextual linear bandits [32, 16, 18] have achieved nearly optimal regret upper bounds of  $\tilde{O}(d\sqrt{T})$ . However, these algorithms rely on action elimination, which involves either performing a linear scan on the action set or solving an optimization problem over the non-convex set of good (not eliminated) actions to design and implement the policy at each time step. Similarly, batched algorithms for linear bandits [25, 12] also rely on action elimination. Although, unlike contextual bandits, the elimination constraint in linear bandits can be linear, which can be exploited to efficiently compute the policy (under certain assumptions) [7], resulting in an  $\tilde{O}(d^{3/2}\sqrt{T})$  regret upper bound, it requires solving an optimization problem over the action set with an elimination constraint. This can be much harder than solving the optimization problem over the action set without additional constraints for some sets, such as the non-convex set resulting from the reduction of contextual to linear bandits [18].
Efficient algorithms for large action spaces. There is a long line of work on efficient algorithms for linear bandits that only rely on a linear optimization oracle over the action set [7, 11, 9, 19, 20]. However, these algorithms cannot be extended to the batched setting without extra assumptions on the action set, and more importantly, they do not extend to the batched contextual setting. Existing efficient algorithms for contextual linear bandits [6, 41, 11] can achieve  $\tilde{O}(d^{3/2}\sqrt{T})$  regret bound, but it remains unclear if they can be extended to the batched setting, particularly given the challenge posed by changing action sets. Another line of work attempts to design efficient algorithms using hashing-based methods to approximate the maximum inner product [39, 22], but these methods result in complexity that is sublinear but still polynomial in the number of actions.
Table 2 in App. A summarizes how our results position w.r.t. related work.
2 Model and Notation
Notation. We use  $[n]$  for a natural number  $n$  to denote the set  $\{1, \dots, n\}$ ;  $\mathbf{1}(E)$ , for an event  $E$ , to denote the indicator function which returns 1 if  $E$  holds and 0 otherwise;  $\mathcal{B}_r = \{a \in \mathbb{R}^d | \|a\|_2 \leq r\}$  to denote the ball of center 0 and radius  $r$ ;  $\mathcal{S}_r = \{a \in \mathbb{R}^d | \|a\|_2 = r\}$  to denote the sphere of center 0 and radius  $r$ ; and  $\|a\|_{\mathbf{V}} = \sqrt{a^\top \mathbf{V}a}$  to denote the matrix norm of a vector  $a \in \mathbb{R}^d$  with respect to a positive semi-definite matrix  $\mathbf{V}$ . Table in App. summarizes our notation.
Contextual Linear Bandits. We consider a contextual linear bandit problem over an horizon of length  $T$ , where at each round  $t \in [T]$ , the learner receives a set of actions  $\mathcal{A}_t \subseteq \mathbb{R}^d$  sampled from an unknown distribution  $\mathcal{D}$  independently from other rounds. The learner plays an action  $a_t \in \mathcal{A}_t$  and receives a reward  $r_t = \langle a_t, \theta_\star \rangle + \eta_t$ , where  $\theta_\star$  is an unknown system parameter vector with  $\theta_\star \in \mathbb{R}^d$ , and  $\eta_t$  is noise that is zero mean conditioned on the filtration of historic information  $(\mathcal{A}_1, a_1, r_1, \dots, \mathcal{A}_t, a_t)$ . The learner adopts a policy that maps the history  $(\mathcal{A}_1, a_1, r_1, \dots, \mathcal{A}_t)$  to a distribution over the action set  $\mathcal{A}_t$ , with the objective of minimizing the pseudo regret defined as
$$
R _ {T} = \sum_ {t = 1} ^ {T} \sup  _ {a \in \mathcal {A} _ {t}} \left\langle a - a _ {t}, \theta_ {\star} \right\rangle . \tag {1}
$$
For simplicity, we assume that  $\mathcal{A}_t$  is compact for all  $t\in [T]$  almost surely, which ensures the existence of an action  $a_{\theta}\in \mathcal{A}_t$  that attains the supremum  $\sup_{a\in \mathcal{A}_t}\langle a,\theta \rangle$ . Non-compact sets can be handled using sufficiently small approximations. We also adopt the following standard assumption [24].
Assumption 1. (Boundedness.)  $\theta_{\star} \in \mathcal{B}_1, \mathcal{A}_t \subseteq \mathcal{B}_1$ , and  $|r_t| \leq 1$  almost surely  $\forall t \in [T]$ .
Linear Bandits. Changing the action set over time enables to model contextual information. If the action space is fixed, namely,  $\mathcal{A}_t = \mathcal{A}$  for all  $t\in [T]$ , the problem is known as Linear Bandits. For Linear Bandits, we denote an optimal action by  $a^{\star} = \arg \max_{a\in \mathcal{A}}\langle a,\theta_{\star}\rangle$  and define the gap  $\Delta_{a} = \langle a^{\star} - a,\theta_{\star}\rangle$  for all actions  $a\in \mathcal{A}$ .
Batched Setting. In a batched setting, the learner is only allowed to change the policy at  $M$  pre-chosen rounds, where  $M$  is the number of batches. Batch  $m$  includes  $T_{m}$  rounds,  $m \in [M]$ , with  $\sum_{m=1}^{M} T_{m} = T$ . In each batch, the learner adopts a policy  $\pi$  that takes as input the action set  $\mathcal{A}_{t}$  along with all the previous history except for rewards observed in the current batch, and outputs a
distribution over the action set  $\mathcal{A}_t$ . In particular, the rewards of the actions pulled in the current batch are utilized solely to update the policy at the end of the batch.
Regularized least squares. Let  $\{a_i, r_i\}_{i=1}^n$  be a sequence of  $n$  pulled actions and observed rewards over  $n$  rounds. The regularized least squares estimate  $\hat{\theta}$  of  $\theta_{\star}$  based on this action-reward sequence can be calculated as
$$
\hat {\theta} = \mathbf {V} ^ {- 1} \sum_ {i = 1} ^ {n} r _ {i} a _ {i}, \tag {2}
$$
where  $\mathbf{V} = \lambda \mathbf{I} + \sum_{i=1}^{n} a_i a_i^\top$ , and  $\lambda$  is the regularization parameter.
Goal. Our goal is to design efficient batched algorithms for Contextual Linear and Linear Bandits with large (even infinite) action spaces that achieve (nearly) optimal regret.
We will do so by making use of the linear optimization oracles defined next.
Definition 1. A linear optimization oracle for a set  $\mathcal{A}$  is a function  $\mathcal{O}(\mathcal{A};.)$  which takes as input  $\theta \in \mathcal{B}_1$  and outputs  $\mathcal{O}(\mathcal{A};\theta)\in \mathcal{A}$  with  $\langle \mathcal{O}(\mathcal{A};\theta),\theta \rangle = \sup_{a\in \mathcal{A}}\langle a,\theta \rangle$ . An approximate linear optimization oracle with additive error at most  $\epsilon$  for the set  $\mathcal{A}$  is a function  $\mathcal{O}_{\epsilon}^{+}(\mathcal{A};.):\mathcal{B}_{1}\to \mathcal{A}$  that satisfies  $\langle \mathcal{O}_{\epsilon}^{+}(\mathcal{A};\theta),\theta \rangle \geq \sup_{a\in \mathcal{A}}\langle a,\theta \rangle -\epsilon ,\forall \theta \in \mathcal{B}_1$ . An approximate linear optimization oracle with multiplicative error  $0 < \alpha < 1$  for the set  $\mathcal{A}$  is a function  $\mathcal{O}_{\alpha}^{\times}(\mathcal{A};.):\mathcal{B}_{1}\to \mathcal{A}$  that satisfies  $\langle \mathcal{O}_{\alpha}^{\times}(\mathcal{A};\theta),\theta \rangle \geq (1 - \alpha)\sup_{a\in \mathcal{A}}\langle a,\theta \rangle$ ,  $\forall \theta \in \mathcal{B}_1$ .
Assumption 2. (Linear optimization oracle.) We assume that we can access a linear optimization oracle  $\mathcal{O}(\mathcal{A}_t;.,)$  for each set of actions  $\mathcal{A}_t$  with running time at most  $\mathcal{T}_{opt}$  and space complexity  $\mathcal{M}_{opt}$ .
We note that assuming a linear optimization oracle over  $\mathcal{A}_t$  is natural [7, 11, 9, 19, 20, 41] since even if the learner perfectly learns the unknown parameter vector  $\theta_{\star}$ , the learner still needs to solve  $\sup_{a\in \mathcal{A}_t}\langle a,\theta_\star\rangle$  to minimize the regret in (I).
3 Efficient Soft Elimination Algorithm for Linear Bandits
In this section we propose and analyze an algorithm (which we call SoftBach and describe in Algorithm  $\square$  for linear bandits, that is, when  $\mathcal{A}_t = \mathcal{A}$
3.1 Main Result
The following two theorems, proved in App. D and E, respectively, formally state that Algorithm I achieves (nearly) optimal regret using  $M = \lceil \log \log T \rceil + 1$  batches with sample and time complexities polynomial in  $d$  and linear in  $T$ . We provide the algorithm description in Section 3.2 and a proof outline in Section 3.3
Theorem 1. Consider a linear bandit instance with action set  $\mathcal{A} \subseteq \mathbb{R}^d$  and horizon  $T$ . There exists a universal constant  $C$  and a choice for the batch lengths such that Algorithm  $\boxed{T}$  finishes in at most  $M = \lceil \log \log T \rceil + 1$  batches with regret bounded as
$$
R _ {T} \leq C \gamma \sqrt {T} \log \log T \text {w i t h p r o b a b i l i t y a t l e a s t} 1 - \delta , \tag {3}
$$
where  $\gamma = 8d\sqrt{C_L(\log(1 / \delta) + \log T)}$ ,  $C_L = e^8 d$  and  $\delta$  is a parameter. Moreover, if  $\forall a \in \mathcal{A}$  with  $\Delta_a > 0$  we have  $\Delta_a \geq \Delta_{\min}$ , then there exists a choice of batch lengths so that Algorithm  $\square$  finishes in at most  $M = \log_4 T$  batches with regret bounded as
$$
R _ {T} \leq C \frac {\gamma^ {2}}{\Delta_ {\min }} \log T \text {w i t h p r o b a b i l i t y a t l e a s t} 1 - \delta . \tag {4}
$$
Our regret bounds achieve nearly optimal dependency on  $T$ , and match the best known regret bounds of  $\tilde{O}(d^{3/2}\sqrt{T})$  for (unbatched) efficient contextual linear bandit algorithms [6, 41, 11], while losing a  $\sqrt{d}$  factor when compared to the  $\Omega(d\sqrt{T})$  lower bound [24]. This extra  $\sqrt{d}$  factor is due to relying on the best known method to design a notion of spanner of the set of actions (as we explain in section 3.2) with radius  $\sqrt{C_L} = O(\sqrt{d})$  using linear optimization oracles. Any future improvement that reduces the radius from  $O(\sqrt{d})$  to  $O(1)$  will immediately result in nearly optimal regret bounds for Algorithm 1. The following result upper bounds the time and space complexity.
Algorithm 1 [SoftBatch] A Batched Algorithm for Linear Bandits
1: Input: action set  $\mathcal{A} \subseteq \mathbb{R}^d$ , horizon  $T$ , number of batches  $M$ , batch lengths  $\{T_m\}_{m=1}^M$ , confidence parameter  $\delta$ .
2: Let  $\mathcal{A}' = \mathcal{A} \cup \mathcal{B}_{1 / T}$ ,  $C_L = e^8 d$ ,  $\gamma = 8d\sqrt{C_L(\log(1 / \delta) + \log T)}$ .
3: Initialize:  $\theta_{1} = 0$ ,  $a_1^{\star}$  is a random action in  $\mathcal{A}$ ,  $\Delta_1(a) = 1 \forall a \in \mathcal{A}'$ , and  $T_0 = 1$ .
4: for  $m = 1:M$  do
5: Calculate  $\{a_1,\dots ,a_d\} = \mathrm{LWS}(\mathcal{A}',\eta_m = \sqrt{T_{m - 1}} /(8\gamma),a_m^\star ,\theta_m)$
6: For the set  $\{a_1,\ldots ,a_d\}$  assign  $\pi (i) = \frac{1}{d}$ $\forall i\in [d]$
7: for  $i = 1:d$  do
8: If  $a_i \notin \mathcal{B}_{1/T}$ , calculate  $\Delta_m(a_i) = \langle a_m^\star - a_i, \theta_m \rangle$  and pull it  $n_m(i) = \left\lceil \frac{\pi(i) T_m / 8}{(1 + \sqrt{T_{m-1}} \Delta_m(a_i) / (8\gamma))^2} \right\rceil$  times. Go to step 10 if the number of pulls in the current batch reaches  $T_m$ . Terminate Algorithm if the total number of pulls reaches  $T$ .
9: Pull action  $a_0 = a_m^\star$  for  $\max \{0, T_m - \sum_{i=1}^d n_m(i)\}$  times.
10: Compute the regularized (with  $\lambda = 1$ ) least squares estimator  $\mathbf{V}_m = \mathbf{I} + \sum_{i=1}^{T_m} \tilde{a}_i \tilde{a}_i^\top$  and  $\theta_{m+1} = \mathbf{V}_m^{-1} \sum_{i=1}^{T_m} r_i \tilde{a}_i$ , and  $\tilde{a}_i$  is the action pulled in  $i$ -th round of the batch.
11: Update  $a_{m + 1}^{\star} = \mathcal{O}_{\frac{1}{T}}^{+}(\mathcal{A};\theta_{m + 1})$
Theorem 2. Algorithm  $\boxed{I}$  finishes in  $\tilde{O}(Td^2 + d^4 M + \mathcal{T}_{opt}d^3 M)$  runtime and uses  $\tilde{O}(d^2 + \mathcal{M}_{opt})$  memory, where  $\mathcal{T}_{opt}, \mathcal{M}_{opt}$  are the time and space complexity of the linear optimization oracle.
We observe that unlike algorithms that require a linear scan on the action set, our space and time complexities are polynomial in the parameters  $d$ ,  $T$ , and  $\mathcal{T}_{\mathrm{opt}}$ .
3.2 SoftBatch (Algorithm 1) Description
Intuition. The main intuition behind SoftBatch is that, we do not need to necessarily eliminate suboptimal actions; it suffices to be able to select and play a small set of unique actions  $\mathcal{C}_m$  in each batch  $m$ , that allows to estimate increasingly well the parameter vector  $\theta_{*}$  and the best action  $a^{\star}$  while playing suboptimal actions for a small number of times. Our algorithm proposes a novel way to select such sets  $\mathcal{C}_m$  efficiently, through a form of "action set shaping" that we will describe in this section. Additionally, to learn  $\theta_{*}$  while achieving a (nearly) optimal regret, SoftBatch plays each action  $a \in \mathcal{C}_m$  a number of times  $\propto 1 / \Delta_a^2$ , where  $\Delta_a = \langle a_\star - a, \theta_\star \rangle$  is the gap for action  $a$  (i.e., we play the suboptimal actions in  $\mathcal{C}_m$  for a small number of times so as not to accumulate regret). SoftBatch enables to estimate the gap  $\Delta_a$  within a constant factor for any action  $a$  (yet only does so for a limited number of actions in each batch), and essentially uses the gaps  $\Delta_a$  as a guide on which actions to play and for how many rounds each.
Steps. SoftBatch (Algorithm 1) takes as input the action set  $\mathcal{A} \subseteq \mathbb{R}^d$ , the horizon  $T$ , the number of batches  $M$ , and the batch lengths  $\{T_m\}_{m=1}^M$ , and operates as follows
In batch  $m$ , the algorithm starts with a current estimate of the parameter vector  $\theta_{\star}$ , which we call  $\theta_{m}$ , and an estimate of the optimal action  $a^{\star}$  which we call  $a_{m}^{\star}$ ; note that given these, we are able to estimate for any action  $a \in \mathcal{A}$  the gap  $\Delta_{m}(a) = \langle a_{m}^{\star} - a, \theta_{m} \rangle$  (but we will only do so for the actions the algorithm actually plays). The algorithm then calls LWS, a Linear Weighted Spanner subroutine (described in Algorithm 2), that it feeds with an augmented action space  $\mathcal{A}' = \mathcal{A} \cup \mathcal{B}_{1/T}$  for reasons we will explain later. LWS selects  $d$  actions  $\mathcal{C}_{m} = \{a_{1}, \dots, a_{d}\}$  to play in batch  $m$  (note that some of these may belong to  $\mathcal{B}_{1/T}$  and will in this case not be played). Each of these  $d$  actions  $a_{i}$  is pulled  $n_{m}(i) \propto \frac{\pi(i)}{\Delta_{m}(a_{i})^{2}}$  times, where  $\pi(.)$  is a uniform exploration distribution with value  $1/d$  for all the  $d$  actions. We show in the proof of Theorem [1] that  $\sum_{i=1}^{d} n_{m}(i) \leq T_{m}$ ,  $\forall m \in [M]$ , with high probability. To guarantee that the length of the batch is  $T_{m}$ , the algorithm pulls  $a_{m}^{\star}$  for the remaining rounds, if needed. At the end of the batch, the algorithm updates its estimate  $\theta_{m+1}$  of the unknown parameter vector using regularized least squares.
2We discuss how to select  $M$  and  $\{T_m\}$  in App. D
The remaining core part of the algorithm to discuss is the subroutine LWS, and we do so next. We start by providing our reasoning behind the LWS design.