Tutorials › Marginal Structural Models › Binary-Treatment Blip Functions In Q-Learning

Dynamic Treatment Regimes · Tutorial 413 of 501

Binary-Treatment Blip Functions In Q-Learning

Learn to form a binary-treatment blip from Q-functions, interpret its sign and zeros, and check when that decision rule has a causal interpretation.

Advanced 11 min read

What You'll Learn

  • Define a binary-treatment blip as the Q-value for action 1 minus the Q-value for action 0.
  • Derive the optimal-action rule from the sign of the blip, including what happens at zero.
  • Identify assumptions needed to interpret conditional Q contrasts causally.
  • Calculate blips from conditional means, treatment-interaction models, and continuation values.
  • Diagnose unsupported actions, coding errors, and unstable decisions near blip zero.
  • Distinguish conditional Q contrasts from marginal treatment effects and regime-value comparisons.

From Two Q-Values to One Decision Contrast

At a decision point, a binary treatment offers two actions, coded 0 and 1. The Q-function assigns a conditional expected utility to each action at the current history, accounting for the rewards and decisions that follow. A decision can therefore be made by comparing two quantities. The blip function compresses that comparison into a single signed contrast: positive favors action 1, negative favors action 0, and zero means the two actions have equal Q-value at that history.

The contrast is conditional on history, not necessarily a population-average treatment effect. Different histories can have different blip values, and therefore favor different actions. The definition below uses the convention “action 1 minus action 0”; reversing the order reverses every sign-based rule.

Definition: At stage \(t\), let \(H_t\) denote the observed history available just before treatment \(A_t\), with \(A_t\in\{0,1\}\). Let \(Q_t(h,a)\) be the conditional expected total utility from stage \(t\) onward when action \(a\) is taken at history \(h\) and optimal decisions are used at subsequent stages. The binary-treatment blip function is $$ \Delta_t(h)=Q_t(h,1)-Q_t(h,0). $$

For a terminal stage, \(Q_t(h,a)\) is simply the conditional expected terminal utility given the action. At an earlier stage, it includes the immediate reward and the value of subsequent decisions. Thus a blip is not necessarily the contrast in the immediate response alone. Its meaning depends on the Q-functions being compared, including their future-decision convention.

Why the Sign Selects an Action

At a fixed history, choosing action 1 gives value \(Q_t(h,1)\), while choosing action 0 gives value \(Q_t(h,0)\). Since the blip is their difference, the larger value can be selected without comparing two separate expressions each time.

Theorem: Suppose both actions are feasible at history \(h\) and the Q-values are finite. An action maximizing \(Q_t(h,a)\) is $$ d_t^*(h)= \begin{cases} 1, & \Delta_t(h)>0,\\ 0, & \Delta_t(h)<0,\\ \text{either 0 or 1}, & \Delta_t(h)=0. \end{cases} $$

Proof. If \(\Delta_t(h)>0\), then \(Q_t(h,1)-Q_t(h,0)>0\), so \(Q_t(h,1)>Q_t(h,0)\) and action 1 maximizes the Q-value. If \(\Delta_t(h)<0\), the inequality reverses and action 0 maximizes it. If \(\Delta_t(h)=0\), the two Q-values are equal, so both actions maximize them. This proves the rule. \(\square\)

The rule is pointwise: it applies separately at each history where the Q-values are defined. If histories are continuous, conditional expectations and Q-functions are generally defined only up to sets of probability zero. Consequently, a decision rule is interpreted almost surely under the relevant history distribution; its values at unsupported or probability-zero histories need not be identified by the data.

Worked Example: Reading a Blip Table

At a terminal decision point, suppose the conditional mean utilities at two histories are as follows. The entries are assumed to be Q-values, not estimates of immediate reward alone.

History\(Q(h,0)\)\(Q(h,1)\)
\(h_A\)69
\(h_B\)85
\(h_C\)77

At \(h_A\), \(\Delta(h_A)=9-6=3\), so action 1 is better by 3 utility units. At \(h_B\), \(\Delta(h_B)=5-8=-3\), so action 0 is better by 3 units. At \(h_C\), \(\Delta(h_C)=7-7=0\), so either action is optimal under these Q-values. The optimal rule is history-dependent: using action 1 for everyone would fail to maximize value at \(h_B\).

