---
title: Dual-branch Score Distillation Sampling (SDS)
url: https://www.emergentmind.com/topics/dual-branch-score-distillation-sampling-sds-f541d06d-52ca-445d-a416-68b326cdbc0c
type: topic
---

# Dual-branch Score Distillation Sampling (SDS)

Searching arXiv for the cited papers and topic-related context.
arxiv_search(query="Dual-branch Score Distillation Sampling UDS BSD 3D editing generation inpainting", max_results=10)
arxiv_search(query="2505.01888", max_results=5)
Dual-branch Score Distillation Sampling (SDS) denotes a family of formulations in which the guidance used to optimize a 3D generator under a frozen 2D diffusion prior is decomposed into two complementary terms rather than treated as a single monolithic score. In one line of work, the decomposition is internal to SDS itself: a reconstruction or consistency branch is separated from a text or prompt branch, and this view is used to unify 3D generation and 3D editing through Unified Distillation Sampling (UDS) [2505.01888]. In another line of work, dual-branch guidance refers to two parallel modalities—appearance and geometry—optimized with Balanced Score Distillation (BSD) for NeRF inpainting [2411.15551]. Across these formulations, the central idea is that the optimization signal from diffusion can be factorized into more interpretable components, and that this factorization can reduce instability, improve identity preservation or geometric consistency, and better align 2D priors with 3D objectives.

## 1. Definition and scope

In the UDS formulation, “dual-branch SDS” is a decomposition of the practical SDS gradient into a consistency or reconstruction branch and a text or prompt branch. Let $x_0$ be a clean image latent, let $x_t$ be its noisy version under a DDPM-style schedule,
$$
x_t = \sqrt{\bar{\alpha}_t}\,x_0 + \sqrt{1-\bar{\alpha}_t}\,\epsilon,\qquad \epsilon \sim \mathcal{N}(0,I),
$$
and let $\epsilon_\phi(x_t,t,y)$ be a pre-trained noise-prediction UNet trained by denoising score matching. For text-to-3D distillation, a differentiable 3D representation $g(\theta,c)$ renders a view $x := g(\theta,c)$, and SDS optimizes $\theta$ through
$$
L_{\mathrm{SDS}}(\theta) := \mathbb{E}_{t,c,\epsilon}\big[\omega(t)\|\epsilon_\phi(x_t,t,y)-\epsilon\|_2^2\big].
$$
Ignoring the UNet Jacobian, the practical gradient is
$$
\nabla_\theta L_{\mathrm{SDS}}
=
\mathbb{E}_{t,\epsilon,c}
\Big[
\omega(t)\big(\epsilon_\phi(x_t,t,y)-\epsilon\big)\frac{\partial g(\theta,c)}{\partial \theta}
\Big].
$$
The key observation is that, under classifier-free guidance (CFG), this update can be decomposed into two interpretable branches [2505.01888].

In GB-NeRF, “dual-branch” has a different but related meaning. The same score-distillation principle is applied to two rendered modalities of the same NeRF generator: RGB appearance and surface normals. BSD then supplies a geometry-aware guidance rule that removes the unconditional term and balances positive and negative conditional prompts in both branches [2411.15551].

A common misconception is that dual-branch SDS names a single standardized algorithm. The literature summarized here indicates two distinct but compatible uses of the phrase: branch decomposition within SDS guidance itself, and branch decomposition across multiple supervision modalities.

## 2. Decomposition of SDS into reconstruction and prompt branches

The UDS paper defines
$$
\delta_{x_t}:=\epsilon_\phi(x_t,t,y)-\epsilon.
$$
With CFG weight $w$, this becomes
$$
\delta_{x_t}
=
\big(\epsilon_\phi(x_t,t,\varnothing)-\epsilon\big)
+
w\big(\epsilon_\phi(x_t,t,y)-\epsilon_\phi(x_t,t,\varnothing)\big).
$$
This yields two branches:
- reconstruction branch:
$$
\delta_{x_t}^{\mathrm{recon}} := \epsilon_\phi(x_t,t,\varnothing)-\epsilon,
$$
- classifier branch:
$$
\delta_{x_t}^{\mathrm{cls}} := \epsilon_\phi(x_t,t,y)-\epsilon_\phi(x_t,t,\varnothing).
$$

This decomposition clarifies that vanilla SDS is driven simultaneously by unconditional denoising consistency and by text-conditional steering. The first term stabilizes the optimization by tying the rendered sample to the unconditional denoiser; the second pushes the sample toward the conditional manifold specified by the prompt [2505.01888].

