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

Hongbo Zheng, Suyuan Wang, Neeraj Gangwar, Nickvash Kani
1/24/2025
cs.LGcs.CLcs.SC

No official code found. Best implementation: hongbozheng/E-Gen (2 stars, Rust, last commit 2025-05-11).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

hongbozheng/E-GenCommunity58%
Rust

Official Repository for "E-Gen: Leveraging E-Graphs to Improve Continuous Representations of Symbolic Expressions".

21Rust, ShellDec 28, 20241 years agoNOASSERTION

Similar Papers

Cite this paper

@article{zheng2025egen,
  title  = {E-Gen: Leveraging E-Graphs to Improve Continuous Representations of Symbolic Expressions},
  author = {Hongbo Zheng and Suyuan Wang and Neeraj Gangwar and Nickvash Kani},
  year   = {2025},
  eprint = {2501.14951},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.14951v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2501.14951.svg)](https://codeofpaper.com/paper/2501.14951)

Discussion