Manuscript Offprint
arXiv:2610.13571Simultaneous Competitive and Regret Guarantees for TCP Acknowledgment
Abstract
We study simultaneous competitive and regret guarantees for TCP acknowledgment. Each acknowledgment serves all pending packets, and the objective is to minimize the total acknowledgment and waiting costs. It is well known that no deterministic online algorithm achieves a competitive ratio better than 2. Given randomized online experts and , we construct a randomized online algorithm whose realized total cost is always at most times the offline optimal cost OPT and whose expected regret against the expert with the smallest realized cost is . The algorithm requires no advance knowledge of the number of packets or OPT. Our algorithm controls switching costs between experts and uses the gap between the permitted competitive bound and its current cost to determine when to learn. We also prove lower bounds showing that, for , this regret bound is asymptotically optimal in OPT, , and , and that is necessary for sublinear regret.
1 Introduction
In TCP acknowledgment, an online algorithm decides when to acknowledge arriving packets. Each acknowledgment costs one and serves all packets that have arrived but have not yet been acknowledged. Delaying an acknowledgment can reduce the number of acknowledgments, but increases the waiting cost of the packets. The objective is to minimize the number of acknowledgments plus the total waiting cost.
TCP acknowledgment has been studied through competitive analysis, which compares an online algorithm with an optimal offline schedule on the same input. Dooly et al. [2001] show that the greedy algorithm, which acknowledges whenever the waiting cost accumulated since its previous acknowledgment reaches one, is 2-competitive, and that no deterministic online algorithm achieves a smaller competitive ratio. A worst-case competitive guarantee alone, however, does not ensure that an algorithm performs nearly as well as a policy suited to the particular arrival pattern. Different acknowledgment policies may perform well on different inputs.
This motivates an approach based on prediction with expert advice. We are given a collection of online acknowledgment algorithms as experts and use their observed costs to decide which expert to follow. In addition to the competitive ratio, we evaluate the resulting algorithm by its regret: the difference between its total cost and the smallest total cost incurred by an expert on the same input. Writing OPT for the offline optimal cost, an expected regret bound of ensures that the algorithm's expected cost is at most times the expected cost of the best expert in hindsight as OPT grows.
Our goal is to adapt to the experts without giving up the worst-case guarantee of competitive analysis. Specifically, we ask whether an online algorithm can maintain a competitive ratio arbitrarily close to two for every realization of its random choices while achieving expected regret sublinear in the offline optimal cost.
Theorem (Upper bound; see Theorem 3.1). For every and every family of randomized online experts for TCP acknowledgment, there is a randomized online algorithm ALG such that OPT for every input and every realization of the random choices, and
The algorithm requires no prior knowledge of the number of packets or OPT, and uses the polynomial number of arithmetic operations with respect to k and the number of packets.
The regret bound depends on only through an additive term. Allowing the total cost to exceed 2 OPT is necessary for sublinear expected regret. We show that any randomized online algorithm whose total cost is at most 2 OPT on every input and for every realization of the random choices must incur expected regret on some inputs. For , we also establish lower bounds matching the dependence on OPT, , and in the upper bound.
Theorem (Lower bounds; see Section 4). For every , there exists a family of at most deterministic online experts with the following property. Let , and let ALG be any randomized online algorithm whose total cost satisfies OPT on every input and for every realization of the random choices. Then, for every integer , there is an input with on which
Moreover, every randomized online algorithm whose total cost is at most 2 OPT on every input and for every realization of the random choices incurs expected regret on inputs with arbitrarily large OPT.
1.2 Overview of techniques
Learning with switching costs. We first divide continuous time into rounds in which each expert incurs bounded cost. Switching experts requires some care because the learner and the newly selected expert may have different unacknowledged packets. Simply copying the expert's acknowledgment times may therefore cause the learner to incur more waiting cost than the expert. To avoid this, the learner sends one additional acknowledgment when necessary at a switch. Its unacknowledged packets then form a subset of those of the selected expert, and this inclusion is preserved while the learner follows that expert. Consequently, the learner's cost in each round is at most the selected expert's cost, apart from the possible additional acknowledgment at the start. This reduces the learning problem to prediction with expert advice with switching cost at most one. We use the multiplicative-weights method of Geulen et al. [2010], which correlates successive expert choices to control the number of switches.
Maintaining the competitive guarantee. We maintain the nonnegative budget , where is the minimum offline cost up to time , allowing packets to remain unacknowledged and counting their waiting cost only up to . Thus, is the additional cost that the algorithm can incur without violating the competitive bound at that time.
We run the learner on time intervals called blocks, whose sizes are proportional to the budget available at their starts. Within each block, we combine the learner with a randomized threshold algorithm from the family of Karlin et al. [2003]. If the learner's cumulative cost becomes too large relative to that of the threshold algorithm, we switch to the latter. This limits the realized cost of a block while preserving a regret bound against each expert. Moreover, the threshold algorithm has a competitive ratio strictly below two in expectation. We use this advantage to show that completed blocks increase the budget in expectation and to bound the sum of their regret contributions.
When the budget is too small to start a learning block, we instead run a separate procedure that increases it by at least one before returning. This procedure adaptively randomizes between two thresholds and has expected cost per invocation. We show that it is invoked only times in expectation, and hence its total contribution to regret is also .
1.3 Related work
Competitive analysis of TCP acknowledgment. Dooly et al. [2001] provide a deterministic 2-competitive algorithm that acknowledges whenever the accumulated waiting cost since its previous acknowledgment reaches one, and establish the optimality of this competitive ratio. Seiden [2000] proves a lower bound of for randomized online algorithms. Karlin et al. [2003] attain this ratio using a different threshold family: they sample a single threshold at the start and use it throughout the execution. Basiak et al. [2026] study the tradeoff between expected competitiveness and competitive guarantees that hold for every realization of the random choices. Several extensions of TCP acknowledgment have also been studied [Albers and Bals, 2005, Bienkowski et al., 2020, Kawase and Nakayoshi, 2025, Bhore et al., 2026].
Imreh and Németh [2011] adapt the acknowledgment threshold using past arrivals and evaluate the resulting algorithm experimentally. Im et al. [2023] use predictions of the arrival sequence to obtain consistency and robustness guarantees. Bamas et al. [2020] give a multiplicative comparison with a predicted schedule through a learning-augmented primal-dual method. Our learning guarantee is an additive comparison with the best online expert, with no assumption on prediction accuracy.
Simultaneous competitive and regret guarantees. Whether a single algorithm can achieve both guarantees depends on the problem and the benchmarks used. Andrew et al. [2013] show that a constant competitive ratio and sublinear static regret can be incompatible in smoothed online convex optimization. For metrical task systems, Daniely and Mansour [2019] retain a baseline algorithm's competitive ratio in expectation while obtaining regret bounds on every interval. Their competitive guarantee permits an additive constant, whereas ours bounds realized total cost by a multiple of OPT and provides regret bounds for the full input. Goel et al. [2023] obtain sublinear policy regret and an optimal competitive ratio up to a sublinear additive term in online linear control. Harada et al. [2025] study the compatibility of per-round baseline guarantees and sublinear regret in repeated optimal stopping.
Combining online algorithms. Expert-learning methods have also been used to combine online algorithms, with the goal of performing nearly as well as the best constituent algorithm. Blum and Burch [2000] apply expert-learning methods to combine k online algorithms for a metrical task system of diameter D, obtaining expected cost at most times the cost of the best algorithm plus . Buchbinder et al. [2012] give a unified algorithm that interpolates, through parameter tuning, between regret guarantees for expert learning and competitive guarantees for metrical task systems. Algorithm combination also appears in work on untrusted predictions and comparison with a sequence of predictors [Antoniadis et al., 2020, 2023].
2 Model
An input consists of packets indexed by , arriving online at times . The algorithm is not informed when the input ends and does not know in advance. At each time, the algorithm first observes all packets arriving at that time. If any packets are pending, it may then send an acknowledgment, which costs one and serves all pending packets. Let be the acknowledgment times of an algorithm . Each of the intervals and for is called an acknowledgment interval. The algorithm must serve all packets (i.e., ), and the waiting cost of packet is .
Let be the set of packets pending under algorithm after processing all arrivals and any acknowledgment at time . Since each pending packet accumulates waiting cost at unit rate, the waiting cost incurred over is for . The total cost of on is
Let OPT( ) denote the minimum total cost achievable with the input known in advance. We use for the total acknowledgment and waiting cost incurred up to time , including any acknowledgment at . We write for the cost immediately before the arrivals and acknowledgment decision at , with . Thus, is the acknowledgment cost at time . When the input is clear, we abbreviate the total costs as and OPT and omit from the time-dependent quantities. For a nonempty input, , since acknowledging immediately at each distinct arrival time costs at most .
We are given k randomized online algorithms as experts. We assume that an algorithm ALG can simulate each expert online on the same input, observing its acknowledgment decisions and realized costs before making its own acknowledgment decision at each time. We consider an oblivious adversary: the input is fixed independently of all random choices. The experts' random choices are independent of those of ALG, and expectations are taken over both unless stated otherwise.
The algorithms we construct combine multiple algorithms. At each time t, the following order applies, where A is the algorithm being followed immediately before processing time t: (1) receive all packets arriving at t; (2) if A acknowledges at t and any packets are pending, send an acknowledgment; (3) determine whether to switch to another algorithm; and (4) if a switch is made, acknowledge any pending packets and then follow the new algorithm.
For , our competitive guarantee requires the realized total cost to satisfy for every input and every possible realization of the random choices. We define expected regret as , comparing the algorithm with the expert having the smallest realized total cost on the same input. Since , also bounds .
3 Simultaneous competitive and regret guarantees
We provide an algorithm with a competitive guarantee and expected regret sublinear in OPT for fixed k and .
Theorem 3.1. For every and every family of randomized online algorithms for TCP acknowledgment, there is a randomized online algorithm ALG such that, on every input, its realized total cost is always at most OPT and its expected regret satisfies
We first recall the greedy algorithm of Dooly et al. [2001] and establish cost bounds for the threshold algorithms of Karlin et al. [2003] in Section 3.1. In Section 3.2, we construct a learner using only the given experts. Section 3.3 introduces the available budget, which measures how much more we can spend under the competitive guarantee, and gives a procedure for increasing it. Section 3.4 combines these components by switching between the learner and a randomized threshold algorithm on blocks sized according to the budget.
3.1 Competitive algorithms
Let be the minimum cost through time of an offline schedule that may leave packets pending, including their waiting cost through . It depends only on packets received by time . The function is continuous and nondecreasing in , and for all sufficiently large .
The greedy algorithm acknowledges whenever the waiting cost accumulated since its previous acknowledgment reaches one. Its standard competitive analysis [Dooly et al., 2001] shows for every input and time .
For , let be the algorithm of Karlin et al. [2003] that acknowledges as soon as there is an integer for which at least pending packets have each waited at least time units. For , we define to acknowledge each packet immediately upon arrival.
Lemma 3.2. Let be the number of acknowledgments sent by through time . For every input, time , and , we have and
The proof is given in Appendix A.1.
The next lemma bounds the cost for each threshold and the expected cost of randomizing between two thresholds, and provides the inequalities used to analyze the available budget in Section 3.3.
Lemma 3.3. For every input, time , and , we have
Moreover, for any , let equal 1 or , each with probability 1/2. Then,
The proof is given in Appendix A.2.
3.2 Learning with switching costs
Algorithm 1 constructs the learner from the given experts , simulated online.
Let be the set of times at which at least one expert sends an acknowledgment. A round ends when an expert acknowledges or when some expert has incurred one unit of waiting cost during that round. For convenience, set , with interpreted as and integrals from evaluated from 0. For , define the end of round by
where . These boundaries are detected online by simulating the experts.
Round is , with . In particular, acknowledgments at are included in round . Define the expert losses by for . Each expert incurs at most one unit of waiting cost and at most one acknowledgment cost in a round. Hence, .
We call the acknowledgment sent at an expert switch in Algorithm 1 synchronization. Excluding synchronization, the learner's cost in each round is at most the selected expert's cost. Each switch therefore adds at most one to the cost of following the experts.
The weight updates and retention/redraw rule in Algorithm 1 implement the multiplicative-weights method of Geulen et al. [2010] with normalized losses .
Algorithm 1: Learning with switching costs ( )
Input: Experts and fixed learning rate
1 Set for and draw uniformly from ;
2 for do
3 Follow expert during round , skipping acknowledgments when no packets are pending, and observe ;
// Time
4 Set for all ;
5 With probability , set ;
6 Otherwise, set with probability for ;
7 If , acknowledge any pending packets;
Lemma 3.4. Fix the input and the experts' random choices. For any fixed number of completed rounds, let be the learner's cost through the end of round , and let be expert 's cost over these rounds. Then, for every , it holds that
The expectation is taken over the learner's expert selections.
The proof is given in Appendix A.3.
3.3 Increasing the budget
We maintain the competitive guarantee while using by keeping at all times. The available budget is the additional cost we can pay without exceeding this bound. Algorithm 2 starts with no pending packets and increases this budget by at least one when it returns. A simple choice is to run a fresh execution of : each completed acknowledgment interval costs two and increases the budget by at least . Thus, completed acknowledgment intervals suffice to increase the budget by at least one, at a total cost of . Algorithm 2 instead uses the algorithms from Section 3.1 and achieves an expected total cost of .
For , let be the minimum offline cost through restricted to packets arriving in . We use the same superscript for costs and acknowledgment counts of a fresh algorithm execution on these packets. For the initial execution, let and for , with . For any offline schedule through , its cost through is at least . Its cost after is at least , since restricting this part of the schedule to packets arriving after can only decrease its cost. Consequently,
Algorithm 2 specifies the trials and their stopping conditions. Let be the starting time of the algorithm and the end of trial , after any final acknowledgment. The threshold choices use independent fair coins, and the budget stopping condition is monitored continuously as time passes.
Algorithm 2: Budget increase by one
Input: Parameter
1 Set and ;
2 while do
// Time ; no packets are pending
3 Set ;
4 Set with probability and otherwise;
5 Start a fresh execution of on subsequent packets and run it until it has sent three acknowledgments or ;
6 Acknowledge any pending packets;
// Time
7 Set ;
Algorithm 2 may never return if all packets have arrived and been acknowledged during a trial without either stopping condition being met. The cost bound in Lemma 3.5 also covers this case.
Lemma 3.5. Suppose a call to Algorithm 2 starts at time with no pending packets. Throughout this call, . If the call returns, its pending set is empty and the budget is at least . Fix the remaining input and condition on the history at . The expected total cost incurred by this call, summed over all its trials and including any final acknowledgments, is .
Proof. Fix the input and the history at the start of trial , and write . The cost and acknowledgment count of started at on subsequent packets are denoted by and . For either choice , (3) and Lemma 3.3 yield, before any final acknowledgment,
(4)
Here, is evaluated along the execution with threshold . For , the budget increase stays at least . For , the bound keeps it at least . Any final acknowledgment is needed only when the increase reaches two, and leaves at least one. Starting with , this proves that never falls below and increases by at least one on return.
Before the trial stops, Lemma 3.3 implies and hence . Since is continuous, holds at the ending time of a terminating trial. The trial's waiting cost is therefore at most five, and it sends at most three acknowledgments, including any final one. Thus, each trial costs at most eight.
For , we show that the expected number of trials from trial onward, including trial itself, is at most for a sufficiently large fixed constant . Let be the number of packets arriving after . We prove this claim by induction on , for every possible history at the start of a trial with . If , the trial cannot reach a third acknowledgment. Thus, at most one trial is run, and proves the base case.
Now, let and assume that the claim holds whenever fewer than packets remain. If trial is followed by another trial, then it must stop at its third acknowledgment and hence serves at least one of the remaining packets. The number of packets arriving after is therefore strictly smaller than , and hence the induction hypothesis applies at the start of trial . Compare the two possible threshold choices and for trial , on the same remaining input and with the same starting history. If at most one of these choices leads to another trial, then another trial occurs with probability at most and has . The induction hypothesis then bounds the expected number of trials, including the current one, by .
Suppose both choices and lead to another trial. Under either choice, trial ends at its third acknowledgment with budget increase below one. Let be the time at which trial would end if , and let denote the budget during trial if instead . Since , the trial with threshold one ends no earlier than and has . Lemma 3.2 implies . Apply (4) to the execution with threshold one. Together with , we have
Thus, . Applying (4) to the execution with threshold gives if . If , the same inequality gives . The induction hypothesis for the two resulting histories therefore bounds the expected number of trials by , where suffices. This completes the induction.
The first trial uses threshold one. If it leads to another trial, its three acknowledgments imply , and (4) gives . The expected total number of trials is therefore , proving the cost bound.
3.4 The full algorithm
Starting with no pending packets, ALG follows Algorithm 3 with , using Algorithm 2 to ensure sufficient budget before each block. For a block of size starting at , define , where . The block is , including all arrivals and acknowledgments at . If , then it is the final, incomplete block and runs on all remaining input.
As budget recovery and completed blocks leave no pending packets, ALG and the fresh simulations of and start each block with empty pending sets. Both simulations run throughout the block, including while ALG follows the other one. The experts continue their executions from time zero, while the learner starts its first round at and uses their subsequent cost increments as losses. Each block uses fresh, mutually independent randomness for , , and . Write and for their respective costs since , and define their cost difference by . These are the costs of the two simulations, not the cost of ALG.
When switching between simulations, ALG synchronizes by acknowledging any pending packets; while following either simulation, it skips acknowledgments when its own pending set is empty.
Consider a complete block of size starting at and ending at , and define and for . Thus, includes all acknowledgments sent at switches and at the block endpoint. The expert is evaluated in its execution from time zero: includes the waiting cost accrued during the block by packets already pending under at , even if they arrived at or before .
Lemma 3.6. Fix the input and the realizations of the given experts, and condition on the history up to the start time of a complete block of size in Algorithm 3. We have for every realization and . Moreover, for each . Here, expectations
Algorithm 3: Maintaining the competitive guarantee
Input: Experts and parameter
1 while true do
2 while do Run Algorithm 2; // Increase the budget
3 Set and ; // Beginning of the block; no packets are pending
4 Set and independently draw uniformly from ;
5 Independently draw uniformly from ;
6 Start fresh simulations of with learning rate and at , without restarting the experts;
7 while do
8 if and then
9 Synchronize with as described above and follow its simulation until or ;
10 if and then
11 Synchronize with as described above and follow its simulation until or ;
12 Acknowledge any remaining packets; // Time ; the block ends
are over the fresh random choices within the block under this conditioning. The same bounds hold for an incomplete block.
Proof. The fixed input and starting history determine the block endpoint independently of , , and the learner's choices. Abbreviate as . Let be the number of switches back to the learner . Suppose that ALG switches to at time and back to at time . Then, and . Using the definition of and the fact that is nondecreasing, we obtain
Then, summing over all such intervals , we have . Since and , Lemma 3.3 yields for every realization.
We next show that is constant in expectation. Fix the realizations of and , leaving only the randomness of . Let be the sorted sequence of all distinct packet arrival times and acknowledgment times of and within the block, together with the block's start and end times. These times are independent of . Split at into subintervals , where and for . Here, denotes the instant immediately before the events at , i.e. represents the jump at . By construction, is affine on each odd-indexed subinterval . Write and let be the index set of the subintervals on which decreases. Every switch from back to requires to cross downwards on some with , and at most one such switch can occur on each of these subintervals. Consequently, . Taking expectations over , which is uniform on , we have
Moreover, since is nondecreasing, for every we have
Summing over and using the monotonicity of , we obtain
By Lemma 3.3 with , we also have . Taking expectations also over and the random choices of therefore gives .
We next upper bound and in terms of and . Let , where are the switching times within the block, i.e., on the interval , ALG follows if is odd and if is even. Since counts the switches back to , there are odd-indexed intervals and at most even-indexed intervals; in particular, . For and , write .
Each of the M - 1 switches and the block endpoint requires at most one additional acknowledgment. Thus,
For either simulation A, we have . By the definition of , this gives
It remains to bound the increments of appearing in these sums. Each jump of has size at most one, since waiting costs are continuous and each simulation pays one per acknowledgment. The switching thresholds and therefore imply that for odd and for even . Since , we obtain
There are odd-indexed intervals after the initial interval and at most even-indexed intervals. Substituting these increment bounds into the two sums above yields
Using the bounds above and , we obtain . Averaging over , , and the learner's choices, with , gives
using . Using , we obtain .
For an expert with , the regret bound follows from . For , apply the proof of Lemma 3.4 to the expert cost increments within the block. Combining this with the preceding estimate gives . For , substituting gives . For , the bound gives .
For an incomplete block, append sufficiently late dummy packets to complete it and apply the same arguments to the portion preceding the dummy arrivals.
We are now ready to prove Theorem 3.1.
Proof of Theorem 3.1. We first establish the competitive guarantee, then bound the expected regret.
Competitive guarantee. We show that the budget remains nonnegative. Algorithm 2 keeps the budget at least its starting value and leaves no pending packets when it returns. By Lemma 3.6, the cost incurred by Algorithm 3 during a block starting at time is at most . Thus, throughout the block. By the definition and the monotonicity of , we have
This proves the competitive guarantee.
Regret bound. We sum the contributions from the blocks and Algorithm 2. Fix the input and the realizations of the given experts. Before the first block, line 2 of Algorithm 3 repeatedly starts Algorithm 2 until . Each execution that returns increases the budget by at least one by Lemma 3.5. Starting from budget zero, this requires at most executions, including a possible final one that never returns to Algorithm 3. Lemma 3.5 also bounds the total expected cost before the first block by , since is a fixed constant. If the first block starts, the preceding budget bound gives OPT at all subsequent times.
We use the expected increase in to sum the block regret bounds, and the expected decrease in to bound how often Algorithm 2 is run. Consider a completed block from time to with size and cost , and condition on its starting history. By (3), , where . By Lemma 3.6, and . Thus, and . To bound the second moment, we use and obtain
Since , we have and . These inequalities give
(6) where we used and .
We next bound the sum of the square roots of the block sizes. Let be the number of completed blocks, and let the th completed block start at , end at and have size . Lemma 3.5 implies for . Thus, for ,
Since , the number of completed blocks is bounded for the fixed input. Whether a block completes is determined by its starting history. Thus, taking expectations over the starting histories and summing (5) yields
(7)
where the first equality uses , the first inequality follows from (5), and the second inequality uses the preceding displayed bound.
Let be the total number of executions of Algorithm 2 started over the entire input; we next show that . For , let be the time of the last return from Algorithm 2 after or if there is no such return. For each , let be the number of executions of Algorithm 2 that return during . Since there are at most executions before the first block and at most one execution after it that never returns, we have . It remains to bound . Each execution counted by starts with a budget and returns with a budget at least by Lemma 3.5. It therefore decreases by at least . By adding these decreases over the intervals , for , we have
where the last inequality uses and . Taking expectations and applying (6) to each completed block yields
Thus, , and hence .
Lemma 3.5 bounds the expected cost of each of the executions, conditional on its starting history, by . Taking expectations over these histories and summing over the executions gives the total expected cost of these executions as .
Choose an expert with minimum total cost under the fixed realizations. For each completed block , let be the cost incurred by Algorithm 3 and the cost incurred by during that block. Summing the bounds from Lemma 3.6 gives
where the last equality uses (7). If there is a final incomplete block, its size is at most OPT / , and Lemma 3.6 bounds its expected regret by as well. Adding the costs of Algorithm 2 therefore yields . For a nonempty input, OPT absorbs the constant into the square-root term, and an empty input has zero cost. Since under the fixed realizations, averaging over the expert realizations proves the regret bound.
Finally, we remark that Algorithm 3 uses a polynomial number of arithmetic operations with respect to k and n. This is because can be computed by dynamic programming and the number of events (e.g., packet arrivals, switches, block endpoints, rounds, and acknowledgments of experts) requiring explicit processing is bounded by a polynomial of k and n. In particular, when ALG has no pending packets, computations can be deferred until the next packet arrival, at which point only the necessary part of the execution is computed.
4 Lower bounds
We establish two lower bounds that together match the dependence on OPT, k, and in Theorem 3.1 for . The first quantifies the regret required by a competitive ratio close to two, while the second establishes the dependence on the number of experts without imposing a competitive requirement.
4.1 Dependence on
Let be the arrival time of packet for , and let consist of the first packets. On these inputs, a competitive ratio close to two forces substantial waiting on the initial packets. Under the same guarantee with competitive ratio two, the algorithm incurs regret .
Theorem 4.1. For all , every randomized online algorithm ALG satisfying OPT on every input and every realization satisfies, for every and every realization,
For , the same competitive requirement forces regret for every and every realization.
Proof. Since serving multiple packets with one acknowledgment adds at least three units of waiting cost per acknowledgment saved, . For , the guarantee on the prefix gives for every realization of the random choices, requiring packet to be acknowledged before . Thus, each acknowledgment serves exactly one packet for every realization. For , let be the random variable giving the time from the arrival of packet until ALG acknowledges it on the fixed input . The regret of ALG is therefore for every realization.
We show by contradiction that for every and every realization. Suppose instead that there is a realization of ALG's internal randomness for which for some
. Fix such a realization, and let be the first index violating the bound. Throughout the following contradiction argument, denotes its value under this realization, and ALG is deterministic and retains the competitive guarantee on every input. Starting with , we add packets to construct an input that violates the competitive guarantee for the fixed realization.
First, the choice of j implies
Since , choose such that the left-hand side is strictly less than . We keep this fixed throughout the construction.
At the th added arrival, release packets simultaneously at time . The first such arrival is at ; for , the next arrival is time units after ALG acknowledges the packets. Let count packet and all packets added before . Choose the integers successively so that
These conditions are possible because is determined by the earlier choices and . For , also require
which is possible by the strict inequality used to choose c.
For each , consider the input consisting of and the first added arrivals, with no packets arriving after . Consider an offline schedule that acknowledges packets immediately upon arrival, and acknowledges packet and all the added packets together at . Let be the cost of this offline schedule; since it is feasible, for this input. At time , before any acknowledgment at that time, consider the difference between and the cost ALG has incurred so far. Since , the choice of makes this difference at most at the first added arrival. If the input ended there, competitiveness would require ALG to serve the packets within this remaining allowance. Since acknowledgment costs one, their total waiting cost is at most .
We now show that the same bound holds at each added arrival, while the difference decreases by a fixed positive amount. Suppose the packets have total waiting cost . Then, ALG acknowledges them time units after . Hence, . Moving this offline schedule's final acknowledgment from to makes all packets already present wait this much longer, while the newly arriving packets incur no waiting cost. Thus,
The first term is the waiting cost of the packets under ALG. The second accounts for the earlier packets waiting until ALG acknowledges those packets, and the third for the short delay until the next arrival. Since and , the choices of and bound times the last two terms by . Meanwhile, ALG pays between the two arrivals. Consequently,
Thus, at , the remaining cost allowance minus the cost already incurred by ALG is still at most . Applying the competitive guarantee to the input ending at again bounds the total waiting cost of the newly arriving packets by , completing the induction. After finitely many added arrivals, the difference becomes negative: ALG has already paid more than OPT for the input ending at that arrival. This contradicts the competitive guarantee and proves the bound on for every realization on .
For , take . Then for every , giving regret at least . For , every , and the competitive guarantee forces . Thus, the regret is , giving the claimed bound.
4.2 Dependence on the number of experts
To establish a regret lower bound in terms of the number of experts, we construct a family of experts.
Theorem 4.2. For every , there is a family of at most deterministic online experts containing such that, for every randomized online algorithm ALG and every integer , some fixed input with satisfies
Proof. Set and let for . Draw independent Bernoulli random variables with parameter . For each , release packets at and if , and only at if .
Assign each interval to group with . Each expert fixes one of two policies for each group and applies it in every interval of that group. The two policies acknowledge each packet immediately or acknowledge all pending packets at in interval . Include all combinations to obtain a family of experts. This family is independent of , its experts are online on every input, and choosing immediate acknowledgment in every group gives .
By Yao’s principle, it suffices to prove the regret lower bound in expectation over this input distribution for every deterministic online algorithm. Fix such an algorithm ALG. Its cost within is at least if it acknowledges the first packet strictly before , and at least otherwise. These bounds also hold if a packet remains unacknowledged until or later, since it arrives no later than and thus incurs at least waiting cost within the interval. Summing over disjoint intervals therefore gives .
An offline optimum never serves packets from different intervals with the same acknowledgment. Inserting an acknowledgment at the last arrival of the earliest of these intervals saves at least 5/2 waiting cost at a cost of one. It therefore pays one for a single-packet interval and 3/2 for a two-packet interval. Hence, .
For , let count the intervals in group in which packets arrive, and let be the sum of over these intervals. Thus, is the number of two-packet intervals minus the number of single-packet intervals in group . These two types of intervals number and , respectively. Immediate acknowledgment costs two on each two-packet interval and one on each single-packet interval, giving a total cost of . The policy that acknowledges all pending packets at in each interval incurs one acknowledgment and a waiting cost of for the first packet; the second packet, if present, is acknowledged upon arrival and incurs no waiting cost. Its total cost on group is therefore . Since the experts include every combination of the two policies across groups, the best expert can choose the cheaper policy separately for each group. Using and
, we obtain, for every realization of the input,
Since , taking expectations gives
To bound from below, fix a group with and write , where the are independent and take values 1 and -1 with equal probability. Thus, and , giving
In the expansion of , independence and symmetry imply that any term in which some has an odd exponent has expectation zero. The surviving terms have either one index occurring four times or two distinct indices occurring twice each; for each pair of distinct indices, there are arrangements. Consequently,
Next, apply Hölder's inequality with conjugate exponents 3/2 and 3 to and :
Raising both sides to the power 3/2 and rearranging, then substituting the moment formulas above, yields
This bound also holds when , since then . If , then for every , and otherwise exactly of the equal one and the rest are zero. Hence, . Since , these estimates give expected regret for every deterministic ALG. Yao's principle yields the same lower bound on some fixed input for every randomized algorithm. The claim follows from .
Fix , an integer , and a randomized online algorithm ALG satisfying the realized competitive guarantee. Use the expert family from Theorem 4.2. Since is optimal on , the best expert's cost on this input equals . Thus, for , Theorem 4.1 gives regret against on . Theorem 4.2 gives regret against the same family on another fixed input with . Choose whichever of these two inputs gives the larger lower bound. Using with and gives regret . For , the same bound follows from Theorem 4.2 alone, since is bounded and is bounded below by a positive constant.
Since on either input, we conclude that, for every , some fixed input in this range satisfies
This lower bound matches the upper bound in Theorem 3.1 up to constant factors.
The same distribution rules out sublinear expected regret against the offline optimum. For every randomized online algorithm and every , we have and . Averaging yields a fixed input with and .
Acknowledgments
This work was partially supported by the joint project of Kyoto University and Toyota Motor Corporation, titled “Advanced Mathematical Science for Mobility Society”, JST ERATO Grant Number JPMJER2301, JST ASPIRE Grant Number JPMJAP2302, and JSPS KAKENHI Grant Numbers JP21K17708, JP21H03397, JP25K00137, JP26K14718, JP26K02867, and JP26KJ1106.
The authors developed the results and proofs with assistance from OpenAI ChatGPT/Codex and Anthropic Claude. These tools also assisted with language editing and literature discovery. The authors take full responsibility for the final manuscript.
References
Susanne Albers and Helge Bals. Dynamic TCP acknowledgment: Penalizing long delays. SIAM Journal on Discrete Mathematics, 19(4):938–951, 2005.
Lachlan Andrew, Siddharth Barman, Katrina Ligett, Minghong Lin, Adam Meyerson, Alan Roytman, and Adam Wierman. A tale of two metrics: Simultaneous bounds on competitiveness and regret. In Proceedings of the 26th Annual Conference on Learning Theory, pages 741–763, 2013.
Antonios Antoniadis, Christian Coester, Marek Eliáš, Adam Polak, and Bertrand Simon. Online metric algorithms with untrusted predictions. In Proceedings of the 37th International Conference on Machine Learning, pages 345–355, 2020.
Antonios Antoniadis, Christian Coester, Marek Eliáš, Adam Polak, and Bertrand Simon. Mixing predictions for online metric algorithms. In Proceedings of the 40th International Conference on Machine Learning, pages 969–983, 2023.
Étienne Bamas, Andreas Maggiori, and Ola Svensson. The primal-dual method for learning augmented algorithms. In Proceedings of the 34th Annual Conference on Neural Information Processing Systems, pages 20083–20094, 2020.
Mateusz Basiak, Marcin Bienkowski, Yongho Shin, and Agnieszka Tatarczuk. Pure tail constraints for online problems. arXiv preprint arXiv:2609.35337, 2026.
Sujoy Bhore, Michał Pawłowski, and Seeun William Umboh. Online TCP acknowledgment under general delays. In Proceedings of the 29th International Conference on Approximation Algorithms for Combinatorial Optimization Problems, pages 26:1–26:24, 2026.
Marcin Bienkowski, Martin Böhm, Jaroslaw Byrka, Marek Chrobak, Christoph Dürr, Lukáš Folwarczny, Łukasz Jeż, Jiří Sgall, Kim Thang Nguyen, and Pavel Veselý. Online algorithms for multilevel aggregation. Operations Research, 68(1):214–232, 2020.
Avrim Blum and Carl Burch. On-line learning and the metrical task system problem. Machine Learning, 39(1):35–58, 2000.
Niv Buchbinder, Shahar Chen, Joseph Naor, and Ohad Shamir. Unified algorithms for online learning and competitive analysis. In Proceedings of the 25th Annual Conference on Learning Theory, pages 5.1–5.18, 2012.
Amit Daniely and Yishay Mansour. Competitive ratio vs regret minimization: Achieving the best of both worlds. In Proceedings of the 30th International Conference on Algorithmic Learning Theory, pages 333–368, 2019.
Daniel R. Dooly, Sally A. Goldman, and Stephen D. Scott. On-line analysis of the TCP acknowledgment delay problem. Journal of the ACM, 48(2):243–273, 2001.
Sascha Geulen, Berthold Vöcking, and Melanie Winkler. Regret minimization for online buffering problems using the weighted majority algorithm. In Proceedings of the 23rd Conference on Learning Theory, pages 132–143, 2010.
Gautam Goel, Naman Agarwal, Karan Singh, and Elad Hazan. Best of both worlds in online control: Competitive ratio and policy regret. In Proceedings of the 5th Annual Learning for Dynamics and Control Conference, pages 1345–1356, 2023.
Tsubasa Harada, Yasushi Kawase, and Hanna Sumita. Online algorithms for repeated optimal stopping: Balancing baseline guarantees and regret. arXiv preprint arXiv:2511.04484, 2025.
Sungjin Im, Benjamin Moseley, Chenyang Xu, and Ruilong Zhang. Online dynamic acknowledgement with learned predictions. In Proceedings of the 42nd IEEE Conference on Computer Communications, pages 1–10, 2023.
Csanád Imreh and Tamás Németh. Parameter learning algorithm for the online data acknowledgment problem. Optimization Methods and Software, 26(3):397–404, 2011.
Anna R. Karlin, Claire Kenyon, and Dana Randall. Dynamic TCP acknowledgment and other stories about . Algorithmica, 36(3):209–224, 2003.
Yasushi Kawase and Tomohiro Nakayoshi. Online matching with delays and size-based costs. In Proceedings of the 42nd International Symposium on Theoretical Aspects of Computer Science, pages 59:1–59:18, 2025.
Steven S. Seiden. A guessing game and randomized online algorithms. In Proceedings of the 32nd Annual ACM Symposium on Theory of Computing, pages 592–601, 2000.
A Omitted Proofs
A.1 Proof of Lemma 3.2
Each completed acknowledgment interval of contains an acknowledgment of , since its triggering packets would otherwise force to acknowledge by the endpoint. This proves . The triggering packets in each completed interval of contribute at least z waiting cost, proving the first displayed inequality.
For the second, compare with any schedule having acknowledgments and waiting cost through . Waiting paid by after this schedule has served a packet can be charged to that schedule's acknowledgment. If packets remain pending under at that acknowledgment, they are served within further time, giving a charge of at most .
On the other hand, at least completed intervals of contain no acknowledgment of the schedule. Fix such an interval ending at , and let be the latest arrival time among its triggering packets. The schedule leaves all packets pending throughout , paying during . If of them remain pending under at , they are served by , contributing at most waiting cost during . Thus, on these packets during , the schedule pays at least more waiting cost than . The triggering packet sets from different intervals are disjoint. These savings occur while the schedule still has the packets pending and do not overlap with the charges after its acknowledgments. Consequently,
Rearranging yields . Minimizing over schedules proves the claim.
A.2 Proof of Lemma 3.3
Lemma 3.2 gives and . These give and
Combining this with proves the deterministic bounds. For the expectation, average the cost bounds for and to obtain
where the last step uses and .
A.3 Proof of Lemma 3.4
Let count redraws in the first rounds, including those that select the same expert. Set , , and . The synchronization rule gives .
We first show by induction that . This holds for . The retention and redraw rules give
completing the induction.
Let and . Since , convexity gives
Consequently, . For every ,
Taking logarithms and using yields
Conditional on , the redraw probability is
Averaging and summing gives . Therefore,
where the last inequality uses .