The ranking model behind an endpoint, released weekly
In a simulated year with nothing planted, checks before release plus a week in the background kept 38 of 51 healthy weekly releases from users.
Main limitation Every catch is a self-test, each failure planted once by the author of the rules and monitors: that rule, a gate plus a shadow week, kept both harmful bad releases from users, the gate alone 1 and shipping weekly 0, at 61 healthy-year alarms against 19; a serving-only bug planted mid-week reached 105 visits under every rule. Most releases it held back were neither better nor worse within their intervals; its live model averaged 6.8 weeks old. Simulated weeks on one public ratings set, under a thousand scored visits a week, one machine under a synthetic load, one fit per release: it shows the method, not a production system.
The quarterly study scored its recommender in a batch. Here the same model sits behind a local HTTP endpoint, is retrained and packaged every week for 52 weeks, and is promoted by a rule written before the run. Five failures were planted, one at a time, and each rule was scored on which of them it kept from users and what it cost on the weeks where nothing was wrong. What decides the answer is noise: at 580 to 907 scored visits a week (visits whose user liked a movie later that week), and 21 to 48 from light users, a healthy release often looks worse than the last one, so every rule that compares releases also blocks good ones.
| Harmful bad releases kept from users 2 of 2 the leaky release and the slow, overfit one, each planted once, by a gate and a shadow week; 1 by the gate alone (its offline check also alarmed that week with nothing planted), 1 by the routed share, 0 by shipping weekly. The label shift is kept from users by every rule by construction; the light-user plant did no measurable harm | Visits a serving-only bug reached 105 one day, under every rule: the bug was planted mid-week, after that week's release checks had run | Alarms in a healthy year 19 to 74 from shipping weekly to gating with a routed share, over 52 weeks with no fault planted | Quality given up by the shadow week 0.0030 NDCG@10 a visit against shipping weekly, about 6.1% of 0.050 (interval 0.0016 to 0.0045, resampling whole weeks, added after the results; one replay's release choices); its live model was 6.8 weeks old on average |
In plain words
A model that is served behind an endpoint and retrained every week can go wrong in ways a quarterly batch never shows: the code that builds features for live requests drifts from the code that built them for training, the job that writes labels breaks quietly, a new release looks great on last week's data and worse on this week's users, or it gets slow. Teams answer with release rules: check each new release before it ships, try it on a slice of users or in the background first, and watch the live model. Each rule catches some failures and costs something on the weeks when nothing is wrong.
I replayed a year of MovieLens activity one week at a time. Every week a new release was trained, packaged with a manifest and served by a small HTTP endpoint, and each user's first visit of the week asked it for a top 20. Six release rules ran on the same weeks, once with nothing planted and once with each of five planted failures.
My recommendation: put a skew monitor on the live feature code from day one: it saw the serving-only bug after one day under every rule, where the next release's skew replay would have seen it five days later. Gate releases on an offline comparison; here it stopped the slow, overfit release. Add a shadow week only if the team can afford its price at this traffic: it kept the leaky release from every user, where shipping weekly served it to 1,010 visits, but it raised 61 alarms in a healthy year and kept a model 6.8 weeks old on average. Before trusting any margin, measure how much healthy releases move week to week on your own traffic, and set the margins outside that noise.
The data stands in for any catalogue with a recommender: films, products, courses, jobs. It is a public research dataset, so no data from any employer is used.
Terms used on this page
- Visit
- A user's first rating in a week, with at least 5 earlier ratings. At that moment the endpoint is asked for the user's top 20, from what was known before it. Exposure counts every visit.
- Scored visit
- A visit whose user went on to rate at least one new movie 4 stars or more that week; only these get an NDCG@10, so there are fewer of them than visits.
- Release
- One weekly model: a factor model refit every fourth week, a re-ranker retrained every week, and a manifest with a fingerprint of every file, the training window, the code version and the holdout scores.
- Champion, challenger
- The release serving users, and the new one that wants to replace it.
- Gate
- Five checks before a release ships: the package is intact, its offline score on last week's visits is at least 0.98 times the champion's, its features match between the serving and training code, its slowest 1% of requests are at most 1.5 times the champion's, and light users score at least 0.90 times the champion's.
- Shadow week
- The challenger scores every visit in the background for a week; it is promoted only if it scored at least 0.98 times the champion on those visits.
- Routed share
- About 10% of users, chosen by a hash of their id, get the challenger for a week; it is promoted if it scored at least 0.95 times the champion on the others.
- Strict
- The same rule with the margins at 1.00: the challenger may not lose at all.
- Skew
- A feature value the serving code computed differently from the training code for the same visit.
- Light users
- Users with 5 to 49 ratings before the visit; heavy users have 50 or more. MovieLens has no demographics, so these are the only groups used.
- NDCG@10
- Ranking quality of the top 10, from 0 to 1, against the movies the user rated 4 stars or more later that week.
- Self-test
- A test whose failures were planted by the same person who wrote the checks.
What each rule costs when nothing is wrong
Shipping every release raised the fewest alarms; every rule that compares a challenger with the champion raised more, because at this traffic healthy releases often score below the release before them. An alarm here is a failed release check, a rejected shadow week or routed share, or a monitor alert, and each one is something a team would have to look into.
| Rule | Alarms | Weeks with an alarm | Releases never promoted | Of those, better on their week (interval above 0) | NDCG@10 given up a visit against shipping weekly (interval over weeks) | Age of the live model, weeks |
|---|---|---|---|---|---|---|
| Ship weekly | 19 | 18 of 52 | 0 of 51 | 0 (0) | reference | 0.0 (max 0) |
| Gate | 50 | 32 of 52 | 23 of 51 | 12 (2) | 0.0001 (-0.0006 to 0.0008) | 1.2 (max 8) |
| Gate, then a shadow week | 61 | 42 of 52 | 38 of 51 | 23 (6) | 0.0030 (0.0016 to 0.0045) | 6.8 (max 30) |
| Gate, then a routed share | 74 | 45 of 52 | 43 of 51 | 29 (13) | 0.0034 (0.0021 to 0.0047) | 13.6 (max 43) |
| Strict gate | 54 | 34 of 52 | 26 of 51 | 13 (2) | 0.0000 (-0.0008 to 0.0007) | 1.4 (max 8) |
| Strict gate, then a shadow week | 62 | 44 of 52 | 38 of 51 | 21 (6) | 0.0030 (0.0016 to 0.0045) | 6.8 (max 30) |
A release that was never promoted was compared with the release that served instead, on the same week's visits. Most differences sit inside their intervals: the rules mostly blocked releases that were neither better nor worse. The given-up quality is the paired difference against shipping weekly on the same visits over weeks 1 to 51. Its interval resamples whole weeks, because the difference comes from which release served each week; that choice was made after the results (the interval over single visits, in the machine results, is narrower), and it holds this one replay's release choices fixed. Under the routed rule the live model fell back to the first release for long stretches: a healthy-year alarm rolls the live model back to the previous champion, and the routed comparison, on about one user in ten, rarely promoted a new one.
Which rule kept which failure from users
Each failure was planted in its own replay and stays in place until an alarm leads to its fix, for at most 8 weeks. The table gives the visits served by the faulty path, the check that raised the first alarm after the onset, and the days from the onset to that alarm (day 0 is a release check at the start of a week). As declared, an alarm from any check while a failure was in place counts as finding it; in the healthy year the same alarm only rolls the live model back. That favours the rules that alarm more.
| Rule | Serving-only feature bug | Silent label shift | Wins offline, loses online | Latency regression | Light-user profile gap |
|---|---|---|---|---|---|
| Ship weekly | 105, skew monitor, day 1 | 0, calibration monitor, day 7 | 1,010, accuracy monitor, day 7 | 995, accuracy monitor, day 7 | 258, latency monitor†, day 1 |
| Gate | 105, skew monitor, day 1 | 0, calibration monitor, day 7 | 1,010, accuracy monitor, day 7 | 0, offline check*, day 0 | 0, latency check†, day 0 |
| Gate, then a shadow week | 105, skew monitor, day 1 | 0, light-user check*, day 0 | 0, shadow week*, day 7 | 0, offline check, day 0 | 0, offline check†, day 0 |
| Gate, then a routed share | 105, skew monitor, day 1 | 0, calibration monitor, day 7 | 102, routed share*, day 7 | 0, offline check, day 0 | 0, latency check†, day 0 |
| Strict gate | 105, skew monitor, day 1 | 0, calibration monitor, day 7 | 1,010, accuracy monitor, day 7 | 0, offline check*, day 0 | 0, latency check†, day 0 |
| Strict gate, then a shadow week | 105, skew monitor, day 1 | 0, light-user check*, day 0 | 0, shadow week*, day 7 | 0, offline check*, day 0 | 0, offline check*†, day 0 |
* The same check also alarmed in that week of the healthy replay under the same rule, so noise alone would have raised it. † The failure did no measurable harm (its interval includes zero overall and for light users), so the alarm stopped a harmless release. The label shift reaches no user under any rule by construction: the first release trained on shifted labels is built two weeks after the shift, and the label monitors alarm at the end of the first week.
Four kinds of catch are luck rather than design, and the page counts them anyway, as declared. The latency check that stopped the light-user release under the gate and the routed rule, and the latency monitor that alarmed on it after one day under shipping weekly, measured noise on a busy shared machine: that release does the same work per request as a clean one, and it was timed later, with the machine busier. The offline check that stopped it under the shadow rules fired on a release that, measured on users, was no worse than the clean one. And the light-user check that alarmed at the label shift's onset under the shadow rules compared two releases trained before the shift.
One failure, traced: the release that wins offline
At week 24 a training change leaked the holdout week into the re-ranker's training rows and raised its capacity. On its holdout it scored 4.50 times the clean release of the same week, so every gate passed it. Over its 8 weeks, on the same visits, the leaky releases scored -17% against the clean ones (interval -0.0113 to -0.0054 NDCG@10 a visit).
- Shipping weekly served it all week: 1,010 visits. At the end of the week the accuracy monitor fired at 0.71 times its trailing mean, and the next release was built without the change.
- Gate, then a shadow week: it scored every visit of week 24 in the background at 0.84 times the champion and was discarded. 0 visits.
- Gate, then a routed share: the share saw it for a week, 102 visits, before the comparison rejected it.
The shadow week was the only rule that kept this failure from every user, and the shadow week also rejected 14 healthy releases in the clean year: it would have rejected some challenger that week with no fault planted.
What each planted failure did to users
Each failure measured against the clean path on the same visits, on the true labels (4 stars or more), with a paired bootstrap interval over visits. Offline is the faulty release's holdout score as a multiple of the clean release's, per week.
| Failure | Weeks | Change, all | Difference a visit (interval) | Change, light users | Light users (interval) | Offline |
|---|---|---|---|---|---|---|
| Serving-only feature bug | 8 to 15 | -1.1% | -0.0006 (-0.0014 to 0.0004) | -6.8% | -0.0073 (-0.0137 to -0.0015) | not a model change |
| Silent label shift | 18 to 23 | -4.8% | -0.0025 (-0.0050 to -0.0002) | 1.0% | 0.0011 (-0.0119 to 0.0125) | not a model change |
| Wins offline, loses online | 24 to 31 | -17% | -0.0085 (-0.0113 to -0.0054) | -21% | -0.0225 (-0.0395 to -0.0062) | 4.50 to 6.61 |
| Latency regression | 32 to 39 | -21% | -0.0097 (-0.0124 to -0.0071) | -6.3% | -0.0078 (-0.0215 to 0.0066) | 0.72 to 0.89 |
| Light-user profile gap | 40 to 47 | -0.5% | -0.0003 (-0.0019 to 0.0015) | -0.1% | -0.0001 (-0.0087 to 0.0095) | 0.89 to 1.04 |
- The serving-only bug moved the overall score by -1.1%, with an interval that includes zero, and light users by -6.8%, with one that excludes it. Small, as predicted.
- The leaky release won offline by 4.50 to 6.61 times and lost 17% on users, as predicted.
- The slow release (four times the rounds, twice the leaves) also overfit: 0.72 to 0.89 times the clean release offline, -21% on users. The prediction was that the latency check would stop it; the offline check did. Its latency effect was not measured reliably: every faulty release was timed after all the clean ones, with the machine busier, so its ratios to the clean releases mix the model with the load. Under shipping weekly the prediction was a latency alarm after a day; the accuracy monitor alarmed first, after a week.
- The light-user profile gap opened no gap: light users moved -0.1%, with an interval that includes zero. Why zeroing their genre affinity changed so little is not tested here. Any rule that "caught" it caught a harmless release.
Latency, relative only
Every release was loaded into the endpoint and sent the same 650 requests by 4 clients. Measured on a shared machine under heavy load from other work, the slowest 1% of requests of healthy releases ranged from 0.95 to 1.63 times the first release's: the machine, not the model, moved most of that. The releases were timed one after another as the machine's load changed, the first release and the clean ones first and the faulty ones last, so a ratio between two releases carries the load difference too. An in-line shadow, scoring champion and challenger in the same request, made the median request 2.01 to 2.38 times slower; a routed share adds no scoring. These are ratios between variants on one machine, never a production latency figure.
What a team should do with this
- Log every served feature value and recompute it with the training code each day. It caught the serving-only bug after one day under every rule; a score comparison cannot see a feature fault that both models are served with.
- Make the endpoint refuse to load a package whose files do not match its manifest, or whose feature version differs from the serving code's. No planted failure tested this check here; it is cheap and it is the last line before users.
- Keep the offline comparison, but read it as a floor. It stopped the overfit release and passed the leaky one at 4.50 times a clean release: a challenger that wins offline by that much is a reason to look, not to ship.
- Measure the week-to-week spread of healthy releases on your own traffic before choosing margins. Here a 2% margin sat inside the noise, and a light-user check on 21 to 48 scored visits a week mostly measured chance.
- Price the shadow week before adopting it: one more model scored per request, a week of delay for every release, and, at this traffic, more alarms than weeks.
Limits
- A self-test: the same author wrote the rules, the monitors and the five failures. Each failure was planted once.
- Simulated weeks on public ratings. The traffic is small: fewer than a thousand scored visits a week, which is what makes the margins noisy. A larger service would see less noise and could use tighter margins.
- One machine, one endpoint process, a synthetic load; the machine was busy with other work, which moved the latency figures. They are relative, never a production claim.
- One factor-model and one re-ranker fit per release, one seed. The week-to-week spread of healthy releases is the noise the rules face, and it is reported as such.
- An alarm is assumed to lead straight to the fix. Finding a cause takes time in practice, so the exposures are a lower bound. And an alarm from any check while a failure was in place counts as finding it, which favours the rules that alarm more.
- The factor model is refit every fourth week, not weekly, a change made before any weekly release was trained.
- No managed serving or tracking product was used; the registry is a versioned folder and the endpoint uses the Python standard library. Nothing here is a claim of having run production model serving.
Use this at your company
To run the same check on your own ranking model, paste this prompt into an AI assistant along with your request logs.
This method comes from Diogo Travassos's study "The ranking model behind an endpoint, released weekly" (https://diogotravassos.dev/ranking-lifecycle/serving.html). If you can open links, read it first: it works the method through end to end, with its checks. The steps below stand on their own if you can't. Help me choose release rules for our ranking model and find out what each one costs. Data: our request logs with the served list and the feature values, the outcomes users went on to have, and the list of model releases with their dates and manifests. Steps: 1. Replay past weeks in time order. Each week, train a release on earlier data and package it with a manifest. 2. Measure how much healthy releases move week to week on our own traffic, overall and per user group. 3. Write down the rules before looking: ship every release; a gate (package, offline margin, feature skew, latency, group check); a gate plus a shadow week; a gate plus a routed share. 4. Plant failures one at a time (a serving-only feature bug, a broken label job, a leaky training change, a slow release, a group gap) and predict what each rule will do. 5. Recompute every served feature value with the training code and compare. Checks: paired comparisons on the same requests with bootstrap intervals; alarms on the healthy replay counted as false alarms; latency only as ratios between variants on the same machine. Report: per rule, the failures kept from users and the requests exposed to each, the alarms in a healthy period, the quality given up against shipping every release, and how old the live model gets. Planted failures are a self-test, not proof the rules work. In your report, say which study you followed and link it: https://diogotravassos.dev/ranking-lifecycle/serving.html
Method and checks
On this study a check compared the HTTP endpoint with the batch replay that produced every number here: 200 of 200 requests returned the identical top 20, and the endpoint's health answer named the same manifest. Every decision on this page was replayed again from the published aggregates and matched.
Set in advance
The calendar, the visit and label definitions, the model, the release contents, the six rules with their margins, the eight monitors with their lines, the latency load, the five planted failures with a prediction for each, the 8-week window and the measures were written down and committed before any weekly release was trained. Before that, only weekly counts of active users had been read.
Changed after that, before any replay outcome was read: the factor model is refit every fourth week instead of weekly (written before any re-ranker was trained); no faulty release is built for the serving-only bug, which lives in the serving code; and the machine's load is stored with each latency measurement. Added after the first replays had run, still before any outcome was read: a planted failure ends at the end of its 8-week window, because the replays where nothing acts otherwise asked for faulty releases past the window that were never built (no replay that acts on alarms changed). Added after the results and labelled so where they appear: which catches were luck, the count of harmful releases kept from users in place of all five failures, the interval over weeks for the quality given up, and the reasons given for the latency and light-user results.
The design's constants are all in protocol-serving.json.
Data, calendar and the model
- MovieLens 32M. Weeks start on Monday; week 0 starts on 3 October 2022 and week 51 on 25 September 2023. A liked movie is a rating of 4 or more; a visit's labels are the movies the user rated 4 or more from the visit to the end of that week, among movies they had not rated.
- The model of the quarterly study: implicit ALS with 128 factors, its top 100 re-ranked by LightGBM on ten features. Release k is trained on the visits of weeks k-5 to k-2 and scored on week k-1, so its holdout stays out of sample.
- 82 releases were built: 52 clean ones and 30 with a planted model change.
Serving and the two feature paths
The endpoint answers a ranking request with the release id and a top 20, checks every package file against its manifest on load, and refuses a package whose feature version differs from its own. User features are computed per request from that user's earlier ratings; the training rows rebuild the same features in bulk with separate code. The skew check recomputes every served value with the training code and counts a mismatch above 1e-4 relative.
Monitors
- Weekly, on the live model's visits, against the mean of the previous 4 weeks: accuracy below 0.85 times; calibration and label rate outside 0.75 to 1.33 times; the light-to-heavy ratio below 0.80 times.
- Weekly, against the previous week: drift index over 0.2 on any input feature or on the predicted chance.
- Daily: skew above 1% of values; the slowest 1% of requests above 1.5 times the first release's.
Displayed numbers
NDCG@10 differences to four decimals, ratios to two, changes in whole percents or one decimal below 10%. Intervals: paired bootstrap over visits, 1,000 resamples, 95%.
Data, licence and privacy
F. Maxwell Harper and Joseph A. Konstan. 2015. The MovieLens Datasets: History and Context. ACM Transactions on Interactive Intelligent Systems 5, 4: 19:1 to 19:19. https://doi.org/10.1145/2827872. This study is independent and not endorsed by the University of Minnesota or GroupLens. No rating is published here; results are aggregates. No employer data is used.
Reproduce itComplete machine resultsRelease registryProtocolThe quarterly study