Generalising Recursive Neural Models by Tensor Decomposition

Daniele Castellana, Davide Bacciu · DOI

Recursive Neural Networks (Tree-RNNs) are powerful tools for processing structured data like sentence parse trees or mathematical expressions. However, they often rely on simple summation for node aggregation, which fails to capture complex interactions between child nodes. While full tensor models can capture these interactions, they suffer from exponential parameter growth as the number of children increases. This paper introduces a general framework for tensor-based aggregation in Tree-RNNs using Tucker decomposition (specifically HOSVD), allowing for high-expressivity models that remain parameter-efficient.

The Challenge of Structured Aggregation

To compute the representation of a "parent" node in a tree, a model must aggregate information from its "children." Most existing models use a weighted sum for this task. While efficient, this "bag-of-children" approach assumes that each child contributes independently to the parent, missing complex dependencies between siblings.

The alternative—using a full tensor to model all possible interactions—is mathematically powerful but suffers from the "curse of dimensionality." For a tree where nodes have multiple children (high outdegree), a full tensor model becomes too massive to train or fit in memory, as the parameter count grows exponentially with the number of children.

Methods: HOSVD-Compressed Aggregation

The authors propose a framework that replaces standard summation with a multi-affine map represented by a high-order tensor. To solve the parameter explosion problem, they apply High-Order Singular Value Decomposition (HOSVD), also known as Tucker decomposition.

The proposed tensor-based aggregation mechanism. Hidden states of children ($h_1 \dots h_L$) and input $x$ are projected into a lower-dimensional interaction space before being combined by a core tensor $G$.

As shown in the diagram, the HOSVD approach decomposes a giant interaction tensor into a small "core tensor" $G$ and several "mode matrices" ($w, u_1, \dots, u_L$). This introduces a new hyperparameter: rank ($r$). The mode matrices project large hidden states (size $c$) into a smaller interaction space (size $r$), where the core tensor handles complex multi-way interactions. This allows the model to increase the hidden state size to improve expressivity without being punished by an exponential increase in parameters; complexity becomes linear with respect to $c$ and exponential only with respect to the much smaller rank $r$.

Experimental Evaluation

The models were evaluated on two key benchmarks:

  • Logical Relations Trees (LRT): A dataset of logical expressions (using and, or, not) where the goal is to determine the logical relationship between sentences.
  • ListOps: A diagnostic dataset consisting of nested list operations (e.g., max, min, median) in prefix notation. These trees have a higher outdegree (up to 5 children), making them a perfect test for the HOSVD approach.

Key Results

The most striking results appeared in the ListOps task, where the meaning of one child depends heavily on its siblings and the specific operation being performed.

Development accuracy vs. number of parameters on the ListOps task. The Hosvd-LSTM models achieve significantly higher accuracy with orders of magnitude fewer parameters than the Sum or Full baselines.

On the ListOps task, the Hosvd-LSTM significantly outperformed both the standard Sum-LSTM and the Full-LSTM:

  • Hosvd-LSTM achieved ~94.5% accuracy with only ~3.3k parameters.
  • Sum-LSTM struggled to reach ~83% even with ~228k parameters.
  • Full-LSTM reached ~82% but required over 229k parameters and was limited by a very small hidden state size to keep the model tractable.

On the binary LRT task, Hosvd-LSTM matched the performance of the Full-LSTM (~91% accuracy) but used roughly 100x fewer parameters (12k vs 1M).

Conclusion

By breaking the exponential link between branching factor and parameter count, HOSVD-based recursive models offer a path toward more expressive and efficient structured learning. While the rank hyperparameter adds complexity to model selection, the performance gains on tasks requiring complex sibling interactions are substantial. Future work may explore other decomposition types, such as Tensor Train or Canonical Polyadic (CP), to further optimize these architectures.

Summary updated

BibTeX
@inproceedings{castellana2020generalising,
  author = {Daniele Castellana and Davide Bacciu},
  title = {{Generalising Recursive Neural Models by Tensor Decomposition}},
  booktitle = {IJCNN},
  year = {2020},
  doi = {10.1109/ijcnn48605.2020.9206597},
}
Figure