Abstract
Complex structures are typical in machine learning. Tailoring learning algorithms for every structure requires an effort that may be saved by defining a generic learning procedure adaptive to any complex structure. In this paper, we propose to map any complex structure onto a generic form, called serialization, over which we can apply any sequence-based density estimator. We then show how to transfer the learned density back onto the space of original structures. To expose the learning procedure to the structural particularities of the original structures, we take care that the serializations reflect accurately the structures' properties. Enumerating all serializations is infeasible. We propose an effective way to sample representative serializations from the complete set of serializations which preserves the statistics of the complete set. Our method is competitive or better than state of the art learning algorithms that have been specifically designed for given structures. In addition, since the serialization involves sampling from a combinatorial process it provides considerable protection from overfitting, which we clearly demonstrate on a number of experiments.
Introduction
In the world of machine learning, data often transcends simple vector representations, manifesting as complex structures such as sets of points, branching trees, or intricate molecular graphs. Traditionally, researchers have faced a binary choice: either squash these structures into fixed-length vectors—often losing vital information—or build custom, highly specialized neural architectures for every new data type.
This paper introduces a third paradigm: mapping complex structures onto generic sequences, or "serializations," allowing the use of standard sequence-based models like Recurrent Neural Networks (RNNs) without sacrificing structural integrity. The proposed framework, S-RNN (Structural RNN), decouples the learning algorithm from structural specifics, creating a generic procedure adaptive to any complex data form.
The S-RNN Framework
The S-RNN framework rests on the principle of stochastic serialization. Rather than defining a single "canonical" sequence for a structure, S-RNN samples multiple equivalent sequences during training. For instance, a set {A, B, C} can be represented by any permutation of its elements, such as [A, B, C] or [C, B, A].
To ensure the model recognizes these sequences as representations of the same underlying object, S-RNN employs two key mechanisms:
- State-Transition Mapping: Partial sequences representing the same partial structure (e.g., [A, B] and [B, A] both representing the subset {A, B}) are mapped to the same internal state.
- Structural Regularization: A loss term penalizes discrepancies in hidden states for structurally equivalent sequences, forcing the model to learn the underlying "logic" of the structure (e.g., that order does not matter for sets).
Experimental Evaluation
The versatility of S-RNN was tested across diverse domains including 3D point clouds (Sets), molecular boiling point prediction (Trees), chemical property estimation (Graphs), and human gait analysis (Dynamical Systems).
Key findings include:
- Generalization: S-RNN matched or exceeded the performance of specialized architectures like "Deep-Sets" and "Doubly-Recurrent Neural Networks." On ModelNet point cloud tasks, it achieved 82-87% accuracy, matching state-of-the-art specialized models.
- Overfitting Protection: A standout feature of S-RNN is its inherent resistance to overfitting. While standard RNNs often show a widening gap between training and test performance, S-RNN's learning curves remain tightly coupled across various tasks, as shown in the experimental plots above.
- The Value of Randomization: In molecular tasks, using randomized (non-canonical) SMILES strings led to significantly better generalization than using fixed canonical strings. The variety of serializations acts as a powerful built-in regularizer, forcing the model to learn representations compatible with all valid views of the data.
Conclusion
S-RNN demonstrates that generic sequence models can be highly effective for complex structural learning when paired with stochastic serialization. By viewing data from multiple "angles" through randomized sequences, the model naturally learns structural invariances. This approach suggests that we do not always need bespoke architectures for complex data; sometimes, the best way to learn a structure is to look at it one sequence at a time.
Summary updated