Parameter-Efficient Adaptation of Qwen3-VL for Handwritten Mathematical Expression Recognition

Manh Tuan Ha, Xuan Bao Viet Tran, Vo Minh Dat Nguyen, Minh Nhat Vo, Quoc Trung Nguyen, Van Bay NguyenarXiv 2026 · arXiv

TL;DR

Handwriting is messy, but handwritten math is a structural nightmare for AI because a tiny shift in position turns a "2" into a "squared." This paper shows that you can take a compact, 4-bit quantized vision-language model (Qwen3-VL) and, using a surgical fine-tuning technique called LoRA, teach it to recognize complex formulas with nearly 10x the accuracy of traditional custom-built baselines.

What Problem Does This Paper Address?

Recognizing handwritten math (HMER) is significantly harder than standard text OCR. In a sentence, words follow a predictable left-to-right line. In math, symbols exist in a two-dimensional dance: subscripts, superscripts, fractions, and nested radicals create a "syntax" where spatial relationships are just as important as the symbols themselves.

If a model recognizes every digit correctly but misses the fact that one is a superscript, the entire mathematical meaning is lost. Most existing systems struggle with this "structural gap"—they might get the "tokens" right but fail to assemble the "graph" of the equation correctly. The authors wanted to see if a modern, multimodal Large Language Model (LLM) could be adapted to solve this structural puzzle without requiring a supercomputer to train.

Methods

The researchers didn't build a model from scratch. Instead, they took Qwen3-VL-4B, a vision-language model already capable of "seeing" and "talking," and performed a "brain transplant" for mathematics.

Key technical choices included:

  • 4-bit Quantization: They used a compressed version of the model to save memory, making it accessible for researchers with limited hardware.
  • QLoRA (Rank-16): Instead of retraining all 4 billion parameters, they used Low-Rank Adaptation. This involves adding tiny, trainable "adapter" layers to the vision and language modules. It’s like keeping the original encyclopedia but adding a few highly specialized sticky notes on every page.
  • Linearized Symbol Label Graphs (SLGs): Rather than just outputting LaTeX code (like $x^2$), they trained the model to generate a "Symbol Label Graph." This format explicitly labels the relationships between symbols (e.g., "Symbol A is to the Right of Symbol B" or "Symbol C is Below the fraction bar").
Overall architecture of the proposed HMER framework.

Datasets

The primary benchmark was CROHME 2019 (Competition on Recognition of Online Handwritten Mathematical Expressions), a gold standard in the field.

To push the boundaries, the authors also created a supplementary set of 2,000 expressions. They generated diverse LaTeX formulas via script, rendered them, and then had humans manually rewrite them to capture natural stroke variations.

Corpus distribution and token statistics across dataset splits.

Key Insights and Ideas

  • Zero-Shot is Not Enough: A powerful vision-language model out of the box (zero-shot) scored 0% on exact matches. It can describe an image, but it doesn't inherently understand the rigid, specialized "grammar" of mathematical graphs without specific instruction.
  • The "Exact Match" Wall: There is a massive gap between a high BLEU score (which measures how many "words" the model got right) and an "Exact Match" (which means the whole formula is perfect). One single misplaced relation token—like calling a neighbor a superscript—invalidates the entire sequence.
  • More Data $\neq$ Better Results: Surprisingly, adding the 2,000 extra human-written samples actually decreased performance slightly (from 43.74% to 42.32%). This suggests that "domain alignment"—how closely the training handwriting matches the test handwriting—is more critical than just having a larger pile of data.

Key Results

The fine-tuned Qwen3-VL model blew the traditional baselines out of the water:

  • Exact Match Accuracy: The model achieved 43.74%, compared to a measly 4.92% for a task-specific ViT-Transformer baseline.
  • BLEU-4 Score: It reached 77.67, nearly double the baseline's 43.26.
  • Efficiency: By using QLoRA, they achieved these results with a fraction of the trainable parameters usually required for such a leap in performance.
Main performance comparison and ablation on the CROHME test set.

Limitations and Future Work

While the results are impressive, the authors note several hurdles:

  • Long Sequences: Errors tend to snowball in long, complex equations. If the model makes a mistake early in a long string, the rest of the structure often collapses.
  • Visual Ambiguity: Some handwriting is so cramped that "right-neighbor" and "superscript" relations look identical, leading to "visually plausible" but mathematically incorrect transcriptions.
  • Future Directions: The authors suggest moving toward grammar-constrained decoding (forcing the model to follow math rules) and using more sophisticated data filtering to ensure that synthetic data actually helps rather than hurts.

Summary updated

Abstract

Handwritten mathematical expression recognition (HMER) requires joint recovery of symbol identity and two-dimensional syntax, so a locally plausible transcription may still be structurally wrong. We study whether a compact vision-language model can be adapted to generate linearized Symbol Label Graphs (SLGs) under limited computing resources. Starting from a 4-bit Qwen3-VL-4B checkpoint, we apply rank-16 Low-Rank Adaptation to the vision, language, attention, and MLP modules and train with instruction-formatted CROHME 2019 examples. We compare this model with an internally implemented ViT-Transformer baseline, a zero-shot Qwen3-VL configuration, and additional internally evaluated alternatives. On the 1,198 valid CROHME test examples, the CROHME-only model obtains 524 exact matches (43.74%) and a corpus BLEU-4 score of 77.67, compared with 4.92% and 43.26 for the task-specific ViT baseline. An ablation that adds 2,000 manually written, formula-guided samples decreases exact match to 42.32%, exposing a domain-alignment issue rather than an automatic benefit from more data. The principal contribution is therefore an evidence-backed, resource-efficient formulation of HMER as multimodal structural generation, together with a controlled data-composition ablation and an analysis of the remaining gap between local token overlap and globally correct structure.
BibTeX
@misc{ha2026parameter,
  author = {Manh Tuan Ha and Xuan Bao Viet Tran and Vo Minh Dat Nguyen and Minh Nhat Vo and Quoc Trung Nguyen and Van Bay Nguyen},
  title = {{Parameter-Efficient Adaptation of Qwen3-VL for Handwritten Mathematical Expression Recognition}},
  year = {2026},
  eprint = {2611.27208},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.27208},
}
Figure