---
title: 'SLERP: Spherical Linear Interpolation'
url: https://www.emergentmind.com/topics/spherical-linear-interpolation-slerp-468c686a-5b2d-4aab-97e1-390017ada09d
type: topic
---

# SLERP: Spherical Linear Interpolation

Spherical Linear intERPolation (SLERP) provides a geometric framework for interpolating between points on a unit sphere, producing paths that traverse constant-speed geodesics along great circles. Initially formulated in the context of geometry and computer graphics for interpolating rotations, SLERP is now foundational in diverse applications, including model merging in deep learning, variational autoencoders, molecular pathway generation, and numerical integration on manifolds. Its mathematical underpinning is the explicit parametrization of the geodesic curve connecting two points in $\mathbb{R}^n$ constrained to the unit sphere $S^{n-1}$, preserving unit norm and ensuring constant angular velocity throughout the interpolation.

## 1. Geometric Foundation and Formal Definition

Given two points $u, v \in S^{n-1} \subset \mathbb{R}^n$ ($\|u\|=\|v\|=1$), the unique shortest path on the sphere (excluding the antipodal case) is the great-circle arc determined by their two-dimensional span. Let $\Omega = \arccos(u \cdot v) \in [0,\pi]$ denote the central angle between $u$ and $v$. The SLERP path $\gamma(t)$, with $t \in [0,1]$, is given by
\[
\gamma(t) = \frac{\sin((1 - t)\Omega)}{\sin \Omega} u + \frac{\sin(t \Omega)}{\sin \Omega} v.
\]
This parametrization ensures $\gamma(0) = u$, $\gamma(1) = v$, and $\|\gamma(t)\| = 1$ for all $t$, traversing the shortest geodesic at uniform angular speed $\|\gamma'(t)\| = \Omega$ [2511.05099].

When $u$ and $v$ are nearly coincident ($\Omega \approx 0$), the formula becomes numerically unstable due to small denominator $\sin \Omega$; in this limiting case, linear interpolation followed by normalization is used:
\[
\gamma(t) = \frac{(1-t)u + tv}{\|(1-t)u + tv\|}.
\]

For the antipodal case ($v = -u$, $\Omega = \pi$), the geodesic is not unique—any great circle orthogonal to $u$ can be chosen as the interpolation plane.

## 2. Algebraic Derivation and Specializations

The geometric construction extends naturally to higher dimensions since the geodesic remains confined within the plane spanned by $u$ and $v$. Letting $e_1 = u$, $w = v - (u \cdot v)u$, $e_2 = w / \|w\|$, the two-dimensional subspace enables a planar trigonometric parametrization:
\[
\gamma(t) = \cos(t\Omega)u + \sin(t\Omega) e_2,
\]
and this can be algebraically recast to match the standard SLERP formula via the trigonometric identity $\sin((1-t)\Omega) = \sin \Omega \cos(t\Omega) - \cos \Omega \sin(t\Omega)$ [2511.05099].

For quaternion interpolation (rotations in $\mathrm{SO}(3)$ and higher), $S^3$ is identified with the space of unit quaternions, and SLERP performs constant-speed rotation interpolation:
\[
\operatorname{SLERP}(q_0, q_1; t) = q_0 (q_0^{-1}q_1)^t.
\]
Here, exponentiation is via the quaternion logarithm and exponential maps, and the resulting path matches the great-circle interpolant on $S^3$ [2111.12549].

## 3. Numerical Implementation and Stability

Numerically robust SLERP implementations require:
- Precomputing $\Omega = \arccos(u \cdot v)$ and $\sin \Omega$.
- Falling back to linear interpolant with normalization where $\sin \Omega$ is below a threshold (e.g., $10^{-5}$).
- Ensuring all floating-point inner products are rounded or clamped to $[-1, 1]$ prior to applying $\arccos$ [2508.01822, 2511.05099].

Pseudocode typically follows:
```python
def slerp(u, v, t, eps=1e-6):
    dot = np.clip(np.dot(u, v), -1.0, 1.0)
    omega = np.arccos(dot)
    if np.abs(omega) < eps:
        return (1-t)*u + t*v
    sin_omega = np.sin(omega)
    a = np.sin((1-t)*omega) / sin_omega
    b = np.sin(t*omega) / sin_omega
    return a*u + b*v
```
This ensures both mathematical correctness and stability across all configurations [2508.01822].

## 4. Applications Across Disciplines

### 4.1. Model Weight Interpolation and Merging (Deep Learning)

SLERP has become central to neural network merging strategies, such as weight-averaged rewarded policies (WARP) and model merging in the context of language model adaptation. The goal is to interpolate between model parameters (or task vectors derived from parameter increments) following the hyperspherical geodesic, thus preserving angular geometry and maintaining network inductive biases. SLERP consistently outperforms naive linear averaging, particularly in preserving clustering structure, avoiding mode bridging artifacts, and balancing task specialization versus generalization [2511.21703, 2406.16768].

