Small language models analyzed for understanding machine learning steps

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

Software EngineeringMachine Learning

Summary

It can be hard to figure out how people build machine learning programs because they involve many different steps, like cleaning data and creating models. The authors studied small language models to see if they can recognize these steps from code better than older methods. They found that while these models do well, they don’t outperform existing techniques and have some practical challenges. Also, how the steps are described can change how well the models work. This study helps us understand the limits and potential of using language tools for analyzing machine learning work.

What this means in practice

  • For software engineering teams: Use small language models to automatically identify stages in machine learning code for improved code understanding and review.
  • For machine learning operations teams: Improve automated analysis of machine learning workflows by integrating small language models to extract pipeline structure for better monitoring.

Authors

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

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 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.