# InferF: Declarative Factorization of AI/ML Inferences over Joins

arXiv: https://arxiv.org/abs/2511.20489 · HTML: https://mlsanity.com/paper/2511.20489/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 22 of its 104 references that are in the map.
- First posted on arXiv 25 Nov 2025.

## Builds on (most cited first, 22 of 22)

- [The Stack: 3 TB of permissively licensed source code](https://mlsanity.com/paper/2211.15533/) (2022)
- [Clipper: A Low-Latency Online Prediction Serving System](https://mlsanity.com/paper/1612.03079/) (2016)
- [Apache Calcite: A Foundational Framework for Optimized Query Processing Over Heterogeneous Data Sources](https://mlsanity.com/paper/1802.10233/) (2018)
- [SystemDS: A Declarative Machine Learning System for the End-to-End Data Science Lifecycle](https://mlsanity.com/paper/1909.02976/) (2019)
- [End-to-end Optimization of Machine Learning Prediction Queries](https://mlsanity.com/paper/2206.00136/) (2022)
- [Serving Deep Learning Models with Deduplication from Relational Databases](https://mlsanity.com/paper/2201.10442/) (2022)
- [Yggdrasil Decision Forests: A Fast and Extensible Decision Forests Library](https://mlsanity.com/paper/2212.02934/) (2022)
- [Towards Linear Algebra over Normalized Data](https://mlsanity.com/paper/1612.07448/) (2016)
- [Declarative Recursive Computation on an RDBMS, or, Why You Should Use a Database For Distributed Machine Learning](https://mlsanity.com/paper/1904.11121/) (2019)
- [A Layered Aggregate Engine for Analytics Workloads](https://mlsanity.com/paper/1906.08687/) (2019)
- [Tensor Relational Algebra for Machine Learning System Design](https://mlsanity.com/paper/2009.00524/) (2020)
- [AC/DC: In-Database Learning Thunderstruck](https://mlsanity.com/paper/1803.07480/) (2018)
- [Functional Collection Programming with Semi-Ring Dictionaries](https://mlsanity.com/paper/2103.06376/) (2021)
- [PlinyCompute: A Platform for High-Performance, Distributed, Data-Intensive Tool Development](https://mlsanity.com/paper/1711.05573/) (2017)
- [JoinBoost: Grow Trees Over Normalized Data Using Only SQL](https://mlsanity.com/paper/2307.00422/) (2023)
- [PyTond: Efficient Python Data Science on the Shoulders of Databases](https://mlsanity.com/paper/2407.11616/) (2024)
- [Pangea: Monolithic Distributed Storage for Data Analytics](https://mlsanity.com/paper/1808.06094/) (2018)
- [Functional Aggregate Queries with Additive Inequalities](https://mlsanity.com/paper/1812.09526/) (2018)
- [DeepMapping: Learned Data Mapping for Lossless Compression and Efficient Lookup](https://mlsanity.com/paper/2307.05861/) (2023)
- [Serving Deep Learning Model in Relational Databases](https://mlsanity.com/paper/2310.04696/) (2023)
- [PARQO: Penalty-Aware Robust Plan Selection in Query Optimization](https://mlsanity.com/paper/2406.01526/) (2024)
- [Privacy and Accuracy-Aware AI/ML Model Deduplication](https://mlsanity.com/paper/2503.02862/) (2025)

## Abstract (arXiv)

Real-world AI/ML workflows often apply inference computations to feature vectors joined from multiple datasets. To avoid the redundant AI/ML computations caused by repeated data records in the join's output, factorized ML has been proposed to decompose ML computations into sub-computations to be executed on each normalized dataset. However, there is insufficient discussion on how factorized ML could impact AI/ML inference over multi-way joins. To address the limitations, we propose a novel declarative InferF system, focusing on the factorization of arbitrary inference workflows represented as analyzable expressions over the multi-way joins. We formalize our problem to flexibly push down partial factorized computations to qualified nodes in the join tree to minimize the overall inference computation and join costs and propose two algorithms to resolve the problem: (1) a greedy algorithm based on a per-node cost function that estimates the influence on overall latency if a subset of factorized computations is pushed to a node, and (2) a genetic algorithm for iteratively enumerating and evaluating promising factorization plans. We implement InferF on Velox, an open-sourced database engine from Meta, evaluate it on real-world datasets, observed up to 11.3x speedups, and systematically summarized the factors that determine when factorized ML can benefit AI/ML inference workflows.
