TLDR: GTED (Generalized Tree Edit Distance) is a new evaluation metric for automatically translating natural language into formal mathematical statements. It works by converting statements into “operator trees” and measuring their structural similarity, outperforming existing methods in accuracy and agreement with human judgment, and offering a more robust and cost-effective solution.
In the rapidly evolving field of artificial intelligence, a significant area of research is dedicated to “autoformalization.” This involves the automated translation of natural language statements, such as mathematical theorems, into precise formal languages like Lean, Isabelle, or Coq. These formal languages are crucial for rigorously verifying the correctness of proofs, but the manual process of formalization is incredibly time-consuming and requires deep expertise.
Despite the advancements in autoformalization, a major challenge has been the lack of robust, automated methods to evaluate the quality of these translations. Existing evaluation metrics often fall short. Some methods, based purely on syntax, might check if the formal statement follows grammatical rules but miss the underlying meaning. Others, like text similarity metrics, are too sensitive to minor wording changes and don’t capture deeper logical equivalence. Proof-based approaches, while logically rigorous, are limited by the current capabilities of automated theorem provers, often failing to recognize valid formalizations if the prover can’t find a proof. Even evaluations assisted by large language models (LLMs) face issues with reproducibility and high computational costs.
Introducing GTED: A New Approach to Evaluation
To address these limitations, researchers have proposed a novel evaluation framework called GTED, which stands for Generalized Tree Edit Distance. This innovative metric aims to provide a more faithful and semantically aware way to assess autoformalized statements. The core idea behind GTED is to transform formal statements into a structured representation called “operator trees” and then measure the semantic similarity between these trees using a generalized tree edit distance calculation.
The GTED framework operates in three main stages. First, it standardizes the formal statements. This involves processes like “theorem rewriting” and “variable expansion” using tools like the Lean Language Server. This step helps to eliminate superficial syntactic variations, ensuring that statements with the same meaning are represented consistently. For example, it might add missing type information or expand compact variable declarations into individual ones, making the structure clearer.
Second, the standardized statements are converted into “operator trees” (OPTs). These trees are powerful data structures that capture both the visual layout and the underlying syntactic hierarchy of mathematical notation. They represent operators (like addition, equality, or quantifiers) as internal nodes and variables or constants as leaf nodes. During this construction, the framework uses “placeholder representation” to outline the tree’s components and deliberately removes “parentheses” which are often just artifacts of linear text and are implicitly handled by the tree’s structure.
Finally, the GTED metric is calculated. This involves determining the “edit distance” between two operator trees – one representing the predicted formal statement and the other representing the ground-truth formal statement. This distance is then converted into a continuous similarity score between 0 and 1. Unlike a simple binary “correct/incorrect” decision, this continuous score allows for a more nuanced understanding of semantic similarity.
Superior Performance and Robustness
The researchers rigorously tested GTED against several existing evaluation metrics on two widely used benchmarks: miniF2F and ProofNet. The results demonstrated that GTED consistently outperformed all baseline metrics, achieving the highest accuracy and Kappa scores. Kappa is a statistical measure that indicates agreement beyond chance, and GTED’s high scores suggest a strong alignment with human expert judgments.
One key advantage of GTED is its robustness to threshold selection. While other metrics like BLEU might see significant performance drops with slight changes in their decision threshold, GTED maintains high and consistent performance over a much broader range of thresholds. This “flatness” makes GTED more practical and dependable in real-world applications, as it reduces the burden of finding a precise optimal threshold.
Furthermore, GTED proved to be competitive with, and often superior to, LLM-based evaluation methods like Majority Voting, while operating at a significantly lower computational cost. This makes GTED a highly advantageous tool for scenarios where efficiency and simplicity of deployment are critical. Unlike proof-based metrics, which can be overly conservative and miss many correct formalizations due to the limitations of current automated theorem provers, GTED offers a more balanced and comprehensive assessment.
Also Read:
- Teaching Language Models to Plan: A Post-Training Approach for Complex Problem Solving
- New Benchmark Reveals Gaps in AI’s Physics Reasoning
Future Directions
The development of GTED marks a significant step forward in the automated evaluation of statement autoformalization. The researchers plan to further enhance GTED by incorporating deeper mathematical domain knowledge. Immediate future work includes fully implementing “alpha-conversion,” which handles the renaming of variables without changing the statement’s essence. More broadly, they aim to address the current limitation of “semantic naivety,” where logically equivalent but syntactically different expressions (like x + y and y + x) might be incorrectly penalized. This will involve augmenting GTED with rewrite rules derived from fundamental mathematical axioms, ultimately transforming it into an even more robust and adaptable tool for gauging true mathematical meaning. You can find more details about this research in the full paper available at this link.


