Skip to main content
QUICK REVIEW

[Paper Review] Learning a Decision Tree Algorithm with Transformers

Yufan Zhuang, Liyuan Liu|arXiv (Cornell University)|Feb 6, 2024
Data Mining Algorithms and ApplicationsComputer Science3 citations
TL;DR

MetaTree is a transformer-based model that learns to generate high-performing decision trees by training on outputs from both greedy and optimized decision tree algorithms. It adapts its strategy based on dataset context, achieving superior generalization on unseen tabular datasets and outperforming traditional methods like CART and GOSDT, especially in reducing variance and handling complex interactions.

ABSTRACT

Decision trees are renowned for their ability to achieve high predictive performance while remaining interpretable, especially on tabular data. Traditionally, they are constructed through recursive algorithms, where they partition the data at every node in a tree. However, identifying a good partition is challenging, as decision trees optimized for local segments may not yield global generalization. To address this, we introduce MetaTree, a transformer-based model trained via meta-learning to directly produce strong decision trees. Specifically, we fit both greedy decision trees and globally optimized decision trees on a large number of datasets, and train MetaTree to produce only the trees that achieve strong generalization performance. This training enables MetaTree to emulate these algorithms and intelligently adapt its strategy according to the context, thereby achieving superior generalization performance.

Motivation & Objective

  • To develop a learnable, adaptive decision tree algorithm that generalizes better than traditional heuristic or optimization-based methods.
  • To enable transformers to generate structured machine learning models (specifically decision trees) rather than just predictions.
  • To improve generalization performance on unseen tabular datasets by learning from diverse tree construction strategies.
  • To reduce variance in model predictions while maintaining low bias through dynamic strategy selection between greedy and global optimization approaches.
  • To explore the feasibility of using deep learning models to learn and refine algorithmic behavior for model generation.

Proposed method

  • MetaTree uses a transformer architecture with alternating row and column attention to process tabular data, enabling joint modeling of samples and features.
  • It applies a learnable absolute positional bias to encode tabular structure, preserving the order and relationship between data points and features.
  • The model is trained on filtered outputs from both greedy decision trees (e.g., CART) and optimized decision trees (e.g., GOSDT), learning to mimic and generalize beyond them.
  • MetaTree recursively applies itself to build trees, making splitting decisions at each node based on the current state, without backtracking.
  • It generates a one-hot mask indicating the optimal splitting feature and threshold at each node using a differentiable attention mechanism.
  • The training objective encourages MetaTree to produce trees that generalize well across diverse datasets, not just replicate training algorithms.
Figure 1: MetaTree demonstrates strong generalization on real-world datasets. MetaTree generalizes well to 91 held-out datasets for both (A) depth-2 trees and (B) depth-3 trees, despite only being trained to produce depth-2 trees. (C) MetaTree also generalizes well to the 13 Tree-of-prompts datasets
Figure 1: MetaTree demonstrates strong generalization on real-world datasets. MetaTree generalizes well to 91 held-out datasets for both (A) depth-2 trees and (B) depth-3 trees, despite only being trained to produce depth-2 trees. (C) MetaTree also generalizes well to the 13 Tree-of-prompts datasets

Experimental results

Research questions

  • RQ1Can a transformer model learn to generate decision trees that generalize better than traditional heuristic or optimization-based algorithms?
  • RQ2To what extent can a transformer-based model adapt its strategy between greedy and global optimization based on dataset characteristics?
  • RQ3Does MetaTree achieve lower variance and better bias-variance trade-offs compared to standard decision tree algorithms?
  • RQ4Can MetaTree generalize to deeper trees and more complex tasks, such as tree-of-prompts reasoning, despite being trained only on depth-2 trees?
  • RQ5How does the internal decision-making process of MetaTree evolve across layers, and does it support early exit strategies?

Key findings

  • MetaTree generalizes well to 91 held-out datasets for both depth-2 and depth-3 trees, even when trained only on depth-2 trees, demonstrating strong inductive bias and transferability.
  • On the 13 Tree-of-Prompts datasets, MetaTree achieves high test accuracy, showing its ability to support complex reasoning tasks requiring hierarchical tree structures.
  • The correlation between splits in MetaTree’s layers increases gradually from layer 1 to 9, peaking near 1, suggesting consistent decision refinement before a drop at layers 10–11, indicating potential for early exit at layer 9.
  • MetaTree achieves significantly lower empirical variance than both CART and GOSDT across 91 left-out datasets, indicating greater robustness to data fluctuations.
  • MetaTree exhibits slightly lower bias than GOSDT and CART, while maintaining superior variance reduction, resulting in a more favorable bias-variance trade-off.
  • The model dynamically switches between greedy and global optimization strategies based on dataset context, which contributes to its improved generalization performance.
Figure 2 : The creation of a decision tree, depicted in (a), entails recursive MetaTree calls. MetaTree only assesses the current state for its decision-making. (b) shows MetaTree’s tabular attention mechanism, in which the tabular input is processed with row and column attention at each layer, and
Figure 2 : The creation of a decision tree, depicted in (a), entails recursive MetaTree calls. MetaTree only assesses the current state for its decision-making. (b) shows MetaTree’s tabular attention mechanism, in which the tabular input is processed with row and column attention at each layer, and

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.