---
title: 'SHARPy: SMC–NUTS for GW Inference'
url: https://www.emergentmind.com/topics/sharpy
type: topic
---

# SHARPy: SMC–NUTS for GW Inference

SHARPy most directly denotes the **Sequential Hamiltonian Riemann Monte Carlo Python sampler**, a Bayesian inference framework for gravitational-wave parameter estimation and model comparison that combines **Sequential Monte Carlo (SMC)** with the **No-U-Turn Sampler (NUTS)**, exploits local posterior geometry, and is built on **JAX** for GPU acceleration [2601.02336]. In adjacent literatures, closely related spellings such as **ShaRPy** and **SHARP** denote unrelated systems, including RGB-D hand tracking with uncertainty and several other domain-specific methods and instruments [2303.10042]. This suggests that the term is best interpreted contextually, with the exact capitalization in recent gravitational-wave inference referring to the 2026 SMC–NUTS framework.

## 1. Nomenclature and scope

The exact label **SHARPy** is introduced in gravitational-wave inference as the **Sequential Hamiltonian Riemann Monte Carlo Python sampler** [2601.02336]. A visually similar spelling, **ShaRPy**, stands for **Shape Reconstruction and Hand Pose Estimation from RGB-D with Uncertainty** in markerless clinical hand tracking [2303.10042]. The broader **SHARP** acronym also appears in large language model compression, continual learning, video token pruning, robotics, astronomical instrumentation, and solar data products [2502.07832] [2305.18563] [2512.05385] [2509.19486] [2509.07057] [1404.1879].

| Name | Expansion | Domain |
|---|---|---|
| SHARPy | Sequential Hamiltonian Riemann Monte Carlo Python sampler | Gravitational-wave inference [2601.02336] |
| ShaRPy | Shape Reconstruction and Hand Pose Estimation from RGB-D with Uncertainty | RGB-D hand pose and shape estimation [2303.10042] |
| SHARP | SHaring Adjacent layers with Recovery Parameters | LLM inference acceleration [2502.07832] |
| SHARP | Sparsity and Hidden Activation RePlay | Continual learning [2305.18563] |
| ShaRP | SHAllow-LayeR Pruning | Video large language model acceleration [2512.05385] |
| SHARP | Supercomputing for High-speed Avoidance and Reactive Planning | Robotics and HPC offloading [2509.19486] |

Because the exact topic name is **SHARPy**, the gravitational-wave framework is the primary referent. The similarity of the spellings nevertheless creates a recurring source of confusion. A common misconception is that these names identify versions of a single software family; the cited papers instead describe independent systems with unrelated objectives, data modalities, and algorithmic foundations.

## 2. Bayesian problem formulation in gravitational-wave inference

SHARPy is motivated by the computational burden of **gravitational-wave (GW) parameter estimation and model comparison**. The target posterior is written as

$$
p(\boldsymbol{\theta}|d, H) = \frac{\mathcal{L}(d|\boldsymbol{\theta}, H)\,\pi(\boldsymbol{\theta}| H)}{p(d| H)},
$$

with Bayesian evidence

$$
\mathcal{Z} = p(d|H) = \int d\boldsymbol{\theta}\,\mathcal{L}(d|\boldsymbol{\theta},H)\,\pi(\boldsymbol{\theta}|H).
$$

For GW data under the assumption of stationary Gaussian noise, the log-likelihood is

$$
\log\mathcal{L}(d|\boldsymbol{\theta}) = -\frac{1}{2}\left\langle d-h(\boldsymbol{\theta}) \middle| d-h(\boldsymbol{\theta})\right\rangle,
$$

where

$$
\left\langle a|b\right\rangle = 4\mathrm{Re}\int_0^\infty \frac{a^*(f)b(f)}{S_n(f)}\,df.
$$

In this formulation, the evidence is not merely a normalization constant. It is described as central for **model comparison**, because it quantifies how well a model explains the data after integrating over all parameter values [2601.02336].

The paper situates SHARPy against the practical limitations of standard GW inference workflows. The posterior is described as high-dimensional, multimodal, and constrained by sharp boundaries, while waveform evaluations are costly. **Nested Sampling** is characterized as robust and widely used but often requiring hours or days. SHARPy is developed to preserve the statistical rigor of likelihood-based GW inference while reducing wall-clock time dramatically [2601.02336]. A plausible implication is that the framework is meant not only as a faster sampler, but also as an infrastructure for evidence-sensitive analyses in which posterior estimation alone is insufficient.

## 3. SMC–NUTS algorithmic structure

The core construction of SHARPy is an SMC population that evolves from prior to posterior through a temperature ladder. At iteration \(t\), the intermediate distribution is