The same paper argues that several editing methods can be rewritten in this two-branch form. For Delta Denoising Score (DDS), the paper gives
$$
\nabla_\theta L_{\mathrm{DDS}}
=
\mathbb{E}_t
\Big[
\omega(t)\big(\epsilon_\phi(x_t^{\mathrm{tgt}},t,y^{\mathrm{tgt}})
-
\epsilon_\phi(x_t^{\mathrm{src}},t,y^{\mathrm{src}})
\big)
\frac{\partial x_0^{\mathrm{tgt}}}{\partial \theta}
\Big],
$$
and rewrites its guidance as
$$
\delta_{x_t}^{\mathrm{DDS}}
=
\big(
\epsilon_\phi(x_t^{\mathrm{tgt}},t,\varnothing)
-
\epsilon_\phi(x_t^{\mathrm{src}},t,\varnothing)
\big)
+
w\big(
\delta_{x_t^{\mathrm{tgt}}}^{\mathrm{cls}}
-
\delta_{x_t^{\mathrm{src}}}^{\mathrm{cls}}
\big).
$$
Posterior Distillation Sampling (PDS) introduces an explicit latent-matching term. Using Tweedie’s formula,
$$
\hat{x}_0 = \mathbb{E}[x_0\mid x_t]
=
\frac{x_t-\sqrt{1-\bar{\alpha}_t}\,\epsilon_\phi(x_t,t,y)}{\sqrt{\bar{\alpha}_t}},
$$
the paper re-expresses PDS in simplified form as
$$
\delta_{x_t}^{\mathrm{PDS}}
=
(\hat{x}_0^{\mathrm{tgt}}-\hat{x}_0^{\mathrm{src}})
+
\big(
\epsilon_\phi(x_t^{\mathrm{tgt}},t,\varnothing)
-
\epsilon_\phi(x_t^{\mathrm{src}},t,\varnothing)
\big)
+
w\big(
\delta_{x_t^{\mathrm{tgt}}}^{\mathrm{cls}}
-
\delta_{x_t^{\mathrm{src}}}^{\mathrm{cls}}
\big).
$$
The paper identifies the term $(\hat{x}_0^{\mathrm{tgt}}-\hat{x}_0^{\mathrm{src}})$ as crucial for identity preservation in 3D editing.

This suggests that dual-branch SDS is not merely an analytical convenience. It is used as a unifying lens through which generation-oriented and editing-oriented score-distillation methods can be compared.

## 3. Unified Distillation Sampling as a dual-branch generalization

UDS replaces the reconstruction branch with differences in clean-latent predictions $\hat{x}_0$ and retains CFG as the text branch. The resulting unified update is
$$
\delta_{x_t}^{\mathrm{UDS}} = \Delta \hat{x}_0 + w\,\Delta \delta_{x_t}^{\mathrm{cls}},
$$
with gradient
$$
\nabla_\theta L_{\mathrm{UDS}}
=
\mathbb{E}_{t,\epsilon,c}
\Big[
\omega(t)\big(\Delta \hat{x}_0 + w\,\Delta \delta_{x_t}^{\mathrm{cls}}\big)
\frac{\partial g(\theta,c)}{\partial \theta}
\Big].
$$
The task dependence enters only through the $\Delta$ terms [2505.01888].

For editing,
$$
\Delta \hat{x}_0 = \hat{x}_0^{\mathrm{tgt}}-\hat{x}_0^{\mathrm{src}},
$$
and
$$
\Delta \delta_{x_t}^{\mathrm{cls}}
=
\big(
\epsilon_\phi(x_t^{\mathrm{tgt}},t,y^{\mathrm{tgt}})
-
\epsilon_\phi(x_t^{\mathrm{tgt}},t,\varnothing)
\big)
-
\big(
\epsilon_\phi(x_t^{\mathrm{src}},t,y^{\mathrm{src}})
-
\epsilon_\phi(x_t^{\mathrm{src}},t,\varnothing)
\big).
$$
Hence
$$
\delta_{x_t}^{\mathrm{edit}}
=
(\hat{x}_0^{\mathrm{tgt}}-\hat{x}_0^{\mathrm{src}})
+
w\Big[
\big(
\epsilon_\phi(x_t^{\mathrm{tgt}},t,y^{\mathrm{tgt}})
-
\epsilon_\phi(x_t^{\mathrm{tgt}},t,\varnothing)
\big)
-
\big(
\epsilon_\phi(x_t^{\mathrm{src}},t,y^{\mathrm{src}})
-
\epsilon_\phi(x_t^{\mathrm{src}},t,\varnothing)
\big)
\Big].
$$

