acceptodds
Under review as a conference paper at ICLR 2027

DiffMath: Symbol- and Graph-Aware Latent Diffusion Transformer for Handwritten Mathematical Expression Generation

Abstract

Handwritten Mathematical Expression Generation (HMEG) remains challenging because it requires accurate modeling of complex hierarchical structures and two-dimensional layouts. Existing methods typically rely on explicit spatial supervision to model expression layouts, resulting in high annotation costs and limited scalability. To address this, we propose , a structure-aware latent diffusion framework that leverages structural priors derived from LaTeX, thereby eliminating the need for positional supervision. First, we design a ational bstract yntax ree ( ), a generation-oriented structural representation that distills MathML trees into compact triplet sequences encoding symbol identities, spatial relations, and nesting depths. Building upon RelAST, we introduce , which learns a structure-preserving latent space through symbol-aware and relation-aware perceptual regularization, jointly encoding symbol semantics and structural topology. Finally, performs conditional denoising in the learned latent space conditioned on RelAST, further guided by a global symbol-count prior via Adaptive Layer Normalization (AdaLN) to improve structural coherence. Experiments demonstrate that DiffMath generates structurally consistent handwritten mathematical expressions, consistently outperforms existing HMEG methods, and effectively improves downstream OCR performance through synthetic data augmentation. The code will be publicly available.

Then back it, or bet against it.

Related papers

Open the market on this paper to see 7 more related papers.