Tutorials › Response-Adaptive Randomization › Batch Assignment From a Shared Posterior State

Thompson Sampling for Trials · Tutorial 261 of 501

Batch Assignment From a Shared Posterior State

Learn to distinguish a fixed posterior state from a shared posterior draw, calculate batch assignment probabilities, and quantify the resulting variation in treatment-arm counts.

Advanced 10 min read

What You'll Learn

  • Define each participant’s Thompson sampling probability from a fixed posterior state.
  • Derive the multinomial distribution of cohort arm counts under independent assignments.
  • Calculate expected arm counts, count variances, and probabilities of specific allocations.
  • Distinguish independent posterior draws from reusing one posterior draw across a cohort.
  • Identify diagnostics and limitations of batch assignment without within-cohort updating.

One Posterior State, Many Assignments

In a batch trial, several participants may need assignments before any new outcomes are available. The allocation rule can use the posterior distribution formed from the trial history so far, then apply that same posterior state to every participant in the batch. The state is unchanged during those assignments, but the assignments themselves are still random. Consequently, participants assigned under the same state need not produce the same realized arm counts from one batch to another.

A key distinction is whether the algorithm draws a new set of treatment parameters for each participant or draws one set and reuses it for the whole cohort. The usual independent batch implementation of Thompson sampling makes a fresh posterior draw for each participant, while keeping the underlying posterior distribution fixed. Reusing one draw is a different randomization scheme and can produce much more extreme cohort allocations.

Definition: Suppose a trial has \(K\) treatment arms and current observed history \(H\). For arm \(k\), define \(q_k=P(\text{arm }k\text{ is best}\mid H)\), where “best” is defined by the trial’s specified treatment outcome or utility. These probabilities satisfy \(q_k\geq 0\) and \(\sum_{k=1}^{K}q_k=1\), assuming the posterior rule assigns every draw to exactly one best arm. Under independent batch assignment, each participant receives arm \(k\) with probability \(q_k\), using an independent posterior draw from the same unchanged posterior state.

The \(q_k\) values are the participant-level assignment probabilities conditional on \(H\). In a conventional Thompson sampling implementation, a fresh joint draw of the arm parameters is generated for each participant, and that participant is assigned to the arm that is best in that draw. The probability of selecting arm \(k\) is therefore its posterior probability of being best. The posterior itself is not updated until the batch responses are observed.

This procedure assumes the posterior state correctly represents the information available before the batch, the best-arm rule is well defined, and randomization draws are independent across participants conditional on that state. It does not require posterior independence between treatment arms: whatever dependence is represented in the posterior must be respected when calculating each \(q_k\). If participants have different eligibility restrictions or different utilities, their assignment probabilities may differ; the common-\(q_k\) results below apply when they share the same assignment rule and posterior state.

Distribution of the Realized Arm Counts

Let \(m\) be the number of participants in the batch. Write \(A_i\) for participant \(i\)’s assigned arm, and let \(N_k\) be the number assigned to arm \(k\). Under the independent batch rule, each assignment is a categorical draw with probabilities \((q_1,\ldots,q_K)\). Thus the count vector has a multinomial distribution.

$$ (N_1,\ldots,N_K)\mid H\sim\operatorname{Multinomial}(m;q_1,\ldots,q_K), \qquad \sum_{k=1}^{K}N_k=m. $$

For nonnegative counts \(n_1,\ldots,n_K\) summing to \(m\), the probability of that particular count vector is

$$ P(N_1=n_1,\ldots,N_K=n_K\mid H) = \frac{m!}{n_1!\cdots n_K!}\prod_{k=1}^{K}q_k^{n_k}. $$

The coefficient counts the different participant-level assignment sequences that yield the same arm counts. Each such sequence has probability \(\prod_k q_k^{n_k}\), because assignments are independent conditional on \(H\). This gives the formula and also explains why a batch need not realize the proportions \(q_k\) exactly.

