---
title: 'MASLA: Subdifferential Langevin Algorithm'
url: https://www.emergentmind.com/topics/metropolis-adjusted-subdifferential-langevin-algorithm-masla
type: topic
---

# MASLA: Subdifferential Langevin Algorithm

Metropolis-Adjusted Subdifferential Langevin Algorithm (MASLA) denotes a class of Metropolis-adjusted Langevin samplers for targets of the form $\pi(x)\propto e^{-U(x)}$ in which the classical gradient drift is replaced by generalized derivative information. In its most general form, MASLA is designed for locally Lipschitz, generally non-differentiable, and possibly non-convex potentials, using conservative set-valued fields and Clarke subgradients to define a Langevin-type proposal and then correcting the Euler discretization by a Metropolis–Hastings step. In the convex setting, Moreau–Yosida MALA (MY-MALA) is a proximal realization of the same idea: the drift is built from the Moreau–Yosida envelope or equivalently from the proximal map, so MY-MALA can be read as a MASLA with proximal or subdifferential drift [2507.06950, 2301.02446].

## 1. Problem setting and conceptual scope

MASLA targets distributions on $\mathbb{R}^d$ with density
\[
\pi(x)\propto e^{-U(x)},
\]
where $U:\mathbb{R}^d\to[0,\infty)$ is the potential. The point of departure is standard MALA, which uses the overdamped Langevin diffusion
\[
dX_t = -\nabla U(X_t)\,dt + \sqrt{2}\,dB_t
\]
and an Euler–Maruyama proposal corrected by Metropolis–Hastings. That construction presupposes differentiability of $U$ at the points where the drift is evaluated, and much of the classical analysis further assumes at least $C^1$ regularity, often together with Lipschitz-gradient and growth conditions [2507.06950].

These assumptions exclude or complicate a range of models that are routine in contemporary Bayesian computation and machine learning. The examples explicitly highlighted include non-smooth penalties such as $\ell_1$ and total variation, piecewise-linear or piecewise-polynomial energies such as ReLU networks, hinge losses, and absolute values, and non-convex but locally Lipschitz energies. In such settings, $\nabla U(x)$ may fail to exist on sets of positive measure, while proximal samplers such as P-MALA and MYULA require a well-defined proximal operator and therefore do not cover general non-convex or some non-smooth potentials [2507.06950].

Within this landscape, the 2025 MASLA formulation generalizes MALA to locally Lipschitz targets through conservative set-valued fields, whereas the 2023 MY-MALA analysis addresses a convex subclass in which the subdifferential information is encoded by the Moreau–Yosida envelope and the proximal map. The latter therefore occupies a specific proximal-convex corner of the broader MASLA framework [2301.02446].

## 2. Conservative fields, Clarke subgradients, and subdifferential structure

The non-smooth differential structure used by MASLA begins with local Lipschitz continuity. By Rademacher’s theorem, a locally Lipschitz function is differentiable almost everywhere. For such a function $F$, the Clarke subgradient is defined by
\[
\partial^c F(x) = \left\{ y\in\mathbb{R}^d : \exists (x_n)\subset {}_F \text{ s.t. } (x_n,\nabla F(x_n))\to (x,y)\right\}.
\]
It is nonempty, convex, and compact for locally Lipschitz $F$, and reduces to the singleton $\{\nabla F(x)\}$ at differentiability points [2507.06950].

The key structural object in the 2025 MASLA theory is a conservative set-valued field. A set-valued map $D:\mathbb{R}^d\rightrightarrows\mathbb{R}^d$ is called a conservative field if it has closed graph and nonempty compact values and satisfies the loop-integral condition
\[
\int_0^1 \max_{v\in D(\gamma(t))}\langle \dot\gamma(t),v\rangle\,dt = 0
\]
for every absolutely continuous loop $\gamma$ with $\gamma(0)=\gamma(1)$. Such a field admits a locally Lipschitz potential $f$, unique up to an additive constant, obtained by path integration. For convex, concave, prox-regular, semialgebraic, or more generally tame functions, the Clarke subgradient is itself conservative [2507.06950].

