Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

The No-U-Turn Sampler: Adaptively Setting Path Lengths in Hamiltonian Monte Carlo

NUTS removes the need to hand-tune path length in Hamiltonian Monte Carlo

  • Problem HMC works well, but its step count L must be set by hand. A poor choice either wastes computation or lets the chain random-walk.
  • Method NUTS doubles a trajectory in a random direction and stops at a U-turn.
  • Results On two of four targets, NUTS with δ = 0.6 reached about three times HMC's best ESS, with no tuning runs.

Why HMC needs hand-tuning

HMC scales better than random-walk Metropolis, at roughly O(D5/4) cost per independent sample against O(D2) for random walks. That advantage comes with a price, because two user-set parameters, the step size ϵ and the number of steps L, control its performance. If L is too small, successive samples sit close together and the chain random-walks, while if L is too large, trajectories loop back and waste work.

Choosing L is the harder of the two, because there is no simple measure of when a trajectory is too short or too long.

Practitioners usually fix L after one or more preliminary runs, which is costly and needs expertise. That hurdle keeps HMC out of general-purpose engines such as BUGS, which is the gap the authors target.

The key idea: stop when the path turns back

NUTS replaces the fixed L with a stopping rule: it keeps extending the trajectory until one end starts to fold back toward the other. The test is the dot product between the current momentum and the displacement from the starting point, which tracks whether the path is still moving away. Stopping at the first sign of a turn would not guarantee time reversibility, so the authors adopt a recursive scheme instead.

The scheme grows the trajectory by 2^j leapfrog steps at height j, in a direction chosen at random. Doubling halts when the end states of a balanced subtree point back against each other, which is the U-turn test.

How one NUTS iteration runs

Each iteration resamples the momentum from a standard normal and draws a slice variable below the current joint density. The slice variable confines the candidate states to those at least as probable as the slice height, and it simplifies the derivation.

Each leapfrog step updates the momentum by a half step, moves the position by a full step, and then applies another half step to the momentum. The update is volume-preserving, which keeps the Metropolis acceptance step valid.

States enter the candidate set C only when they lie inside the slice, and the tree-building keeps the candidates consistent with detailed balance. A separate rule halts doubling when the energy error becomes very large, with Δmax recommended at 1000.

The next state is drawn uniformly from C, the union of the valid candidate sets. The efficient variant drops the stored tree and breaks out of the recursion as soon as the stop indicator is zero, which saves memory and computation.

Adapting the step size

During burn-in the step size is adjusted by dual averaging, so no separate tuning run is needed. The method averages a statistic H_t and shrinks the iterates toward a target μ, so early extreme values of ϵ are damped. The defaults are γ = 0.05, t0 = 10 and κ = 0.75 in every experiment.

For HMC the statistic is the Metropolis acceptance probability, which is driven toward a target δ. The starting ϵ comes from a heuristic that doubles or halves the value until the acceptance probability crosses 0.5.

Does NUTS match a tuned HMC?

The authors ran HMC at ten logarithmically spaced simulation lengths and NUTS on four targets for 2000 iterations. The first 1000 iterations were used to adapt ϵ, and efficiency is measured as ESS divided by gradient evaluations.

On the two logistic regression targets NUTS produces effectively independent samples about as efficiently as HMC. On the multivariate normal and stochastic volatility targets NUTS with δ = 0.6 reached about three times HMC's best ESS. That gap matters because HMC's best simulation length varied by about a factor of 100 across the targets, with 17.62 the longest and 0.17 the shortest.

So a well-tuned HMC needs a length chosen separately for each target, which NUTS does not. NUTS performed similarly for δ between 0.45 and 0.65, so the authors treat 0.6 as a default. The authors add that NUTS matches HMC even when the cost of tuning HMC is not counted.

Comparison with random-walk Metropolis and Gibbs

NUTS ran with δ = 0.5 for 2,000 iterations, with the first 1,000 used as burn-in and adaptation, costing about 1,000,000 gradient and likelihood evaluations. Random-walk Metropolis ran for 1,000,000 iterations with its proposal tuned to an acceptance rate of 0.234.

Random-walk Metropolis barely explored the space, and Gibbs sampling covered more of it but left parts unexplored. NUTS produced many effectively independent samples from the same target. The authors note that rotating the space would help the other two, but finding a rotation gets expensive as the dimension grows.

Trajectory lengths and adaptation behaviour

Most NUTS trajectory lengths are integer powers of two, so the U-turn test is usually met after a full doubling. This means the sampler seldom has to discard half a trajectory to keep the chain balanced.

The averaged step size converged within a few hundred iterations, except for the stochastic volatility model. The authors attribute its weaker adaptation to its longer burn-in period.

Limitations

The authors compared NUTS only with basic HMC, not with its extensions. NUTS works only on unconstrained continuous variables, so discrete variables must be summed out or handled by Gibbs sampling.

The default settings were chosen by hand on the stochastic volatility model, and the authors say they may not transfer to other sampling algorithms. The mass-matrix extension is discussed as a possible improvement but was not tested here.

Paper info

Authors
Matthew D. Hoffman, Andrew Gelman
Venue
arXiv · Preprint
First published
2011-11-18
Added
2026-11-12
Updated
2011-11-18
Version
v1
arXiv
1111.4246
Category
stat.CO · cs.LG
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Matthew D. Hoffman, Andrew Gelman (2011). The No-U-Turn Sampler: Adaptively Setting Path Lengths in Hamiltonian Monte Carlo. arXiv:1111.4246v1. https://arxiv.org/abs/1111.4246v1

BibTeX
@misc{hoffman2011turn,
  title = {{The No-U-Turn Sampler: Adaptively Setting Path Lengths in Hamiltonian Monte Carlo}},
  author = {Matthew D. Hoffman and Andrew Gelman},
  year = {2011},
  eprint = {1111.4246},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1111.4246v1}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up