E-Gen: Leveraging E-Graphs to Improve Continuous Representations of Symbolic Expressions

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zheng, Hongbo, Wang, Suyuan, Gangwar, Neeraj, Kani, Nickvash
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915189368029184
author Zheng, Hongbo
Wang, Suyuan
Gangwar, Neeraj
Kani, Nickvash
author_facet Zheng, Hongbo
Wang, Suyuan
Gangwar, Neeraj
Kani, Nickvash
contents Vector representations have been pivotal in advancing natural language processing (NLP), with prior research focusing on embedding techniques for mathematical expressions using mathematically equivalent formulations. While effective, these approaches are constrained by the size and diversity of training data. In this work, we address these limitations by introducing E-Gen, a novel e-graph-based dataset generation scheme that synthesizes large and diverse mathematical expression datasets, surpassing prior methods in size and operator variety. Leveraging this dataset, we train embedding models using two strategies: (1) generating mathematically equivalent expressions, and (2) contrastive learning to explicitly group equivalent expressions. We evaluate these embeddings on both in-distribution and out-of-distribution mathematical language processing tasks, comparing them against prior methods. Finally, we demonstrate that our embedding-based approach outperforms state-of-the-art large language models (LLMs) on several tasks, underscoring the necessity of optimizing embedding methods for the mathematical data modality. The source code and datasets are available at https://github.com/MLPgroup/E-Gen.
format Preprint
id arxiv_https___arxiv_org_abs_2501_14951
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle E-Gen: Leveraging E-Graphs to Improve Continuous Representations of Symbolic Expressions
Zheng, Hongbo
Wang, Suyuan
Gangwar, Neeraj
Kani, Nickvash
Machine Learning
Computation and Language
Symbolic Computation
Vector representations have been pivotal in advancing natural language processing (NLP), with prior research focusing on embedding techniques for mathematical expressions using mathematically equivalent formulations. While effective, these approaches are constrained by the size and diversity of training data. In this work, we address these limitations by introducing E-Gen, a novel e-graph-based dataset generation scheme that synthesizes large and diverse mathematical expression datasets, surpassing prior methods in size and operator variety. Leveraging this dataset, we train embedding models using two strategies: (1) generating mathematically equivalent expressions, and (2) contrastive learning to explicitly group equivalent expressions. We evaluate these embeddings on both in-distribution and out-of-distribution mathematical language processing tasks, comparing them against prior methods. Finally, we demonstrate that our embedding-based approach outperforms state-of-the-art large language models (LLMs) on several tasks, underscoring the necessity of optimizing embedding methods for the mathematical data modality. The source code and datasets are available at https://github.com/MLPgroup/E-Gen.
title E-Gen: Leveraging E-Graphs to Improve Continuous Representations of Symbolic Expressions
topic Machine Learning
Computation and Language
Symbolic Computation
url https://arxiv.org/abs/2501.14951