1: decreasing timesteps (tk)k=K0 with tK=1 , t0=0 ; latent measurement {\color[rgb]{0.8789,0.375,0.0625}{\mathbf{y}}_{z}}={\mathcal{E}}({\color[rgb]{0.8789,0.375,0.0625}{\mathbf{y}}})\in\mathbb{R}^{d} ; learned latent operator Hψ ; noise level r ; DDIM parameters (ηk)k=K0 ; damping λ≥0 ; relaxation ρ∈(0,1] ; inner steps P ; CG budget C . 2: {\color[rgb]{1,0,0}{\mathbf{x}}}\sim\mathbf{N}(0,{\mathbf{I}}_{d})
3: for k=K−1 to 1 do 4: \hat{{\mathbf{x}}}_{0}\leftarrow\hat{{\mathbf{x}}}_{0}^{\theta}({\color[rgb]{1,0,0}{\mathbf{x}}},t_{k+1})
5: \hat{{\mathbf{x}}}_{1}\leftarrow\big({\color[rgb]{1,0,0}{\mathbf{x}}}-\alpha_{t_{k+1}}\hat{{\mathbf{x}}}_{0}\big)/\sigma_{t_{k+1}}
6: m←αtkx^0+(σtk2−ηk2)1/2x^1 ▹ bridge xtk∣xtk+1≈N(m,ηk2Id) 8: w′∼N(0,Id) 9: {\color[rgb]{0,0,1}{\mathbf{x}}_{t_{k}}^{\mathrm{pxy}}}\leftarrow{\mathbf{m}}+\eta_{k}{\mathbf{w}}^{\prime}
10: {\color[rgb]{0,0,1}\hat{{\mathbf{x}}}_{1}^{\prime}}\leftarrow\hat{{\mathbf{x}}}_{1}^{\theta}({\color[rgb]{0,0,1}{\mathbf{x}}_{t_{k}}^{\mathrm{pxy}}},t_{k}) ▹ noise latent re-estimated at tk 11: {\color[rgb]{0.1797,0.4883,0.1953}{\bm{\mu}}_{z}}\leftarrow({\mathbf{m}}-\sigma_{t_{k}}{\color[rgb]{0,0,1}\hat{{\mathbf{x}}}_{1}^{\prime}})/\alpha_{t_{k}} , ηz:=ηk/αtk ▹ clean prior given the current state and proxy 12: {\color[rgb]{0.1797,0.4883,0.1953}{\mathbf{z}}_{0}^{(0)}}\leftarrow({\color[rgb]{0,0,1}{\mathbf{x}}_{t_{k}}^{\mathrm{pxy}}}-\sigma_{t_{k}}{\color[rgb]{0,0,1}\hat{{\mathbf{x}}}_{1}^{\prime}})/\alpha_{t_{k}} ▹ Gauss–Newton expansion point 14: ξy∼N(0,Id) , ξz∼N(0,Id) 15: {\color[rgb]{0.8789,0.375,0.0625}\tilde{{\mathbf{y}}}_{z}}\leftarrow{\color[rgb]{0.8789,0.375,0.0625}{\mathbf{y}}_{z}}+r\,\bm{\xi}_{y} , {\color[rgb]{0.1797,0.4883,0.1953}\tilde{{\bm{\mu}}}_{z}}\leftarrow{\color[rgb]{0.1797,0.4883,0.1953}{\bm{\mu}}_{z}}+\eta_{z}\,\bm{\xi}_{z}
16: βk←ηz,min/ηz , c1←(1−βk2)1/2 ▹ ηz,min : smallest ηz in the schedule 18: for j=0 to P−1 do 19: {\color[rgb]{0.1797,0.4883,0.1953}{\mathbf{z}}_{a}}\leftarrow{\color[rgb]{0.1797,0.4883,0.1953}{\bm{\mu}}_{z}}+c_{1}({\color[rgb]{0.1797,0.4883,0.1953}{\mathbf{z}}_{0}^{(j)}}-{\color[rgb]{0.1797,0.4883,0.1953}{\bm{\mu}}_{z}})+\beta_{k}({\color[rgb]{0.1797,0.4883,0.1953}\tilde{{\bm{\mu}}}_{z}}-{\color[rgb]{0.1797,0.4883,0.1953}{\bm{\mu}}_{z}}) ▹ arc anchor, Appendix C 20: {\mathbf{h}}\leftarrow{\mathbf{H}}_{\psi}({\color[rgb]{0.1797,0.4883,0.1953}{\mathbf{z}}_{0}^{(j)}})
21: {\mathbf{J}}\leftarrow\partial{\mathbf{H}}_{\psi}/\partial{\mathbf{z}}_{0}\big|_{{\color[rgb]{0.1797,0.4883,0.1953}{\mathbf{z}}_{0}^{(j)}}} ▹ used only through JVPs and VJPs 22: W←diag(w) , wi∝∥Ji,:∥ ▹ inpainting; otherwise W=Id 23: {\mathbf{b}}\leftarrow{\mathbf{W}}\big({\color[rgb]{0.8789,0.375,0.0625}\tilde{{\mathbf{y}}}_{z}}-{\mathbf{h}}-{\mathbf{J}}({\color[rgb]{0.1797,0.4883,0.1953}{\mathbf{z}}_{a}}-{\color[rgb]{0.1797,0.4883,0.1953}{\mathbf{z}}_{0}^{(j)}})\big)
24: solve ((r2+λ)Id+ηz2WJJ⊤W)v=b ▹ at most C CG iterations 25: {\color[rgb]{0.1797,0.4883,0.1953}{\mathbf{z}}_{0}^{\star}}\leftarrow{\color[rgb]{0.1797,0.4883,0.1953}{\mathbf{z}}_{a}}+\eta_{z}^{2}{\mathbf{J}}^{\top}{\mathbf{W}}{\mathbf{v}}
26: {\color[rgb]{0.1797,0.4883,0.1953}{\mathbf{z}}_{0}^{(j+1)}}\leftarrow{\color[rgb]{0.1797,0.4883,0.1953}{\mathbf{z}}_{0}^{(j)}}+\rho\,({\color[rgb]{0.1797,0.4883,0.1953}{\mathbf{z}}_{0}^{\star}}-{\color[rgb]{0.1797,0.4883,0.1953}{\mathbf{z}}_{0}^{(j)}})
28: Return: {\mathcal{D}}\big(\hat{{\mathbf{x}}}_{0}^{\theta}({\color[rgb]{1,0,0}{\mathbf{x}}},t_{1})\big)