NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Why Neural Networks Can Discover Symbolic Structures with Gradient-based Training: An Algebraic and Geometric Foundation for Neurosymbolic Reasoning

Peihao Wang, Zhangyang (Atlas) WangNeuS 2025

Abstract

While neural networks are proficient at statistical pattern recognition, their ability to perform discrete symbolic reasoning remains a subject of intense research. This paper establishes a rigorous theoretical foundation for how continuous gradient-based training can lead to the discovery of discrete symbolic rules. By modeling the training process as a Wasserstein gradient flow in measure space, we demonstrate that geometric symmetries—specifically $O(d)$-invariance—cause complex optimization dynamics to decouple into independent, compositional symbolic operations. This framework provides a mathematical explanation for the spontaneous dimension reduction and sample efficiency observed when neural architectures align with the algebraic structure of a task.

1. Introduction

The divide between connectionist AI (neural networks) and symbolic AI (logic-based systems) has long been a central challenge in the field. Neurosymbolic AI seeks to bridge this gap, yet we have lacked a fundamental mathematical explanation for how a system of continuous, floating-point weights can settle into a discrete symbolic structure. This paper addresses the underlying mechanism: under what conditions does gradient descent find the algebraic "skeleton" of a problem rather than merely overfitting the training data?

2. Theoretical Framework: Lifting to Measure Space

To analyze the emergence of structure, the research moves beyond the traditional view of individual weight updates. Instead, the problem is "lifted" into Measure Space, treating neural training as the evolution of a probability distribution of weights.

2.1 Wasserstein Gradient Flow

The authors model training dynamics as a Wasserstein gradient flow. This approach allows the study of how the entire distribution of weights moves toward an optimal configuration, rather than tracking high-dimensional point-wise trajectories.

2.2 Monomial Potentials and Algebraic Lifting

The training loss is reformulated as a composition of Monomial Potentials (MPs)—expectations of specific algebraic terms. By defining a commutative semi-ring structure on the space of measures, the authors treat weight distributions as algebraic objects. This allows the network's state to be decomposed into components that correspond to specific logical or algebraic operations.

3. The Role of Geometric Constraints

The core of the discovery process lies in $O(d)$-invariance (symmetry under rotation or reflection). When a network architecture or loss function respects these symmetries, the training dynamics undergo a significant simplification.

3.1 Gradient Decoupling

A pivotal finding of this work is the phenomenon of Gradient Decoupling. Under geometric constraints, the "velocity field" of the training process simplifies. Instead of a chaotic interaction between all weights, the evolution of each symbolic piece (represented by a monomial potential) follows an independent path. This suggests that the network effectively solves complex reasoning tasks by decomposing them into independent sub-problems.

3.2 Spontaneous Dimension Reduction

As training progresses, the network does not merely find a solution; it collapses the system's degrees of freedom. The dynamics move from a high-dimensional exploration to a low-dimensional manifold that mirrors the symbolic rules of the task. This reduction is bounded by the number of symbolic rules (monomials) required to represent the target function.

4. Key Mathematical Results

The paper formalizes these insights through three primary theorems:

  • Theorem 4.2 (Decoupled Dynamics): Mathematically proves that under $O(d)$-invariance, each monomial potential is optimized coordinate-wisely. This confirms that the network treats the reasoning task as a collection of independent satisfaction problems.
  • Theorem 4.4 (Degree of Freedom Reduction): Demonstrates that the effective dimension of the parameter space shrinks over time, with the number of active directions in weight space being limited by the task's underlying symbolic complexity.
  • Theorem 5.1 (Sample Complexity): Establishes that the more symmetry (invariance) a network possesses, the fewer data points it requires to internalize a symbolic rule, providing a theoretical basis for the efficiency of symmetry-aware architectures.

5. Case Study: Abelian Group Reasoning

The framework is applied to the task of learning the addition table of a finite Abelian group. Using a two-layer model with quadratic activations, the authors show that the network naturally discovers the group's structure. The $O(d)$-invariance of the setup ensures that the noise between different symbolic components is canceled out, allowing the underlying algebraic logic to emerge clearly from the gradient flow.

6. Discussion and Limitations

While providing a robust foundation, the current framework focuses primarily on Abelian (commutative) groups. Many real-world reasoning tasks involve non-commutative operations, such as 3D rotations or the hierarchical structures of natural language. Additionally, the proofs rely on idealized assumptions regarding the smoothness of activations and stationary data distributions, which may differ from the dynamics of modern large-scale models like Transformers.

7. Conclusion

This work provides a geometric and algebraic explanation for the "magic" of symbolic discovery in neural networks. By showing that symmetry leads to gradient decoupling and dimension reduction, the authors offer a path toward more interpretable and efficient neurosymbolic systems. Future research will focus on extending these principles to non-Abelian structures and reverse-engineering the symbolic rules embedded within large-scale pre-trained models.

Summary updated

BibTeX
@inproceedings{wang2025why,
  author = {Peihao Wang and Zhangyang (Atlas) Wang},
  title = {{Why Neural Networks Can Discover Symbolic Structures with Gradient-based Training: An Algebraic and Geometric Foundation for Neurosymbolic Reasoning}},
  booktitle = {NeuS},
  year = {2025},
}
Figure