For generation,
$$
\Delta \hat{x}_0 = \hat{x}_0^{t}-\hat{x}_0^{t-c},
$$
and
$$
\Delta \delta_{x_t}^{\mathrm{cls}} = \epsilon_\phi(x_t,t,y)-\epsilon_\phi(x_t,t,\varnothing),
$$
optionally with negative CFG:
$$
\delta_{x_t}^{\mathrm{gen}}
=
(\hat{x}_0^{t}-\hat{x}_0^{t-c})
+
w\big(
\delta_{x_t}^{\mathrm{cls}}-\delta_{x_t}^{\mathrm{neg,cls}}
\big).
$$

The paper gives two approximations for $\hat{x}_0$. A single-step Tweedie estimate is
$$
\hat{x}_0
\approx
\frac{x_t-\sqrt{1-\bar{\alpha}_t}\,\epsilon_\phi(x_t,t,\varnothing)}{\sqrt{\bar{\alpha}_t}},
$$
while a multi-step unconditional DDIM inverse computes
$$
x_{t-1}
=
\sqrt{\bar{\alpha}_{t-1}}
\left(
\frac{x_t-\sqrt{1-\bar{\alpha}_t}\,\epsilon_\phi(x_t,t,\varnothing)}{\sqrt{\bar{\alpha}_t}}
\right)
+
\sqrt{1-\bar{\alpha}_{t-1}}\,
\epsilon_\phi(x_t,t,\varnothing),
$$
iterated to $t=0$ for a higher-fidelity $\hat{x}_0$.

The theoretical claim advanced by the paper is that generation and editing differ only in what “consistency” means. In editing, consistency is identity preservation between source and target clean latents; in generation, consistency is temporal coherence between nearby denoising states. A plausible implication is that the dual-branch view shifts the emphasis from handcrafting separate objectives toward specifying the appropriate notion of latent consistency.

## 4. Dual-branch guidance in geometry-aware NeRF inpainting

GB-NeRF formulates NeRF inpainting as optimization of a differentiable generator under 2D diffusion priors and introduces Balanced Score Distillation (BSD), which also adopts a dual-branch structure, but here the branches are appearance RGB and geometry normals [2411.15551]. The overall objective is
$$
L_{\mathrm{BSD}}(\theta)=\lambda_{\mathrm{app}}L_{\mathrm{app}}(\theta)+\lambda_{\mathrm{geo}}L_{\mathrm{geo}}(\theta).
$$

For the appearance branch, an RGB rendering $I=R_{\mathrm{RGB}}(g(\theta),c)$ is encoded as latent $x=E_{\mathrm{VAE}}(I)$, then noised as
$$
x_t=\alpha_t x+\sigma_t \epsilon.
$$
BSD removes the unconditional term and balances positive and negative prompts:
$$
\delta_x^{\mathrm{BSD}}
=
\omega_1 \hat{\epsilon}_\phi(x_t;y,t)
-
\omega_2 \hat{\epsilon}_\phi(x_t;y_{\mathrm{neg}},t).
$$
The gradient is
$$
\nabla_\theta L_{\mathrm{app}}(\theta)
\approx
\mathbb{E}_{t,\epsilon}
\Big[
w_a(t)\,\delta_x^{\mathrm{BSD}}\,
\frac{\partial x}{\partial \theta}
\Big].
$$

For the geometry branch, a normal map $N=R_N(g(\theta),c)$ is encoded as $n=E_{\mathrm{VAE}}(N)$, and
$$
n_t=\alpha_t n+\sigma_t \epsilon.
$$
The corresponding BSD direction is
$$
\delta_n^{\mathrm{BSD}}
=
\omega_1 \hat{\epsilon}_\phi(n_t;y,t)
-
\omega_2 \hat{\epsilon}_\phi(n_t;y_{\mathrm{neg}},t),
$$
with
$$
\nabla_\theta L_{\mathrm{geo}}(\theta)
\approx
\mathbb{E}_{t,\epsilon}
\Big[
w_g(t)\,\delta_n^{\mathrm{BSD}}\,
\frac{\partial n}{\partial \theta}
\Big].
$$

