Skip to content
MLiS Hub
On this page

Rare Trajectory Sampling with Reinforcement Learning

The Problem

The State Space

The walker lives on a two-dimensional grid indexed by position xx and time tt,

s=(x,t),x∈{−T,−T+1,...,T−1,T},t∈{0,1,...,T}, s = (x, t), \qquad x \in \{-T, -T+1, \ldots, T-1, T\}, \quad t \in \{0, 1, \ldots, T\},(1)

giving a grid of size (2T+1)×(T+1)(2T+1) \times (T+1). The walker always starts at the origin,

s0=(0,0), s_0 = (0, 0),

and time advances by one at each step, so tt simply counts how many moves have been taken. The walk ends at t=Tt = T.

Allowed Moves

At each timestep the walker takes exactly one step, either up or down by one unit,

a∈{−1,+1}. a \in \{-1, +1\}.

The position updates as xt+1=xt+atx_{t+1} = x_t + a_t, and the unbiased baseline is a uniform random walk where each action is chosen with equal probability.

Note that for the walk to return to the origin in exactly TT steps, the number of up-steps and down-steps must be equal, which requires TT to be even. This constraint is implicit in the problem structure.

What Is an Excursion?

A random walk excursion is a trajectory that starts at the origin and is conditioned to return there at the final time t=Tt = T. Under the unbiased random walk, the probability of any particular excursion of length TT is (1/2)T(1/2)^T, and the probability of returning to the origin at all decays as TT grows. For our toy example, we want to study the ensembles of trajectories which do come back to the origin and have x>0x>0 between 0<t<T0<t<T. These conditions dramatically lower the number of eligible trajectories, and the chances of sampling one at random become quite rare, especially for higher values of TT.

Figure 1: Excursion diagram showing random walk behavior

The Connection to Rare Event Sampling

This setup is chosen because it is a solid representation for a broad class of rare event problems in physics, all sharing the same structure: a stochastic system conditioned on an outcome that is vanishingly unlikely under the natural dynamics. The grid walk is tractable enough that we can compute exact solutions (see Exact solution) and use them to rigorously benchmark the RL methods we develop. With the problem defined, the next question is: what does the walker get rewarded for?


← Back to the main article: The case of the Random Walker