paperbot · PL 论文追踪

全部论文 待读 收藏

P0 Refty

Refty:基于细化类型的深度学习模型静态检查
ICSE Proceedings of the 44th International Conference on Software Engineering2022匹配度 8/10 · 论文将细化类型与 SMT 用于深度学习模型的静态检查,属于用户关注的 PL→AI 中“在机器学习系统中应用静态分析”方向,且兼具形式化约束与 PyTorch/TensorFlow 工具实现。但它不涉及 Agentic/LLM 程序、浮点程序分析或贝叶斯程序分析,因此并非最核心子方向。引用 4 inbox
Yanjie Gao, Zhengxian Li, Haoxiang Lin, Hongyu Zhang, Ming Wu, Mao Yang
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出基于细化类型的工具 Refty,用 SMT 求解算子约束,在运行前静态检测深度学习模型的类型错误。

深度学习模型构建多依赖手工且缺乏工具支持,若违反算子计算约束会引发类型错误,导致运行时异常或错误结果。Refty 基于细化类型,为每个深度学习算子类型附加与框架无关的逻辑公式,刻画张量与超参数的计算约束;给定模型结构和超参数域后,遍历算子生成约束,并调用 SMT 求解器判定模型合法性。在 PyTorch 和 TensorFlow 下,对单个算子及多种超参数取值的真实模型进行评估,并与现有形状检查工具比较;Refty 找到全部类型错误,精确率和召回率均达 100%。

问题
深度学习模型构建缺乏必要工具支持,开发者可能违反算子的计算约束(如卷积核过大导致输出张量维度非正),从而引发模型类型错误、运行时异常或错误结果。
方法
Refty 用细化类型为每个算子编码与框架无关的逻辑约束,遍历模型结构并生成待满足约束,再借助 SMT 求解器静态判定模型是否合法。
评估
作者在 PyTorch 与 TensorFlow 上评估单个算子及多种超参数取值的真实模型,并与已有形状检查工具对比;Refty 找出全部类型错误,精确率和召回率均为 100%。
原文摘要(Abstract)

Deep learning has been increasingly adopted in many application areas. To construct valid deep learning models, developers must conform to certain computational constraints by carefully selecting appropriate neural architectures and hyperparameter values. For example, the kernel size hyperparameter of the 2D convolution operator cannot be overlarge to ensure that the height and width of the output tensor remain positive. Because model construction is largely manual and lacks necessary tooling support, it is possible to violate those constraints and raise type errors of deep learning models, causing either runtime exceptions or wrong output results. In this paper, we propose Refty, a refinement type-based tool for statically checking the validity of deep learning models ahead of job execution. Refty refines each type of deep learning operator with framework-independent logical formulae that describe the computational constraints on both tensors and hyperparameters. Given the neural architecture and hyperparameter domains of a model, Refty visits every operator, generates a set of constraints that the model should satisfy, and utilizes an SMT solver for solving the constraints. We have evaluated Refty on both individual operators and representative real-world models with various hyperparameter values under PyTorch and TensorFlow. We also compare it with an existing shape-checking tool. The experimental results show that Refty finds all the type errors and achieves 100% Precision and Recall, demonstrating its effectiveness.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{GaoLLZWY22,
  title = {Refty},
  author = {Yanjie Gao and Zhengxian Li and Haoxiang Lin and Hongyu Zhang and Ming Wu and Mao Yang},
  booktitle = {ICSE},
  year = {2022},
  doi = {10.1145/3510003.3510077}
}