LeveredDocs
Concepts

Optimizations

An optimization is one product decision that Levered optimizes. It contains the design factors, the metrics, the model and the training data config.

An optimization is the top-level entity in Levered. It represents one product decision to improve, for example which headline converts best, which checkout flow produces the most revenue, or which pricing display produces the most sign-ups.

What an optimization contains

An optimization contains the following parts:

  • Design factors. The variables that Levered controls (headline text, button color, layout) and their possible values. See Design Factors.
  • A model. The model learns which variants perform best. See Models.
  • Linked metrics. The reward signals that define success, written as SQL queries against the warehouse.
  • Training data config. The settings that Levered uses to connect exposures to rewards, including the conversion window and the warehouse tables.

Example

An optimization for a landing page hero section can have the following parts:

  • Design factors: headline (5 options) and cta_text (2 options), which produce 10 variants.
  • Reward metric: a SQL query that counts sign-ups within 24 hours of seeing the page.
  • Context factors: country and device type. The model uses them to select a variant per segment. See Context Factors.

When the optimization is live, the SDK serves a variant to each visitor, and the model retrains as new data arrives in the warehouse.

Status lifecycle

An optimization has one of the following statuses:

StatusMeaning
draftBeing set up. Nothing is served yet, except for dry-run calls that verify the SDK integration.
liveLevered serves variants and the app collects data. The model retrains periodically as new observations arrive.
pausedLevered serves nothing until the optimization is resumed. Users get the fallback defined in the app.
shippedLevered serves the leading variant for each context to 100% of traffic. The model no longer learns, there is no holdout, and results are frozen.
completedThe optimization is stopped and cannot be resumed. Levered serves nothing, so users get the fallback defined in the app. Results remain available.
archivedThe optimization is not active and is hidden from the default dashboard view. Data is retained.

Ending an optimization: ship or stop

The learning phase can be ended in two ways, Ship winner and Stop. The table shows what each one does.

Ship winnerStop
Statusshippedcompleted
Users getThe leading variant for their contextThe fallback defined in the app
HoldoutRemovedRemoved
ModelFrozenFrozen
ReversibleYes, learning can be resumed at any timeNo

Shipping has the following consequences:

  • Served variants. Levered serves a policy. If the optimization has context factors, each context segment that the model has seen gets its own leading variant. A context that the model has not seen gets the variant that leads over all traffic. The dashboard and levered optimizations show <id> list the served variants.
  • Measurement. Lift and guardrails are measured against the holdout. Shipping removes the holdout, so the results are frozen at the time of shipping.
  • Returning users. While the optimization is live, a returning user keeps the variant that was first assigned. After shipping, all users get the leading variant for their context, including users who were in the holdout.
  • SDK integration. The integration stays unchanged and the app keeps calling Levered. To hardcode the winner and remove the integration, read the shipped policy from the dashboard or the CLI, then stop the optimization.

A shipped optimization cannot be archived directly, because it is still serving users. Stop it first.

Comparison with A/B testing

An A/B test has a fixed design. The sample size is chosen upfront, traffic is split evenly, and a winner is picked manually after the test reaches statistical significance. Until then, underperforming variants keep their full share of traffic.

A Levered optimization differs in the following ways:

  • Start of optimization. The model starts to shift traffic toward better variants as soon as it has enough data. There is no waiting period.
  • Sample size. No sample size has to be calculated upfront. The model adapts as data accumulates.
  • Traffic allocation. Variants that perform well get more traffic, and variants that underperform get less. The model allocates traffic with Thompson Sampling.
  • Exploration. The model continues to serve other variants occasionally while it serves the leading variant most of the time. If user behavior changes, the model adapts.