The paper contrasts BSD with SDS and CSD. In its notation,
$$
\nabla_\theta L_{\mathrm{SDS}}(\theta)
\approx
\mathbb{E}_{t,\epsilon}
\Big[
w(t)\big(\hat{\epsilon}_\phi(x_t;y,t)-\epsilon\big)\frac{\partial x}{\partial \theta}
\Big],
$$
while CFG gives
$$
\hat{\epsilon}^{\mathrm{CFG}}_\phi(x_t;y,t)
=
\hat{\epsilon}_\phi(x_t;t)
+
\omega\big(
\hat{\epsilon}_\phi(x_t;y,t)-\hat{\epsilon}_\phi(x_t;t)
\big).
$$
GB-NeRF analyzes a CSD form
$$
\delta_x^{\mathrm{cls}}
=
\omega_1 \hat{\epsilon}_\phi(x_t;y,t)
+
(\omega_2-\omega_1)\hat{\epsilon}_\phi(x_t;t)
-
\omega_2 \hat{\epsilon}_\phi(x_t;y_{\mathrm{neg}},t),
$$
and reports that the unconditional prediction term $\hat{\epsilon}_\phi(x_t;t)$ introduces high variability: positive $\omega_3$ blurs reconstructions, negative $\omega_3$ causes artifacts, and best results arise near $\omega_3 \approx 0$. BSD therefore eliminates the unconditional term entirely.

This use of dual branches differs from UDS. In UDS, the two branches are a reconstruction or consistency term and a text term; in BSD, the two branches are appearance and geometry, each using the same positive-versus-negative conditional balancing principle. The commonality is the attempt to make score distillation more structured and less stochastic.

## 5. Optimization procedures and implementation regimes

In UDS, the paper gives explicit per-iteration procedures for editing and generation [2505.01888]. For editing, a camera $c$ is sampled, the current target view $x_0^{\mathrm{tgt}}=g(\theta,c)$ is rendered, and a source view $x_0^{\mathrm{src}}$ is prepared. Noise is added to both latents with the same $\epsilon$,
$$
x_t^{\mathrm{tgt}}=\sqrt{\bar{\alpha}_t}x_0^{\mathrm{tgt}}+\sqrt{1-\bar{\alpha}_t}\epsilon,\qquad
x_t^{\mathrm{src}}=\sqrt{\bar{\alpha}_t}x_0^{\mathrm{src}}+\sqrt{1-\bar{\alpha}_t}\epsilon,
$$
after which unconditional and conditional predictions are evaluated for target and source, $\hat{x}_0$ is approximated by Tweedie or DDIM inverse, and the gradient
$$
\nabla_\theta L_{\mathrm{UDS}}
=
\omega(t)\big[\Delta \hat{x}_0+w\,\Delta \delta_{x_t}^{\mathrm{cls}}\big]\frac{\partial g(\theta,c)}{\partial \theta}
$$
is used to update $\theta$.

For generation, the procedure samples camera, timestep, and noise; forms $x_t$ from the rendered view; evaluates $\epsilon_u^t=\epsilon_\phi(x_t,t,\varnothing)$ and $\epsilon_c^t=\epsilon_\phi(x_t,t,y)$; optionally constructs $x_{t-c}$ and $\epsilon_u^{t-c}$; approximates $\hat{x}_0^t$ and $\hat{x}_0^{t-c}$; then applies the same UDS template with generation-specific $\Delta$ terms. The paper states that UDS is mask-free by default, though localized edits can be implemented by restricting the image-space gradient to a region of interest.

The implementation details reported for UDS are specific. Stable Diffusion 2.1 is used for 3D generation, Stable Diffusion 1.5 for SVG editing, and both NeRF and 3D Gaussian Splatting are supported. The paper lists Threestudio and DreamFusion-style volumetric radiance fields for NeRF, LucidDreamer-style 3D Gaussian Splatting, random or stratified camera sampling, timestep sampling $t\sim \mathrm{Uniform}\{1,\dots,T\}$, stride $c$ for generation in the range $10$–$50$, and guidance weight $w\approx 7.5$. All reported experiments used a single NVIDIA 3090 GPU.

GB-NeRF likewise specifies a concrete optimization pipeline [2411.15551]. NeRF maps $(\gamma(p),\gamma(d))\mapsto (c,\sigma)$, with volumetric rendering
$$
\hat{C}(r)=\sum_i w_i c_i,\qquad
w_i=T_i(1-e^{-\sigma_i\delta_i}),\qquad
T_i=e^{-\sum_{j<i}\sigma_j\delta_j}.
$$
For unmasked regions, the method uses
$$
L_{\mathrm{unmask}}^a=\sum_{r\in R}\|\hat{C}(r)-C(r)\|^2,
$$
and optionally
$$
L_{\mathrm{unmask}}^g=\sum_{r\in R}\|\hat{D}(r)-D(r)\|^2.
$$
For masked regions, it encodes rendered RGB and normals through the Stable Diffusion VAE, applies BSD only within the NeRF mask $(1-m)$, and uses
$$
\nabla_\theta L_{\mathrm{mask}}^a
=
\mathbb{E}_{t,\epsilon}
\Big[
(\delta_x^{\mathrm{BSD}}\odot (1-m))\alpha_t \frac{\partial x}{\partial \theta}
\Big],
$$
$$
\nabla_\theta L_{\mathrm{mask}}^g
=
\mathbb{E}_{t,\epsilon}
\Big[
(\delta_n^{\mathrm{BSD}}\odot (1-m))\alpha_t \frac{\partial n}{\partial \theta}
\Big].
$$
The final loss is
$$
L=L_{\mathrm{unmask}}^a+\lambda_1 L_{\mathrm{unmask}}^g+\lambda_2 L_{\mathrm{mask}}^a+\lambda_3 L_{\mathrm{mask}}^g,
$$
with $\lambda_1=0.1$ and $\lambda_2=\lambda_3=10^{-4}$.

