---
title: Zig-Zag Process (ZZP) Overview
url: https://www.emergentmind.com/topics/zig-zag-process-zzp
type: topic
---

# Zig-Zag Process (ZZP) Overview

The Zig-Zag Process (ZZP) is a nonreversible piecewise deterministic Markov process (PDMP) used as a continuous-time Monte Carlo sampler on an extended position–velocity state space. In its standard form, the position moves linearly between random event times, while one velocity coordinate flips sign at each event; the switching rates are chosen so that the position marginal has a prescribed target density \(\pi(x)\propto e^{-U(x)}\). This construction yields an exact PDMP sampler with invariant law \(\pi\) in position and a uniform law on velocities, and it has been studied from the viewpoints of ergodicity, limit theorems, large deviations, scalable Bayesian computation, heavy-tailed targets, numerical implementation, and hybrid discrete–continuous state spaces [1607.03188], [1607.08845], [2106.11357], [1912.06635].

## 1. Canonical construction and dynamics

In the multidimensional formulation, the state space is
\[
E=\mathbb{R}^d\times\{-1,+1\}^d,
\]
with state \((\xi,\theta)\), where \(\xi\in\mathbb R^d\) is position and \(\theta\in\{-1,+1\}^d\) is a velocity/sign vector. Between switching events, the dynamics are deterministic:
\[
\frac{d}{dt}\Xi(t)=\Theta(t),
\]
while \(\Theta(t)\) remains constant; at an event of type \(i\), only the \(i\)-th component of \(\Theta\) flips [1607.03188]. The process is therefore a continuous-time Markov process with deterministic linear flow and stochastic sign flips in individual velocity coordinates.

The target distribution is written
\[
\pi(\xi)=\frac{1}{Z}\exp(-\Psi(\xi)),
\qquad
Z=\int_{\mathbb{R}^d}e^{-\Psi(\xi)}\,d\xi,
\]
and the structural condition guaranteeing stationarity is
\[
\lambda_i(\xi,\theta)-\lambda_i(\xi,F_i[\theta])=\theta_i\,\partial_i\Psi(\xi).
\]
Equivalently, the admissible switching rates are
\[
\lambda_i(\xi,\theta)=\bigl(\theta_i\partial_i\Psi(\xi)\bigr)^+ + \gamma_i(\xi,\theta),
\]
with \(\gamma_i(\xi,\theta)=\gamma_i(\xi,F_i[\theta])\). The canonical Zig-Zag process corresponds to \(\gamma_i\equiv0\) [1607.03188].

The generator takes the PDMP form
\[
\mathcal{L}f(\xi,\theta)
=
\sum_{i=1}^d \theta_i \partial_i f(\xi,\theta)
+
\sum_{i=1}^d \lambda_i(\xi,\theta)\bigl(f(\xi,F_i[\theta])-f(\xi,\theta)\bigr),
\]
combining deterministic transport with coordinate-wise jump terms [1607.03188].