Blips in Treatment-Interaction Models

A treatment-interaction model makes the history dependence of the contrast explicit. For a scalar history summary \(x\), consider the working model $$ Q(x,a)=\beta_0+\beta_x x+a(\beta_a+\beta_{ax}x), \qquad a\in\{0,1\}. $$ Substituting \(a=1\) and \(a=0\), then subtracting, gives $$ \Delta(x)=\{\beta_0+\beta_x x+\beta_a+\beta_{ax}x\} -\{\beta_0+\beta_x x\} =\beta_a+\beta_{ax}x. $$ The terms common to both actions cancel. The interaction allows the preferred action to change across values of \(x\); without it, this model constrains the blip to the constant \(\beta_a\). This algebra describes the model’s implied contrast, whether or not the model is correctly specified.

Worked Example: Finding the Decision Threshold

Suppose a fitted Q-model is \(Q(x,a)=10+2x+a(1.5-0.5x)\), where \(x\) is a measured history summary and larger utility is preferred. The action-0 prediction is \(Q(x,0)=10+2x\). The action-1 prediction is \(Q(x,1)=10+2x+1.5-0.5x\). Their difference is $$ \Delta(x)=Q(x,1)-Q(x,0)=1.5-0.5x. $$

To find where the decision changes, solve \(1.5-0.5x=0\), giving \(x=3\). For \(x=1\), the blip is \(1.5-0.5=1\), so action 1 is preferred. For \(x=4\), it is \(1.5-2=-0.5\), so action 0 is preferred. At \(x=3\), the fitted Q-values tie. For example, \(Q(3,0)=10+6=16\) and \(Q(3,1)=16+1.5-1.5=16\), confirming the tie directly.

Continuation Values Are Part of the Contrast

In a multistage problem, the current action can change both immediate reward and the distribution of later histories. The blip must compare the resulting total Q-values, including the continuation value under optimal later decisions. The following finite example makes that contribution explicit.

Worked Example: Immediate Reward Plus Future Value

At a current history \(h\), suppose action 0 gives immediate reward 1 and leads to next history \(L\) with probability \(0.25\) and \(H\) with probability \(0.75\). The optimal future values are \(V(L)=4\) and \(V(H)=6\). Action 1 gives immediate reward 2 and leads to \(L\) and \(H\) with probabilities \(0.5\) each; its future values are \(V(L)=4\) and \(V(H)=8\). The Q-value is the expected immediate reward plus expected future value.

For action 0, the expected continuation value is \(0.25(4)+0.75(6)=1+4.5=5.5\). Therefore \(Q(h,0)=1+5.5=6.5\). For action 1, it is \(0.5(4)+0.5(8)=2+4=6\), so \(Q(h,1)=2+6=8\). The blip is \(\Delta(h)=8-6.5=1.5\), and action 1 is optimal at \(h\). Its advantage is not just the one-unit immediate-reward difference: the expected continuation also differs by \(6-5.5=0.5\), yielding a total difference of \(1+0.5=1.5\).

When Does the Contrast Have a Causal Interpretation?

The sign rule is algebraic once the Q-values are defined. Interpreting those Q-values as the outcomes that would result from intervening on treatment requires additional assumptions when treatment is assigned observationally. A standard identification argument uses consistency, sequential exchangeability, and positivity at each decision point.

Identification assumptions: Consistency means the observed reward and subsequent history agree with those under the treatment actually received; treatment versions are well-defined. Sequential exchangeability means that, conditional on \(H_t\), the assigned \(A_t\) is independent of the relevant future potential rewards and histories under treatment strategies. Positivity means \(P(A_t=a\mid H_t=h)>0\) for each action \(a\) being compared at histories \(h\) of interest. Expectations used in the Q-functions must exist and be finite.