This framework retains several gradient-like properties. If $D$ is conservative with potential $f$, then $D(x)=\{\nabla f(x)\}$ for Lebesgue-a.e. $x$, the Clarke subgradient satisfies
\[
\partial^c f(x)\subset \operatorname{co}(D(x)),
\]
and along absolutely continuous curves one has the chain rule
\[
\frac{d}{dt} f(x(t)) = \langle v,\dot x(t)\rangle,\qquad \forall v\in D(x(t)),\ \text{a.e. }t.
\]
These facts are what allow MASLA to replace classical gradients by generalized derivatives without abandoning the Langevin construction [2507.06950].

## 3. General MASLA construction

In the general non-smooth and non-convex setting, MASLA is motivated by the Langevin-type stochastic differential inclusion
\[
dX_t \in -D_U(X_t)\,dt + \sqrt{2}\,dB_t.
\]
A discrete Euler–Maruyama step is then written as
\[
\breve{Y}_{n+1} = X_n - \gamma \beta(X_n) + \sqrt{2\gamma}\,Z_{n+1},\qquad Z_{n+1}\sim\mathcal{N}(0,I_d),
\]
where $\beta(X_n)\in D_U(X_n)$ is a measurable selection from the conservative field. The paper also writes
\[
\beta(x) = \begin{cases}
\nabla U(x), & x\in {}_U,\\
\beta(x)\in D_U(x), & x\notin {}_U,
\end{cases}
\]
so that gradients are used wherever $U$ is smooth and a subgradient is used at non-smooth points [2507.06950].

Conditional on $X_n=x$ and a deterministic choice of $\beta(x)$, the proposal is Gaussian with density
\[
q_\gamma(x,y) = (4\pi \gamma)^{-d/2}\exp\!\left\{-\frac{1}{4\gamma}\|y - x + \gamma\beta(x)\|^2\right\}.
\]
The Metropolis–Hastings correction is
\[
\alpha_\gamma(x,y) = 1 \wedge \frac{\pi(y) q_\gamma(y,x)}{\pi(x) q_\gamma(x,y)},
\]
and the chain update is
\[
X_{n+1} = X_n + (\breve{Y}_{n+1}-X_n)\,\mathbf{1}_{\{U_{n+1} \le \alpha_\gamma(X_n,\breve{Y}_{n+1})\}},
\]
with $U_{n+1}\sim \mathrm{Unif}[0,1]$. When $U$ is $C^1$ everywhere and $D_U(x)=\{\nabla U(x)\}$, MASLA reduces exactly to standard MALA [2507.06950].

The algorithm does not prescribe a unique selection rule for $\beta(x)$. Any measurable selection from $D_U(x)$ is admissible. For compositions of linear maps and activations, including neural-network architectures, the paper emphasizes that automatic differentiation can be used to compute a generalized gradient consistent with the conservative-field chain rule; at smooth points it coincides with $\nabla U$, and at non-smooth points it selects one valid generalized derivative [2507.06950].

## 4. Moreau–Yosida and proximal realizations of MASLA

In the convex setting treated in the MY-MALA scaling analysis, the target is
\[
\pi(x)\propto \exp(-G(x)),\qquad x\in\mathbb{R}^d,
\]
under the assumption that $G:\mathbb{R}^d\to\mathbb{R}$ is convex, proper, and lower semicontinuous. The Moreau–Yosida envelope is
\[
G^\lambda(x) =\min_{u\in\mathbb{R}^d}\Big\{ G(u) + \frac1{2\lambda}\|u-x\|^2 \Big\},
\]
with proximal operator
\[
\operatorname{prox}_G^\lambda(x) = \arg\min_{u\in\mathbb{R}^d}\Big\{G(u) + \frac1{2\lambda}\|u-x\|^2\Big\}.
\]
The central identity is
\[
\nabla G^\lambda(x) = \frac1{\lambda}\bigl(x - \operatorname{prox}_G^\lambda(x)\bigr).
\]
Because $G$ is convex, $G^\lambda$ is continuously differentiable and convex, with $\nabla G^\lambda$ Lipschitz of constant $1/\lambda$ [2301.02446].