Theorem: Under independent batch assignment from a fixed state, \(E(N_k\mid H)=mq_k\) and \(\operatorname{Var}(N_k\mid H)=mq_k(1-q_k)\). For distinct arms \(j\) and \(k\), \(\operatorname{Cov}(N_j,N_k\mid H)=-mq_jq_k\). The negative covariance reflects the fixed total \(m\): assigning one participant to an arm leaves one fewer assignment available for the others.

A short derivation follows from indicator variables. Let \(I_{ik}=1\) if participant \(i\) is assigned to arm \(k\), and \(0\) otherwise. Then \(N_k=\sum_{i=1}^{m}I_{ik}\), with \(E(I_{ik}\mid H)=q_k\) and \(\operatorname{Var}(I_{ik}\mid H)=q_k(1-q_k)\). Independence across participants makes the variances add, giving \(E(N_k\mid H)=mq_k\) and \(\operatorname{Var}(N_k\mid H)=mq_k(1-q_k)\). For distinct arms, \(I_{ij}I_{ik}=0\) for each participant, so their within-participant covariance is \(0-q_jq_k=-q_jq_k\). Covariances across different participants are zero; summing gives \(-mq_jq_k\).

Worked Example: Two Arms in a Batch of Ten

Suppose the current posterior state gives arm A a best-arm probability of \(q_A=0.70\) and arm B a probability of \(q_B=0.30\). A batch of \(m=10\) participants is assigned independently from this fixed state. Find the expected counts, the standard deviation of the arm A count, and the probability that exactly seven participants receive arm A.

The expected counts are \(E(N_A\mid H)=10(0.70)=7.00\) participants and \(E(N_B\mid H)=10(0.30)=3.00\) participants. These are averages over repeated batches, not guaranteed counts in this particular batch.

The arm A count variance is \(10(0.70)(0.30)=2.10\) participants squared, so its standard deviation is \(\sqrt{2.10}=1.449\) participants. The count \(N_A\) has a binomial distribution because there are two arms.

For exactly seven assignments to A, the remaining three go to B:

$$ P(N_A=7\mid H) =\binom{10}{7}(0.70)^7(0.30)^3 =120(0.0823543)(0.027) =0.2668. $$

Thus, even though the expected count is seven, the probability of getting exactly seven is about \(0.267\), not 1. Counts above or below seven are also possible under the same assignment probabilities.

More Than Two Arms and Participant-Level Probabilities

For \(K\) arms, each participant has the probability vector \((q_1,\ldots,q_K)\). In a homogeneous batch the vector is the same for every participant, but it is useful to write the assignment probability at the participant level: \(P(A_i=k\mid H)=q_k\) for each \(i\). The count distribution then accounts for all possible ways those assignments can be grouped by arm.

Worked Example: A Three-Arm Batch

Suppose a fixed posterior state gives three arms assignment probabilities \(q_1=0.50\), \(q_2=0.30\), and \(q_3=0.20\). For a batch of six, calculate the expected count for each arm and the probability of counts \((3,2,1)\).

The expected counts are \(E(N_1\mid H)=6(0.50)=3.00\), \(E(N_2\mid H)=6(0.30)=1.80\), and \(E(N_3\mid H)=6(0.20)=1.20\) participants. They sum to six, as they must.

There are \(6!/(3!2!1!)=60\) participant-level assignment sequences with these counts. Each sequence has probability \((0.50)^3(0.30)^2(0.20)^1\). Therefore,

$$ P(N_1=3,N_2=2,N_3=1\mid H) = \frac{6!}{3!2!1!}(0.50)^3(0.30)^2(0.20) =60(0.125)(0.09)(0.20) =0.135. $$

The specified count vector has probability \(0.135\). Other count vectors, including ones that differ noticeably from the expected counts, are also possible; their probabilities follow from the same multinomial formula.

A Fixed State Is Not a Shared Draw

The phrase “shared posterior state” refers to the same posterior distribution and data history being used for all assignments. It does not, by itself, mean that one random posterior draw is reused. These two implementations have the same marginal assignment probability for an individual, but generally different joint assignment distributions and different variability in cohort counts.

Worked Example: Reusing One Posterior Draw

