Queueing Foundation Model

One policy.
Many networks.

Inference does not need the true arrival rates λ, service rates μ, or holding costs h.QFM schedules from the visible network structure, resource capacities, and feedback on queue lengths, past actions, time, and cost. One set of weights serves different tasks.

No true λ / μ / h neededOne shared model
Parcel factory · real task network9 queues · 3 shared pools
In system0
Total cost / time0.00
Shipped0

Two lines share three service pools. Parcels leaving Q6 return to Q1 at P0 for the next stage.

Running
9.59MParameters, shared across tasks
64Steps of history the model reads
8,594Training tasks
88 / 276Unseen tasks where QFM beats every baseline
01 / The problem

Serving faster
does not always make the system better.

Serving one queue can push jobs into a more congested, more expensive downstream stage. Fixed priorities and state-dependent pressure capture different parts of this trade-off.

STATIC PRIORITY

cμ: fixed scores

hiμpi

Fixed parameters → fixed scores.
Actions still depend on queue availability and capacity.

STATE-DEPENDENT PRIORITY

MaxPressure: changing scores

μpi(hiQi − ΣjRijhjQj)

Backlog − downstream pressure (R: routing).
Drift-based; not universally cost-optimal.

More downstream backlog. A different action.

Illustration · μ = 1 · A and C unchanged
B has 1 job
Low downstream backlog: serve AOne shared pool can serve A or C. A has 3 jobs, cost 2, and routes to B, which has 1 job and cost 1. C has 4 jobs, cost 1, and exits. A's pressure is 5, exceeding C's 4. A is highlighted blue to indicate service. A · h = 2 B · h = 1 2 × 3 − 1 = 5 C · h = 1Exit1 × 4 = 4
+3 at B
B has 4 jobs
High downstream backlog: switch to COnly B's backlog changes, from 1 to 4 jobs. A's pressure falls to 2, while C's remains 4. C is now highlighted blue to indicate service. The shared pool's c-mu choice would remain A in both states. A · h = 2 B · h = 1 2 × 3 − 4 = 2 C · h = 1Exit1 × 4 = 4
Being servedJob routingOne jobcμ: A → A (2 > 1 in both states)

Which rule fits? Compare the costs.

01 · RE-ENTRANT

cμ wins

07 · SAME TOPOLOGY, NEW RATES & COSTS

MaxPressure wins

04 · UNEVEN BOTTLENECKS

cμQ wins

02 / Explore the networks

15 tasks, all shown.
One model, compared case by case.

Fifteen tasks the model never saw in training: new loads, new fluctuations, new connections, larger networks. Pick one to compare QFM with five classical rules.

21 of 35

Most networks here are new. 21 of the 35 network structures in the unseen-task set never appear in training. Cases tagged New topology use one of them.

QFM vs. this task's best baseline

Why does QFM change where the backlog waits? Explore the cost-structure cases →

03 / Inside the policy

Structure and time,
in one decision.

QFM treats every queue, resource pool, and connection as an entity. It exchanges information over the topology, distills experience over time, and outputs a service allocation that satisfies the constraints.

Model architecture

Learn from history, not from the answer

The model sees the network and what has happened so far, not the true parameters.

Space × time, not simple flattening

The model looks at the network and its recent history together.

Shared weights, constrained actions

One set of weights for every task; every action satisfies the constraints.

04 / Learning from experience

Pretrain on teachers.
Then learn from its own rollouts.

STAGE 1

Offline pretraining

  1. Collect teacher trajectories

    cμcμQFluidMaxPressure
  2. Relabel with each task’s best teacher

  3. Build 64-step history windows

  4. Learn allocations with structured imitation loss

STAGE 2

DAgger

  1. Roll out QFM

  2. Relabel visited states with teacher actions

  3. Aggregate three rounds & train

Final training mix

50% offline40% corrections10% self-imitation
05 / Results

Overall results

QFM against five classical rules on every task. The rules are given the true parameters; QFM is not.

Arithmetic mean of relative costLower is better ↓

1.0 = the best of the five rules on each task.

Below the per-task best baseline
Cost ≤ 1.05× best baseline
Unseen tasks, by network · arithmetic mean
New topologies21 structures · 116 tasks1.085×35 below best
68 within 5%
Seen topologies14 structures · 160 tasks1.103×53 below best
94 within 5%

Show all method scores
MethodArithmetic mean cost ratio ↓Within 5% of bestTasks
06 / Cost structure

Where should
the backlog wait?

Swap Q3 and Q6’s costs.
Keep the network and model fixed.

Cheaper queueCostlier queueh = holding cost

Ablation experiments

Arithmetic mean cost ratio ↓
K64 · 64-step history
ModelAll tasks276 tasksNo queue-to-queue transfers72 tasksWith queue-to-queue transfers204 tasksMaxPressure advantage ≥5%31 tasks
STGraph1.227741.241321.222941.53451
Transformer1.337531.251431.367921.64071
GRU1.375801.203001.436782.03752

All three models have approximately matched parameter counts (~9.6M each; Transformer and GRU are within 0.1% of STGraph). All models use offline training only, without DAgger. Transformer and GRU receive the full queue, resource and history feature set, including topology features (routing summaries and service connections), but do not use graph layers to model topology connections.

K512 · 512-step history
ModelAll tasks276 tasksNo queue-to-queue transfers72 tasksWith queue-to-queue transfers204 tasksMaxPressure advantage ≥5%31 tasks
STGraph1.193111.332201.144021.22144
Transformer1.333111.110281.411762.45216
GRU2.117701.153332.458079.07551

Matched model size (~9.6M parameters). Offline training only, without DAgger.

Different networks.
Shared intelligence.

QFM explores a transferable way to schedule: instead of hand-writing a policy for each network, one shared model decides from structure and experience.