Skip to main content
QUICK REVIEW

[Paper Review] AC/DC: In-Database Learning Thunderstruck

Mahmoud Abo Khamis, Hung Q. Ngo|arXiv (Cornell University)|Mar 20, 2018
Machine Learning and AlgorithmsComputer Science18 references10 citations
TL;DR

AC/DC is a database-integrated gradient descent solver that accelerates in-database machine learning by decomposing optimization problems into factorized aggregates over normalized databases. It achieves up to 300x speedup over competitors like TensorFlow, libFM, and MADlib by using sparse group-by aggregates, functional dependency-aware reparameterization, and shared computation, training models with up to 154K features in under 30 minutes on a single core.

ABSTRACT

We report on the design and implementation of the AC/DC gradient descent solver for a class of optimization problems over normalized databases. AC/DC decomposes an optimization problem into a set of aggregates over the join of the database relations. It then uses the answers to these aggregates to iteratively improve the solution to the problem until it converges. The challenges faced by AC/DC are the large database size, the mixture of continuous and categorical features, and the large number of aggregates to compute. AC/DC addresses these challenges by employing a sparse data representation, factorized computation, problem reparameterization under functional dependencies, and a data structure that supports shared computation of aggregates. To train polynomial regression models and factorization machines of up to 154K features over the natural join of all relations from a real-world dataset of up to 86M tuples, AC/DC needs up to 30 minutes on one core of a commodity machine. This is up to three orders of magnitude faster than its competitors R, MadLib, libFM, and TensorFlow whenever they finish and thus do not exceed memory limitation, 24-hour timeout, or internal design limitations.

Motivation & Objective

  • To address the performance bottleneck of traditional in-database machine learning systems that rely on one-hot encoding of categorical features.
  • To enable efficient training of nonlinear models such as polynomial regression and factorization machines over normalized, normalized-database relations.
  • To reduce computational complexity in large-scale optimization by exploiting functional dependencies and factorized query processing.
  • To unify database query execution and gradient descent optimization into a single, low-complexity execution plan.
  • To overcome memory and timeout limitations of existing systems when scaling to datasets with millions of tuples and tens of thousands of features.

Proposed method

  • AC/DC decomposes optimization problems into a set of aggregates—group-by aggregates for categorical features and scalar aggregates for continuous features—computed over the natural join of database relations.
  • It employs a sparse data representation using group-by aggregates to avoid the memory and computational overhead of one-hot encoding.
  • The system factorizes aggregate computation across feature combinations using advanced query optimization techniques, achieving asymptotically lower complexity than full-join computation.
  • AC/DC shares computation across multiple aggregate queries by reusing intermediate results through a specialized data structure that supports efficient aggregation over shared join plans.
  • It reparameterizes models using functional dependencies to reduce feature space dimensionality, transforming complex regularizers into sums of identity matrices and dot products.
  • The convergence step integrates with the Eigen library for linear algebra, enabling efficient matrix inversion and gradient updates within the database execution framework.

Experimental results

Research questions

  • RQ1Can in-database machine learning be made significantly faster by avoiding one-hot encoding and instead using sparse group-by aggregates?
  • RQ2To what extent can factorized computation of aggregates reduce the asymptotic complexity of in-database optimization compared to full-join execution?
  • RQ3How does model reparameterization under functional dependencies affect the performance and scalability of gradient descent in a database setting?
  • RQ4Can shared computation across multiple aggregate queries lead to orders-of-magnitude performance improvements in large-scale learning workloads?
  • RQ5How does AC/DC compare to state-of-the-art systems like TensorFlow, libFM, and MADlib in terms of speed, memory usage, and scalability on real-world, high-cardinality datasets?

Key findings

  • AC/DC trained a ridge linear regression model with 154,595 features over 86M tuples in under 30 minutes on a single core, outperforming all competitors.
  • For the same dataset, AC/DC achieved a 152.70× speedup over libFM and a 3.87× speedup over MADlib on factorization machines, even when MADlib failed on larger fragments due to memory limits.
  • The system reduced the number of non-zero aggregates by 259× compared to one-hot encoding, from ~11.9 billion to 46 million, due to sparse group-by representation.
  • Functional dependencies reduced the number of group-by aggregates by 20% and improved performance by up to 3.87× for factorization machines, despite increasing the complexity of the convergence step.
  • AC/DC’s aggregate computation step dominated the total runtime, accounting for up to 99% of the time, and showed sub-linear scaling with increasing categorical features—only a 13.7× slowdown for 65× more features in polynomial regression.
  • While TensorFlow showed stable performance with increasing categorical features due to on-the-fly one-hot encoding, AC/DC was still orders of magnitude faster, even when computing only a single training epoch.

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.