A Framework for End-to-End Learning on Semantic Tree-Structured Data

Ke Chen, William Woof, Ke Chen 0001arXiv 2020

Abstract

Modern machine learning models typically require inputs to be formatted as fixed-length feature vectors, creating a "vector bottleneck" for hierarchical data like JSON or XML. This paper introduces the Semantic Tree-structured Recursive Learning Architecture (STRLA), a framework that processes such data directly by mirroring its natural tree structure. By employing recursive neural networks with type-specific encoders and permutation-invariant container functions, STRLA achieves state-of-the-art performance and exceptional data efficiency on complex hierarchical datasets.

Introduction: Overcoming the Vector Bottleneck

Most traditional machine learning algorithms struggle with data that isn't naturally flat. Real-world information—from web APIs to medical records—is often stored in flexible, hierarchical formats. To process this data, engineers typically "flatten" it manually, a process that is labor-intensive, loses structural context, and fails to handle variable-length lists (variadicity) effectively.

Figure 1: Mapping a JSON object to its corresponding semantic tree structure, identifying primitives (leaf nodes) and containers (branch nodes).

STRLA addresses this by treating data structures as trees where leaf nodes are "primitives" (raw values like strings or numbers) and branch nodes are "containers" (objects or arrays). This allows the model to learn directly from the raw hierarchy without manual preprocessing.

The STRLA Architecture

The core of STRLA is a recursive embedding process that builds a neural network dynamically for each data entry.

Key Components:

  • Element Paths: To resolve semantic ambiguity (e.g., distinguishing a "home address" from a "work address"), the model prepends the full path from the root to each node. This provides global context to local data points.
  • Recursive Embedding: Data is processed bottom-up. Primitives are converted into latent vectors using specialized encoders, such as LSTMs for strings or linear layers for numerical values.
  • Container Functions: Branch nodes aggregate child vectors. STRLA uses Deep Set-based pooling for JSON objects (ensuring permutation invariance) and LSTM-based aggregation for arrays (preserving order).
Figure 6: The recursive embedding process. (a) Primitives are encoded via type-specific functions, and (b) these are aggregated into container representations.

Experimental Results and Data Efficiency

The authors evaluated STRLA across several domains, demonstrating its superiority over standard Multi-Layer Perceptrons (MLPs):

  1. UCI Benchmarks: On datasets like Car Evaluation and Nursery, STRLA achieved 100% accuracy, whereas MLPs struggled to capture the latent hierarchical logic, peaking at ~80-95%.
  2. Poker Hands: This task highlighted STRLA's extreme data efficiency. By inherently understanding that the order of cards in a hand is irrelevant (via permutation invariance), STRLA reached 96.1% accuracy using only 5% of the training data. The MLP baseline managed only 47.7% with the same data.
  3. Reinforcement Learning: In grid-world tasks (Py-VGDL), an agent using raw JSON state representations performed as well as those using hand-crafted features, proving the framework's utility in complex decision-making environments.

Key Insights

  • Hierarchy as an Inductive Bias: Respecting the "shape" of data acts as a powerful prior, allowing models to recover logical structures that flat models miss.
  • The Power of Invariance: Using Deep Sets for objects prevents the model from needing to learn every possible permutation of key-value pairs, drastically reducing the required training volume.
  • Contextual Disambiguation: Element paths allow the same primitive encoder to function differently based on its location in the tree, providing necessary spatial awareness.

Limitations and Future Directions

The primary challenge for STRLA is computational overhead. Because the network architecture is reconstructed for every data point to match its unique JSON shape, training is currently about 10 times slower than static models. This is largely due to current deep learning frameworks' limitations in handling dynamic graphs.

Future work aims to automate the mapping of paths to functions using Neural Architecture Search (NAS) and to extend the framework to other semi-structured formats like HTML and YAML.

Summary updated

BibTeX
@misc{chen2020framework,
  author = {Ke Chen and William Woof and Ke Chen},
  title = {{A Framework for End-to-End Learning on Semantic Tree-Structured Data}},
  year = {2020},
  eprint = {2002.05707},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.05707},
}
Figure