FeRG-LLM : Feature Engineering by Reason Generation Large Language Models

Jeonghyun Ko, Gyeongyun Park, Donghoon Lee, Kyunam LeeNAACL 2025

Abstract

Feature engineering (FE) is widely regarded as the most effective way to enhance machine learning model performance on tabular data, yet it remains a manual, domain-intensive "black art." We present FeRG-LLM, a specialized 8B-parameter model that automates FE by generating both conceptual rationales and executable code. By integrating a two-stage "Chain of Thought" dialogue with Direct Preference Optimization (DPO), FeRG-LLM matches the performance of 70B-parameter models while running locally on a single GPU, addressing critical concerns regarding data privacy and API costs.

Introduction: The Challenge of Automated Feature Engineering

In tabular data modeling, creating new input variables from raw data is essential for capturing complex relationships. However, manual FE is time-consuming and requires significant expertise. While Large Language Models (LLMs) offer a path toward automation, existing approaches often rely on expensive, privacy-compromising cloud APIs or struggle with the logical reasoning required for complex variable interactions. Furthermore, most research has focused exclusively on classification, neglecting regression tasks.

Methodology: Reasoning-First Alignment

FeRG-LLM is built upon the Llama 3.1 8B architecture and employs a three-pronged approach to automate high-quality feature generation:

  1. Two-Stage Dialogue: The model follows a "Chain of Thought" (CoT) process. It first analyzes dataset metadata to propose conceptual "key ideas" for new features before translating these ideas into Python code.
  2. Knowledge Extraction: To ground the model in real-world expertise, researchers used GPT-4o-mini to synthesize patterns from over 7,000 research papers and technical documents, creating a high-fidelity synthetic training dataset.
  3. DPO Alignment: The model is refined using Direct Preference Optimization (DPO). Multiple feature sets are generated and evaluated using XGBoost; the resulting performance metrics (e.g., AUC) are used to create preference pairs. This process trains the model to prioritize rationales that lead to superior predictive accuracy.
The FeRG-LLM training and alignment pipeline, illustrating the flow from data construction to DPO alignment.

Experimental Setup and Datasets

The model's versatility was tested across a wide array of benchmarks:

  • Training and Feedback: 8 diverse datasets were used for DPO alignment.
  • Classification Evaluation: 14 datasets from the UCI Repository and Kaggle, spanning healthcare, finance, and technology.
  • Regression Evaluation: 4 datasets (e.g., Bike sharing, Real estate) to validate the model's applicability to continuous value prediction.

Results and Discussion

FeRG-LLM demonstrates that specialized small models can achieve state-of-the-art results.

Performance and Efficiency

FeRG-LLM achieved the highest AUC on 7 out of 14 classification datasets and the second-highest on the remainder, outperforming specialized baselines like CAAFE and FeatLLM. Notably, it achieved parity with the Llama 3.1 70B model while being significantly more efficient. FeRG-LLM completes inference in approximately 16.4 seconds on a single RTX A6000 GPU, whereas the 70B model requires four GPUs and over 80 seconds.

Performance comparison of FeRG-LLM against baseline methods and larger models across various classification datasets.

The Power of Metadata and Reasoning

A key insight is the model's ability to infer complex relationships solely from variable names and descriptions. The "Reasoning Shift" observed after DPO alignment indicates that the model's logic becomes more sophisticated, focusing on interrelated metrics (e.g., health indicators) rather than isolated variables. In regression tasks, this led to a 5–10% decrease in Mean Squared Error (MSE) compared to baseline models.

Conclusion

FeRG-LLM represents a significant step toward democratizing advanced feature engineering. By prioritizing reasoning and local alignment, it provides a high-performance, privacy-preserving alternative to massive general-purpose models. Future work will explore closed-loop iterative refinement and optimizing the volume of generated features to further enhance downstream model performance.

Summary updated

BibTeX
@inproceedings{ko2025ferg,
  author = {Jeonghyun Ko and Gyeongyun Park and Donghoon Lee and Kyunam Lee},
  title = {{FeRG-LLM : Feature Engineering by Reason Generation Large Language Models}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.findings-naacl.237},
}
Figure