Tree-Based Representation and Generation of Natural and Mathematical Language

Alexander Scarlatos, Andrew Lan


Abstract
Mathematical language in scientific communications and educational scenarios is important yet relatively understudied compared to natural languages. Recent works on mathematical language focus either on representing stand-alone mathematical expressions, especially in their natural tree format, or mathematical reasoning in pre-trained natural language models. Existing works on jointly modeling and generating natural and mathematical languages simply treat mathematical expressions as text, without accounting for the rigid structural properties of mathematical expressions. In this paper, we propose a series of modifications to existing language models to jointly represent and generate text and math: representing mathematical expressions as sequences of node tokens in their operator tree format, using math symbol and tree position embeddings to preserve the semantic and structural properties of mathematical expressions, and using a constrained decoding method to generate mathematically valid expressions. We ground our modifications in GPT-2, resulting in a model MathGPT, and demonstrate that it outperforms baselines on mathematical expression generation tasks.
Anthology ID:
2023.acl-long.205
Volume:
Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
Month:
July
Year:
2023
Address:
Toronto, Canada
Editors:
Anna Rogers, Jordan Boyd-Graber, Naoaki Okazaki
Venue:
ACL
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
3714–3730
Language:
URL:
https://aclanthology.org/2023.acl-long.205
DOI:
10.18653/v1/2023.acl-long.205
Bibkey:
Cite (ACL):
Alexander Scarlatos and Andrew Lan. 2023. Tree-Based Representation and Generation of Natural and Mathematical Language. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 3714–3730, Toronto, Canada. Association for Computational Linguistics.
Cite (Informal):
Tree-Based Representation and Generation of Natural and Mathematical Language (Scarlatos & Lan, ACL 2023)
Copy Citation:
PDF:
https://preview.aclanthology.org/nschneid-patch-2/2023.acl-long.205.pdf
Video:
 https://preview.aclanthology.org/nschneid-patch-2/2023.acl-long.205.mp4