一句话:提出数据感知的静态分析,结合数据流、控制流与 API 契约,在编码阶段检测机器学习代码的语义错误。
机器学习开发者常因误用模型而引入语义错误,例如使用未缩放的数据训练对尺度敏感的模型,这类错误通常要在训练完成后通过人工分析结果才能发现,效率低下。本文提出一种数据感知的静态分析(data-aware static analysis)方法,使开发者能够在编写代码时即发现这些缺陷,而不必等到模型训练之后。该方法结合数据流与控制流分析以及 API 契约,从而在高抽象层次上对机器学习代码进行数据感知推理。作者通过分析一组真实世界的机器学习 notebook 样本展示该方案的潜力,结果表明其能够检测出必须依靠数据感知方法才能发现的语义错误。
Semantic faults specific to the use of machine learning models are a common problem for machine learning developers, causing suboptimal predictions, high computational cost, or incorrect outputs. For example, one may erroneously use unscaled data to train a scale-sensitive model. Machine learning developers detect these faults after training their models and manually analyzing the results, making it an inefficient process. We propose a novel data-aware static analysis approach to detect semantic faults in machine learning code, allowing developers to reveal these bugs while writing code instead of after training the model. Our approach uses combined data and control flow analysis, and API contracts, enabling data-aware reasoning about machine learning code at a high level of abstraction. We highlight the potential of our solution by analyzing a sample of real-world machine learning notebooks, finding that we can detect faults that require a data-aware approach.
@inproceedings{paperbot12066,
title = {Data-aware Static Analysis: Improving Semantic Fault Detection in Machine Learning Code Using Data Characteristics},
author = {Willem Meijer and Kristian Sandahl and Dániel Varró},
booktitle = {ICSE},
year = {2026},
doi = {10.1145/3786582.3786805}
}