The proximal map is the resolvent of the subdifferential. If $u^*=\operatorname{prox}_G^\lambda(x)$, then
\[
0 \in \partial G(u^*) + \frac1{\lambda}(u^*-x),
\qquad
\frac{x-u^*}{\lambda} \in \partial G(u^*).
\]
Thus $\nabla G^\lambda(x)$ is a particular subgradient of $G$ evaluated at the prox image. This is the precise sense in which MY-MALA is a MASLA: the drift is built from a proximal or subdifferential object rather than from a classical gradient [2301.02446].

The unadjusted Moreau–Yosida Langevin step is
\[
\xi_{k+1}
= \xi_k - \frac{\sigma^2}{2}\,\nabla G^\lambda(\xi_k) + \sigma Z_{k+1},
\qquad Z_{k+1}\sim N(0,I_d),
\]
or equivalently
\[
\xi_{k+1} = \Big(1-\frac{\sigma^2}{2\lambda}\Big)\xi_k + \frac{\sigma^2}{2\lambda}\operatorname{prox}_G^\lambda(\xi_k) + \sigma Z_{k+1}.
\]
In the Metropolis-adjusted version, the proposal is
\[
Y_{k+1}^d = \Big(1-\frac{\sigma_d^2}{2\lambda_d}\Big) X_k^d + \frac{\sigma_d^2}{2\lambda_d}\,\operatorname{prox}_G^{\lambda_d}(X_k^d) + \sigma_d Z_{k+1}^d,
\]
with Gaussian proposal density
\[
q(x,y) = \varphi_d\bigl(y;\,\mu_\lambda(x),\,\sigma^2 I_d\bigr),
\qquad
\mu_\lambda(x) = \Big(1-\frac{\sigma^2}{2\lambda}\Big)x + \frac{\sigma^2}{2\lambda}\operatorname{prox}_G^\lambda(x),
\]
and acceptance probability
\[
\alpha(x,y) = 1\wedge \frac{\pi(y)\,q(y,x)}{\pi(x)\,q(x,y)}.
\]
The special case $\lambda=\sigma^2/2$ is P-MALA. For the Laplace potential $G(x)=|x|$, the limiting case $\lambda=0$ yields the paper’s subgradient MALA, sG-MALA,
\[
Y_{k+1} = X_k - \frac{\sigma^2}{2}\,\operatorname{sgn}(X_k) + \sigma Z_{k+1},
\]
which is the pure subgradient MASLA for that target [2301.02446].

## 5. High-dimensional scaling theory

The most detailed optimal-scaling results currently attached to MASLA-type methods come from the MY-MALA analysis in product targets [2301.02446]. For differentiable targets of the form
\[
G(\mathbf{x})=\sum_{i=1}^d g(x_i),
\]
with $g\in C^8(\mathbb{R})$ and polynomially bounded derivatives, the proposal parameters are written as
\[
\sigma_d^2=\frac{\ell^2}{d^{2\alpha}},\qquad
\lambda_d=\frac{c^2}{2d^{2\beta}},\qquad
v=\frac{\beta}{\alpha},\qquad
r=\frac{c^2}{\ell^{2v}}.
\]
Three regimes appear.

For **case (a)**, $v=1/2$ with $\alpha=1/4$ and $\beta=1/8$, the optimal scaling is
\[
\sigma_d^2\asymp d^{-1/2},
\]
the limiting mean acceptance is
\[
2\Phi\Big(-\frac{\ell^2 K_1(r)}{2}\Big),
\]
and the speed function is maximized at acceptance approximately $0.452$. This is the RWM-like regime. For **case (b)**, $v=1$ with $\alpha=\beta=1/6$, the optimal scaling becomes
\[
\sigma_d^2\asymp d^{-1/3},
\]
the limiting acceptance is
\[
2\Phi\Big(-\frac{\ell^3 K_2(r)}{2}\Big),
\]
and the optimal acceptance is approximately $0.574$, as in MALA. For **case (c)**, $v>1$ with $\alpha=1/6$ and $\beta>1/6$, MY-MALA has the same limiting scaling and the same $K_2(0)$ constant as classical MALA, again with optimal acceptance approximately $0.574$ [2301.02446].

