SLERP: Spherical Linear Interpolation
- SLERP is a method for interpolating points on a unit sphere along great circles, ensuring constant angular velocity and preservation of unit norm.
- It is applied in areas such as deep learning model merging, latent space interpolation in generative models, and molecular simulation to achieve smooth, realistic transitions.
- Numerical implementations of SLERP emphasize stability by switching to linear interpolation for near-zero angles and careful handling of antipodal cases.
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 constrained to the unit sphere , preserving unit norm and ensuring constant angular velocity throughout the interpolation.
1. Geometric Foundation and Formal Definition
Given two points (), the unique shortest path on the sphere (excluding the antipodal case) is the great-circle arc determined by their two-dimensional span. Let denote the central angle between and . The SLERP path , with , is given by
This parametrization ensures , , and for all , traversing the shortest geodesic at uniform angular speed (Roychowdhury, 7 Nov 2025).
When and are nearly coincident (), the formula becomes numerically unstable due to small denominator ; in this limiting case, linear interpolation followed by normalization is used:
For the antipodal case (, ), the geodesic is not unique—any great circle orthogonal to 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 and . Letting , , , the two-dimensional subspace enables a planar trigonometric parametrization: and this can be algebraically recast to match the standard SLERP formula via the trigonometric identity (Roychowdhury, 7 Nov 2025).
For quaternion interpolation (rotations in and higher), is identified with the space of unit quaternions, and SLERP performs constant-speed rotation interpolation: Here, exponentiation is via the quaternion logarithm and exponential maps, and the resulting path matches the great-circle interpolant on (Kapić et al., 2021).
3. Numerical Implementation and Stability
Numerically robust SLERP implementations require:
- Precomputing and .
- Falling back to linear interpolant with normalization where is below a threshold (e.g., ).
- Ensuring all floating-point inner products are rounded or clamped to prior to applying (Gaikwad et al., 3 Aug 2025, Roychowdhury, 7 Nov 2025).
Pseudocode typically follows:
1 2 3 4 5 6 7 8 9 |
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 |
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 LLM 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 (Kabane, 16 Nov 2025, Ramé et al., 2024).
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 (Gaikwad et al., 3 Aug 2025, Zheng et al., 2024).
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 (Goncharova et al., 2024).
4.4. Geometric Numerical Integration
SLERP is integral in numerical solvers for differential equations with manifold constraints (e.g., maintaining points on ). 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 ) are nontrivial due to SLERP's non-associativity, and require consideration of Riemannian means (Leung et al., 2024).
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 confirms that the unique geodesic interpolant matches SLERP exactly (Kapić et al., 2021).
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 (Leung et al., 2024).
- For points with nearly zero separation, the denominator 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 (Zheng et al., 2024).
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., for text/image mixings) (Jang et al., 2024).
- 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 (Kabane, 16 Nov 2025).
- Artifact-free, morphologically realistic interpolations in high-dimensional generative models and accurate intermediate-state prediction in materials science (Gaikwad et al., 3 Aug 2025, Goncharova et al., 2024).
- Efficient and projection-free geometric numerical integration on with first, second, and third-order explicit methods (Leung et al., 2024).
7. Table: Canonical SLERP Formulae Across Contexts
| Domain | Endpoints | SLERP Formula (t ∈ [0,1]) |
|---|---|---|
| Vector/Sphere | ||
| Quaternion/Rotation | ||
| Model Weights |
Here, ; ; for quaternions, denotes the unit quaternion representing the relative rotation (Roychowdhury, 7 Nov 2025, Kabane, 16 Nov 2025, Kapić et al., 2021).
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.