Concepts
Predictions and experiments
An experiment is one change, written down before it runs: the variant, the hypothesis and a prediction for each tier.
Proposing
e = h.propose(
"Rerank search results", "rerank-v1",
{"T0": {"pass_rate": 1.0}, "T1": {"mean_accuracy": 0.84, "cost_usd": 1.2}},
hypothesis="The right article is retrieved but ranked too low",
treatment_axes=["retrieval"], max_cost_usd=5,
)const e = await h.propose({
title: "Rerank search results",
variant: "rerank-v1",
hypothesis: "The right article is retrieved but ranked too low",
predictions: { T0: { pass_rate: 1.0 }, T1: { mean_accuracy: 0.84, cost_usd: 1.2 } },
treatmentAxes: ["retrieval"],
maxCostUsd: 5,
});{
"title": "Rerank search results",
"hypothesis": "The right article is retrieved but ranked too low",
"variant": "rerank-v1",
"treatment_axes": ["retrieval"],
"predictions": {
"T0": {"pass_rate": 1.0},
"T1": {"mean_accuracy": 0.84, "cost_usd": 1.2}
},
"max_cost_usd": 5
}The hypothesis is required: what you expect the change to do, and why. Every predicted tier needs at least one number: pass_rate, mean_<metric>, cost_usd, or another metric you report. treatment_axes names what the experiment varies; max_cost_usd caps what its runs may report.
Closing
| Decision | Means |
|---|---|
adopt | The variant becomes the next version. It must pass its gate, including the held-out test set. An override needs a written reason, and is logged and shown. |
iterate | Promising; a follow-up experiment comes next. |
reject | It didn't help. The result is kept, so nobody tries it blind again. |
kill | Stop: it can't win, or it isn't worth the cost. |
At close, the predictions are graded against what happened. A note says why, in your words: it's required, because the decision log keeps it.
from synaptra_sdk import GateRefused
try:
h.close(e["id"], "adopt", note="Reranking fixed the misses on T1 and the test set")
except GateRefused as err:
print(err.detail) # the reasons, per tier
h.close(e["id"], "iterate", note="Good on T1; needs more test-set runs")import { GateRefused } from "synaptra-sdk";
try {
await h.close({ experimentId: e.id, decision: "adopt", note: "Reranking fixed the misses on T1 and the test set" });
} catch (err) {
if (!(err instanceof GateRefused)) throw err;
console.log(err.detail); // the reasons, per tier
await h.close({ experimentId: e.id, decision: "iterate", note: "Good on T1; needs more test-set runs" });
}Comparing variants
Comparisons are paired: the same tasks, incumbent against challenger, with an interval on the difference rather than two means side by side. When draws vary, the interval includes that variation.
Something unclear or missing? Email support@synaptra.my.