NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

How Many Deterministic Agents Does a Hierarchy Need? An Empirical Test of Barely Random Online Algorithms on Real Tree Metrics

Online algorithms make irrevocable decisions as requests arrive, and theory says randomness helps them enormously. For metrical task systems, the standard model of an agent that moves between states and pays both a movement cost and a per-request service cost, any deterministic algorithm can be forced to pay $2n-1$ times the offline optimum on $n$ states. Randomized algorithms pay only $O(\log^2 n)$ times the optimum. Two recent theoretical results sharpen this gap. The first shows that almost all of the randomness can be removed: a randomized algorithm that uses $\log k$ random bits is the same thing as a team of $k$ deterministic agents that split their total cost, and $k \ge n^2/\epsilon$ agents suffice to lose only a $(1+\epsilon)$ factor (Barely Random Algorithms and Collective Metrical Task Systems). The second shows that on trees, which are the natural shape of taxonomies, phylogenies and ontologies, a mirror-descent algorithm gets $O(\log n)$ on well-separated hierarchical trees (Metrical Task Systems on Trees via Mirror Descent and Unfair Gluing). Neither paper runs a single experiment. The first paper also conjectures that on tree-like metrics the team could shrink from $n^2$ agents to $O(n)$.

This proposal builds the first working implementation of these algorithms on real hierarchies and measures three things. The first is how many deterministic agents are actually needed to match the fully randomized algorithm on real trees. The second is whether the deterministic worst case ever appears on realistic request streams. The third applies to graphs that are only approximately tree-like: whether a single deterministic tree extracted from a hyperbolic embedding can replace the random trees that theory uses. Hierarchical embedding distortion is the measurement lens here, not decoration. The quantity we track is how much a tree approximation stretches true distances, and we test whether that measured stretch, rather than the worst-case $O(\log n)$ factor, predicts the cost the online algorithm actually pays.

Core Claim

On real hierarchical metrics, we hypothesize that a team of $O(n)$ deterministic agents, and often far fewer, reaches within a few percent of the fully randomized fractional cost. On near-tree graphs, we hypothesize that the gap between running on a single deterministic low-distortion tree and running on randomly sampled trees is governed by the empirically measured distortion of that tree. If both hypotheses hold, a practitioner with a fleet of $k$ servers, caches or replicas on a hierarchy gets the randomized guarantee's benefit deterministically and cheaply. If they fail, we will have located the concrete instance structure where the $n^2$ requirement actually binds, which theory currently cannot say.

One technical observation makes the implementation feasible and is part of the contribution. The Cosson–Massoulié rounding step requires solving an optimal transport problem under the Wasserstein-1 distance every time a request arrives. Wasserstein-1 is the cheapest way to move one probability mass distribution into another when moving a unit of mass costs the distance travelled. The cost of that per-request solve is flagged as unaddressed in the literature. On a tree, the Wasserstein-1 distance between distributions $p$ and $q$ has the closed form

$$W_1(p,q)=\sum_{e} w_e \,\bigl|p(T_e)-q(T_e)\bigr|,$$

where the sum runs over tree edges $e$, $w_e$ is the edge length, and $p(T_e)$ is the probability mass inside the subtree below $e$. The optimal plan moves mass only across edges whose subtree mass changed. The per-request update therefore costs time proportional to the edges touched rather than a general transport solve, and assigning the resulting mass moves to integer agents reduces to a greedy walk up the tree. Whether this makes the method fast enough for real request rates is an empirical question the proposal answers.

Research Program

The build has three layers. The first layer is a fractional tree algorithm: the entropic mirror-descent dynamics with log-sum-exp gluing from Metrical Task Systems on Trees via Mirror Descent and Unfair Gluing, discretized in time. This is the paper that supplies the method, and we reuse it without modification. The second layer is the collective rounding of Barely Random Algorithms and Collective Metrical Task Systems. It keeps $k$ deterministic agents whose empirical distribution tracks the fractional state, with the Wasserstein-1 potential providing lag so that small fractional changes do not trigger costly jumps. We implement it with the tree closed form above. The third layer turns general graphs into trees, and it is where embedding distortion enters.

For inputs that are already trees, we run directly on the tree metric and use no embedding. We state this plainly because a reviewer would rightly object to a hyperbolic detour here. For graphs that are only approximately hierarchical, such as the YEAST protein network and the networks in the 38-network collection of Bridging ML and algorithms: comparison of hyperbolic embeddings, the theoretical route samples random hierarchically separated trees. These are random trees with geometrically shrinking edge lengths, and the method pays an $O(\log n)$ expected stretch. Our alternative computes a hyperbolic embedding with the fast deterministic BFKL algorithm, which that paper found roughly 100 times faster than gradient-based hyperbolic embeddings. We then extract a single tree by attaching each node to its hyperbolically nearest neighbour at smaller radius, and we measure that tree's worst-case and average stretch against true graph distances. A second deterministic extraction uses the canonical minimum spanning tree covers of Canonical Tree Cover Neural Networks for Expressive and Invariant Graph Learning, whose authors report a max stretch of about 18x against about 170x for sequence flattening on protein graphs. The algorithm always pays true graph distances; the tree is used only to make decisions. The comparison is therefore honest.

The analysis relates three measured quantities: empirical competitive ratio, team size $k$, and measured distortion of the decision tree. Empirical competitive ratio is algorithm cost divided by exact offline optimum, where the offline optimum is computed by dynamic programming over states and time. This is tractable for the $n$ in the low thousands we target. We fit how the $k$ needed to reach within $(1+\epsilon)$ of fractional cost scales with $n$, and compare the fitted exponent against 1 (the conjecture) and 2 (the proven bound).

