Paper commentary
Near-Optimal Consistency-Robustness Trade-Offs for Learning-Augmented Online Knapsack Problems
PP-a and MIX give near-optimal consistency-robustness trade-offs for online knapsack
- Problem Without extra assumptions, no online algorithm has a bounded competitive ratio for online knapsack. Prior Pareto-optimal results only covered simplified variants, not general knapsack.
- Method MIX runs a prediction-based algorithm beside the robust ZCL and blends their item decisions with trust weight λ.
- Results The algorithms reach near Pareto-optimal consistency-robustness trade-offs. On 2,000 synthetic instances, PP-a had the best empirical ratio among prediction-based algorithms.
Why online knapsack resists plain competitive analysis
Online knapsack asks the decision maker to admit or reject each item on arrival, without seeing future items. Without extra assumptions, no online algorithm achieves a bounded competitive ratio for the basic version of OKP. Earlier work usually escapes this limit by assuming that value-to-weight ratios are bounded. The paper instead studies OKP through learning-augmented design, which uses ML predictions while keeping worst-case guarantees.
Its goal is to measure how much a prediction can improve performance when the prediction is accurate, and how much it can hurt when it is wrong.
Böckenhauer et al. report a competitive ratio of 1 + ε for any constant ε > 0 using O(log n) bits of advice. Böckenhauer et al. also assume the advice is accurate, so their analysis doesn't give consistency-robustness trade-offs. Frequency predictions avoid the index problem, but they require one prediction per possible unit value, which is difficult to get accurately.
Pareto-optimal results exist for simplified variants, such as the single-leg revenue management problem with unit weight items. Online conversion problems also have Pareto-optimal results, but these are fractional variants where each item's weight equals the capacity. Those settings don't extend to general OKP, because the most valuable items may be small.
So prior work doesn't reach Pareto-optimal trade-offs for general OKP, and this gap motivates the paper's question.
A single critical value as the prediction
The authors predict one number, the critical value, instead of a full profile of item frequencies. The critical value is the minimum unit value of any item that the offline optimal solution admits, possibly fractionally. A point prediction supplies that value directly, while an interval prediction supplies a lower bound ℓ and an upper bound u with ℓ ≤ v̂ ≤ u.
Frequency predictions, by contrast, need one prediction for each possible unit value, which is hard to obtain in practice.
Knowing v̂ exactly doesn't let an online algorithm rebuild the offline optimum, because the right policy for items at v̂ is unclear. The offline optimum fully accepts every item valued strictly above v̂, but it may only partially admit items valued at v̂. The quantity ω̂ is the total weight of items at v̂, and the algorithms never receive it as a prediction.
Even so, the authors argue that a point prediction of the exact value is almost impossible in practice, which motivates intervals.
An interval prediction degrades in quality as the ratio u/ℓ grows, and u = ℓ reduces it to a point prediction. Setting u = U and ℓ = L turns the problem back into classic OKP with only the unit value bounds known. The same critical-value idea appears in online search, where all weights are 1 and the critical value is the maximum value. Inside OFKP with arbitrary item sizes, leveraging such a prediction becomes notably more challenging.
The authors claim their succinct models need only a point or interval prediction, yet still match the performance of more complicated predictions. A frequency prediction with bounds f_ℓ and f_u yields an interval on the critical value by integrating each density from v to U. Because of this conversion, the succinct prediction is strictly weaker than the frequency model.
Building the ML model that produces these predictions is outside the paper's scope.
PP-b and PP-a under a point prediction
PP-b is the simpler starting point: it sets aside half of the capacity for items above the predicted critical value. It allocates the other half to minimum acceptable items with value equal to the prediction. That split makes PP-b 2-competitive, which matches the lower bound for general ω̂ across all instances. A naive rule that accepts every item at or above v̂ has no bounded worst-case ratio.
Because ω̂ is unknown, PP-a uses a prebuying strategy and initially selects entire items with values above v̂. It then adjusts its selections upon observing items with value v̂, so the high-value reservation shrinks as those items arrive. This lower bound sets how much of the earlier high-value allocation is released, which gives 1 + min{1, ω̂}.
Compared with PP-b's fixed split, this reserve-while-greedy approach improves the ratio from 2 to 1 + min{1, ω̂}.
The key idea of prebuying is to reserve capacity before all items above v̂ have arrived. This helps the knapsack when ω̂ is small. If many items at v̂ arrive later, PP-a reduces the amount allocated to higher-value items. Reserve-then-greedy strategies, by contrast, fix their reservations in advance.
Interval predictions with IPA
IPA handles a range prediction by splitting unit values into three regions, with the interval [ℓ, u] as the boundary. Items with values below ℓ are rejected outright, so IPA never spends capacity on them. Items with values above u receive a fraction 1/(α+1) of the knapsack capacity, reserved before they arrive. Items inside [ℓ, u] are passed to a robust sub-algorithm A, which is α-competitive and receives the fraction α/(α+1) of capacity.
The sub-algorithm's decision is scaled by α/(α+1), so the two parts together stay within the knapsack.
The authors set the reservation for high-value items as a dedicated portion of capacity, which is the same idea as the PP-b split. Theorem 3.4 states that IPA is (α+1)-competitive for any OFKP algorithm with worst-case ratio α. The proof sketch covers the high-value part and the interval part, and the authors leave the step that joins both parts to the appendix.
With ZCL as the sub-algorithm, Corollary 3.5 gives IPA a ratio of 2 + ln(u/ℓ).
The ratio 2 + ln(u/ℓ) is the best possible for interval predictions, since Theorem 3.6 gives a matching lower bound. A wider interval means a larger u/ℓ, so the bound grows logarithmically with the interval width. The authors note that prediction quality degrades as the ratio u/ℓ increases. When u equals ℓ, the interval collapses to a point prediction, and when u equals U and ℓ equals L, the problem becomes classic OKP.
The paper leaves untrusted interval predictions open, so the analysis here covers only trusted ranges. Section 4 then extends these results to untrusted predictions with the MIX algorithm.
Untrusted predictions and MIX
MIX limits the damage from a wrong prediction by running a prediction-based algorithm and ZCL side by side. MIX combines ZCL, the optimal (ln(U/L) + 1)-competitive OFKP algorithm, with a trusted prediction algorithm such as PP-a or IPA. MIX offers each arriving item to the prediction-based ALG first, collects its decision x̂i, and then offers the same item to ZCL, collecting x̃i.
It then accepts xi = λx̂i + (1 − λ)x̃i of the item, so the trust parameter λ in [0, 1] sets how much weight the prediction gets. Setting λ = 1 copies the prediction-based ALG, while λ = 0 copies the robust ZCL.
For robustness, the analysis assumes that unit values lie in [L, U], and L and U are not tied to the predicted interval [ℓ, u]. Here c is the competitive ratio of the inner prediction ALG when the prediction is accurate. For consistency, MIX's profit is at least λALG(I), because the ZCL term is nonnegative. For robustness, when ALG obtains no profit, MIX's profit is at least (1 − λ)ZCL(I).
The authors work an example with λ = 1/2 in which the prediction-based ALG obtains no profit. ZCL is c-competitive in that example, so MIX gets 1/2 · ZCL(I), which equals 1/2 · OPT/c. That gives MIX a 2c competitive ratio, so a non-zero λ keeps the ratio finite even under the worst-case prediction. The robust subroutine is what keeps the guarantee in place when the prediction fails.
The authors also check whether this trade-off can be improved, and the answer is that MIX nearly matches the best trade-off. Theorem 4.2 lower-bounds consistency for any deterministic γ-robust algorithm with γ in [ln(U/L) + 1, ∞). In the limit as U/L goes to infinity, any 2/λ-consistent algorithm is at least β-robust.
How close these trade-offs are to optimal
The paper asks whether any algorithm could do better than the consistency-robustness trade-offs it reports for MIX. Table 1 lists the upper and lower bounds for the point, interval and MIX settings. For an exact point prediction, Theorem 3.1 shows that no deterministic or randomized algorithm can beat 1 + min{1, ω̂}. Here ω̂ is the total weight of items with the critical value, so the bound depends on the instance.
The lower bound of 2 for ω̂ ≥ 1 holds even when the point prediction is accurate.