Result and derivation. Under these assumptions, the observed-data recursion identifies the optimal Q-functions. Write \(R_t\) for the reward at stage \(t\), \(H_{t+1}\) for the next history, and \(V_{t+1}(h')=\max_{a'}Q_{t+1}(h',a')\), with terminal continuation value zero after the last reward. Then $$ Q_t(h,a)=E\!\left[R_t+V_{t+1}(H_{t+1})\mid H_t=h,A_t=a\right]. $$ To justify the recursion, begin at the final stage. Given \(H_T=h,A_T=a\), consistency equates the observed reward with the reward under action \(a\). Sequential exchangeability makes its conditional distribution among those receiving \(a\) equal to the corresponding intervention distribution, and positivity ensures that this conditional distribution is supported by observed data. Hence the conditional mean identifies the final-stage causal Q-value.

Now suppose the recursion identifies the optimal continuation value from stage \(t+1\) onward. At stage \(t\), conditional on \(H_t=h\) and setting \(A_t=a\), consistency and sequential exchangeability identify the distribution of \((R_t,H_{t+1})\) by its observed conditional distribution given \(H_t=h,A_t=a\). For each next history, the induction hypothesis identifies \(V_{t+1}(H_{t+1})\). Taking the conditional expectation of the immediate reward plus that continuation value therefore gives the causal expected utility for action \(a\) followed by optimal future decisions. This is exactly the displayed recursion. Backward induction establishes the claim for every stage, and the difference of the two identified Q-values is the causal blip. \(\square\)

Diagnostics, Alternatives, and Limitations

A model-based blip is useful because it turns fitted Q-values into an interpretable decision contrast. It also makes certain problems visible. Check that treatment coding matches the stated contrast, that the fitted Q-model includes the interactions needed to represent relevant history-dependent differences, and that both actions are represented at histories where a decision is to be made. In an observational data set, sparse or absent treatment groups can make one side of the contrast extrapolative. A numerically precise fitted blip does not repair a positivity violation.

A second warning concerns decisions near zero. If a blip estimate is small, modest estimation error can change its sign and hence the selected action. Inspect the scale and uncertainty of the contrast rather than treating every positive or negative fitted value as equally persuasive. Also check whether predicted Q-values and blips are plausible over the history range used for decisions; an interaction model can yield extreme extrapolations outside the data support.

Q-learning builds conditional Q-functions and derives a rule from their contrast. G-computation also evaluates strategies using conditional outcome models, while inverse-probability-weighted methods use treatment probabilities to reweight observed outcomes. Marginal structural models generally describe marginal contrasts across treatment strategies rather than a history-specific Q-contrast. These approaches target related causal questions but rely on different modeling and weighting structures; none makes unsupported treatment comparisons empirically identified.

A blip is only as meaningful as its Q-functions: it is not automatically an immediate treatment effect, a marginal effect, or a guaranteed benefit for every individual. The sign identifies the maximizing action for the defined conditional expected utility, subject to the assumptions and model used. If the conditional means are misspecified, the sign of the fitted contrast can select the wrong action even when the subtraction is correct.

Common Mistakes

  • Reversing the contrast. With \(\Delta=Q(1)-Q(0)\), a positive value favors action 1. The opposite convention requires reversing the decision rule too.
  • Calling a zero blip a positive or negative preference. Zero means the two Q-values tie; it does not uniquely determine an action.
  • Using only immediate reward in a multistage setting. The Q-contrast includes how the action changes future histories and their optimal continuation values.
  • Treating observed conditional means as automatically causal. Consistency, sequential exchangeability, and positivity are needed for the observational-data identification argument.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. If \(Q(h,0)=12\) and \(Q(h,1)=10\), what is the blip and which action maximizes the Q-value?
  2. A model has \(Q(x,a)=5+x+a(2-0.25x)\). Find the blip and the history value where the fitted actions tie.
  3. Why can a positive immediate-reward contrast still produce a negative blip in a multistage problem?
  4. Name the three assumptions used to give an observational Q-contrast a causal interpretation, and state what positivity requires here.

Solutions. (1) \(\Delta(h)=10-12=-2\), so action 0 maximizes the Q-value. (2) Subtracting the action-0 prediction \(5+x\) from the action-1 prediction gives \(\Delta(x)=2-0.25x\). Setting it to zero gives \(x=8\). (3) The action can reduce expected continuation value by more than its immediate reward advantage, making the total Q-contrast negative. (4) The assumptions are consistency, sequential exchangeability, and positivity. Positivity requires both actions to have positive conditional probability at histories where their contrast is to be identified.

Clinical Biostats