arXiv:2606.19939cs.CV2026-06

无需标注位置,用结构先验生成手写公式

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

论文配图:DiffMath: Symbol- and Graph-Aware Latent Diffusion Transformer for Handwritten Mathematical Expression Generation
图 1 · 摘自论文原文
  • 用三元组表示符号关系与嵌套深度,构建生成导向的语法树
  • 在保留结构的隐空间中进行扩散生成,提升布局一致性
  • 适合需要高质量合成手写公式数据的研究者

手写数学表达式生成(HMEG)因表达式的二维复杂布局和长距离结构依赖而具有挑战性。现有方法通常依赖符号级边界框等显式空间监督,导致标注成本高且难以扩展。本文提出DiffMath,一种符号与图感知的潜在扩散框架,利用LaTeX固有的层次结构作为结构先验,避免了位置监督。首先,设计面向生成的关联抽象语法树(RelAST),将MathML树压缩为紧凑的三元组序列[S, R, D],每个标记直接编码符号身份、空间关系或嵌套深度。其次,引入MathVAE,通过符号感知和关系感知的感知正则化学习保持结构的潜在表示,确保隐空间同时捕捉字符语义与空间拓扑。第三,MathDiT在此结构化隐空间中执行条件去噪,并通过自适应层归一化(AdaLN)引入全局符号数量先验,增强结构连贯性。实验表明,DiffMath生成的表达式结构一致,性能优于现有方法,并通过合成数据增强显著提升下游OCR模型的准确率。

原文摘要 · Abstract (English)

Handwritten Mathematical Expression Generation (HMEG) is challenging due to the complex two-dimensional layouts and long-range structural dependencies of mathematical expressions. Existing methods typically rely on explicit spatial supervision, such as symbol-level bounding boxes, which incurs high annotation costs and limits scalability. In this work, we propose DiffMath, a symbol- and graph-aware latent diffusion framework that leverages the hierarchical structure inherent in LaTeX as a structural prior, eliminating the need for positional supervision. First, we design a Relational Abstract Syntax Tree (RelAST), a generation-oriented representation that distills MathML trees into compact triplet sequences [S, R, D], where each token directly encodes a symbol identity, spatial relation, or nesting depth. Second, we introduce MathVAE, which learns structure-preserving latent representations through symbol-aware and relation-aware perceptual regularization, ensuring that the latent space captures both character semantics and spatial topology. Third, MathDiT performs conditional denoising in this structured latent space, further guided by a global symbol-count prior via Adaptive Layer Normalization (AdaLN) to improve structural coherence. Experiments show that DiffMath produces structurally consistent handwritten expressions, achieves superior performance over existing methods, and improves the accuracy of downstream OCR models through synthetic data augmentation.

手写公式扩散模型结构生成

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。