Software Dependencies 2.0: An Empirical Study of Reuse and Integration of Pre-Trained Models in Open-Source Projects

Jerin Yasmin, Wenxin Jiang, James C. Davis, Yuan Tian · DOI

Introduction

In traditional software engineering, dependencies—referred to here as Software Dependencies 1.0—are code-centric. These libraries and frameworks have explicitly programmed behaviors and are managed through mature ecosystems like npm or PyPI. However, the rapid adoption of Pre-Trained Models (PTMs) from hubs like Hugging Face has introduced a new paradigm: Software Dependencies 2.0.

Unlike their predecessors, 2.0 dependencies are model-centric; their behavior is determined by learned parameters and probabilistic outputs rather than human-written logic. This paper presents an empirical study of 401 GitHub projects to understand how these dependencies are integrated into real-world software and the unique challenges they pose to maintainability and software engineering (SE) practices.

Methodology

To investigate the landscape of PTM reuse, the researchers employed a mixed-methods approach utilizing the PeaTMOSS dataset, which tracks GitHub repositories using models from Hugging Face and PyTorch Hub.

The study followed a rigorous selection process:

  1. Sampling: 650 popular projects were initially extracted from a pool of over 28,000.
  2. Manual Curation: The sample was narrowed to 401 "Functional Applications"—projects where PTMs are core to the application's functionality, excluding tutorials or simple experiments.
  3. Traceability Analysis: Using static analysis and git grep, the authors traced how models are loaded and utilized within the codebases.
  4. Qualitative Coding: A manual review of READMEs and source code was conducted to categorize PTM reuse pipelines and interaction patterns.

The final sample spanned multiple domains, with Natural Language Processing (44.4%) and Computer Vision (35.7%) being the most prevalent.

Defining Software Dependencies 2.0

The study identifies three core characteristics that distinguish PTMs from traditional code libraries:

  • Probabilistic Behavior: Unlike deterministic code, PTM outputs are inherently probabilistic, requiring different testing and validation strategies.
  • Model Artifacts: Integration involves not just code APIs, but also heavy binary artifacts such as weights and tokenizers.
  • Interchangeability: Developers often treat models as interchangeable at the family level (e.g., swapping one BERT variant for another), a practice rarely seen with traditional libraries where APIs are highly specific.

Integration Patterns and Pipelines

PTM reuse is rarely a simple "plug-and-play" operation. The research identifies three primary organizational structures for PTM pipelines:

  1. Feature Extraction-Oriented (59%): The model is used to transform raw data into embeddings for downstream tasks.
  2. Discriminative-Oriented (21%): The model is used for classification or detection tasks.
  3. Generative-Oriented (20%): The model generates new content, such as text or images.

Furthermore, multi-model systems are the norm rather than the exception, with 52.6% of projects utilizing more than one PTM. These models interact in four distinct ways:

  • Feature Handoff (42%): The output of one model serves as the direct input for the next.
  • Feedback Guidance (45%): One model guides or evaluates the training/execution of another.
  • Evaluation (9%): A model is used to calculate performance metrics for another model.
  • Post-Processing Refinement (4%): A model filters or "cleans" the output of a primary model (e.g., a safety filter).

The Traceability and Versioning Gap

A critical finding of the study is the significant "technical debt" associated with PTM integration. Traditional SE practices for dependency management are largely failing in the 2.0 era:

  • Documentation Fragmentation: Only 21.2% of projects declare their PTM dependencies in a centralized file. Most references are buried deep within the source code, making them invisible to standard dependency scanners.
  • Versioning Debt: Only 12% of projects specify a specific model version (such as a Git commit hash). Most projects default to the "latest" version, leaving them vulnerable to silent failures or breaking changes if the upstream model is updated.
  • Mandatory Adaptation: Models are rarely used "as-is." Developers frequently modify the architecture through "head addition," layer deletion, or fine-tuning to align the model with specific project requirements.

Conclusion and Future Work

The shift toward Software Dependencies 2.0 requires a fundamental rethinking of software maintenance. The current lack of traceability and versioning standards creates a "blind spot" that threatens the long-term stability of AI-enabled systems.

The authors suggest that future research and tool development should focus on:

  • Establishing Software Bill of Materials (SBOM) standards specifically for models to track provenance.
  • Creating automated tools to map and document PTM pipelines.
  • Investigating the "entanglement" between data, models, and code to prevent silent system degradation.

While this study focuses on open-source hubs like Hugging Face, it lays the groundwork for understanding the complex lifecycle of learned behaviors in modern software architecture.

Summary updated

BibTeX
@article{yasmin2026software,
  author = {Jerin Yasmin and Wenxin Jiang and James C. Davis and Yuan Tian},
  title = {{Software Dependencies 2.0: An Empirical Study of Reuse and Integration of Pre-Trained Models in Open-Source Projects}},
  journal = {Empir. Softw. Eng.},
  year = {2026},
  doi = {10.1007/s10664-026-10894-4},
}
Figure