Consider two arms with \(q_A=0.60\), \(q_B=0.40\), and a batch of five. Under independent posterior draws, the number assigned to A has mean \(5(0.60)=3.00\) and variance \(5(0.60)(0.40)=1.20\) participants squared.

Now consider a different rule: draw the best arm once, then assign all five participants to that arm. Each participant still has marginal probability \(0.60\) of receiving A, but the count \(N_A\) is now 5 with probability \(0.60\) and 0 with probability \(0.40\). Its mean remains \(5(0.60)=3.00\), while its variance is

$$ \operatorname{Var}(N_A\mid H) =0.60(5-3)^2+0.40(0-3)^2 =0.60(4)+0.40(9) =6.00. $$

The variance is five times the independent-assignment variance. Under the reused-draw rule, every participant’s assignment is perfectly linked to the same draw; the cohort goes entirely to one arm. Matching individual probabilities therefore does not make two batch mechanisms equivalent.

Implementation Checks, Alternatives, and Limitations

Useful checks focus on both the individual probabilities and the cohort-level behavior. Confirm that the \(q_k\) values are nonnegative and sum to one, that every participant in the homogeneous batch uses the same intended state, and that the implementation makes a fresh randomization draw for each participant if independent batch assignment is intended. Across many simulated batches, the average count for arm \(k\) should be close to \(mq_k\), and the empirical count variance should be close to \(mq_k(1-q_k)\). A single batch can differ substantially from these averages without indicating an error.

Large departures across repeated simulations may indicate a coding problem: for example, using one posterior draw for all participants, accidentally updating the posterior with outcomes before the batch is complete, or using probabilities that do not sum to one. A further check is to compare simulated count frequencies with the multinomial probabilities for selected count vectors. Simulation error means the frequencies need not match exactly, particularly with few replicates.

Independent batch assignment differs from sequential updating, in which outcomes that become available can change the state used for later assignments. It also differs from fixed-ratio randomization, where target allocation proportions are enforced or controlled rather than arising as independent draws with probabilities \(q_k\). A reused posterior draw is another alternative, but it creates strong within-batch dependence. Which rule is appropriate depends on operational timing and the desired allocation behavior; the individual best-arm probabilities alone do not specify that dependence.

The method’s main limitation is that no response observed within the batch can influence assignments later in that same batch. This may be necessary when participants must be allocated together, but it forgoes within-batch adaptation. Also, \(q_k\) is a posterior probability that arm \(k\) is best under the specified model and criterion, not the probability that a participant assigned to \(k\) will respond. Expected arm counts describe randomization, not treatment effects or guaranteed enrollment totals. If allocation floors, covariate-dependent probabilities, or other constraints modify the rule, the simple common-probability multinomial calculations may no longer apply as written.

Common mistake: “Arm A has assignment probability 0.70, so exactly 70% of this batch will receive A.” This confuses an assignment probability with a fixed quota. Under independent batch randomization, \(0.70\) determines the expected fraction across repeated batches; the realized count varies according to the binomial or multinomial distribution. A quota requires an additional constrained allocation rule.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. A four-arm batch has \(m=20\) and probabilities \((0.40,0.30,0.20,0.10)\). What is the expected count for arm 3?
  2. For \(m=12\) and \(q_1=0.25\), what are the variance and standard deviation of \(N_1\) under independent assignment?
  3. Why can the realized arm 1 fraction differ from \(q_1\), even if the posterior state is held fixed?
  4. What changes if one posterior draw is reused for every participant in a batch?

Solutions. (1) \(E(N_3\mid H)=20(0.20)=4\) participants. (2) The variance is \(12(0.25)(0.75)=2.25\) participants squared, and the standard deviation is \(\sqrt{2.25}=1.50\) participants. (3) Independent random assignments fluctuate around their expected counts; a fixed state fixes the probabilities, not each realized outcome. (4) Assignments become dependent through the shared draw. Individual marginal probabilities may remain \(q_k\), but cohort counts generally have a different distribution and can be much more variable than multinomial counts.

Clinical Biostats