The paper interprets these regimes through the relative decay of $\lambda_d$ and $\sigma_d^2$. If $v>1$, $\lambda_d$ goes to zero faster than $\sigma_d^2$ and MY-MALA behaves asymptotically as MALA. If $v=1$, the order remains MALA-like but the speed constant worsens with $r$, so MALA is optimal within that family. If $v=1/2$, the envelope remains comparatively smooth, stability is improved, but the scaling degrades [2301.02446].

For the non-smooth product Laplace target
\[
\pi_d(\mathbf{x})=\prod_{i=1}^d \frac12 e^{-|x_i|},
\]
the proximal operator is soft thresholding,
\[
\operatorname{prox}_G^\lambda(x)=(x-\lambda\,\text{sgn}(x))\,\mathbf{1}_{|x|\ge\lambda} + 0\cdot\mathbf{1}_{|x|<\lambda},
\]
and the componentwise MY-MALA proposal becomes
\[
Y_{k+1,i}^d = X_{k,i}^d
-\frac{\sigma_d^2}{2}\operatorname{sgn}(X_{k,i}^d)\mathbf{1}_{|X_{k,i}^d|\ge\lambda_d}
-\frac{\sigma_d^2}{2\lambda_d}X_{k,i}^d \mathbf{1}_{|X_{k,i}^d|<\lambda_d}
+ \sigma_d Z_{k+1,i}^d.
\]
When
\[
\sigma_d^2=\ell^2/d^{2\alpha},\qquad \alpha=1/3,\qquad \beta=v/3,\qquad v\ge 1,
\]
the acceptance limit is
\[
a^L(\ell)= 2\Phi\Big(-\frac{\ell^{3/2}}{(72\pi)^{1/4}}\Big),
\]
which does not depend on $r$ and therefore does not depend on $\lambda_d$ as long as $\lambda_d$ decays at least as fast as $\sigma_d^2$. The limiting diffusion is
\[
dL_t = \sqrt{h^L(\ell)}\,dB_t - \frac{h^L(\ell)}{2}\,\operatorname{sgn}(L_t)\,dt,
\qquad h^L(\ell)=\ell^2 a^L(\ell),
\]
and the optimal acceptance is characterized by $a^L(\ell)=0.360$. Equivalently, the step-size regime is
\[
\sigma_d^2\asymp d^{-2/3},
\]
which the paper describes as a new intermediate regime between RWM and smooth-target MALA [2301.02446].

## 6. Stationarity, reversibility, and implementation

For the general locally Lipschitz MASLA, the main formal guarantee is a stationarity theorem. If at Lebesgue-a.e. point $x$ in the domain of $U$ there exists an open neighborhood $V_x$ where $U$ is $C^2$, and if the initial distribution is absolutely continuous with respect to Lebesgue measure, then for almost every step size $\gamma>0$ the MASLA chain has $\pi$ as a stationary distribution and is reversible with respect to $\pi$ [2507.06950].

The proof strategy is based on showing that the proposal kernel has a density for almost every $\gamma$. A simplified proposal using $\nabla U(x)$ where it exists is analyzed via a pseudo-Hessian and the inverse function theorem to prove that the proposal maps absolutely continuous measures to absolutely continuous measures. Since $D_U(x)=\{\nabla U(x)\}$ a.e., the actual subgradient proposal coincides almost surely with the simplified one, and standard Metropolis–Hastings detailed balance then yields reversibility [2507.06950].

Implementation requires three ingredients: evaluation of $U(x)$, evaluation of a measurable selection $\beta(x)\in D_U(x)$, and Gaussian noise generation. In practice, the subgradient can be written analytically in piecewise-smooth models such as $U(x)=\|Kx\|_1+f(x)$, or obtained through automatic differentiation in ReLU-type neural networks. The per-iteration cost is essentially the same as for MALA: one subgradient evaluation, one Gaussian draw, and the energy evaluations needed by the acceptance ratio [2507.06950].

