Context <p>Pre-trained models (PTMs) are machine learning models that have been trained in advance, often on large-scale data, and can be reused for new tasks, thereby reducing the need for costly training from scratch. Their widespread adoption introduces a new class of software dependency, which we term <i>Software Dependencies 2.0</i>, extending beyond conventional libraries to learned behaviors embodied in trained models and their associated artifacts. The integration of PTMs as software dependencies in real projects remains unclear, potentially threatening maintainability and reliability of modern software systems that increasingly rely on them.</p> Objective <p>In this study, we investigate Software Dependencies 2.0 in open-source software (OSS) projects by examining the reuse of PTMs, with a focus on how developers manage and integrate these models. Specifically, we seek to understand: (1) how OSS projects structure and document their PTM dependencies; (2) what stages and organizational patterns emerge in the reuse pipelines of PTMs within these projects; and (3) the interactions among PTMs and other learned components across pipeline stages.</p> Method <p>We conduct a mixed-methods analysis of a statistically significant random sample of 401&#xa0;GitHub repositories from the PeaTMOSS dataset (28,575 repositories reusing PTMs from Hugging Face and PyTorch Hub). We quantitatively examine PTM reuse by identifying patterns and qualitatively investigate how developers integrate and manage these models in practice.</p> Results <p>We find that multi-PTM reuse is common (52.6%&#xa0;of the studied projects). In these projects, a notable portion of PTMs are interchangeable (37%), meaning one model can seamlessly replace another in the workflow, while others are complementary (23%), performing distinct functional roles. This integration complexity is compounded by fragmented dependency declarations across code, documentation, and configuration files, with only 21.2%&#xa0;of projects documented outside code. We identify three types of PTM reuse pipelines, <i>i.e.,</i>&#xa0;feature extraction, generative, and discriminative, all involving varying degrees of PTM adaptation, from as-is reuse to head addition or architectural modification. PTMs also frequently interact with other models in tightly coupled or modular designs, reflecting the complexity of such systems.</p> Conclusion <p>Managing Software Dependencies 2.0 and PTM reuse pipeline complexity introduces unique technical challenges in ML-enabled software. Our findings underscore the need for enhanced tools and practices that treat PTMs as first-class, modular components, facilitating their reliable integration and long-term maintenance within Software Dependencies 2.0. We identify future research on PTM reuse and integration as a way to further understand Software Dependencies 2.0.</p>

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

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

摘要

Context

Pre-trained models (PTMs) are machine learning models that have been trained in advance, often on large-scale data, and can be reused for new tasks, thereby reducing the need for costly training from scratch. Their widespread adoption introduces a new class of software dependency, which we term Software Dependencies 2.0, extending beyond conventional libraries to learned behaviors embodied in trained models and their associated artifacts. The integration of PTMs as software dependencies in real projects remains unclear, potentially threatening maintainability and reliability of modern software systems that increasingly rely on them.

Objective

In this study, we investigate Software Dependencies 2.0 in open-source software (OSS) projects by examining the reuse of PTMs, with a focus on how developers manage and integrate these models. Specifically, we seek to understand: (1) how OSS projects structure and document their PTM dependencies; (2) what stages and organizational patterns emerge in the reuse pipelines of PTMs within these projects; and (3) the interactions among PTMs and other learned components across pipeline stages.

Method

We conduct a mixed-methods analysis of a statistically significant random sample of 401 GitHub repositories from the PeaTMOSS dataset (28,575 repositories reusing PTMs from Hugging Face and PyTorch Hub). We quantitatively examine PTM reuse by identifying patterns and qualitatively investigate how developers integrate and manage these models in practice.

Results

We find that multi-PTM reuse is common (52.6% of the studied projects). In these projects, a notable portion of PTMs are interchangeable (37%), meaning one model can seamlessly replace another in the workflow, while others are complementary (23%), performing distinct functional roles. This integration complexity is compounded by fragmented dependency declarations across code, documentation, and configuration files, with only 21.2% of projects documented outside code. We identify three types of PTM reuse pipelines, i.e., feature extraction, generative, and discriminative, all involving varying degrees of PTM adaptation, from as-is reuse to head addition or architectural modification. PTMs also frequently interact with other models in tightly coupled or modular designs, reflecting the complexity of such systems.

Conclusion

Managing Software Dependencies 2.0 and PTM reuse pipeline complexity introduces unique technical challenges in ML-enabled software. Our findings underscore the need for enhanced tools and practices that treat PTMs as first-class, modular components, facilitating their reliable integration and long-term maintenance within Software Dependencies 2.0. We identify future research on PTM reuse and integration as a way to further understand Software Dependencies 2.0.