KatInterview

Experiment Plan for an LLM-Powered Inline Rewrite Feature

Statistics & ExperimentsModel answer
HardModel answerStatistics & Experimentsab-testingexperiment-designmetrics

Last updated

Plan a controlled experiment for an inline AI rewrite feature: choose metrics and guardrails, pick the randomization unit, size the test, and guard against bias.

Scenario

You work on a document-editing product with an AI writing assistant. A new capability will highlight passages of text and offer reworded alternatives that the user can accept with one click. Product leadership wants evidence that it makes people more engaged, and the proposed engagement measure is characters edited per session.

Each suggestion comes from a call to a large language model and adds roughly 100 ms of delay whenever one is triggered. The product has about 1 million daily active users.

Your task

Describe how you would run a controlled experiment to decide whether to launch. Cover these four areas:

  1. Hypothesis and metrics. State the hypothesis. Choose a primary metric, supporting secondary metrics, and guardrail metrics that would catch harmful side effects. Say whether the proposed engagement measure is trustworthy.
  2. Randomization. Choose the unit of assignment (user, session, request, or something coarser) and justify it. Explain how you would deal with interference between users.
  3. Sample size and duration. List what drives the required sample size, show how you would estimate it, and explain how you would choose the test length.
  4. Bias and validity threats. Name the main ways the result could be misleading (selection, novelty, instrumentation, and so on) and how you would reduce each.

Be ready for follow-ups such as: what if engagement rises but retention falls, or what if a bug put a non-random group of users into one arm?

Hints

Hint 1

Ask whether the feature can raise the primary metric without delivering any value. Consider what a single click on an accepted rewrite does to a character count.

Hint 2

Think about who actually sees the feature. If most sessions never trigger a suggestion, the effect is diluted. Consider logging when a suggestion would have fired in the control arm too.

Hint 3

In shared documents, one user's accepted rewrite shows up in another user's document. Ask which unit of randomization keeps arms from contaminating each other.

Hint 4

For sample size, write the formula and identify which inputs are business decisions (minimum detectable effect) and which are data properties (variance, heavy tails). Then ask what, other than sample count, should set the duration.