arXiv:2610.10261cs.SEOct 2026

Manuscript Offprint

arXiv:2610.10261

Using Small Language Models to Reverse-Engineer Machine Learning Pipelines Structures

Nicolas Lacroix, Frederic Precioso, Mireille Blay-Fornarino, Sebastien Mosser

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

Abstract

Context: Once defined a taxonomy of stages structuring Machine Learning (ML) pipelines (e.g. Data Preprocessing, Modeling...), extracting these stages from source code is key for better understanding ML practices. However, the diversity caused by the constant evolution of ML (e.g., algorithms, datasets) makes this task challenging. Existing approaches either rely on non-scalable manual labeling or on classifiers that do not properly support domain's diversity. These limitations call for more reliable solutions. Objective: We evaluate whether Small Language Models (SLMs) can leverage their code understanding and classification abilities to address these limitations, and enhance our understanding of practices in ML. Method: We conduct a confirmatory study based on two relevant reference works representing current limitations in the state-of-the-art. We first compare several SLMs using Cochran's Q test, then evaluate the best-performing model against reference studies via two McNemar's tests. An additional Cochran's Q test examines how taxonomy definition variations affect the SLM performance. Finally, goodness-of-fit tests compare ML practice insights from SLM classification with those from prior studies. Results: First, we found that the taxonomy wording significantly impacts classification performance. Second, the best performing SLM yielded good results, yet, without outperforming other classifiers. Third, the three classification methods led to significantly different insights, with varying effect

This work is funded by the FATES-MLOps international cooperation project (ANR (TSIA 2024) ANR-24-IAS2-0002-01, NSERC – ALLRP-2024-599951) and by the French National Research Agency (ANR) under grant agreement no. ANR-24-CE25-1286-01.

Nicolas Lacroix* · Frédéric Precioso Université Côte d'Azur, Inria, CNRS, I3S, Sophia Antipolis, France E-mail: nicolas.lacroix@univ-cotedazur.fr E-mail: frederic.precioso@univ-cotedazur.fr

Mireille Blay-Fornarino Université Côte d'Azur, CNRS, I3S, Sophia Antipolis, France E-mail: mireille.blay@univ-cotedazur.fr

Sébastien Mosser McSCert, McMaster University, Hamilton, ON, Canada E-mail: mossers@mcmaster.ca *Corresponding author.

Nicolas Lacroix et al.

sizes, when exploring practices of data scientists. Conclusions: Limitations of existing classification methods bias our understanding of ML practices. While current SLMs show promising results without prior fine-tuning, they still exhibit common limitations, in addition to inference high costs challenging their applicability in large-scale studies.

Keywords Reverse Engineering · Machine Learning Pipelines · Small Language Models · Jupyter Notebooks

1 Introduction

Over the last two decades, Machine Learning (ML) got a pervasive impact, solving increasingly complex decision tasks, owing to new families of methods every two or three years. ML democratization lead to a huge and ever increasing amount of contributions (i.e. ML workflows/pipelines), of various qualities, exploring to address new more complex tasks. Understanding how data scientists structure their ML pipelines to answer a problem, is key to better supporting the quality and evolution of these pipelines. Studying them at an abstract level enables the analysis of how workflows are organized, iteratively built, and reused for a new problem. This higher-level perspective is therefore crucial to characterize current practices empirically.

Recently, studies have examined pipeline quality [1,2], identified recurring patterns [3], and supported practitioners through pipeline reuse [4]. All these efforts rely on accurately extracting the underlying structure of ML pipelines from source code. However, this task is often achieved manually because of the high diversity of the ML domain. Indeed, the exploratory nature [5] of ML associated with the rapid evolution of new algorithm families and ML libraries has led to increasingly heterogeneous ML pipelines [6,7].

From reliance on static mappings between specific libraries and pipeline stages [6,8,9], efforts have recently shifted toward automated approaches using rule-based or supervised classifiers [10–12]. Despite their promising results, existing methods remain constrained in performance (e.g., classification accuracy) and scope (e.g., specific libraries or pipeline patterns). Furthermore, they often use different taxonomies of the different ML stages (e.g., Data Preprocessing, Modeling, Evaluation...) with variations in their formulations. Consequently, the same limitations affect the empirical analysis of data science pipelines in practice.

Simultaneously, language models have shown strong capabilities in code understanding and classification tasks [13]. In addition, Small Language Models (SLMs) have drawn interest from the scientific community, looking for more sustainable and reproducible practices, thanks to their lower resource demands. Yet, their potential for extracting ML pipeline structures has still to be evaluated.

Following our registered report [14], we present the results of our confirmatory study which investigates the use of SLMs for reverse-engineering ML pipeline structures, its limitations, and its impact on our understanding of ML practices. This paper addresses the following research questions:

RQ1 In ML pipeline’s structure extraction, are SLMs significantly more accurate in identifying stages than existing model-based or rule-based classifiers?

RQ2 Does the taxonomy “wording” significantly influence the classification results of SLMs?

RQ3 Does the use of an SLM in the reverse-engineering process provide significantly different exploratory insights than those produced by reference studies compared to the ground truth?

To answer RQ1, we selected two reference studies from the literature, and replicated their classification methods using provided reproduction packages. Building on their datasets, we benchmarked and selected the best performing SLM among a set of open-weight SLMs trained for coding tasks. Then, we created a mapping between the different reference studies' taxonomies to obtain a unified taxonomy. This taxonomy was used to compare classification results from this SLM with the reference studies, both from a statistical and practical perspective.

To answer RQ2, we mutated the unified taxonomy’s headwords using the “synonym substitution” [15] method. Each mutation impact was evaluated using the same benchmarking methodology that RQ1, with the SLM being prompted with the mutated taxonomy.

To answer RQ3, we analyzed key insights (e.g., stages distribution, transition frequencies, sequential patterns) emerging from the classification results obtained using the reference studies and the best performing SLM. These insights were compared according to the classification method used with manually labeled ML pipelines to assess the ability of these classification methods to provide a consistent understanding of the practices in ML.

Contribution First, we replicate two scientific studies and show empirically that our understanding of practices in ML is influenced by limitations in the classification methods currently used in the literature. This demonstrates that there remains a significant amount of work to be done to develop a comprehensive understanding of these practices. We also show that available SLMs are not an immediate solution to this problem. Despite offering promising results, we demonstrate that they are highly sensitive to the formulation of the taxonomy used. This is particularly important as the literature presents a multitude of taxonomies. Finally, our contribution also lies in the adoption of a more sustainable scientific approach (better reproducibility and contained energy consumption with smaller language models), as motivated by “The Copenhagen Manifesto” [16]. Our study demonstrates that SLMs still present a high inference cost, a factor that must be considered before undertaking costly fine-tuning or turning to larger models.

Paper structure The overview of our study is illustrated in Figure 1. We provide background and discuss related work of the study in Section 2. We present key insights from the reference studies and discuss the challenges encountered in replicating them in Section 3. We introduce the preparation of the study, including the best performing SLM selection and taxonomy unification, in Section 4. We introduce the study results and answer research questions in Section 5. We clarify the few deviations from the registered report in Section 6. We discuss the threats to validity in Section 7. We conclude and discuss future works in Section 8.

Nicolas Lacroix et al.

Fig. 1 Overview of the main tasks of our study

Figure

References (58)