$$
p_t(\boldsymbol{\theta}|d) = \frac{\mathcal{L}(d|\boldsymbol{\theta})^{\beta_t}\pi(\boldsymbol{\theta})}{\mathcal{Z}_t},
$$

with \(\beta_0=0\) at the prior and \(\beta_T=1\) at the posterior [2601.02336].

Each SMC iteration comprises three standard stages. In **reweighting**, particles receive weights based on the change in inverse temperature, and the framework monitors the effective sample size

$$
\mathrm{ESS}_t = \frac{\left(\sum_{i=1}^N w_t^{(i)}\right)^2}{\sum_{i=1}^N \left(w_t^{(i)}\right)^2}.
$$

In **adaptive temperature selection**, \(\beta_t\) is chosen so that the ESS remains at a controlled fraction of the particle count through

$$
\mathrm{ESS}(\beta_t) - \alpha N_P = 0.
$$

In **resampling and mutation**, low-weight particles are replaced and then moved with a Markov transition kernel [2601.02336].

The distinctive design choice is the mutation kernel. Rather than using a generic MCMC step, SHARPy uses **NUTS**, described as an adaptive version of Hamiltonian Monte Carlo. HMC augments the parameters \(\boldsymbol{\theta}\) with auxiliary momentum variables \(\mathbf{r}\), draws momenta from a Gaussian defined by a mass matrix \(M\), and evolves the system under the Hamiltonian

$$
\mathcal{H}(\boldsymbol{\theta},\mathbf{r}) = U(\boldsymbol{\theta}) + K(\mathbf{r}) = -\log p(\boldsymbol{\theta}|d) + \frac{1}{2}\mathbf{r}^T M^{-1}\mathbf{r}.
$$

NUTS removes the need to hand-tune trajectory length by terminating when the trajectory starts to “turn back” on itself. In the GW setting, this is important because posterior geometry is described as complex and traditional random-walk proposals are inefficient [2601.02336].

Methodologically, SHARPy therefore couples two distinct strengths: SMC contributes particle parallelism and evidence estimation, while NUTS contributes efficient exploration of high-dimensional posteriors. This suggests that the framework is designed to avoid the usual trade-off between evidence-aware population methods and gradient-based local exploration.

## 4. Local geometry, boundary treatment, and software stack

A major feature of SHARPy is its use of local posterior geometry. The paper emphasizes that fixed-metric HMC or NUTS methods can miss local structure when correlations and curvatures vary strongly across parameter space. SHARPy therefore adopts a **hybrid geometric strategy**: at the beginning of each SMC iteration, and for each particle, the mass matrix \(M\) is set to the **Hessian of the posterior**,

$$
H_{ij} := \frac{\partial^2 p(\boldsymbol{\theta}|d)}{\partial \theta_i \partial \theta_j},
$$

so that local curvature informs the momentum distribution; during the actual NUTS mutation step, \(M\) is kept fixed, preserving separability of the Hamiltonian equations and allowing standard leapfrog integration [2601.02336].

The paper characterizes this as borrowing from **Riemannian ideas** without incurring the full complexity of a fully position-dependent Hamiltonian integrator. In practical terms, the aim is to navigate narrow ridges, curved degeneracies, and anisotropic structure more effectively. This is especially relevant for GW inference, where posterior structure is often shaped by strong parameter correlations and physically imposed bounds [2601.02336].

Boundary handling is treated explicitly. SHARPy enforces **reflective boundaries** for bounded variables and **periodic boundaries** for angular variables. The stated motivation is that parameters such as mass ratio are bounded and angles are periodic, so the sampler must respect physical constraints while continuing to move efficiently through parameter space [2601.02336].

The implementation stack is also part of the method’s design. SHARPy is built entirely in **JAX**, uses **BLACKJAX** for NUTS, and obtains waveforms through **ripple**. JAX is used for **automatic differentiation** and **device-agnostic compilation and vectorization**, allowing the framework to run efficiently on **GPUs** and exploit the parallelism inherent in SMC [2601.02336]. A plausible implication is that the method’s performance is inseparable from this software architecture: the combination of autodiff, JIT compilation, GPU execution, and particle parallelism is presented as the route by which a traditionally sequential workload becomes highly parallel.

## 5. Evidence estimation, sample recycling, and reported performance

Because SMC reweights particles across intermediate temperatures, SHARPy obtains an evidence estimate through the ratio of normalizing constants,

$$
\frac{\mathcal{Z}_t}{\mathcal{Z}_{t-1}} = \frac{1}{N}\sum_{i=1}^{N} w_t^{(i)}.
$$

