Gateways Are a Set, Not a Vector
Nov 2026 · 7 min read ·
The title of my ICCKE 2026 paper sounds like a quip, but it was the bug. Our reinforcement-learning policy for gateway selection treated a symmetric set of gateways as an ordered list — and paid for that mistake in sample efficiency, every single episode.
GreenWeb runs a WireGuard overlay cluster. Layer-3 traffic from customers' servers can leave through several gateway machines, and the gateways differ: some are cheaper, some are faster at peak hours, and each customer's SLA says which trade-offs are acceptable. "Which gateway should carry this flow?" is therefore a sequential decision problem with a learned component, which is why we trained a deep-RL policy on it instead of writing a hand-tuned rule.
Where the vector comes from
The obvious way to feed N gateways into a neural network is to flatten
their features into a fixed-length vector: bandwidth of gateway 1, latency
of gateway 1, … bandwidth of gateway N, latency of gateway N. That is
exactly what our first policy did. The problem is what "gateway 1" means.
There is no gateway 1. The ordering we used was an artifact of how
kubectl listed the pods that morning. Permute the list and the
same cluster becomes a different input vector, mapped — absurdly — to
outputs that are supposed to be identical.
The standard fix has a name: permutation equivariance. Build the policy so that permuting the gateway inputs permutes the corresponding outputs and leaves the decision invariant. For our action space — pick a gateway per flow, subject to that flow's SLA — the architecture enforces the symmetry that the environment actually has. The network stops wasting capacity memorizing orderings that carry no information, and every permutation of a training situation becomes free extra data.
The consequence that matters operationally: the policy generalizes when the cluster changes. Add a gateway, lose a gateway, reorder the discovery output — the policy's job is defined over the set of available gateways, so none of those events look like a new problem. For an SRE department, that difference is the whole argument. A policy that must be retrained after every cluster topology change is a liability with a GPU bill.
SLA-awareness lives in the reward, not the architecture
People sometimes assume "SLA-differentiated" means a separate policy per service tier. We kept one policy and let the SLA enter through the reward: violating a stricter tier costs proportionally more. The equivariant architecture and the SLA-aware objective are orthogonal, and keeping them orthogonal made ablations legible — we could attribute improvements to the symmetry fix rather than to a tangle of changes.
If you take one design lesson from this paper, make it this one: when a symmetry exists in your problem, put it in the architecture, and put your business constraints in the reward. Neither belongs in the data augmentation pipeline.
What I'd do differently
We found the symmetry issue by staring at a learning curve that plateaued exactly when the number of gateways grew. An equivariance sanity check — feed the policy the same cluster under K random permutations, assert the decisions match — would have caught it in week one, not month three. It's now a permanent unit test in the training pipeline, and it costs nothing.