In one dimension, the state space reduces to
\[
E=\mathbb{R}\times\{-1,+1\},
\]
with state \(z=(x,\theta)\). The target density is
\[
\pi(dx)=\frac{1}{Z}e^{-U(x)}\,dx,
\]
and the switching intensity is
\[
\lambda(x,\theta)=[\theta U'(x)]^+ + \gamma(x).
\]
Between switching times,
\[
X_t=x+t\theta,\qquad \Theta_t=\theta,
\]
and at a switch the direction flips, \(\Theta_{T_1}=-\theta\). In this form, ZZP is a piecewise linear motion with random velocity flips; the term \([\theta U'(x)]^+\) produces systematic bounces against the gradient, while \(\gamma(x)\) adds refreshments [2106.11357].

## 2. Invariant distribution and event-time simulation

Under the rate identity above, the extended invariant law is
\[
\mu(d\xi,d\theta)\propto e^{-\Psi(\xi)}\,d\xi,
\]
with \(\theta\) uniform on \(\{-1,+1\}^d\); in one dimension,
\[
\mu=\pi\otimes \frac12\delta_{\{-1,+1\}}.
\]
Thus the position marginal is exactly the target \(\pi\), which is the basic reason ZZP is useful for Monte Carlo simulation [1607.03188], [2106.11357].

A major practical feature of the classical construction is that ZZP can be simulated without discretisation error when one can sample its event times exactly. If
\[
m_i(t):=\lambda_i(\xi+\theta t,\theta),
\]
and one has tractable dominating rates \(M_i(t)\ge m_i(t)\), then Poisson thinning can be used: candidate event times are generated from the easier inhomogeneous Poisson processes with rates \(M_i\), and accepted with probability \(m_i(t)/M_i(t)\). Two classes of bounds highlighted in the literature are globally bounded gradients, for which \(M_i(t)\equiv c_i\), and dominated-Hessian settings, for which affine bounds \(M_i(t)=(a_i+b_it)^+\) are available [1607.03188].

For more general models, NuZZ replaces analytic inversion or thinning envelopes by numerical solution of the Sellke event equation
\[
\int_0^\tau \Lambda(\mathbf{x}(s),\mathbf{v})\,ds = R,
\qquad
R\sim \mathrm{Exp}(1),
\]
where \(\Lambda=\sum_i \lambda_i\). The implementation uses adaptive Gauss–Kronrod quadrature and Brent’s method, and then chooses the flipped coordinate with probability
\[
\frac{\lambda_i(\mathbf x(\tau),\mathbf v)}{\Lambda(\mathbf x(\tau),\mathbf v)}.
\]
In this formulation, one event-time integral replaces \(d\) separate coordinate-wise integrals [2003.03636].

NuZZ is not exact at fixed numerical tolerance, but the perturbation is explicit. Under the assumptions stated in the numerical analysis, if
\[
\varepsilon_{\mathrm{Tot}}=\varepsilon_{\mathrm{int}}+\varepsilon_{\mathrm{Bre}},
\]
then the Kantorovich–Rubinstein distance between the exact invariant law \(\mu\) and the numerical occupation measure \(\widetilde\mu\) satisfies
\[
d_{KR}(\mu,\widetilde\mu)
\le
\mathcal O\!\left(
\Gamma^{-1/2}\max(\varepsilon_{\mathrm{Tot}},\sqrt{Md\,\varepsilon_{\mathrm{Tot}}})
\right),
\]
where \(\Gamma>0\) is a positive refreshment lower bound and \(M\) bounds Hessian entries of \(\log\pi\) [2003.03636].

## 3. Ergodicity, heavy tails, and speed modulation

A central theme in ZZP theory is the dependence of convergence on tail behavior. In one dimension, heavy-tailed targets invalidate geometric or exponential ergodicity for the original constant-speed process. One sharp obstruction is geometric: if ZZP starts at the origin, then by time \(t\) it cannot reach distance larger than \(\sqrt d\,t\), so for heavy-tailed targets the total variation distance cannot decay exponentially. The corresponding theorem states that if the original Zig-Zag targets a heavy-tailed distribution, then it is not exponentially ergodic [2103.16620].

The one-dimensional heavy-tail theory is particularly explicit. Suppose there exist \(\nu>0\) and a compact \(C\subset\mathbb R\) such that, outside \(C\),
\[
|U'(x)|\ge \frac{1+\nu}{|x|},
\]
and that the refreshment rate is asymptotically negligible relative to the deterministic bounce term,
\[
\lim_{|x|\to\infty}\frac{\gamma(x)}{|U'(x)|}=0.
\]
Then for every \(k<\nu\), there exist \(B,\delta>0\) and \(\beta\in(0,1)\) such that with
\[
V_{\beta,\delta}(x,\theta)=\exp\{\beta U(x)+\delta\,\operatorname{sgn}(x)\theta\},
\]
\[
\left\|
\mathbb P_{x,\theta}(Z_t\in\cdot)-\mu(\cdot)
\right\|_{TV}
\le
\frac{B\,V_{\beta,\delta}(x,\theta)}{t^{1+k}}+\frac{B}{t^k}.
\]
Hence the process is polynomially ergodic of order \(k\) [2106.11357]. The proof uses a subgeometric Foster–Lyapunov drift condition
\[
\mathcal LV \le K-cV^a,
\]
small-set theory, and a continuous-time subgeometric ergodicity theorem [2106.11357].

For Student targets,
\[
\pi(x)=\frac{1}{Z}\left(1+\frac{x^2}{\nu}\right)^{-(\nu+1)/2},
\qquad
U'(x)=\frac{(\nu+1)x}{\nu+x^2},
\]
the result is nearly sharp. For every \(k<\nu\), ZZP is polynomially ergodic of order \(k\), while for every \(k>\nu\) it is not polynomially ergodic of order \(k\). More precisely, for sufficiently large \(t\),
\[
\left\|
\mathbb P_{0,+1}(Z_t\in\cdot)-\mu(\cdot)
\right\|_{TV}
\ge
\frac{C'}{t^\nu}.
\]
Whether order exactly \(k=\nu\) holds remains open [2106.11357].

To overcome the bounded-speed obstruction on heavy tails, the Speed Up Zig-Zag (SUZZ) process replaces unit speed by a state-dependent positive function \(s(x)\), so that between events
\[
\frac{dX_t}{dt}=\theta\,s(X_t).
\]
To preserve the same target \(\pi(dx)\propto e^{-U(x)}dx\), the rates become
\[
\lambda_i(x,\theta)
=
[\theta_iA_i(x)]^+ + \gamma_i(x,\theta_{-i}),
\qquad
A_i(x)=s(x)\partial_iU(x)-\partial_i s(x).
\]
The effective potential is therefore \(U-\log s\) [2103.16620].

This modification changes the tail geometry substantially. Under the assumptions stated in the stability theory, SUZZ is non-explosive, has invariant law
\[
\mu(dx,d\theta)=\frac{1}{2^dH}e^{-U(x)}\,dx\,d\theta,
\]
and can be exponentially ergodic on heavy-tailed targets [2103.16620]. In one dimension, if the deterministic flow has finite explosion time in both directions, the process is even uniformly ergodic:
\[
\sup_{(x,\theta)\in E}
\bigl\|
\mathbb P_{x,\theta}(Z_t\in\cdot)-\mu(\cdot)
\bigr\|_{TV}
\le M\rho^t.
\]
A notable consequence is that explosive deterministic dynamics need not imply an unstable PDMP; the switching mechanism can interrupt the trajectory before explosion and yield a stable, faster-mixing algorithm [2103.16620].

## 4. Limit theorems and large deviations

For one-dimensional ZZP, ergodic averages admit a detailed fluctuation theory. In the general CLT framework, for centered observables \(g\) one defines
\[
\psi(x)
=
\frac{1}{2\pi(x)}
\int_x^\infty
\{g(\xi,+1)+g(\xi,-1)\}\pi(\xi)\,d\xi,
\]
and the asymptotic variance is
\[
\sigma_g^2
=
4\int_E \lambda(x,\theta)\psi^2(x)\,d\mu(x,\theta).
\]
If \(g=g(x)\) depends only on position, then
\[
\sigma_g^2
=
2\int_{\mathbb R}
\bigl(\lambda(x,+1)+\lambda(x,-1)\bigr)\psi^2(x)\pi(x)\,dx
=
2\int_{\mathbb R}
\bigl(|U'(x)|+2\gamma(x)\bigr)\psi^2(x)\pi(x)\,dx.
\]
This makes explicit that excess switching \(\gamma\) increases asymptotic variance [1607.08845].

In the canonical unimodal one-dimensional setting, the process admits an explicit regenerative decomposition, yielding a closed-form asymptotic variance formula:
\[
\sigma_g^2
=
\frac{
2\int_{\mathbb R}|U'(t)|e^{-U(t)}
\left(\int_0^t g(s)\,ds\right)^2dt
-
4\left(\int_0^\infty e^{-U(t)}g(t)\,dt\right)^2
}{
\int_{-\infty}^{\infty}e^{-U(t)}\,dt
}.
\]
The same analysis also gives functional central limit theorems under Foster–Lyapunov conditions in exponentially ergodic and suitable heavy-tailed regimes [1607.08845].

A second asymptotic regime appears when the excess switching becomes very large. If
\[
\lambda(x,\theta)=\max(0,\theta U'(x))+\gamma(x),
\qquad
\gamma^\varepsilon(x)=\varepsilon^{-1}\gamma(x),
\]
then, after time acceleration \(t\mapsto t/\varepsilon\),
\[
X^\varepsilon(t/\varepsilon)\Rightarrow \xi(t),
\]
where \(\xi\) solves
\[
d\xi(t)
=
-\frac12\left(
\frac{U'(\xi(t))}{\gamma(\xi(t))}
+
\frac{\gamma'(\xi(t))}{\gamma(\xi(t))^2}
\right)\,dt
+
\sqrt{\frac{1}{\gamma(\xi(t))}}\,dW(t).
\]
Thus large excess switching drives ZZP toward a diffusion limit [1607.08845].

Large deviations theory provides a complementary description of long-time behavior. For the empirical measure
\[
\eta_t(A)=\frac1t\int_0^t \mathbf 1_A(Y_s)\,ds,
\]
the one-dimensional zig-zag process satisfies an LDP with speed \(t\) and Donsker–Varadhan-type rate function
\[
\mathcal I(\mu)
=
-\inf_{u\in\mathcal D^+(L)}
\int_E \frac{Lu}{u}\,d\mu
\]
on the torus, and an analogous formula on \(\mathbb R\times\{\pm1\}\) under additional Lyapunov and regularity conditions [1912.06635].

In the compact setting, the Donsker–Varadhan functional can be written explicitly. This explicit form shows that the rate function is strictly decreasing in a constant refreshment parameter \(\gamma\); from an empirical-measure large deviations perspective, smaller \(\gamma\) is therefore better, and the optimal choice is \(\gamma=0\) [1912.06635]. This does not contradict spectral-gap-based arguments favoring positive refreshment, because convergence to equilibrium and empirical-measure concentration are different criteria [1912.06635].

## 5. Bayesian inference, sub-sampling, and large-sample scaling

The Zig-Zag process is especially prominent in Bayesian big-data settings because posterior gradients decompose over observations. If
\[
\partial_i\Psi(\xi)=\frac1n\sum_{j=1}^n E_i^j(\xi),
\]
then one can construct an exact sub-sampling scheme: along a deterministic segment, propose candidate events from dominating bounds, choose a datapoint index \(J\sim\mathrm{Uniform}\{1,\dots,n\}\), and accept with probability based on \((\theta_iE_i^J)^+\). The resulting effective rates are
\[
\lambda_i(\xi,\theta)=\frac1n\sum_{j=1}^n \bigl(\theta_i E_i^j(\xi)\bigr)^+,
\]
and still satisfy the invariance identity
\[
\lambda_i(\xi,\theta)-\lambda_i(\xi,F_i[\theta])=\theta_i\partial_i\Psi(\xi).
\]
This is the exact approximate scheme: the algorithm uses approximation internally but retains the exact posterior as invariant law [1607.03188].

A key refinement is the control-variate estimator
\[
E_i^j(\xi)
=
\partial_i\Psi(\xi^\star)
+
\partial_i\Psi^j(\xi)
-
\partial_i\Psi^j(\xi^\star),
\]
where \(\xi^\star\) is a reference point near the posterior mode. With an \(O(n)\) preprocessing step to compute \(\partial_i\Psi(\xi^\star)\), the cost per essentially independent posterior sample can be \(O(1)\), provided the posterior contracts at \(n^{-1/2}\) scale and the reference point is sufficiently accurate [1607.03188].

Large-sample analysis clarifies why naive sub-sampling and control variates behave so differently. In the transient phase, the trajectories are well approximated by a deterministic ODE,
\[
\frac{dX_t}{dt}=b(X_t),
\]
whose drift points in the direction of decreasing KL divergence between the assumed model and the true distribution [2411.14983]. For canonical ZZ, the denominator of the drift reduces to \(|\mathbb E[S_i(x;Y)]|\), so the process moves at the optimal coordinate speed \(\pm1\). For naive sub-sampling, the denominator involves
\[
\mathbb E\left|
\frac1m\sum_{j=1}^m S_i(x;Y_j)
\right|,
\]
which is larger and damps the motion, especially near the KL minimizer. Control variates reduce this damping when the reference point is close to the posterior center [2411.14983].

In the stationary phase, the distinction is sharper. With local parameter
\[
\xi=n^{1/2}(x-\hat x_n),
\]
naive sub-sampling ZZ-SS converges to a stationary Ornstein–Uhlenbeck diffusion,
\[
d\xi_t
=
-\frac{A\,I(x_0)}{2}\,\xi_t\,dt
+
A^{1/2}dB_t,
\]
where
\[
A_{ii}
=
\frac{2}{
\mathbb E\!\left[
\left|m^{-1}\sum_{j=1}^m S_i(x_0;Y_j)\right|
\right]
}
\]
[2411.14983]. By contrast, ZZ-CV with reference points satisfying
\[
\|X_n^\ast-\hat x_n\|=O(n^{-1/2})
\]
retains a Zig-Zag PDMP limit after the \(n^{-1/2}\)-time rescaling, and the same limiting PDMP also describes canonical ZZ in the large-batch regime [2411.14983].

The resulting complexity comparison is:
\[
\text{ZZ}: O(n),\qquad
\text{ZZ-SS}: O(n),\qquad
\text{ZZ-CV}: O(1).
\]
More precisely, canonical ZZ mixes in \(O(n^{-1/2})\) physical time but pays \(O(n)\) per proposed switch; ZZ-SS has \(O(1)\) per-switch cost but \(O(n)\) switching burden; ZZ-CV combines \(O(1)\) per-switch cost with \(O(n^{-1/2})\) mixing time under suitable control-variate assumptions [2411.14983]. This suggests that exact sub-sampling alone is not sufficient for large-\(n\) scalability; variance reduction is the essential ingredient.

## 6. Extensions, hybrid state spaces, and disambiguation

ZZP has also been extended beyond purely continuous Euclidean targets. In the hybrid construction for targets \(\pi(m,x)\), the discrete state \(m\in F\) is countable and the continuous state lies in a domain \(\Omega_m^o\subset\mathbb R^d\) depending on \(m\). The process evolves as \((m_t,x_t,v_t)\), where \(v_t\in\{-1,1\}^d\), follows ordinary Zig-Zag dynamics in the interior,
\[
\frac{d}{dt}x_t=v_t,
\]
and uses a boundary kernel \(Q\) to jump between domains when \((m_t,x_t)\) hits an interface. Under skew-detailed balance and flux compatibility conditions,
\[
\tilde\pi(m,x,v)=\pi(m,x)/2^d
\]
is stationary [2004.08807].

This hybrid formulation does not require any structural assumptions on the discrete component. It was developed for coalescent-based phylogenetic models in which the latent state combines a tree topology with branch lengths and mutation parameters. In that setting, the continuous-time zig-zag process avoids the boundary-crossing complications that arise in Hamiltonian Monte Carlo on hybrid tree spaces, and the paper reports efficiency gains of up to several orders of magnitude over classical Metropolis–Hastings algorithms in some examples [2004.08807].

A common source of confusion is nomenclature. “Zigzag” also appears in topological data analysis and combinatorial expansion, but these are different objects. “Using Zigzag Persistent Homology to Detect Hopf Bifurcations in Dynamical Systems” studies zigzag persistent homology and states explicitly that it is “not anything related to the stochastic Zig-Zag MCMC process” [2009.08972]. Likewise, work on the zig-zag product in hypergraph expansion concerns graph-theoretic and spectral constructions rather than PDMP Monte Carlo [2001.08829]. This suggests that “Zig-Zag Process” should be reserved for the stochastic position–velocity sampler, while “zigzag persistence” and “zig-zag product” belong to distinct mathematical literatures.

Overall, ZZP occupies a distinctive position within nonreversible Monte Carlo. Its defining mechanism is persistent ballistic motion punctuated by state-dependent sign flips; its invariant law is controlled by a simple antisymmetry relation on switching intensities; and its theory now spans exact simulation, sub-sampling, CLTs, empirical-measure large deviations, heavy-tail polynomial ergodicity, state-dependent speedups, numerical perturbation bounds, and hybrid discrete–continuous extensions [1607.03188], [1607.08845], [1912.06635], [2106.11357], [2103.16620], [2003.03636], [2411.14983], [2004.08807].

Source: https://www.emergentmind.com/topics/zig-zag-process-zzp