### 4.2. Latent Space Interpolation in Generative Models

In variational autoencoders (VAEs), conditional VAEs (CVAEs), and diffusion models, SLERP ensures latent vectors remain on the high-density "shell" of the prior distribution (approximately Gaussian in high dimensions), resulting in smooth interpolations and realistic syntheses. Linear interpolation through Euclidean space would penetrate low-probability interior regions, inducing undesirable artifacts post-decoding, while SLERP respects the latent manifold's geometry [2508.01822, 2403.08840].

### 4.3. Molecular and Materials Pathway Interpolation

In computational chemistry and solid-state physics, SLERP is applied to the interpolation of molecular orientations (e.g., using unit quaternions for fragments), yielding physically plausible, collision-free transition pathways for nudged-elastic band (NEB) algorithms. The hybridization of SLERP for rotation and linear interpolation for translations is prevalent in generating realistic reaction pathways and phase transitions in periodic systems [2410.10506].

### 4.4. Geometric Numerical Integration

SLERP is integral in numerical solvers for differential equations with manifold constraints (e.g., maintaining points on $S^n$). In "SLERP-TVDRK" schemes for solving ODEs on spheres, convex combinations (averages) required by Runge-Kutta stages are replaced by SLERP, eliminating the need for costly post-step projections and improving stability and accuracy. However, higher-order generalizations (order $r \geq 4$) are nontrivial due to SLERP's non-associativity, and require consideration of Riemannian means [2410.10420].

### 4.5. Rotation Interpolation and Animation

In computer graphics and robotics, SLERP is the standard for smoothly interpolating orientations represented as unit quaternions, ensuring constant-speed rotational motion and avoiding discontinuities inherent in Euler- or axis-angle interpolation. The non-Abelian Kuramoto model on $S^3$ confirms that the unique geodesic interpolant matches SLERP exactly [2111.12549].

## 5. Limitations and Extensions

While SLERP preserves unit norm and constant angular velocity, several limitations and technical caveats arise:
- For antipodal endpoints, infinite geodesics exist, and a unique path must be chosen by selecting an orthogonal direction.
- Pairwise SLERP is not associative: successive interpolations are not rotationally invariant in higher-dimensional spaces, creating ambiguity in multi-way merges or convex combinations [2410.10420].
- For points with nearly zero separation, the denominator $\sin \Omega$ is ill-conditioned, requiring fallback to linear interpolation for numerical robustness.
- In generative modeling, the assumption that endpoints reside on the manifold's "shell" does not always hold for out-of-distribution data; preprocessing steps, such as noise re-injection and clipping (as in NoiseDiffusion), become necessary [2403.08840].

## 6. Empirical Performance and Best Practices

Across application domains, SLERP has demonstrated:
- Superior alignment between compositional endpoints in embedding spaces, supporting state-of-the-art zero-shot retrieval in vision-language tasks with optimal weighting coefficients (e.g., $\alpha=0.8-0.9$ for text/image mixings) [2405.00571].
- Robust model merging with preservation of base-model generalization and retention of specialized adaptation, evidenced by improved clustering-based metrics such as the Silhouette Score and Davies-Bouldin Index [2511.21703].
- Artifact-free, morphologically realistic interpolations in high-dimensional generative models and accurate intermediate-state prediction in materials science [2508.01822, 2410.10506].
- Efficient and projection-free geometric numerical integration on $S^n$ with first, second, and third-order explicit methods [2410.10420].

## 7. Table: Canonical SLERP Formulae Across Contexts

| Domain            | Endpoints         | SLERP Formula (t ∈ [0,1])                   |
|-------------------|------------------|----------------------------------------------|
| Vector/Sphere     | $u, v \in S^{n-1}$         | $\frac{\sin((1-t)\Omega)}{\sin \Omega} u + \frac{\sin(t\Omega)}{\sin \Omega} v$ |
| Quaternion/Rotation | $q_0, q_1 \in S^3$         | $q_0 (q_0^{-1} q_1)^t$                      |
| Model Weights     | $w_0, w_1 \in \mathbb{R}^d$ | $\frac{\sin((1-t)\theta)}{\sin \theta} w_0 + \frac{\sin(t\theta)}{\sin \theta} w_1$ |

Here, $\Omega = \arccos(u \cdot v)$; $\theta = \arccos((w_0^\top w_1)/(\|w_0\|\|w_1\|))$; for quaternions, $q_0^{-1} q_1$ denotes the unit quaternion representing the relative rotation [2511.05099, 2511.21703, 2111.12549].

---

SLERP stands as the canonical method for geodesic interpolation on spheres, with unique solutions and closed-form implementation across vector, quaternion, and high-dimensional parameter spaces, combining geometric rigor with empirical effectiveness in modern computational pipelines.

Source: https://www.emergentmind.com/topics/spherical-linear-interpolation-slerp-468c686a-5b2d-4aab-97e1-390017ada09d