Table 1 . Summary of contributions.
Original paper · CC BY 4.0 · Mohammadreza Daneshvaramoli, Helia Karisani, Adam Lechowicz, Bo Sun, Cameron Musco, Mohammad Hajiesmaili · Near-Optimal Consistency-Robustness Trade-Offs for Learning-Augmented Online Knapsack Problems · Original paper figure · Extracted the figure area from page 2 of the original PDF.For untrusted predictions, Theorem 4.2 bounds the consistency of any deterministic γ-robust algorithm for γ in [ln(U/L) + 1, ∞). Such an algorithm must be η-consistent for η at least the maximum of 2 − L/U and a term in 1/(1 − 1/γ ln(U/L)). The paper considers this setting with item values bounded in [L, U]. The authors also disregard consistency above ln(U/L) + 1, since ZCL gives better guarantees there.
In the limit as U/L grows, any 2/λ-consistent algorithm must be at least β-robust. The bound β equals 1 + ln(U/L)/(1 − λ) minus a term that vanishes, so it grows with ln(U/L). MIX's robustness is ln(U/L)+1 over (1 − λ), so MIX sits close to this lower bound. Figure 1 plots the MIX upper bound against both lower bounds with U/L = 1000, and all three curves show a similar convex trade-off.
The remaining gap between the upper and lower bounds comes from constants in the proof of the robustness bound. The authors don't claim the trade-off is exactly Pareto-optimal, only nearly so. Because the lower bounds for the fractional case also hold for integral items, the same limits apply to OIKP.
How Fr2Int turns a fractional algorithm into an integral one
Fr2Int starts from a value partitioning that splits the unit value range [L, U] into sub-intervals G1 to GK. Each sub-interval spans a multiplicative factor of (1 + δ), so values inside one bin differ by at most that factor. Fr2Int hands every arriving item to any OFKP algorithm ALG and reads back the fractional decision that ALG makes. The integral choice for that item then depends on this simulated fractional decision.
For each bin j, Fr2Int keeps a running sum R[j] of the fractional value that ALG has accepted there. It also keeps A[j], the integral value it has already admitted in that bin. Fr2Int admits a new whole item only when A[j] stays below R[j] scaled by a factor just under one divided by 1 + δ. This rule keeps the integral value in each bin close to the simulated fractional value, so the integral knapsack tracks ALG.
The authors say their new algorithms don't follow a threshold design, so the usual discretized threshold route doesn't apply.
Theorem 5.2 gives the loss factor γ · (1 + δ)/(1 − ϵ(⌈log(1+δ) U/L⌉ + 1)) for OIKP, when ALG is γ-competitive. This loss comes from discretizing the value range and from the discrete sizes of the items. The proof bounds each bin's weight by its value range, using w(A[j]) · L · (1 + δ)^j ≤ A[j]. Fr2Int carries the earlier OFKP results, including PP-a, IPA and MIX, over to OIKP with minimal loss.
When δ tends to zero and ϵ is below δ divided by ⌈log(1+δ) U/L⌉ + 1, the factor approaches γ.
What the synthetic experiments show
The authors run their experiments on 2,000 synthetic OFKP instances and plot CDFs of empirical competitive ratios. Item values and weights come from a power-law distribution, with the lowest unit value L = 1 and the highest U = 1000. Weights are normalized to the range [0, 1] after the power-law draw. The CDF shows both average and worst-case behavior, so one plot answers both questions.
Among the prediction-based algorithms, PP-a has the best average and worst-case empirical competitive ratio. This result matches the guarantee of Theorem 3.3 for PP-a. PP-n beats most other algorithms on average, and PP-a is the only one ahead of it. Its worst case is still worse than ZCL, which the authors tie to bad edge cases identified in Theorem A.4.
IPA beats ZCL on average, even with a relatively wide interval prediction. IPA also beats ZCL in the worst case, and its interval range u − ℓ is set to 15%, 25%, and 40% of [L, U]. Figure 2(a) reports six tested algorithms, while MIX and Fr2Int-PP-a appear only in the experimental setup.
Varying U/L tests whether trusted predictions remove the dependence on the ratio U/L. The empirical competitive ratio of ZCL increases along with U/L. PP-b, PP-a and IPA stay robust to these variations, in line with the theory for trusted predictions.
Figure 2(c) varies ω̂ over four values, 0.29, 0.45, 0.63, and 0.78, and compares PP-b, PP-a and PP-n against ZCL. PP-a performs better with smaller values of ω̂, because its design, per Theorem 3.3, exploits that case. The other algorithms gain less from smaller values of ω̂.
Where the results stop short
The results here rest on synthetic power-law instances, and the real Bitcoin and Google trace results fall outside this excerpt. The authors compare against ZCL and SENTINEL on synthetic and real datasets, so the trace-based evidence is not covered here. The small item weight assumption is standard for integral OKP, and the paper states that OFKP algorithms don't rely on it.
Algorithms that use untrusted predictions without the small item weight assumption are left as an open question.
Frequency predictions require one prediction per possible unit value, so accurate frequency predictions may be hard to obtain in practice. The authors argue that a point prediction of the exact critical value is almost impossible, which motivates interval predictions. For interval predictions, the quality of the prediction degrades as the ratio u/ℓ increases.
Bounded robustness also depends on the bounded value assumption, since the untrusted setting uses ZCL as a subroutine with values in [L, U]. Without that assumption, Theorem A.2 shows no bounded competitive ratio is possible, even with a trusted prediction.
Paper info
- Authors
- Mohammadreza Daneshvaramoli, Helia Karisani, Adam Lechowicz, Bo Sun, Cameron Musco, Mohammad Hajiesmaili
- Venue
- arXiv · Preprint
- First published
- 2024-6-26
- Added
- 2026-10-31
- Updated
- 2025-7-9
- Version
- v2
- arXiv
- 2406.18752
- Category
- cs.LG · cs.GT
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
This paper introduces a family of learning-augmented algorithms for online knapsack problems that achieve near Pareto-optimal consistency-robustness trade-offs through a simple combination of trusted learning-augmented and worst-case algorithms. Our approach relies on succinct, practical predictions -- single values or intervals estimating the minimum value of any item in an offline solution. Additionally, we propose a novel fractional-to-integral conversion procedure, offering new insights for online algorithm design.
Quote from the paper
Mohammadreza Daneshvaramoli, Helia Karisani, Adam Lechowicz, Bo Sun, Cameron Musco, Mohammad Hajiesmaili (2024). Near-Optimal Consistency-Robustness Trade-Offs for Learning-Augmented Online Knapsack Problems. arXiv:2406.18752v2. https://arxiv.org/abs/2406.18752v2
BibTeX
@misc{daneshvaramoli2024near,
title = {{Near-Optimal Consistency-Robustness Trade-Offs for Learning-Augmented Online Knapsack Problems}},
author = {Mohammadreza Daneshvaramoli and Helia Karisani and Adam Lechowicz and Bo Sun and Cameron Musco and Mohammad Hajiesmaili},
year = {2024},
eprint = {2406.18752},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2406.18752v2}
}