Abstract
We consider a general framework of online learning with expert advice where regret is defined with respect to sequences of experts accepted by a weighted automaton. Our framework covers several problems such as tracking the best expert or competing with $n$-gram models. We provide a general algorithm, Automata Weighted-Majority (AWM), that achieves sublinear regret and prove that several well-known heuristics are specific instances or approximations of this framework.
Introduction
In standard online learning, a learner aims to perform as well as the single best expert in hindsight. However, in many real-world scenarios, the "best" expert changes over time. While previous research addressed this using $k$-shifting regret—competing against sequences that change at most $k$ times—this approach is often too rigid to capture complex prior knowledge.
This paper introduces a unified framework that allows a learner to compete against the best sequence of experts defined by a Weighted Finite Automaton (WFA). By using WFAs, the learner can encode arbitrary constraints or preferences, such as hierarchical structures or specific transition probabilities between experts.
Methods: The Automata Weighted-Majority (AWM) Algorithm
The core of the proposed framework is the Automata Weighted-Majority (AWM) algorithm. It extends the classic Weighted Majority algorithm to work over the paths of a WFA. Instead of maintaining a simple weight for each expert, AWM uses efficient automata operations—specifically intersection and weight-pushing—to maintain a distribution over all valid sequences of length $T$.
Efficient Path Summing
To maintain computational feasibility, AWM employs a forward-backward style update. At each round, the algorithm calculates "forward weights" (mass reaching a state) and "backward weights" (potential mass from that state to the end). This allows the algorithm to update expert probabilities in time linear to the number of transitions in the automaton, avoiding the exponential explosion of possible sequences.
Key Insights and Theoretical Connections
A significant insight of this work is that many existing online learning problems are special cases of WFA-based regret. For instance, the authors prove that the well-known Fixed-Share algorithm is mathematically equivalent to a bigram (2-gram) approximation of a $k$-shifting automaton. This provides a principled theoretical foundation for an algorithm previously viewed as a clever heuristic.
Furthermore, when approximating a complex WFA with a simpler model (like an $n$-gram), the authors show that the additional regret is bounded by the $\infty$-Rényi divergence between the two models.
Results and Performance
The AWM algorithm achieves a weighted regret of $O(\sqrt{T \log K})$, where $T$ is the number of rounds and $K$ is the number of valid sequences. This matches optimal rates for simpler settings while providing much greater flexibility. The total computational complexity is $O(|E_A|)$, where $|E_A|$ is the number of transitions in the intersection of the competitor WFA and the sequence length. Additionally, the framework successfully extends to the "sleeping experts" setting with the AWAKEAWM algorithm.
Limitations and Future Directions
While efficient, the intersection WFA can become large for very complex constraints or long time horizons. Future research could focus on "learning the benchmark"—automatically constructing the WFA from historical data—or extending the framework to more complex formal languages, such as Context-Free Grammars (CFGs).
Summary updated