Baselines

The naive reference point is the deterministic work-function algorithm, together with a nearest-cheap-state greedy rule run on the true metric. These are the algorithms the $2n-1$ lower bound targets, and they cost nothing to deploy. If they are within a few percent of optimal on realistic streams, the randomness question is practically moot. They are run on identical request streams, and they have no tuning parameters.

The strongest existing method is the fully randomized fractional tree algorithm itself, with unlimited random bits and randomly sampled hierarchical trees for graph inputs. Our collective team with finite $k$ must match it in expected cost. We average it over many random seeds and many sampled trees, and we give it the same learning-rate grid as our rounding scheme. Beating it means matching its mean cost within 5% while using deterministic agents and at most a fraction of its wall-clock time. No reported result found on Lacuna for any implemented metrical task system algorithm on tree or hierarchical metrics, so we establish this baseline ourselves.

For learning-augmented comparisons on traces, we include DART from Optimal Robustness-Consistency Tradeoffs for Learning-Augmented Metrical Task Systems, which moves between advice and a robust algorithm by Wasserstein-1 transport, evaluated on Citi Bike and BrightKite. No reported cost number found on Lacuna for DART on those traces; the file only states that it beat LRU and prior learning-augmented methods. We rerun it with its published trust parameter swept over the same grid.

The key ablations target the two ingredients. The first removes the Wasserstein-1 lag and rounds the fractional state greedily at each step, which isolates whether the lag is what keeps movement cost low. The second replaces the extracted deterministic tree with sampled random trees at matched compute, which isolates the value of a low-distortion single tree. On embedding quality we anchor to reported numbers: BFKL reaches MAP 0.756 on YEAST against 0.542 for Lorentz embeddings (Bridging ML and algorithms: comparison of hyperbolic embeddings).

Why not just…?

Why not just use the deterministic greedy or work-function algorithm, since real traffic is not adversarial? This is the most serious threat, and we treat it as a hypothesis rather than dismissing it. The evidence that deterministic methods are bad is worst-case: the $2n-1$ ceiling in Barely Random Algorithms and Collective Metrical Task Systems. In learning-augmented matching, a simple greedy rule actually beat a robustified algorithm on Chicago taxi traces under moderate prediction noise (Parsimonious Learning-Augmented Online Metric Matching). Our experiments report the deterministic baseline's empirical ratio on every workload, including adversarial streams built from the lower-bound constructions and drifting Zipf streams on real trees. If greedy is within 5% everywhere except the constructed adversarial streams, that is the main finding, and the recommendation becomes a cheap switch to a collective team only when a drift detector fires.

Why not just use full randomness, since random bits are cheap? Bits are cheap, but the collective reading is the practically relevant one. $k$ deterministic agents correspond to $k$ physical replicas, vehicles or cache copies, whose count is a hardware budget. The question "how large must $k$ be" has no empirical answer today. Measuring the $k$-versus-cost curve settles whether the $n^2$ requirement is a proof artifact.

Why not just use random hierarchically separated trees for graph inputs, as theory does? They carry an $O(\log n)$ expected stretch and require averaging over many sampled trees (Metrical Task Systems on Trees via Mirror Descent and Unfair Gluing). On near-tree networks, a single deterministic tree may stretch far less. Hyperbolic embeddings cannot rescue graphs that are far from tree-like, and on such graphs we expect random trees to win. The distortion-versus-cost regression across the 38 networks will show where the crossover lies.

Why not just embed with standard gradient-trained hyperbolic models? They are slower and less accurate on these networks: BFKL is about 100 times faster and scores higher MAP on YEAST (Bridging ML and algorithms: comparison of hyperbolic embeddings). On deep trees they hit float64 precision limits; the reported distortion is 9.42 on the depth-30 Mosses phylogeny in Low-distortion and GPU-compatible Tree Embeddings in Hyperbolic Space. For genuine trees we avoid coordinates entirely, which also avoids the precision problem.

Proposed Experiments

The tree workloads use the phylogenies (Mosses, Weevils, Carnivora), the Disease and CS PhD advisor hierarchies, and synthetic $m$-ary trees from Low-distortion and GPU-compatible Tree Embeddings in Hyperbolic Space, along with WordNet subtrees. Each tree carries three request families. The first is adversarial streams from the deterministic lower-bound constructions. The second is drifting Zipf demand over leaves, which mimics shifting popularity in a taxonomy. The third is Citi Bike and BrightKite requests mapped onto a hierarchical clustering of stations and locations. The graph workloads use YEAST and the 38 real networks, with the same request families.

The first decisive check is the team-size scaling. For each tree, we find the smallest $k$ reaching within 5% of fractional cost and fit $k \propto n^\alpha$. An exponent near 1 supports the Cosson–Massoulié conjecture on trees. An exponent near 2 on some instance family identifies where the bound is tight.

The second check is whether the deterministic single tree matches random trees on graph inputs. We regress the cost gap between the two on the measured worst-case and average stretch of the extracted tree. The claim fails if cost does not track measured distortion.

The third check is the wall-clock cost per request of the tree-closed-form transport step against a general linear-programming transport solve. It must support at least thousands of requests per second at $n$ in the thousands for the method to count as practical.

The fourth check is the deterministic baseline's gap to optimum on non-adversarial streams. This check can overturn the motivation, and the paper reports it either way.