Dynamic Arms
Add arms to a live campaign, start them from a sensible guess, and take them out of rotation without losing what they learned. Available from 2.1.0.
Catalogues change. Products launch and sell out, creatives wear out, a model gets added to the routing pool. You can add an arm to a running campaign, or take one out of rotation, without disturbing what the other arms have learned. You don't need to recreate the campaign.
Adding an arm
POST /campaign/:id/arms (admin role). The body is {arm_id, group?, warm_start?}.
curl -X POST http://localhost:8080/campaign/catalog/arms \
-H "X-Api-Key: $ADMIN_KEY" -H "Content-Type: application/json" \
-d '{"arm_id": "sneaker_42", "group": "shoes",
"warm_start": {"from": "group", "strength": 1.0}}'
db.add_arm("catalog", "sneaker_42", group="shoes",
warm_start={"from": "group", "strength": 1.0})
| Field | Meaning |
|---|---|
arm_id | 1–128 characters of [a-zA-Z0-9_-]. Must not already exist on the campaign (409). |
group | Optional label, such as a product category. Used by warm_start.from = "group". |
warm_start | Optional. Where the new arm's starting estimate comes from. Without it the arm starts cold. |
Warm start
A new arm starts cold: θ = 0, with everything still to learn. A warm_start centres its prior on the mean θ of arms that already exist instead:
from | Prior mean is taken over | Example |
|---|---|---|
"none" (default) | Nothing. Cold start. | {"from": "none"} |
"population" | Every active arm in the campaign. | {"from": "population", "strength": 1.0} |
"group" | Active arms with the same group as the new arm. | {"from": "group", "strength": 1.0} |
"arms" | An explicit list of arms, whatever their status. Use it to replace a worn-out creative with a fresh one. | {"from": "arms", "arms": ["banner_v1"], "strength": 2.0} |
The math. The warm start uses the same ridge prior every arm already has, centred on μ₀ instead of zero. A cold arm starts at A⁻¹ = I, b = 0. A warm start uses A⁻¹ = I/λ, b = λ·μ₀, so θ = A⁻¹b = μ₀. strength (λ, default 1.0, maximum 10⁶) is measured in pseudo-observations:
- At 1.0 the arm is exactly as uncertain as a cold one, so it is still explored. It just starts from a sensible guess instead of from nothing.
- Raise λ to trust the prior more and explore less.
- Real rewards outweigh the prior as they arrive.
This is cold-start relief, not a hierarchical model. The prior is resolved once, when the arm is added. Nothing shrinks toward a group mean afterwards.
- Progressive campaigns: the arm is added to the base and the challenger together. Each prior is resolved against that model's own
θ. - Neural campaigns: the prior lives in the current embedding space. The next retrain rebuilds arm matrices in a new space, which in effect discards it. Status and
groupsurvive retraining. - Budgeted campaigns: pass
costsfor the new arm (see Budgets & Costs).
Taking an arm out
Exclusion is soft at every level. Nothing is deleted.
| Scope | How | Effect |
|---|---|---|
| One request | eligible_arms / exclude_arms on /predict and /batch_predict | Narrows the candidates for this call only. No state changes and no admin key needed. Use it for: out of stock for this shopper, already shown to this user, not permitted in this region. |
| One arm | POST /campaign/:id/arms/:arm_id/status → "paused" | Not selectable by any request. Reversible, and the arm keeps everything it learned. |
| One arm | … → "retired" | Same as paused, but meant as permanent. It can still be restored with "active". |
# This shopper: only shoes, and not the one they just returned
curl -X POST http://localhost:8080/predict -H "X-Api-Key: $APP_KEY" -H "Content-Type: application/json" \
-d '{"campaign_id": "catalog", "context": [0.2, 0.7, 0.1, 0.6],
"eligible_arms": ["sneaker_41", "sneaker_42", "boot_7"],
"exclude_arms": ["sneaker_41"]}'
# Everyone: pause an arm, then bring it back
curl -X POST http://localhost:8080/campaign/catalog/arms/boot_7/status \
-H "X-Api-Key: $ADMIN_KEY" -H "Content-Type: application/json" -d '{"status": "paused"}'
curl -X POST http://localhost:8080/campaign/catalog/arms/boot_7/status \
-H "X-Api-Key: $ADMIN_KEY" -H "Content-Type: application/json" -d '{"status": "active"}'
arm, iid = db.predict("catalog", ctx, eligible_arms=["sneaker_41", "sneaker_42", "boot_7"],
exclude_arms=["sneaker_41"])
db.set_arm_status("catalog", "boot_7", "paused")
eligible_arms is applied first, then exclude_arms. A filter can only narrow the active set. It never makes a paused or retired arm selectable.
What to know
- A paused arm keeps learning. Predictions made before the pause are still in flight, and their rewards still arrive. Dropping them would throw away data the arm already paid for.
- Propensities follow the filter. Arms are filtered before propensities are computed. The logged propensity is the probability of the chosen arm under the policy that actually ran. Off-policy evaluation and the Progressive tournament stay valid.
selection_entropyandconvergedcover active arms only. Otherwise a paused arm's historical traffic would make a collapsed campaign look healthy. Its history stays visible in/reportand/diagnostics, tagged with its status.- You can't pause the last active arm. The request is refused with a 400, because every prediction would fail. Archive the campaign instead.
- With
decay_half_life_hoursset, a paused arm's posterior keeps widening while it is out of rotation. When it is reactivated it gets explored again, instead of being trusted on stale confidence.