Skip to main content
QUICK REVIEW

[Paper Review] Machine Learning Systems are Bloated and Vulnerable

Huaifeng Zhang, Fahmi Abdulqadir Ahmed|arXiv (Cornell University)|Dec 16, 2022
Cloud Computing and Resource ManagementComputer Science5 citations
TL;DR

This paper introduces MMLB, a framework that analyzes and quantifies bloat in machine learning containers by measuring unused code and dependencies at the container and package levels. It finds that bloat accounts for up to 80% of container size, increasing provisioning time by 370% and vulnerabilities by 99%, with APT packages and ML frameworks being major sources of bloat and risk.

ABSTRACT

Today's software is bloated with both code and features that are not used by most users. This bloat is prevalent across the entire software stack, from operating systems and applications to containers. Containers are lightweight virtualization technologies used to package code and dependencies, providing portable, reproducible and isolated environments. For their ease of use, data scientists often utilize machine learning containers to simplify their workflow. However, this convenience comes at a cost: containers are often bloated with unnecessary code and dependencies, resulting in very large sizes. In this paper, we analyze and quantify bloat in machine learning containers. We develop MMLB, a framework for analyzing bloat in software systems, focusing on machine learning containers. MMLB measures the amount of bloat at both the container and package levels, quantifying the sources of bloat. In addition, MMLB integrates with vulnerability analysis tools and performs package dependency analysis to evaluate the impact of bloat on container vulnerabilities. Through experimentation with 15 machine learning containers from TensorFlow, PyTorch, and Nvidia, we show that bloat accounts for up to 80% of machine learning container sizes, increasing container provisioning times by up to 370% and exacerbating vulnerabilities by up to 99%.

Motivation & Objective

  • To investigate the extent and sources of bloat in machine learning containers, which are often deployed as monolithic, pre-packaged environments.
  • To quantify how bloat affects container size, provisioning time, and security vulnerabilities in ML workloads.
  • To develop a systematic framework for identifying, measuring, and analyzing bloat at both container and package levels in ML systems.
  • To evaluate the impact of bloat on container security by integrating vulnerability analysis and dependency tracking.
  • To highlight the need for more modular ML systems and intelligent container ecosystems to reduce technical debt.

Proposed method

  • Developed MMLB, a multi-layered framework combining container-level analysis, package-level analysis, and dependency graph construction to identify bloat sources.
  • Used Cimplifier to detect and remove bloat in ML containers, enabling comparison between original and debloated versions.
  • Integrated Grype and Trivy for vulnerability scanning, with custom logic to verify if CVEs are eliminated after debloating by checking file deletion.
  • Performed container size, provisioning time, and vulnerability analysis on 15 real-world ML containers from TensorFlow, PyTorch, and NVIDIA.
  • Tracked bloat contributions from APT packages, ML frameworks (e.g., TensorFlow, PyTorch), and unused features across training and serving pipelines.
  • Applied package dependency analysis to trace how transitive dependencies contribute to bloat and vulnerability surface.

Experimental results

Research questions

  • RQ1To what extent does bloat contribute to the size of machine learning containers?
  • RQ2Which components—such as APT packages, ML frameworks, or unused features—are the primary sources of bloat in ML containers?
  • RQ3How does bloat affect container provisioning time and performance overhead?
  • RQ4To what degree does bloat amplify vulnerability surface area in ML containers?
  • RQ5How effective are existing vulnerability scanners in detecting CVEs that are eliminated through debloating?

Key findings

  • Bloat accounts for up to 80% of the total size in some machine learning containers, indicating massive inefficiency in packaging.
  • Container provisioning time increases by up to 370% due to bloat, significantly impacting deployment efficiency.
  • Bloat exacerbates vulnerabilities by up to 99%, primarily due to unused dependencies and transitive package inclusions.
  • APT packages are a dominant source of both bloat and vulnerabilities, largely due to complex dependency chains.
  • ML frameworks such as TensorFlow and PyTorch contribute significantly to bloat, especially when used in mismatched deployment scenarios (e.g., training features in serving containers).
  • Despite high bloat and vulnerability exposure, very few CVEs are reported for ML-specific packages, indicating a gap in security scrutiny.

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.