Skip to main content
QUICK REVIEW

[Paper Review] Towards Linear Algebra over Normalized Data

Lingjiao Chen, Arun Kumar|arXiv (Cornell University)|Dec 22, 2016
Advanced Database Systems and QueriesComputer Science33 references5 citations
TL;DR

This paper introduces Morpheus, a framework that automatically factorizes linear algebra (LA) operations over normalized (multi-table) relational data, enabling efficient machine learning (ML) without materializing denormalized tables. By introducing a logical 'normalized matrix' type and algebraic rewrite rules, Morpheus transforms LA-based ML algorithms—like logistic regression and K-Means—into optimized, join-aware computations, achieving up to 36x speedups on real data while maintaining compatibility with existing LA systems.

ABSTRACT

Providing machine learning (ML) over relational data is a mainstream requirement for data analytics systems. While almost all the ML tools require the input data to be presented as a single table, many datasets are multi-table, which forces data scientists to join those tables first, leading to data redundancy and runtime waste. Recent works on "factorized" ML mitigate this issue for a few specific ML algorithms by pushing ML through joins. But their approaches require a manual rewrite of ML implementations. Such piecemeal methods create a massive development overhead when extending such ideas to other ML algorithms. In this paper, we show that it is possible to mitigate this overhead by leveraging a popular formal algebra to represent the computations of many ML algorithms: linear algebra. We introduce a new logical data type to represent normalized data and devise a framework of algebraic rewrite rules to convert a large set of linear algebra operations over denormalized data into operations over normalized data. We show how this enables us to automatically "factorize" several popular ML algorithms, thus unifying and generalizing several prior works. We prototype our framework in the popular ML environment R and an industrial R-over-RDBMS tool. Experiments with both synthetic and real normalized data show that our framework also yields significant speed-ups, up to 36x on real data.

Motivation & Objective

  • To address the high development overhead of manually rewriting ML algorithms for factorized execution over normalized data.
  • To unify and generalize prior ad-hoc factorized ML approaches by leveraging linear algebra as a common representation language.
  • To enable automatic optimization of LA-based ML workloads on normalized schemas without modifying underlying LA systems.
  • To decouple the factorization logic from the execution platform, ensuring compatibility with diverse LA environments like R and RDBMS.
  • To provide performance gains through schema-aware LA optimization while preserving correctness and closure in LA operations.

Proposed method

  • Introduces a new logical data type, the 'normalized matrix', to represent multi-table data with primary key-foreign key or M:N relationships.
  • Designs a comprehensive set of algebraic rewrite rules to transform LA operations (e.g., matrix multiplication, transpose, row sums) over denormalized data into equivalent operations over normalized base tables.
  • Employs a heuristic decision rule that uses input statistics to predict whether the factorized LA version will outperform the denormalized version.
  • Builds a middleware framework, Morpheus, that applies these rewrite rules automatically to LA scripts, enabling transparent optimization.
  • Integrates with existing LA systems (e.g., R, Oracle R Enterprise, SystemML) via closure, avoiding changes to LA operator implementations.
  • Validates the framework using synthetic and real-world normalized datasets, measuring performance against standard denormalized LA execution.

Experimental results

Research questions

  • RQ1Can linear algebra be used as a unified formalism to systematically factorize diverse ML algorithms over normalized relational data?
  • RQ2How can algebraic rewrite rules be designed to transform LA operations on denormalized data into equivalent, efficient operations on normalized base tables?
  • RQ3What heuristics can guide the decision to use factorized LA over denormalized LA, ensuring performance gains?
  • RQ4To what extent can a generic, portable framework automate factorized ML without requiring low-level system modifications?
  • RQ5How does the performance of the factorized LA approach compare to traditional denormalized execution on real and synthetic normalized data?

Key findings

  • The Morpheus framework successfully factorizes multiple popular ML algorithms—such as logistic regression, K-Means, and linear regression—by applying algebraic rewrite rules to LA expressions.
  • The framework achieves up to 36x speedup on real-world normalized datasets by avoiding redundant computation from materialized denormalized tables.
  • The heuristic decision rule accurately predicts performance gains, ensuring that factorized execution is only applied when beneficial.
  • The approach maintains closure in linear algebra, enabling seamless integration with existing LA systems like R and Oracle R Enterprise without modifying their internals.
  • The framework generalizes and unifies prior ad-hoc factorized ML techniques, reducing development overhead from manual algorithm rewriting.
  • Experiments confirm that the performance benefits are consistent across both synthetic and real normalized data, demonstrating practical scalability.

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.