NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

E2ETune: End-to-End Knob Tuning via Fine-tuned Generative Language Model

Xinmei Huang, Haoyang Li, Jing Zhang, Xinxin Zhao, Zhiming Yao, Yiyan Li, Tieying Zhang, Jianjun Chen, Hong Chen, Cuiping Li · DOI

Abstract

Database knob tuning is essential for performance but traditionally relies on slow, iterative optimization cycles. We present E2ETune, a novel framework that replaces these cycles with a single-pass prediction from a fine-tuned Large Language Model (LLM). By mapping workload features directly to optimal configurations, E2ETune reduces tuning time by up to 98.6% while matching or exceeding the performance of state-of-the-art Bayesian Optimization methods.

Introduction

Modern database systems feature hundreds of configurable parameters, or "knobs," such as buffer sizes and memory limits. Finding the optimal combination for a specific workload is an NP-hard problem. Traditionally, Database Administrators (DBAs) or automated tools using Bayesian Optimization (BO) or Reinforcement Learning (RL) have addressed this through iterative search.

The primary bottleneck in these methods is the iteration cycle: to evaluate a configuration, the system must "replay" the workload, measure performance, and update its model. For complex workloads, a single replay can take hours, making a full optimization run last days. E2ETune shifts this paradigm from iterative search to end-to-end prediction.

Comparison between traditional iterative tuning and E2ETune's end-to-end approach.

Methodology

E2ETune operates in three distinct stages designed to bridge the gap between workload characteristics and database configurations.

Stage I: Training Data Construction

Because no large-scale dataset of workload-to-optimal-knob mappings exists, the authors developed a synthetic pipeline. They utilized GPT-4 to generate thousands of diverse SQL queries (OLAP) and varied transaction weights (OLTP). To avoid the replay bottleneck during data collection, they trained a "Cost Model" (an ensemble of Gradient Boosting and Random Forests) to act as a fast performance simulator. A BO tuner (HEBO) then used this cost model to identify promising configurations for the synthetic workloads.

Stage II: Fine-tuning the Language Model

The framework fine-tunes a Mistral-7B model to act as the core tuner. The input consists of serialized workload statistics, query plans, and internal database metrics. To improve prediction accuracy, knob values are discretized into ten "buckets" (e.g., 30-40% of maximum value), transforming the complex regression problem into a more manageable classification task for the LLM.

Stage III: Knob Tuning (Inference)

When presented with a new, unseen workload, E2ETune extracts features and prompts the LLM to suggest configurations. It employs a "sampling-then-ranking" strategy: the LLM generates eight candidate configurations, which are then ranked by the Cost Model to select the final recommendation.

The three-stage workflow of E2ETune: Training Data Construction, Fine-tuning, and Knob Tuning.

Key Insights

  • Query Plan Understanding: LLMs demonstrate a surprising ability to map hierarchical query plans to the hardware resources they require.
  • Cross-Schema Generalization: Unlike previous tuners tied to specific database structures, E2ETune can recommend configurations for schemas it has never encountered by identifying general execution patterns.
  • Surpassing the Teacher: E2ETune occasionally outperforms the BO tuner used to generate its training data. This is attributed to the LLM's ability to explore high-probability regions of the configuration space that iterative optimizers might overlook.

Experimental Results

E2ETune was evaluated across 10 standard benchmarks (including TPC-H, TPC-DS, and YCSB) and real-world production workloads from ByteDance.

  • Efficiency: In TPC-H tests, traditional HEBO required 1,381 minutes to find an optimal configuration. E2ETune achieved comparable performance in just 19.8 minutes—a 98.6% reduction in time.
  • Performance: Across the benchmarks, E2ETune identified the absolute best configuration in 40% of cases and the second-best in 50%, consistently outperforming other LLM-based approaches like DB-BERT.
  • Real-World Impact: On ByteDance's internal workloads (SSAG and AMPS), E2ETune provided "out-of-the-box" configurations that were immediately competitive with state-of-the-art methods that require hours of online tuning.

Limitations and Future Work

While highly effective, E2ETune's performance is currently tied to the hardware environment used during training. Significant changes in CPU or RAM capacity might necessitate model retraining. Additionally, the system is currently optimized for PostgreSQL; extending it to other engines like MySQL or Oracle would require engine-specific training data. Future research will focus on "self-improvement" loops, allowing the model to learn continuously from the real-world performance of its own recommendations.

Summary updated

BibTeX
@article{huang2025e,
  author = {Xinmei Huang and Haoyang Li and Jing Zhang and Xinxin Zhao and Zhiming Yao and Yiyan Li and Tieying Zhang and Jianjun Chen and Hong Chen and Cuiping Li},
  title = {{E2ETune: End-to-End Knob Tuning via Fine-tuned Generative Language Model}},
  journal = {Proc. VLDB Endow.},
  year = {2025},
  url = {https://openreview.net/forum?id=XL5CJbHn1F},
}
Figure