Skip to main content
QUICK REVIEW

[Paper Review] Learning to Discover Efficient Mathematical Identities

Wojciech Zaremba, Karol Kurach|arXiv (Cornell University)|Jun 6, 2014
Natural Language Processing TechniquesComputer Science28 references35 citations
TL;DR

This paper introduces a learning-based framework that discovers computationally efficient mathematical identities by exploring symbolic expression trees via a grammar of operators. Using n-gram models and recursive neural networks trained on simpler identities, the method efficiently finds complex, low-complexity alternatives to expensive expressions—such as reducing O(n³) computations to O(n²)—that are infeasible for brute-force or manual search.

ABSTRACT

In this paper we explore how machine learning techniques can be applied to the discovery of efficient mathematical identities. We introduce an attribute grammar framework for representing symbolic expressions. Given a set of grammar rules we build trees that combine different rules, looking for branches which yield compositions that are analytically equivalent to a target expression, but of lower computational complexity. However, as the size of the trees grows exponentially with the complexity of the target expression, brute force search is impractical for all but the simplest of expressions. Consequently, we introduce two novel learning approaches that are able to learn from simpler expressions to guide the tree search. The first of these is a simple n-gram model, the other being a recursive neural-network. We show how these approaches enable us to derive complex identities, beyond reach of brute-force search, or human derivation.

Motivation & Objective

  • To address the challenge of discovering computationally efficient mathematical identities for complex symbolic expressions.
  • To overcome the exponential explosion in search space when enumerating all possible expression trees for a given target.
  • To leverage machine learning to generalize from solutions of simpler expressions and guide the search toward efficient identities.
  • To enable automated discovery of novel identities that reduce computational complexity from exponential or cubic to quadratic time.
  • To demonstrate that learned search strategies outperform random or brute-force methods on complex, previously intractable expressions.

Proposed method

  • Formalizes symbolic expressions using an attribute grammar framework that defines valid compositions of mathematical operators.
  • Represents expressions as trees built from grammar rules, where each node corresponds to an operation or operand.
  • Employs n-gram models to learn recurring patterns in successful expression trees from simpler targets (e.g., k=2 to k=5).
  • Trains a recursive neural network (RNN) to learn continuous vector representations of symbolic expressions and predict the next operation in a tree to minimize complexity.
  • Uses transfer learning: pre-train the RNN on expression representations, then fine-tune it to predict efficient next steps toward a target expression.
  • Applies a search strategy guided by the learned model to explore promising subtrees, avoiding exhaustive enumeration.

Experimental results

Research questions

  • RQ1Can machine learning models trained on simpler identities generalize to discover efficient identities for more complex expressions?
  • RQ2To what extent can n-gram and RNN-based models outperform random or brute-force search in discovering low-complexity symbolic identities?
  • RQ3How effective are different sequence modeling approaches (n-grams vs. RNNs) in capturing structural patterns in symbolic expression trees?
  • RQ4Can the framework discover identities that are too complex for manual derivation or exhaustive search?
  • RQ5What is the scalability of the learning-guided search strategy as expression complexity (e.g., degree k) increases?

Key findings

  • The n-gram and RNN-based search strategies successfully discovered identities that reduce computational complexity from O(n³) to O(n²) for matrix expressions, such as sum(sum(A*B)) and higher-degree products.
  • For k=6, the framework discovered an O(n²) identity for sum(sum((A*B)^k)) that is infeasible to find via brute-force or random search.
  • The 3-gram model outperformed the RNN on repetitive structures (e.g., alternating A*B patterns), achieving 100% success rate for k=2 and k=3.
  • On the most complex family (RBM-2), no method outperformed random search for k>5, but the RNN found the k=5 solution significantly faster (100±12 sec vs. 438±77 sec).
  • The number of possible expression trees grows rapidly with k: 9,785 for k=6, making exhaustive search infeasible beyond small k.
  • The recursive neural network learned a meaningful continuous representation of symbolic expressions, enabling effective generalization across structural patterns.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.