The paper also specifies a fine-tuned Stable Diffusion teacher with LoRA adapters inserted into both U-Net and text encoder, rank $r=32$, trained on DIODE RGB–normal pairs. BLIP captions from RGB are reused for normals, each caption prepended with a modality token, “RGB image” or “normal map.” Training uses 10,000 iterations, Adam with learning rate $10^{-4}$, a single NVIDIA A100, latent size $256\times 256$, and timestep sampling $t\sim U(0.02,0.98)$. BSD scales are $\omega_1=7.5,\omega_2=6.5$ for appearance and $\omega_1=1.5,\omega_2=0.5$ for geometry.

## 6. Empirical behavior, comparisons, and limitations

The UDS paper reports that, in 3D editing on a NeRF-based benchmark of 8 scenes and 37 prompt pairs, UDS achieves CLIP $\approx 0.2498$ and user preference $\approx 41.52\%$, outperforming IN2N ($\sim 0.2334$, $23.76\%$), DDS ($\sim 0.2030$, $4.52\%$), and PDS ($\sim 0.2395$, $30.20\%$). For 3D generation with Stable Diffusion 2.1 on NeRF and 3D Gaussian Splatting under a single 3090 GPU, UDS reports higher CLIP and user preference than DreamFusion, Fantasia3D, and ProlificDreamer, and reaches CLIP up to $\sim 0.2984$ and user preference $\sim 48.37\%$ relative to LucidDreamer SDS and ISM baselines. For SVG editing with Stable Diffusion 1.5, it attains LPIPS $\sim 0.3489$, CLIP $\sim 0.2576$, and user preference $\sim 27.64\%$ [2505.01888].

The same paper attributes part of this behavior to the choice of reconstruction branch. Using DDIM inversion for $\hat{x}_0$ preserves identity better than single-step Tweedie in editing, while Tweedie may reflect text edits more aggressively but risks identity drift. In generation, adding DDIM reverse-process noise improves quality but increases compute and resource cost. The paper also states that UDS shows lower variability and more stable gradient norms than SDS, DDS, PDS, and ISM in 3D.

GB-NeRF reports improvements on SPIn-NeRF and LLFF. On SPIn-NeRF, it reports FID $67.587$ versus $72.616$ for MVIP-NeRF, D-FID $150.473$ versus $172.127$, D-PSNR $14.157$ versus $13.914$, SSIM $0.4266$ versus $0.4208$, NIMA $4.550$ versus $4.455$, and BRISQUE $17.496$ versus $23.562$. On LLFF, it reports FID $270.923$ versus approximately $286$ for SDS baselines, NIMA $4.915$, and BRISQUE $11.711$. Ablations state that BSD alone reduces FID to $64.31$ versus $72.62$ for the origin, while LoRA fine-tuning significantly lowers D-FID to $147.33$ versus $172.13$ and improves BRISQUE and normal/detail reconstruction [2411.15551].

The limitations described in the two papers are also consistent with a dual-branch view. UDS identifies failure modes for large semantic gaps, an identity-versus-prompt trade-off controlled by $w$, sensitivity to timestep stride $c$, DDIM inversion overhead, and residual risk of oversaturation or color artifacts under poorly tuned $\omega(t)$ or negative guidance. GB-NeRF reports increased training time from the fine-tuned teacher and two-branch setup, sensitivity of hyperparameters $(\omega,\lambda)$ to dataset choice, inability to remove shadows reliably, and oversmoothing when the geometry branch is over-regularized. Taken together, these results suggest that dual-branch SDS improves control and stability, but does not remove the underlying dependence on diffusion priors, guidance schedules, and 3D initialization quality.

Source: https://www.emergentmind.com/topics/dual-branch-score-distillation-sampling-sds-f541d06d-52ca-445d-a416-68b326cdbc0c