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

Declarative Systems for Large-Scale Machine Learning

Vinayak R. Borkar, Yingyi Bu, Michael J. Carey, Joshua Rosen, Neoklis Polyzotis, Tyson Condie, Markus Weimer, Raghu RamakrishnanIEEE Data Eng. Bull 2012

Abstract

Traditional "Big Data" platforms designed for single-pass processing often struggle with the iterative nature of machine learning (ML). This paper proposes a declarative approach to ML systems, utilizing recursive queries (Datalog) to separate high-level logic from physical execution. By treating ML as a series of recursive operations, the authors demonstrate that database-style query optimization can significantly enhance the efficiency, portability, and programmability of large-scale iterative algorithms.

The Challenge of Iterative Machine Learning

The "Big Data" revolution, spearheaded by platforms like Apache Hadoop, was primarily optimized for single-pass data processing. However, machine learning is fundamentally iterative; training a model or calculating PageRank involves repeating computations until convergence.

Standard MapReduce lacks native support for these loops, forcing developers to implement "looping" logic outside the core framework. This results in ad-hoc systems that are difficult to optimize and often inefficient. While newer systems like Spark or Pregel address some of these issues, they frequently lack a clean separation between the logical intent of the user and the physical execution by the system. The authors aim to bring the "logical and physical data independence" of the database world to large-scale ML.

A Three-Layered Declarative Stack

To bridge the gap between data science and distributed systems, the authors propose a three-layered architecture:

  1. ScalOps (The DSL): A high-level, domain-specific language allowing data scientists to write ML tasks in a functional style similar to Scala.
  2. Datalog (The Logical Layer): ScalOps programs are translated into Datalog, which handles recursion as a first-class citizen. Specifically, the authors use XY-stratified Datalog to ensure iterative updates are mathematically sound and guaranteed to terminate.
  3. Hyracks (The Physical Layer): The Datalog plan is compiled into a physical execution plan for Hyracks, a data-parallel partition-processing engine.

The IMRU Model

A central contribution is the Iterative Map-Reduce-Update (IMRU) model. Unlike standard MapReduce, IMRU introduces an explicit update step. This step takes the aggregated results of a reduce operation and produces a new "global state" (the model) for the subsequent iteration.

The Iterative Map-Reduce-Update (IMRU) model, illustrating the flow from model initialization to iterative updates based on training data.

System Architecture and Execution

The system's execution flow is designed to maximize efficiency through data caching and optimized communication. Data is loaded from HDFS into cached records (CR) to avoid redundant I/O across iterations.

The system's iterative computation architecture, detailing the flow from data loading to the map-reduce-update cycle managed by a driver loop.

As shown in the architecture, the map phase operates on cached records, followed by an aggregation tree for the reduce phase. A sequential update step then modifies the model, which is passed back through an iteration barrier for the next cycle. This structure allows the system to perform "database-style" optimizations automatically, such as recognizing when to cache data in memory without manual user hints.

Key Insights and Performance

The authors highlight several advantages of their declarative approach:

  • ML as Recursion: Most ML tasks can be expressed as recursive queries, allowing the system to leverage decades of database research.
  • Scaling Efficiency: The system can mathematically identify the "sweet spot" for data partitioning, balancing the speed of the map phase against the overhead of the reduce phase. They discovered that the optimal "fan-in" for aggregation trees is often a constant based on cluster hardware.
  • Robustness: In large-scale experiments, the authors note that Spark failed due to memory limitations, whereas their system (running on Hyracks) succeeded by gracefully spilling to disk when necessary.

In experimental evaluations, the optimized declarative plans were highly competitive with specialized ML systems and ran an order of magnitude faster than standard Hadoop for iterative tasks. Furthermore, complex iterative algorithms can be expressed in just a few lines of code that map directly to the underlying mathematical equations.

Future Directions

While the current model focuses on synchronous iterations, the authors acknowledge the potential for asynchronous models to further improve performance. Future work includes developing a fully automated Planner/Optimizer and extending the "Algebricks" query algebra to provide a more general foundation for iterative workloads.

Summary updated

BibTeX
@article{borkar2012declarative,
  author = {Vinayak R. Borkar and Yingyi Bu and Michael J. Carey and Joshua Rosen and Neoklis Polyzotis and Tyson Condie and Markus Weimer and Raghu Ramakrishnan},
  title = {{Declarative Systems for Large-Scale Machine Learning}},
  journal = {IEEE Data Eng. Bull.},
  year = {2012},
}
Figure