Since \(\mathcal{Z}_0=1\) for a normalized prior, the full evidence is the product of these ratios across all SMC steps [2601.02336]. This is central to the framework’s model-comparison role.

The paper further states that SHARPy **recycles samples** from all intermediate temperatures rather than discarding everything except the final iteration. It constructs the pooled distribution

$$
\tilde{p}(\boldsymbol{\theta}|d) = \frac{1}{T}\sum_{t=1}^{T} p_t(\boldsymbol{\theta}|d),
$$

and then uses rejection sampling to extract i.i.d. posterior samples. The intended effect is to reduce waste and improve effective sample output [2601.02336].

Empirical results are reported for both simulated and real GW data. For **100 simulated binary black-hole signals injected into Gaussian noise**, SHARPy passed a **probability–probability (P–P) test**, indicating statistical unbiasedness. On a single **NVIDIA A100 GPU**, it produced on average around **27,000 posterior samples in slightly more than 15 minutes** [2601.02336].

For **GW150914**, using an **11-dimensional aligned-spin waveform model**, SHARPy was run **100 times** and produced around **30,000 samples in about 10 minutes**, requiring about **55 SMC iterations** to evolve from \(\beta=0\) to \(\beta=1\) [2601.02336]. Posterior samples were compared with **Dynesty** via **Bilby**, and the corner plots showed close agreement in intrinsic and extrinsic parameters. The paper reports that the **Jensen–Shannon divergence** between marginal posteriors was for most parameters below or near the threshold for consistency, while declination, luminosity distance, and inclination showed somewhat larger divergence, attributed mainly to sharp posterior structure and boundary effects that make density estimation harder [2601.02336].

Evidence estimation is also benchmarked against Nested Sampling. Across **100 independent runs**, SHARPy’s evidence distribution was consistent with Dynesty at the **90% level**. The Dynesty value tended to lie in the upper tail, which the authors interpret as suggesting that SHARPy may slightly underestimate evidence relative to Nested Sampling, a behavior also noted in related SMC work [2601.02336]. The broader claim of the paper is therefore not identity with Nested Sampling output, but consistency in posterior and evidence while reducing runtime from hours to minutes.

## 6. Other systems named ShaRPy or SHARP

Outside gravitational-wave inference, the closest spelling is **ShaRPy**, a markerless hand tracking system designed for the diagnosis or monitoring of activity in inflammatory musculoskeletal diseases. That system combines a data-driven dense correspondence predictor with traditional energy minimization, estimates both hand pose and personalized hand shape from a single consumer-level RGB-D camera, incorporates biomedical constraints into a parametric hand model, and provides segment-level uncertainty estimates when fingers are hidden or inconsistent with the observations [2303.10042]. The overlap with gravitational-wave SHARPy is nominal rather than methodological.

The acronym **SHARP** is also used for several unrelated constructs. In large language model deployment, it denotes **SHaring Adjacent layers with Recovery Parameters**, a post-training method that shares adjacent MLP layers and adds low-rank recovery parameters to reduce memory movement and inference time on mobile devices [2502.07832]. In continual learning, it denotes **Sparsity and Hidden Activation RePlay**, a replay-based class-incremental learning method that combines sparse dynamic connectivity, rank-based freezing, and hidden activation replay [2305.18563]. In video large language models, **ShaRP** denotes **SHAllow-LayeR Pruning**, a training-free shallow-layer token-pruning framework that combines segment-aware causal masking, positional debiasing, and token deduplication [2512.05385].

Further uses continue this dispersion. In robotics, **SHARP** denotes **Supercomputing for High-speed Avoidance and Reactive Planning**, an HPC-offloading architecture for millisecond-scale reactive planning with a 7-DOF manipulator [2509.19486]. In astronomical instrumentation, **SHARP** is a near-infrared multi-mode spectrograph for the ELT and MORFEO MCAO system, comprising the **NEXUS** MOS and **VESPER** multi-IFU units [2509.07057]. In solar physics, **SHARPs** denotes **Space-weather HMI Active Region Patches**, an HMI vector-magnetic-field data product for active-region tracking and forecasting applications [1404.1879].

Taken together, these uses show that **SHARPy** is not a uniquely identifying acronym across arXiv. In exact contemporary usage, however, the capitalization **SHARPy** refers specifically to the gravitational-wave SMC–NUTS framework [2601.02336], whereas the clinically oriented hand-tracking system is spelled **ShaRPy** [2303.10042]. This distinction matters in bibliographic searches, software discovery, and cross-domain citation practice.

Source: https://www.emergentmind.com/topics/sharpy