- Home
- Library
- Computational Quantum Field Theory
- From Generated Events to an Inferred Coupling
- Adaptive Channels and Event Unweighting
Adaptive Channels and Event Unweighting
A narrow resonance can make most uniformly generated events contribute almost nothing. Sampling near several resonances solves part of that problem, but introduces two decisions: how often to use each channel, and how to account for the overlap between them. Turning those weighted events into unit-weight events poses a further problem: a good average variance does not guarantee a good rejection bound.
We generate an actual two-channel resonance sample, adapt its channel probabilities on an independent pilot, and compare integration errors at equal target-evaluation budgets. We then test valid rejection sampling and a deliberately underestimated envelope. The latter gives a visibly biased unit-weight sample; a prescribed compensation restores the integral by retaining nonunit event weights.
Preparation: Phase-space maps and importance sampling. The example is a positive, incoherent scalar decay model. It does not replace a coherent amplitude calculation or a signed higher-order event sample.
A resonance target with an exact integral
Use the massless three-body invariant on , with all four angular coordinates sampled isotropically. Define two normalized truncated Cauchy densities,
The fixed parameters are
In resonance notation, and . No narrow-width approximation is made. Choose the dimensionless squared amplitude . The phase-space factor gives the one-dimensional target
For distinguishable daughters its absolute decay width is . The normalized invariant-mass distribution is .
We add the two positive channel contributions incoherently. The selected sampling channel is an auxiliary random label; it is not an observed resonance history.
The integral and every histogram-bin reference follow from the elementary primitive
Consequently
A separately evaluated split Gauss rule agrees to . The exact reference tests the algorithm; it is never used to select a favorable pilot iteration or random sample.
Draw a channel, divide by the full mixture
Let , . Draw a channel with probability , then draw uniformly and set
Differentiating gives . Thus the marginal density of the returned invariant is
Both channels cover the whole interval, so a point sampled from channel 1 can also lie under channel 2. The full mixture accounts for this overlap. This is the balance-mixture estimator used here. Kleiss and Pittau, Eqs. (1)–(2), printed pp. 1–2 (PDF).
One specific wrong estimator divides by the joint density and then forgets to partition the target between channels. Its expectation is
The retained control measures , consistent with that doubled expectation rather than with . This does not mean that every estimator using a single-channel denominator is biased. For example, is unbiased here because each normalized channel covers the full target; it simply has a different variance. The estimator and its sampling law must be specified together.
The inverse CDF also needs numerical endpoint care. The subtraction in can round an interior point to zero. Only if this happens within a roundoff-size guard, the code uses
or the corresponding expression for near the upper endpoint. These follow from the tangent-difference identity. Forced first-cell and last-cell tests retain strictly interior invariant masses; no physical mass cut is introduced.
Adapt variance on a pilot, then freeze
For a fixed proposal, the variance of the ordinary mean is
Differentiation defines useful channel sensitivities,
A sample from the current estimates these by
Use the Kleiss–Pittau update
It shifts probability toward channels whose undercoverage contributes more to the second moment. Finite pilot estimates fluctuate, so successive updates need not improve the true variance monotonically. Kleiss and Pittau, Eqs. (6)–(7) and accompanying qualifications, printed pp. 2–3 (PDF).
The frozen experiment starts at and performs exactly six rounds of 1,024 new pilot points. After each update it clips to and sets . It then freezes the result and uses an independent production stream. The pilot is not included as if it were an independent sample from the final proposal. Conditional on any resulting proposal, the independent production estimator remains unbiased; the pilot's randomness can still change its variance.
There are 16 independent experiments. Each method spends 65,536 target evaluations per experiment: the learned method uses 6,144 pilot and 59,392 production evaluations; the other methods use 65,536 production evaluations. Both channel densities are evaluated per target call, giving 131,072 individual density values. Independent reference quadrature and validation are additional checks, outside that common sampling budget. No universal wall-time speedup is inferred from this inexpensive one-dimensional example.
A useful fixed comparison is the coefficient-balanced proposal,
It captures both resonance peaks but leaves the smooth phase-space factor in the weight.
| Proposal | Mean of 16 estimates | Standard error of that mean from replicas | RMS exact standard error of one run |
|---|---|---|---|
| Uniform | |||
| Equal channels | |||
| Learned channels | |||
| Coefficient-balanced |
The last column comes from independently integrated second moments, with orders 64 and 128 compared on intervals split around the resonances. For learned proposals it averages the conditional variances over the 16 retained pilots. The standard errors estimated directly from production weights closely reproduce those scales. The finite replica scatter need not match them exactly: for coefficient-balanced sampling, the observed single-run replica standard deviation is , smaller than its theoretical .
The learned values of range from to . They favor the lower resonance, where is larger. Five of the sixteen learned estimates lie outside their own one-standard-error intervals about the reference. Such fluctuations are part of the output, not failed seeds to replace.
Unweighting requires a bound, not a small variance
Suppose a proven constant bounds everywhere. Accept a proposal with probability . Then
Accepted events are unit weight for shape sampling. The absolute normalization is recovered from , not from the normalized accepted histogram alone. Its exact variance is
For this model a global bound follows without scanning for a maximum:
The bound is conservative but proved. An empirical maximum from a pilot would not establish the same property. Each production proposal is also checked for a material violation of the stated bound.
Using 131,072 proposals for each condition gives:
| Proposal | Certified bound | Predicted acceptance | Observed acceptance |
|---|---|---|---|
| Equal channels | |||
| Replica-0 learned channels | |||
| Coefficient-balanced |
The learned proposal has the best integration variance in this comparison and the worst efficiency under these certified bounds. It assigns a small probability to the upper channel, increasing . The coefficient-balanced proposal minimizes this particular bound: if both ratios are at most , their sum implies , with equality at the coefficient-balanced choice. This need not be the same as minimizing the true maximum weight, much less the second moment.
The equal-channel acceptance is about binomial standard errors below its expectation; its normalization estimate is . All accepted events are converted to full three-body momenta using independent angular draws, and their mass shells and momentum conservation are checked.
What an underestimated envelope actually samples
Use equal channels and deliberately choose
This is a known false bound: the center itself proves an overshoot on a neighborhood. Replay the same equal-channel proposals and acceptance uniforms with
If every accepted event is mistakenly called unit weight, the unnormalized selected density is proportional to
High-weight regions are clipped. The exact clipped integral is , far below . The run estimates for that clipped integral. About of the proposals exceed the false bound, and the largest observed ratio is .
A predetermined compensation instead gives each accepted event the residual weight
Since , the per-proposal variable
has expectation . The retained events now have nonunit weights. This is the basic overweight correction used in partially unweighted sampling; it is distinct from the neural-network proposal and two-stage construction in the cited application. Danziger et al., §2, Eqs. (4)–(7) and Algorithm 1.
For the actual replay, compensation gives , about estimated standard errors below . Every rejected proposal contributes a zero when estimating this variance. Treating the retained weighted events as an independent sample of fixed size and forgetting the rejected proposals would use the wrong normalization experiment. The compensated and clipped estimates also share their proposals and acceptance uniforms: the uncertainty in their difference is , calculated from the paired differences, not by adding two independent variances.
The pilot trace is replica 0, whose proposal is then frozen. The invariant-mass histogram uses the same 131,072 equal-channel proposals for valid rejection, unsafe clipping, and compensation. Each bin estimates , with no normalization to unit area. Clipping changes the target; residual weights restore its expectation while retaining statistical fluctuations.
If an unexpected overweight occurs in a run intended to have unit weights, simply raising a running maximum does not repair earlier acceptances. Use a previously specified compensation law and retain its weights, or discard and restart the affected unit-weight production after establishing a valid bound. A larger empirical maximum alone is still not proof of a bound. The valid unit-weight runs here use the analytic envelope throughout.
Reproduce the comparison
The pure density and inverse maps are in resonance_channels.py. Run:
python3 examples/computational-qft/event-generation/adaptive_events.py
The pilot streams are SeedSequence([911025,1,replica,round]); independent production uses [911025,2,method_id,replica]. Rejection and angular reconstruction use [911025,3,method_id] and [911025,4,method_id]. The JSON output retains every pilot update, production estimate, conditional variance check, histogram, envelope, and overweight diagnostic. --refresh-kinematics only replays the already fixed accepted-event kinematics and asserts unchanged retained acceptance counts and bins; it does not regenerate or select integration estimates.
The measured efficiency belongs to this smooth positive target, these proposals, and these budgets. Signed weights, interference or detector acceptance would change the proposal and its uncertainty analysis.
Exercises
1. Variance adaptation and envelope optimization
For a positive target and normalized channels , derive the interior stationarity condition for under . Show its second variation is nonnegative. Then prove the bound above and find the that minimizes that bound for the present two coefficients.
Solution
Because ,
A Lagrange multiplier gives for every active channel at an interior optimum. Multiplying by and summing shows
so the common value is itself. For an allowed direction with zero sum,
Equality can occur if the channels are redundant along that direction. A clipped or boundary-constrained optimum instead obeys the corresponding inequality conditions; it need not equalize all .
If and , then , giving the claimed envelope. Adding those coefficient inequalities yields . Equality requires and .
The variance objective integrates over the target, whereas this envelope uses a worst coefficient ratio. Neither minimization condition implies the other. The retained learned proposal explicitly demonstrates the distinction.
2. Derive the compensated estimator and its variance
For any positive trial bound , set and . Derive the density sampled by wrongly unit-weighting accepted events, and prove that is unbiased. Give its second moment and explain why zeros from rejected proposals must be retained.
Solution
At fixed , acceptance is Bernoulli with probability . Consequently the falsely unit-weighted contribution has mean
Its conditional accepted density is divided by that clipped integral, rather than . For compensation, pointwise, hence
The conditional second moment is . Splitting the domain gives
Thus independent proposals give variance for their mean. Rejected proposals are genuine outcomes of this random variable. Removing them and dividing by the random accepted count estimates a different quantity. To form a normalized shape from accepted weights, use their ratio of weighted sums and propagate the numerator–denominator covariance.
For two estimators built from the same proposal and uniform acceptance draw, use the sample variance of their per-proposal difference. The covariance term is part of the experiment, not an optional correction. Finally, on overweight events: the compensated sample is partially weighted and cannot honestly be described as unit weight.
Summary
A multichannel event estimator divides by the actual marginal proposal and preserves its normalization. Independent pilot adaptation can substantially reduce integration variance at a counted cost. Unit-weight production additionally needs a valid envelope; a variance-optimized mixture can have a poorer conservative acceptance rate. Underestimated envelopes change the selected density unless a specified residual-weight correction is retained. Both systematic bias and ordinary statistical misses remain visible in the worked experiment.
References
- K. Danziger, T. Janßen, S. Schumann and F. Siegert, “Accelerating Monte Carlo event generation—rejection sampling using neural network event-weight estimates,” SciPost Physics 12, 164 (2022), arXiv:2109.11964v2, §2, Eqs. (4)–(7) and Algorithm 1. The present example uses the basic overweight correction, not the paper's neural-network acceleration. Article.
- R. Kleiss and R. Pittau, “Weight optimization in multichannel Monte Carlo,” Computer Physics Communications 83, 141–146 (1994), hep-ph/9405257v2, Eqs. (1), (2), (6), (7), printed pp. 1–3, PDF pp. 2–4. Paper (PDF).
Scrollable formula. Use Left and Right arrow keys to reveal hidden content.
Scrollable table. Use Left and Right arrow keys to reveal hidden columns.
Scrollable figure. Use Left and Right arrow keys to reveal hidden content.