Dual Orthogonal Guidance in HTG
- Dual Orthogonal Guidance (DOG) is a sampling strategy for diffusion-based handwritten text generation that replaces the unconditional branch with an orthogonalized negative prompt and triangular scheduling.
- The method improves readability and performance by removing parallel noise components, achieving lower Character Error Rates (e.g., 18.1% on OOV samples) compared to CFG and APG.
- DOG operates as a plug-and-play, test-time scheme that enhances style variability and minimizes artifacts without requiring retraining of existing models.
Dual Orthogonal Guidance (DOG) is a sampling guidance strategy for diffusion-based handwritten text generation (HTG) that replaces the unconditional branch of standard Classifier-Free Guidance (CFG) with an orthogonalized negative-prompt direction. In the formulation introduced for HTG, DOG constructs a negatively perturbed version of the content and style condition, predicts its noise, removes the component parallel to the positive prediction, and then injects the resulting direction through a time-dependent triangular schedule during denoising. The method is presented as a plug-and-play, test-time scheme requiring no retraining, and is reported to improve content clarity, reduce artifacts, and increase style variability on DiffusionPen and One-DM, including for out-of-vocabulary words and challenging or unseen handwriting styles (Nikolaidou et al., 23 Aug 2025).
1. Problem formulation in diffusion-based handwritten text generation
DOG is motivated by failure modes observed in diffusion HTG systems. Diffusion-based HTG approaches are described as achieving strong results on frequent, in-vocabulary words observed at training time and on regular styles, while remaining prone to memorizing training samples and struggling with style variability and generation clarity. Standard diffusion models are further described as tending to produce artifacts or distortions that harm readability, especially when the target style is difficult to produce (Nikolaidou et al., 23 Aug 2025).
Within this setting, the conditioning signal is split into desired content and style embeddings, written as . DOG is designed for the denoising phase rather than the training objective: it modifies sampling so that generation is steered away from artifact-inducing directions while preserving intended textual content. The paper’s summary characterizes the method through three coupled elements: a structured negative prompt, orthogonalization against the clean prediction, and a triangular guidance schedule. A common misunderstanding is to treat DOG as merely a variant of negative prompting; the formulation instead depends on the interaction of all three components, with ablations indicating that removing orthogonal projection or scheduling degrades generation quality (Nikolaidou et al., 23 Aug 2025).
2. Mathematical construction of the DOG direction
Let denote the current noisy latent at diffusion timestep , and let the model’s noise predictor under the true prompt be
DOG then forms a negative prompt by stochastically corrupting both content and style embeddings:
and evaluates the corresponding prediction
Before projection, the norm of is clipped to a threshold . DOG then isolates only the orthogonal component of with respect to 0:
1
2
The paper also gives an equivalent expression in terms of 3 and 4:
5
The final guided noise prediction is
6
This construction is explicitly positioned as a disentangled latent-space direction: the parallel component of the negative prediction is removed, so the guidance acts only through the orthogonal remainder. In the comparison given in the paper, this is framed as content-preserving because “we never push parallel to 7” (Nikolaidou et al., 23 Aug 2025).
3. Triangular scheduling across the denoising trajectory
DOG does not apply a constant guidance scale at every timestep. Instead, it uses a triangular schedule that is weak at early and late steps and peaks in the middle of denoising. If 8 is the total number of denoising steps and 9 is a designated peak timestep, then
0
and
1
where 2 is the base guidance scale.
The stated intuition is threefold. For 3, guidance remains minimal while the sample is still mostly noise. For 4, guidance is strongest when coarse structure forms. For 5, guidance tapers off so that fine refinement can proceed without over-conditioning. The paper’s ablations report that removing scheduling causes images to become noisy at high guidance scales, and that a peak near mid-denoising, specifically 6, gives the best balance, whereas peaks that are too early or too late harm quality (Nikolaidou et al., 23 Aug 2025).
Within a DDIM sampling loop, DOG is introduced by replacing CFG’s unconditional branch with the negative-prompt prediction, clipping its norm, orthogonalizing it, computing the triangularly scheduled scale, and using the resulting 7 in the usual DDIM update. The hyperparameters listed for this process are 8, 9, 0, 1, 2, and 3 (Nikolaidou et al., 23 Aug 2025).
4. Relation to classifier-free and projected guidance methods
The paper contrasts DOG most directly with standard CFG. In the notation given there, CFG combines conditional and unconditional predictions as
4
At high 5, this is described as often oversaturating or injecting artifacts. DOG replaces 6 with an orthogonalized negative-prompt direction, yielding a guidance vector that is described as disentangled from the core signal, more stable at large guidance scales because of scheduling, and content-preserving because the parallel component to the positive prediction is removed (Nikolaidou et al., 23 Aug 2025).
The comparison extends to APG (“Adaptive Projected Guidance”). Empirically, DOG is reported to achieve lower Character Error Rates (CER) and fewer visual artifacts than both CFG and APG, especially when 7. A related evaluation caveat is explicitly noted: FID is stated to be unreliable for HTG, because DOG can produce visually cleaner samples despite higher FID. This matters because the method is aimed at readability, stylistic fidelity, and text correctness rather than optimization against a single image-distribution metric (Nikolaidou et al., 23 Aug 2025).
5. Reported empirical results on IAM and GNHK
DOG was evaluated on two HTG backbones, DiffusionPen and One-DM, using IAM and GNHK. The reported quantitative highlights span out-of-vocabulary generation, downstream handwriting recognition augmentation, standard generation metrics, and ablations (Nikolaidou et al., 23 Aug 2025).
| Setting | Comparator(s) | Reported DOG result |
|---|---|---|
| HTG_OOV CER on 8K OOV samples | No guidance: 22.8%; CFG (best 9): 19.9%; APG (best 0): 20.8% | 18.1% with DOG (best 1) |
| HTR training on IAM + synthetic data | Real IAM only: 3.58% val, 4.92% test; + DiffusionPen generated: 2.43% val, 4.17% test | 2.27% val, 3.99% test with DOG-guided generation |
| IAM test metrics for 2 | CFG and APG degrade beyond 3 | DOG always achieves lowest CER, approximately 7–7.8% |
The ablation findings are central to interpreting the method. Removing orthogonal projection is reported to cause generation collapse under noise. Removing scheduling makes images noisy at high 4. For the negative prompt itself, using unconditional 5 is less effective than directly corrupting style or content. The reported best balance occurs near mid-denoising with 6 (Nikolaidou et al., 23 Aug 2025).
Qualitatively, DOG is described as greatly reducing speckle-like artifacts, producing diverse variants of the same word-style pair under repeated sampling with fresh noise, and maintaining readability together with stylistic fidelity on truly unseen styles in GNHK, where baseline samplers struggle. These observations align with the method’s stated objective of combining clarity with controlled diversity rather than forcing a single deterministic rendering (Nikolaidou et al., 23 Aug 2025).
6. Interpretation, scope, and related orthogonal-guidance formulations
DOG is specific to diffusion-based HTG and operates entirely at test time. It is therefore best understood as a sampler-side control mechanism rather than a training-time architecture change. The summary states that implementing it requires no retraining and that it is plug-and-play with existing HTG diffusion models. This suggests that its practical value lies in modifying guidance geometry without changing the underlying denoiser, which is relevant for systems already trained on datasets such as IAM or GNHK (Nikolaidou et al., 23 Aug 2025).
A broader methodological context is provided by related orthogonal-guidance ideas outside HTG. In flow-matching robot policies, the method "POTR" introduces a prior-corrected orthogonal trust-region guidance that decomposes a guidance vector into components parallel and perpendicular to the denoising velocity and constrains the perpendicular component within a trust region. In that setting, the prior-corrected weight provides stronger intermediate-time correction, while the orthogonal trust region improves stability; on LIBERO with 7, POTR improves success rate and reduces chunk-boundary discontinuity, acceleration, and jerk relative to RTC (Fang et al., 23 May 2026). This suggests that projection-based control of transverse perturbations has broader relevance, but the HTG formulation of DOG and the robotics formulation of POTR act on different latent objects, with different schedules, constraints, and evaluation targets.
Within HTG itself, the most important interpretive caution is that DOG should not be reduced to a simple “stronger CFG.” Its defining components are the structured negative prompt, orthogonal decomposition, and triangular scheduling taken together. The reported improvements in OOV CER, readability, and style variability, alongside the ablations showing collapse without orthogonal projection and noise without scheduling, indicate that the method’s contribution is geometric and temporal rather than merely scalar rescaling of guidance (Nikolaidou et al., 23 Aug 2025).