Boost and kill switch
Algorithms decide what is likely to be relevant. Editors decide what must be shown, shown more, or not shown at all. Boost and kill switch are the two controls for that, applied after the model has produced its list.
Why tune content by hand
A model only knows the past. It cannot know that a campaign starts tomorrow, that a programme's rights expire tonight, or that an episode was published with an error. These controls let people react in minutes, and they do it without retraining or changing the algorithm.
Business rules work on the item-score list that an algorithm returns. Each rule can rescore items or remove them, and the list is re-sorted after every rescoring step (see applying business rules). Boost and kill switch are two more steps of exactly that kind.
The controls
| Control | What it does | Typical use |
|---|---|---|
| Boost | Multiplies the score of chosen items or programmes, so they rise in the ranking | Campaigns, new series, editorial picks |
| Downrank | Multiplies by less than one, so items sink but can still appear | Content that is correct but should be seen less |
| Pin | Places an item at a fixed position, such as the first slot | A guaranteed headline item |
| Kill switch | Removes chosen items or programmes from every list immediately | Rights problems, errors, sensitive events |
A boost changes a probability. A kill switch changes a guarantee. If something must never appear, use the kill switch, not a very low score.
Kill switch and program blacklist
The program blacklist also removes content from recommendations, and it is the right tool for programmes that are never suitable, such as a weather forecast. The difference is how fast and how often it changes.
| Program blacklist | Kill switch | |
|---|---|---|
| Intended for | Permanent exclusions | Urgent, temporary removal |
| Where the list lives | In the endpoint code | In storage that the endpoint reads on each request |
| Takes effect | After the endpoint is deployed | On the next request |
| Usually set by | Data scientists | Editors or operators |
How it works in the stack
Keep the rules as small lists
Store boosts, blocks and pins as plain lists of ids with a factor, a scope and an end date. Keeping them in Dragonfly means they are read at request time and can change without a deploy.
Add the steps to the endpoint
After the model has scored the candidates, the endpoint reads the rules and applies them in a fixed order. The business rules guide explains the standard way to do this.
Look before it is live
Use Spectrum to see the effect of a rule on a real list before you rely on it.
Check the effect
Compare click-through with and without the boost in an A/B test. A boost that does not improve engagement should end.
Example
A single step that applies all four controls to an item-score list. The rules are loaded once per request.
import time
def apply_editorial(items, rules, now=None):
"""items: list of (item_id, score). rules: dict with boost, block, pin."""
now = now or time.time()
live = lambda r: r.get("until", float("inf")) > now
blocked = {r["id"] for r in rules["block"] if live(r)}
factor = {r["id"]: r["factor"] for r in rules["boost"] if live(r)}
# 1. kill switch: remove first, so nothing below can bring it back
items = [(i, s) for i, s in items if i not in blocked]
# 2. boost and downrank: rescore, then re-sort
items = [(i, s * factor.get(i, 1.0)) for i, s in items]
items.sort(key=lambda x: x[1], reverse=True)
# 3. pin: move to a fixed position, never a blocked item
for r in sorted(rules["pin"], key=lambda r: r["position"]):
if live(r) and r["id"] not in blocked:
items = [x for x in items if x[0] != r["id"]]
items.insert(r["position"], (r["id"], float("inf")))
return items
Order matters. Removal comes first so that a blocked item can never come back through a boost or a pin.
Good practice
- Give every rule an end date. A boost that is forgotten becomes a permanent distortion.
- Keep factors modest. A boost of 1.2 to 2 reorders neighbours. A very large factor turns the list into an editorial list and hides how the model performs.
- Scope rules. Apply them per codops, per endpoint or per placement, not everywhere by default.
- Record who changed what and why. A kill switch is easy to flip and hard to explain afterwards.
- Apply the kill switch to every endpoint. Include search, similar items and the fallback list, otherwise the item returns through another route.
- Test the removal. Request the list after the change and check that the item is gone.
Note
The existing generic rules need a code change to the endpoint. The request-time lists described here are a recommended way to build the same steps. Contact the PEACH team if you want help setting them up for your codops.