Optimistic Safety for Online Convex Optimization with Unknown Linear Constraints

Spencer Hutchinson, Tianyi Chen, Mahnoosh Alizadeh

In the world of online learning, we often talk about "regret"—the difference between how well we did and how well we could have done if we knew the future. But in many real-world scenarios, like managing a power grid or a high-frequency trading portfolio, performance isn't the only thing that matters. You also have to follow the rules (constraints), and often, you don't even know exactly what those rules are until you start playing.

TL;DR

This paper introduces OSOCO (Optimistically Safe Online Convex Optimization), a new algorithm that achieves the optimal $\tilde{O}(\sqrt{T})$ regret rate while ensuring zero constraint violations, even when the linear constraints are unknown or changing stochastically. It bridges the gap between high-performance learning and strict safety, improving upon previous methods that either learned too slowly or allowed "accidental" violations.

What Problem Does This Paper Address?

Standard Online Convex Optimization (OCO) assumes you know your "feasible set"—the boundaries of what you're allowed to do—from the start. In reality, these boundaries are often unknown. You might receive noisy feedback (e.g., "you're close to the limit") only after you take an action.

The challenge is a classic exploration-exploitation trade-off with a high-stakes twist:

  1. To minimize regret, you need to push the boundaries to find the best actions.
  2. Because you don't know the boundaries exactly, pushing them risks a violation.
  3. Previous "safe" algorithms were overly cautious, resulting in a slow learning rate of $\tilde{O}(T^{2/3})$. Other faster algorithms achieved $\tilde{O}(\sqrt{T})$ but allowed cumulative violations (meaning they "broke the rules" occasionally).

This paper asks: Can we learn at the optimal rate ($\sqrt{T}$) without ever violating the constraints?

Methods

The authors propose Optimistically Safe OCO (OSOCO). The core innovation is the "Optimistic Safety" framework, which maintains two different views of the world:

  • The Optimistic Set (Outer Approximation): This set is a "best-case scenario" estimate of the feasible region. The algorithm uses this set to pick an action $\tilde{x}_t$ that is likely to have very low regret.
  • The Pessimistic Set (Inner Approximation): This is a "worst-case scenario" estimate. It represents the region we are certain is safe.

The OSOCO Loop: 1. Pick an Optimistic Action: A sub-algorithm (like Hedge or FTPL) picks a point $\tilde{x}_t$ from the optimistic set. 2. Scale for Safety: Instead of playing $\tilde{x}_t$ directly, OSOCO finds the largest scaling factor $\gamma_t \in [0, 1]$ such that the scaled action $x_t = \gamma_t \tilde{x}_t$ sits safely inside the pessimistic set. 3. Update: After playing $x_t$, the algorithm observes the cost and the noisy constraint feedback, refining its estimates of the boundaries.

To make this computationally efficient, the authors also introduce HedgeDescent. Since the optimistic set can be non-convex (and thus hard to optimize over), they represent it as a union of $2d$ convex sets and use a "Hedge" meta-algorithm to manage "experts" running Gradient Descent on each convex piece.

Datasets

The paper evaluates the algorithm using synthetic numerical experiments (a "toy setting") rather than large-scale public datasets.

  • Setup: A 2-dimensional quadratic cost problem.
  • Constraints: Unknown linear constraints with added Gaussian noise.
  • Comparison: They benchmark against DPP (Drift-Plus-Penalty) and SO-PGD (Safe Online Projected Gradient Descent).

Key Insights and Ideas

  • Simultaneous Learning: Unlike prior work that required a "pure exploration" phase (spending time just learning the constraints without trying to minimize cost), OSOCO learns the constraints and minimizes regret simultaneously.
  • Scaling vs. Projecting: Most algorithms use Euclidean projection to stay safe. OSOCO uses scaling toward a known safe point (the origin). This is clever because scaling preserves the "direction" of the optimistic action, which contains the most useful information for both performance and learning the constraint boundaries.
  • Rare Updates: The algorithm doesn't rebuild its safe sets every round. It uses a "determinant doubling" rule—only updating when it has gathered a significant amount of new information. This keeps the computational overhead low and provides theoretical stability.

Key Results

  • Optimal Regret: OSOCO achieves $\tilde{O}(\sqrt{T})$ regret, the gold standard in OCO, while maintaining zero violations (with high probability for static constraints and in expectation for stochastic ones).
  • Efficiency: The "Efficient Version" (using HedgeDescent) requires only $2d$ convex projections per round, making it practical for real-time applications.
  • Empirical Superiority: In simulations, OSOCO outperformed the previous state-of-the-art safe algorithm (SO-PGD) in regret. While the DPP algorithm achieved lower regret, it did so by significantly violating constraints—a trade-off OSOCO is designed to avoid.

Limitations and Future Work

  • Linear Constraints Only: The current theory relies heavily on the constraints being linear. Extending this to general convex constraints (like quadratic or exponential boundaries) is a major next step.
  • Known Safe Point: The algorithm assumes you know at least one strictly safe point (e.g., "doing nothing" is safe) to use as an anchor for scaling.
  • Future Directions: The authors suggest applying this "Optimistic Safety" logic to more complex problems like Safe Reinforcement Learning (MDPs) or Online Control, where the unknown "rules" are the dynamics of the system itself.

Summary updated

BibTeX
@inproceedings{hutchinson2025optimistic,
  author = {Spencer Hutchinson and Tianyi Chen and Mahnoosh Alizadeh},
  title = {{Optimistic Safety for Online Convex Optimization with Unknown Linear Constraints}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2025},
  url = {https://openreview.net/forum?id=GCHZypmMOm},
}
Figure