Skip to main content
QUICK REVIEW

[Paper Review] Combining Symbolic Expressions and Black-box Function Evaluations in Neural Programs

Forough Arabshahi, Sameer Singh|arXiv (Cornell University)|Jan 12, 2018
Machine Learning and Data ClassificationComputer Science9 citations
TL;DR

This paper proposes a novel neural programming framework that combines symbolic expressions and black-box function evaluations using tree LSTMs to improve generalization in mathematical equation learning. By jointly modeling symbolic structure and numerical function outputs, the model achieves state-of-the-art performance on equation verification and completion tasks, generalizing effectively to unseen expressions and numbers even with limited training data.

ABSTRACT

Neural programming involves training neural networks to learn programs, mathematics, or logic from data. Previous works have failed to achieve good generalization performance, especially on problems and programs with high complexity or on large domains. This is because they mostly rely either on black-box function evaluations that do not capture the structure of the program, or on detailed execution traces that are expensive to obtain, and hence the training data has poor coverage of the domain under consideration. We present a novel framework that utilizes black-box function evaluations, in conjunction with symbolic expressions that define relationships between the given functions. We employ tree LSTMs to incorporate the structure of the symbolic expression trees. We use tree encoding for numbers present in function evaluation data, based on their decimal representation. We present an evaluation benchmark for this task to demonstrate our proposed model combines symbolic reasoning and function evaluation in a fruitful manner, obtaining high accuracies in our experiments. Our framework generalizes significantly better to expressions of higher depth and is able to fill partial equations with valid completions.

Motivation & Objective

  • To address the poor generalization of existing neural programming models that rely solely on black-box function evaluations or detailed execution traces.
  • To leverage symbolic expressions—representing structural relationships between functions and variables—alongside black-box function evaluations to improve model generalization.
  • To design a scalable, flexible architecture that can learn multiple mathematical functions simultaneously through weight sharing across symbolic expression trees.
  • To develop a data generation strategy that ensures balanced and comprehensive coverage of symbolic identities and function evaluations for training.
  • To evaluate the framework on equation verification and completion tasks in trigonometry and elementary algebra, demonstrating superior performance and generalization.

Proposed method

  • Employ tree LSTMs to encode symbolic expression trees, with shared parameters across identical functions to enable joint learning of multiple mathematical functions.
  • Extend tree LSTMs to process numerical inputs from black-box function evaluations by encoding numbers via their decimal representation.
  • Use a hybrid training objective that incorporates both symbolic identity verification and function evaluation prediction.
  • Apply tree encoding for numbers to enable generalization to unseen numerical values during inference.
  • Design a data generation pipeline that produces diverse symbolic identities and corresponding function evaluation pairs with balanced coverage.
  • Utilize top-k accuracy and top-k minimum MSE as evaluation metrics for equation completion, distinguishing between symbolic and function evaluation tasks.

Experimental results

Research questions

  • RQ1Can combining symbolic expressions with black-box function evaluations lead to better generalization in neural program learning than using either modality alone?
  • RQ2How well can a neural model with tree-structured encoding generalize to unseen mathematical expressions and numbers not present in training data?
  • RQ3Does incorporating symbolic structure improve performance on equation completion and verification tasks compared to sequential or non-tree-structured models?
  • RQ4To what extent does the proposed data generation strategy ensure balanced and comprehensive coverage of the domain?
  • RQ5Can the model transfer knowledge across different mathematical domains, such as trigonometry and algebra, and do learned representations cluster meaningfully?

Key findings

  • The proposed Tree LSTM model with joint symbolic and function evaluation input achieves significantly higher top-1 accuracy on equation completion than models using only function evaluation data or only symbolic data.
  • Tree-structured models, particularly Tree LSTMs, outperform sequential models in both equation verification and completion tasks, demonstrating the importance of modeling compositional structure.
  • The model generalizes effectively to unseen numbers and symbolic expressions, as evidenced by high confidence predictions on previously unobserved values and structures.
  • For function evaluation tasks, the Tree LSTM achieves lower top-k minimum MSE than Tree NN across all k values, indicating more accurate and confident predictions.
  • The model generates multiple correct candidates with high confidence for symbolic equation completion, while correctly identifying the single correct value in function evaluation tasks.
  • The integration of symbolic expressions and function evaluations leads to a substantial performance gain, especially at k=1, highlighting the complementary nature of the two data types.

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.