For the convex-proximal subclass, the MY-MALA analysis gives more explicit tuning guidance. For smooth targets where MALA is stable and gradients are cheaply available, it is preferable to make $\lambda_d$ very small, effectively recovering the MALA regime. For non-smooth Laplace-like targets, the recommendation is to choose $\lambda_d\lesssim \sigma_d^2$ so that the algorithm remains in the correct scaling regime $v\ge 1$. For smooth targets with tails in the family $\exp(-\gamma|x|^\beta)$, MALA is geometrically ergodic for $\beta\in[1,2]$, whereas for $\beta>2$ it may fail to be geometrically ergodic; in that case MY-MALA with suitably large $\lambda$ can improve ergodicity by smoothing the tails, at the cost of less favorable scaling [2301.02446].

## 7. Empirical behavior, terminology, and open questions

The 2025 paper reports two main empirical studies [2507.06950]. In a two-dimensional TV–$L^2$ model,
\[
U(x)=F(x)+G(Kx),\qquad
F(x)=\tfrac{1}{2\sigma^2}\|x-y\|^2,\qquad
G(p)=\lambda|p|,\qquad
Kx=x_2-x_1,
\]
with parameters $y=(-1,1)$, $\sigma=1$, and $\lambda=5$, MASLA is compared against proximal-subgradient Langevin, gradient-subgradient Langevin, P-MALA, and MYULA. Using $10^4$ independent chains and step sizes $\tau\in\{10^{-3},10^{-4},10^{-5}\}$, the experiments show exponential decay of $W_2$ and total variation distance to the true target for all algorithms considered, with MASLA close to the specialized proximal and subgradient methods.

A second experiment studies the non-convex and non-proximal example
\[
U(x)=|x^2-1|.
\]
Here the proximal operator is multi-valued at some points, so P-MALA and MYULA are not directly applicable. MASLA is compared with the unadjusted subdifferential Langevin algorithm (USLA). With $100\,000$ iterations, step size $\tau=0.1$, initialization at $x=0$, and $20\%$ burn-in discarded, the reported errors are: TV error $0.1168$ for USLA versus $0.0144$ for MASLA, $W_2$ error $0.0922$ for USLA versus $0.0082$ for MASLA, and computation time $0.998$ s for USLA versus $1.536$ s for MASLA. The histogram for MASLA matches the theoretical density well, while the USLA histogram deviates substantially.

The terminology surrounding this family is not uniform. The literature names recorded in the two papers are MYULA for the unadjusted Moreau–Yosida sampler, P-Langevin or Proximal Langevin for the same unadjusted idea, P-MALA for the special case $\lambda=\sigma^2/2$, MY-MALA for the general convex-proximal Metropolis-adjusted family, and sG-MALA for the Laplace subgradient method. MASLA is broader than these proximal variants: it does not require convexity and does not require a single-valued proximal operator, whereas MY-MALA is a particular MASLA instance built from $\nabla G^\lambda$ or $\operatorname{prox}_G^\lambda$ [2507.06950, 2301.02446].

Several limitations remain explicit. The general MASLA paper proves stationarity and reversibility but does not provide a detailed geometric-ergodicity or mixing-rate theory, no explicit step-size bounds or optimal scaling rules are derived for the general locally Lipschitz non-convex setting, and the effect of different measurable subgradient selections on mixing is left open. High-dimensional experiments on realistic applications, such as deep Bayesian neural networks, also remain to be carried out systematically. By contrast, the 2023 paper provides sharp scaling theory only for the convex Moreau–Yosida subclass, specifically smooth product targets and the product Laplace target. A plausible implication is that the current theory is strongest in the convex-proximal regime, while the full non-convex MASLA program is presently supported mainly by the stationarity theorem and low-dimensional empirical evidence [2507.06950, 2301.02446].

Source: https://www.emergentmind.com/topics/metropolis-adjusted-subdifferential-langevin-algorithm-masla