While deep learning has conquered vision and language, tabular data remains a stubborn stronghold for tree-based models like XGBoost. A key reason for this is that tabular data often requires clever "feature engineering"—creating new columns from existing ones—to unlock its full potential. Traditionally, this is a manual, grueling process of trial and error.
In their NeurIPS 2024 paper, "Optimized Feature Generation for Tabular Data via LLMs with Decision Tree Reasoning," Jaehyun Nam and colleagues introduce OCTree. This framework turns Large Language Models (LLMs) into automated data scientists that don't just guess new features, but actually "reason" about why they work.
TL;DR
OCTree leverages LLMs as black-box optimizers to generate Python rules for new features in tabular datasets. By feeding the LLM natural language descriptions of Decision Trees as feedback, the system iteratively refines these features, significantly outperforming existing automated feature engineering methods.
What Problem Does This Paper Address?
Automated Feature Engineering (AFE) aims to find useful combinations of data (e.g., Age * Income) without human intervention. However, current AFE methods face two major hurdles:
- Fixed Search Spaces: Most tools only explore a pre-defined set of mathematical operations (addition, multiplication, etc.), missing complex logical relationships.
- Blind Selection: They usually rely solely on a single validation score to decide if a feature is good. They don't understand how the feature helps the model, meaning they can't learn from "near misses" or failed experiments.
OCTree addresses this by using LLMs to explore an unconstrained search space and using Decision Trees to provide the "missing link" of reasoning.
Methods
The OCTree framework follows an iterative loop, as illustrated in the overview below:
- Column Name Generation: The LLM looks at the task description and existing column names to propose a semantically meaningful new feature (e.g., suggesting "Trading Volume" for a stock prediction task).
- Rule Optimization (The Loop):
- The LLM generates a Python function (a "rule") to create this new column.
- A prediction model (like XGBoost) is trained on the data augmented with this new column.
- The "Aha" Moment: The researchers fit a shallow Decision Tree (CART) to the data. Because decision trees are essentially a series of if-else statements, they can be easily converted into natural language.
- Reasoning as Feedback: The LLM is given a "trajectory" of its past attempts. Each entry includes the rule it wrote, the resulting validation score, and the textual description of the decision tree. This tells the LLM exactly how the model utilized the new feature in its logic.
- Refinement: The LLM uses this feedback to tweak the rule, repeating the process for a fixed number of iterations to find the optimal feature.
Datasets
The authors evaluated OCTree on two distinct types of benchmarks:
- Context-Aware Datasets: Real-world datasets with descriptive column names (Tesla Stock, Enefit energy consumption, Disease diagnosis, Clinical trials, and Academic performance).
- Context-Agnostic Datasets: 19 classification tasks from a standard tabular benchmark where column names and values are anonymized (e.g.,
x1,x2). - High-Dimensional Data: The
madelondataset, which contains 501 features, to test scalability.
Key Insights and Ideas
- Decision Trees as Translators: The most brilliant move in this paper is using decision trees as a bridge. LLMs struggle with raw numbers but excel at logic. By turning a model's performance into a logical "story" (the tree), the authors allow the LLM to perform true optimization.
- LLMs as Black-Box Optimizers: The paper demonstrates that LLMs can optimize non-differentiable problems (like writing code for features) better than traditional search algorithms because they can leverage linguistic common sense.
- Feature Transferability: Interestingly, features generated using a simple "proxy" model (like a fast XGBoost) often significantly improve much heavier models (like Deep Neural Networks). This makes the process computationally feasible.
- Beyond Semantics: Even when the LLM doesn't know what the columns mean (anonymized data), the decision tree feedback allows it to find useful mathematical combinations purely through logical iteration.
Key Results
- Superior Performance: OCTree consistently outperformed state-of-the-art AFE methods like CAAFE and OpenFE.
- Error Reduction: On the 19-dataset benchmark, OCTree reduced relative prediction errors by an average of 5.0% compared to a tuned XGBoost baseline.
- Model Agnostic: It improved performance across diverse architectures, including Gradient Boosted Decision Trees (XGBoost), Multi-Layer Perceptrons (MLP), and HyperFast.
- LLM Scaling: While GPT-4o provided the best results, the authors found that a custom-tuned Llama 2 7B was also highly effective, proving that this method doesn't require the most expensive models to work.
Limitations and Future Work
- Computational Overhead: Each iteration requires training a model and running an LLM inference. For massive datasets, this could become expensive, though the authors suggest using subsampling or simpler proxy models to mitigate this.
- Prompt Length: As the number of iterations increases, the "trajectory" in the prompt grows, potentially hitting the LLM's context limit.
- Hallucinations: In early stages or with weaker LLMs, the model might suggest semantically incoherent rules, though the feedback loop generally corrects these over time.
The authors suggest that future work could involve Reinforcement Learning from Human Feedback (RLHF) to further align LLMs specifically for the task of rule generation.
Summary updated