                           UniDB: A Unified Diffusion Bridge Framework via Stochastic Optimal Control

where µ is a given state vector, θt denotes a scalar drift co-      4. Methods
efficient and gt represents the diffusion coefficient with θt ,
gt satisfying the specified relationship gt2 = 2λ2 θt where         4.1. Diffusion Bridges Constructed by SOC Problem
λ2 is a given constant scalar. Based on this, Generalized           The forward SDE of the Diffusion Bridge with Doob’s h-
Ornstein-Uhlenbeck Bridge (GOUB) is a diffusion bridge              transform is enforced to pass from the predetermined origin
model (Yue et al., 2023), which can address image restora-          x0 to the terminal xT . With a similar purpose, UniDB con-
tion tasks without the need for specific prior knowledge if         structs a SOC problem where the constraints are an arbitrary
we consider the initial state x0 to represent a high-quality        linear SDE of the forward diffusion with a given initial state,
image and the corresponding low-quality image xT = µ as             while the objective incorporates a penalty term steering the
the final condition. With the introduction of µ, xt tends to µ      forward diffusion trajectory towards the predetermined ter-
as timeRt progresses. RThrough Doob’s h-transform, denote           minal xT . Meanwhile, compared with the linear drift term
          t               t
θ̄s:t = s θz dz, θ̄t = 0 θz dz for simplification when s = 0        (2), we combined a given state vector term m with the same
       2      2       −2θ̄s:t                                       dimension as xt and its related coefficient ht which is a
and σ̄s:t = λ (1 − e          ), the forward process of GOUB
is formed as:                                                       simple reformulation and generalization of the parameters
                               !                                    in GOU process (5):
                       −2θ̄t:T
                     e
    dxt = θt + gt2 2              (xT − xt ) dt + gt dwt . (6)                            f (xt , t) = ft xt + ht m.             (10)
                       σ̄t:T

And the forward transition p(xt | x0 , xT ) is given by             Accordingly, our SOC problem with unified linear SDE (10)
                                                                    is formed as:
                p(xt | x0 , xT ) = N (µ̄′t , σ̄t′2 I),                               "Z
                                                                                        T
                                                                                                                          #
             2                                                                            1        2     γ u            2
           σ̄t:T                 σ̄ 2               σ̄ 2 σ̄ 2                 min E         ∥ut,γ ∥2 dt + ∥xT − xT ∥2
 µ̄′t = e−θ̄t 2  x0 + (1 − e−θ̄t t:T 2 )xT , σ̄t′2 = t 2t:T .                ut,γ ∈U   0 2               2
            σ̄T                   σ̄T                  σ̄T                                          
                                                              (7)    s.t.dxt = ft xt + ht m + gt ut,γ dt + gt dwt , xu0 = x0 .
Also, GOUB presents a new reverse ODE called Mean-ODE,
                                                                                                                           (11)
which directly neglects the Brownian term of (4):
                 h                                                  According to the certainty equivalence principle (Chen et al.,
         dxt = f (xt , t) + gt2 ∇xt log p(xT | xt )                 2023; Rout et al., 2024), the addition of noise or perturba-
                                             i                (8)   tions to a linear system with quadratic costs does not change
                   − gt2 ∇xt log p(xt | xT ) dt.                    the optimal control. Therefore, we can modify the SOC
                                                                    problem with the deterministic ODE condition to obtain the
3.3. Stochastic Optimal Control                                     optimal controller u∗t,γ as follows,
Stochastic Optimal Control (SOC) is a mathematical dis-                             Z T
                                                                                     1        2      γ            2
cipline that focuses on determining optimal control strate-                  min       ∥ut,γ ∥2 dt + ∥xuT − xT ∥2
                                                                          ut,γ ∈U    2               2                           (12)
gies for dynamic systems under uncertainty. By integrating                       0                     
stochastic processes with optimization theory, SOC seeks               s.t. dxt = ft xt + ht m + gt ut,γ dt, xu0 = x0 .
to identify the best control strategies in scenarios involving
randomness, as commonly encountered in fields like finance          We can derive the closed-form solution to the problem (12),
(Geering et al., 2010) and style transfer (Rout et al., 2024).      which leads to the following Theorem 4.1:
Considering the dynamics described in (1), let us exam-             Theorem 4.1. Consider the SOC problem
ine the following Linear Quadratic SOC problem (Bryson,                                     ¯ 2               R t (12), denote
                                                                    dt,γ = γ −1 + e2fT ḡt:T      , f¯s:t = s fz dz, h̄s:t =
2018; O’Connell, 2003; Kappen, 2008; Chen et al., 2023):            R t −f¯                     Rt      ¯
                                                                      s
                                                                                          2
                                                                         e z hz dz and ḡs:t = s e−2fz gz2 dz, denote f¯t , h̄t and
                                                                    ḡt2 for simplification when s = 0, then the closed-form
              "Z                                       #
                  T
                     1         2      γ u            2
      min E            ∥ut,γ ∥2 dt + ∥xT − xT ∥2                    optimal controller u∗t,γ is
     ut,γ ∈U     0 2                  2                     (9)
                                                                                                        ¯              ¯
 s.t. dxt = (f (xt , t) + gt ut,γ ) dt + gt dwt , xu0 = x0 ,                                ¯    xT − eft:T xt − mefT h̄t:T
                                                                              u∗t,γ = gt eft:T                              ,    (13)
                                                                                                            dt,γ
where xut is the diffusion process under control, x0 and xT
represent for the initial state and the preset terminal respec-     and the transition of xt from x0 and xT is
               2                                           2
tively, ∥ut,γ ∥2 is the instantaneous cost, γ2 ∥xuT − xT ∥2 is                                ¯                    ¯
                                                                                                                                   !
the terminal cost with its penalty coefficient γ. The SOC                    f¯t   dt,γ      efT ḡt2           e2fT h̄T ḡt2 
                                                                    xt = e              x0 +          xT + h̄t −                 m .
problem aims to design the controller ut,γ to drive the dy-                        d0,γ       d0,γ                  d0,γ
namic system from x0 to xT with minimum cost.                                                                                     (14)
