Chapter 61
Operating Mechanisms for ML Systems
On this page
Operating a model service requires measurable control rules: an error-budget signal, a guarded release transition, and a recovery action. This chapter derives those rules from request counts, release state, and authority boundaries.
Turn goals into control loops¶
Give the serving-efficiency review an owner with authority to change capacity or schedule experiments. Bring cost per successful task, latency violations, rejection rates, and the traces explaining a regression. Record the resulting allocation, experiment, rollback, or no-action decision, then check its outcome at the next review. Part III defines the serving metrics; this review assigns responsibility for acting on them.
Turn an SLO into an error-budget signal¶
For an event-based SLO with required good fraction s, let N be eligible events and E bad events in the reporting period. The allowed bad-event count is (1-s)N. The measured error ratio is E/N; burn rate is that ratio divided by 1-s. At constant traffic, burn rate b sustained for duration t consumes fraction b*t/T of a period-T budget. With variable traffic, use actual event counts instead of assuming time and request mass are proportional. This is the construction developed in the Google SRE workbook's alerting chapter.
For an original example, a 99.9% SLO permits 30,000 bad events among 30 million requests. An interval with 1.2% bad events has burn rate 12. If traffic is constant, one hour at that rate consumes 12/720, about 1.67% of a 30-day budget. Twelve is a severity signal, not a probability that an incident will occur. A short-window and long-window condition can distinguish ongoing impact from a historical spike; choose their thresholds from the response policy.
For generation, define a bad event explicitly: timeout, unavailable service, or failure of a latency threshold may be observable immediately, while semantic correctness can require delayed adjudication. Keep separate indicators when their populations or observation delays differ. Retries are attempts inside a logical request, so count their cost without hiding the user's original failure. Missing telemetry is unknown and needs its own alert; it must not turn into an artificial run of good events.
Represent a release as guarded state transitions¶
A release can move through staged -> validated -> canary -> active -> retired, with blocked or rolled_back outcomes. Each transition binds the expected current state, immutable manifest, evidence record and actor authority. Publish the new routing generation with a compare-and-set or equivalent transaction so two controllers cannot independently promote incompatible bundles. Consumers must reject unsupported manifests and report the generation they actually execute.
Promotion changes future admissions; it does not transform in-flight requests or cached state automatically. Define drain, cancellation, cache compatibility and side-effect reconciliation separately. On rollback, preserve current permissions and receipts while changing the compatible execution bundle. A controller that merely redeploys an older binary has not implemented this state machine.
Define ownership at interfaces¶
Cross-team failures often expose gaps between nominal owners. A model team owns a checkpoint, a serving team owns an engine, and a product team owns traffic; without an explicit release owner, nobody may own whether that exact combination is safe to release.
For each critical interface, define:
- the producer and consumer;
- versioning and compatibility guarantees;
- validation performed on each side;
- the SLO and escalation path;
- who can stop a rollout;
- who owns migration and deprecation;
- the evidence required to declare completion.
Avoid responsibility matrices that assign many “accountable” people. One role owns the decision, even when several teams own execution. Ownership must include authority and resources; assigning accountability without either is organizational fiction.
Govern a changing model-and-agent stack¶
A modern release may change the backbone architecture, low-precision kernels, retrieval index, tool permissions, and agent prompt at once. Those changes have different owners and different evidence. Keep a release manifest that binds the compatible versions; avoid making a model-name change stand in for the entire system identity.
| Proposed change | Minimum decision evidence | Accountable boundary |
|---|---|---|
| Hybrid or compressed-state model | Slice-level quality, cache/state accounting, rollback compatibility | Model release owner with serving signoff |
| FP4 or a new attention kernel | Numerical and convergence checks where applicable; end-to-end latency | Kernel/precision owner, not benchmark author alone |
| Asynchronous RL | Quality versus time/cost, stale-sample and verifier diagnostics | Training owner with rollout-platform support |
| New agent tool | Authorized effects, failure reconciliation, adversarial task tests | Product capability owner and security review |
| New retrieval representation | Filtered recall, lineage, deletion/revocation behavior | Data/retrieval owner |
Consider a hypothetical attention replacement that makes a kernel twice as fast. That kernel previously consumed 20 percent of request service time. With all else unchanged, total time becomes 0.8 + 0.2/2 = 0.9 of baseline: a 10 percent reduction, not 50 percent. If layout conversion adds 12 percent of the old total, the replacement loses overall. The decision memo should contain this resource model before the team schedules a large migration.
For an agent improvement, use verified tasks per budget as the outcome. A stricter tool policy can reduce apparent completion while preventing unauthorized actions; a larger model can reduce retries enough to lower cost per success. Separate utility, policy violations, latency, and cost so the decision does not reward unsafe completion or blanket refusal. Define who can stop the rollout when one of these boundaries fails.
The release owner should be able to answer: which immutable baseline did we beat, under whose workload, what changed besides the named technique, which failures remain, and what exactly can be rolled back? That is the leadership counterpart of the book's technical invariants.
Review architecture without becoming a gatekeeper¶
Set review depth by blast radius and reversibility. Local implementation changes can use a pull request; shared interfaces, irreversible formats, security boundaries, and fleet control planes need the affected consumers and release owner involved. The artifact table in Executive Technical Communication gives the record for each case.
Publish accepted examples and reference implementations so routine choices do not wait for the senior engineer. Sample completed designs to check whether the review found real risks, and give teams a deadline for decisions and an escalation path.
Completed release review¶
Continue the index case. A held-out query has current permission at retrieval time, but the permission is revoked while generation runs. The release test finds that the response validator checks only the citation's index-generation ID and emits the answer. The model, index, and schema are each behaving as implemented; the system discloses content after revocation.
| Boundary | Owner | Evidence from the test | Required action |
|---|---|---|---|
| Current authority | Identity/data service | Revocation timestamp and document revision | Supply an authoritative final eligibility check |
| Retrieval | Search service | Candidate list was eligible at initial lookup | Preserve source identity through reranking and packing |
| Generation | Model service | Text generated from the supplied evidence | Propagate cancellation; do not interpret output as authority |
| Response commit | Application service | Final check omitted current authority | Suppress the response and record changed/denied status |
| Release | Service owner | End-to-end invariant failed | Block expansion until the race test passes |
Keep the candidate's routing disabled until output commit validates evidence epochs and enqueues text in one authority transaction, as specified in Part VI. Replay the race before restarting the canary; a new ownership spreadsheet cannot repair it.
The selected boundary is trusted outbound enqueue. Previously committed chunks may still arrive after revocation; later commits must fail. examples/output_authority.py tests local ordering and regrant fencing. Production acceptance additionally requires the distributed authority transaction and its latency budget; two independent remote checks do not establish this guarantee.
Control the change frequency¶
A model, index, template, and verifier can each change independently. If all four change during a comparison, a regression may have no identifiable cause. Release compatible bundles, preserve their identities, and change one high-risk axis per experiment when feasible. Emergency fixes can require a broader change; record that loss of attribution and compensate with targeted replay.
The review cadence follows exposure. An internal deterministic parser change can use local tests and a small rollout. A new policy for external writes needs reconciliation and effect-budget tests. Apply the required evidence to the boundary being changed instead of making every change pass the same large ceremony.