SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.23566 · NeurIPS · 2025

Uni-MuMER: Unified Multi-Task Fine-Tuning of Vision-Language Model for Handwritten Mathematical Expression Recognition

Yuxuan Zhou, Yu Li, Liangcai Gao, Jin Jiang, Jianhua Zhu, Shuai Peng, Baole Wei

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 4 failures of our instrument; 0 no recorded run), measured 2026-11-24; 3 contract verdicts on these samples were measured on the host before the contract probe was jailed (2026-09-18T14:29:13Z) or are undated; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2505.23566.json · badge: /api/ran/2505.23566.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
bflameswift/uni-mumer canonical (classifier label)
classifier basis: classifier_2025
7 ran · 0 no recorded run
FunctionStatusWhere it lives
Node Ran
ran on a synthesized input · constructed an object; no result was computed
bflameswift/uni-mumer/preprocess/unimumer_tree/latex2tree.py
code served (permissive licence) · get_code("902d6fc90dfc3c3b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, Node: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from dataclasses import dataclass, field

@dataclass
class Node:
    x: str
    childs: list['Node'] = field(default_factory=list)
    relations: list[str] = field(default_factory=list)

# Create a simple tree structure with nested Node instances
child_node_1 = Node(x="child1", childs=[], relations=["rel1"])
child_node_2 = Node(x="child2", childs=[], relations=["rel2", "rel3"])

root_node = Node(
    x="root",
    childs=[child_node_1, child_node_2],
    relations=["parent_rel1", "parent_rel2"]
)

ARGS = {
    "x": "root_value",
    "childs": [
        Node(x="child_a", childs=[], relations=["relation_a"]),
        Node(x="child_b", childs=[], relations=["relation_b", "relation_c"])
    ],
    "relations": ["rel_1", "rel_2", "rel_3"]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Node — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Node output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
findendenv Ran
ran, honoured the contract we drafted
bflameswift/uni-mumer/preprocess/unimumer_tree/latex2tree.py
code served (permissive licence) · get_code("51b08bef9ae97ab4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# This function finds the index of the closing \end{env_name} token
# that matches an opening \begin{env_name} token at index 0.
# It takes a sequence of LaTeX tokens and an environment name.

# The function iterates through latex tokens looking for matching
# \begin and \end pairs, tracking nesting depth with num.

ARGS = {
    "latex": [
        "\\begin",
        "{equation}",
        "x",
        "=",
        "y",
        "\\end",
        "{equation}",
    ],
    "env_name": "equation",
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
findnextbracket Ran
ran, honoured the contract we drafted
bflameswift/uni-mumer/preprocess/unimumer_tree/latex2tree.py
code served (permissive licence) · get_code("fb7b689b9588f582")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from typing import Sequence

# Construct valid arguments for findnextbracket function
# The function takes:
# 1. latex: Sequence[str] - a sequence of string tokens
# 2. leftbracket: str - the opening bracket to search for (default '{')

# Test case 1: Basic curly bracket matching
latex_tokens = ['{', 'command', '{', 'nested', '}', '}']

ARGS = {
    'latex': latex_tokens,
    'leftbracket': '{'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_symbol_counts Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bflameswift/uni-mumer/preprocess/make_unimumer_tree_data.py
code served (permissive licence) · get_code("75ff77728a39652d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from pathlib import Path

# Analyze the function: get_symbol_counts takes a latex_string parameter
# and splits it by whitespace, counts tokens, and removes '{' and '}' entries

ARGS = {
    "latex_string": r"\frac{1}{2} x^2 + y \sin \theta \frac{1}{2} x"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
latex2Tree Ran
ran; our contract draft was wrong, not the code
bflameswift/uni-mumer/preprocess/unimumer_tree/latex2tree.py
code served (permissive licence) · get_code("b8f2bff4488c69d5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Node. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from dataclasses import dataclass, field
from typing import Sequence

EOL = '<eol>'

@dataclass
class Node:
    x: str
    childs: list['Node'] = field(default_factory=list)
    relations: list[str] = field(default_factory=list)

latex_categories = {
    'double_arg_cmds': ['\\frac', '\\cfrac'],
    'single_arg_cmds': ['\\dot', '\\ddot'],
    'optional_bracket_single_arg_cmds': ['\\sqrt'],
    'big_operator_cmds': ['\\sum', '\\lim'],
    'ordinary_cmds': ['\\alpha', '\\beta'],
    'ordinary_chars': ['a', 'b', 'c', '+', '-'],
    'delete_chars': ['\\text']
}

# Create a minimal valid LaTeX token sequence
latex_input = ['a', '+', 'b']

ARGS = {
    'latex': latex_input,
    'cats': latex_categories
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Node — a Node output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Node output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_count_dict2str Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bflameswift/uni-mumer/preprocess/make_unimumer_tree_data.py
code served (permissive licence) · get_code("92e5c6e686c8d6c2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from typing import Any

# Construct arguments for make_count_dict2str
count_dict = {
    'apple': 5,
    'banana': 3,
    'cherry': 8,
    'date': 1
}

ARGS = {
    'count_dict': count_dict
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
validate_record Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bflameswift/uni-mumer/preprocess/make_unimumer_tree_data.py
code served (permissive licence) · get_code("23ca323607bb2020")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from typing import Any

# Construct a valid record that satisfies validate_record requirements
record = {
    'images': ['/path/to/image.png'],
    'messages': [
        {'role': 'user', 'content': 'Convert this image to LaTeX'},
        {'value': r'\frac{x^2 + y^2}{z}'}
    ]
}

ARGS = {
    'record': record
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Handwritten Mathematical Expression Recognition (HMER) remains a persistent challenge in Optical Character Recognition (OCR) due to the inherent freedom of symbol layouts and variability in handwriting styles. Prior methods have faced performance bottlenecks by proposing isolated architectural modifications, making them difficult to integrate coherently into a unified framework. Meanwhile, recent advances in pretrained vision-language models (VLMs) have demonstrated strong cross-task generalization, offering a promising foundation for developing unified solutions. In this paper, we introduce Uni-MuMER, which fully fine-tunes a VLM for the HMER task without modifying its architecture, effectively injecting domainspecific knowledge into a generalist framework. Our method integrates three datadriven tasks: Tree-Aware Chain-of-Thought (Tree-CoT) for structured spatial reasoning, Error-Driven Learning (EDL) for reducing confusion among visually similar characters, and Symbol Counting (SC) for improving recognition consistency in long expressions. Experiments on the CROHME and HME100K datasets show that Uni-MuMER achieves super state-of-the-art performance, outperforming the best lightweight specialized model SSAN by 16.31% and the top-performing VLM Gemini2.5-flash by 24.42% under zero-shot setting. Our datasets, models, and code are open-sourced at: https://github.com/BFlameSwift/Uni-MuMER * Equal contribution, Corresponding authors. 39th Conference on Neural Information Processing Systems (NeurIPS 2025).

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2505.23566")
get_code_for_paper("2505.23566")
have("2505.23566")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2505.23566.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2505.23566.svg)](https://syntology.ai/paper/2505.23566)

Connect an agent — have() is free.