Hybrid Edge-Cloud Inference › Worked example: a routing decision

Michael BrenndoerferDecember 1, 20262 min read
Language AI HandbookAll chapters
Part 43 of 67Small and On-Device Language Models
Chapter 330Hybrid Edge-Cloud Inference › Worked example: a routing decision
Reading section 9 of 13 · Worked example: a routing decision · 2 minSection 9 of 13 · 2 min

Section 9 of 13 · 2 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

Let us make the routing rule concrete with numbers, then build intuition without code.

  • Edge quality qedge=0.55q_{\text{edge}} = 0.55 (mean reward score on this task), cloud qcloud=0.80q_{\text{cloud}} = 0.80.
  • Edge latency Tlocal=60T_{\text{local}} = 60 ms; cloud latency Tcloud=400T_{\text{cloud}} = 400 ms on this network.
  • Cloud monetary cost per request (raw serving + egress, aggregated) is 0.002 dollars. The edge path carries no marginal monetary charge.

Routing every request to the cloud yields a mean quality of 0.80, and routing every request to the edge yields 0.55. The difference is 0.25 across this workload. With the same cloud price on every request, sending 30% to the cloud pays 30% of the all-cloud monetary cost. How much quality that buys depends on which requests the router sends.

Start with two separate hypothetical workloads. With a uniform 0.25 cloud gain on every request, routing 30% to the cloud adds 0.075 to the edge-only mean of 0.55, giving 0.625. In a second workload, the edge scores 0.30 on the 30% sent to the cloud and 0.66 on the rest, while the cloud scores 0.80 throughout. That workload has an edge-only mean of 0.30×0.30+0.70×0.66=0.5520.30 \times 0.30 + 0.70 \times 0.66 = 0.552 and a hybrid mean of 0.30×0.80+0.70×0.66=0.7020.30 \times 0.80 + 0.70 \times 0.66 = 0.702.

The hybrid closes about 60.5% of this workload's gap between 0.552 and 0.80.

At a fixed cloud fraction, selecting larger gains can raise mean quality relative to selecting smaller gains. If every request has the same gain, changing which requests route leaves mean quality unchanged at that fraction. Transfer eligibility, differing costs and a cloud budget can still favor serving some requests on edge and others in the cloud.

On an approved labeled sample, run both models on the same requests and plot their per-request quality differences. A large spread gives the router an opportunity to target high-gain requests if its features predict that gain. Compare each selection under the applicable costs and transfer requirements.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy