- Title
- REFTY: Refinement Types for Valid Deep Learning Models
- Creator
- Gao, Yanjie; Li, Zhengxian; Lin, Haoxiang; Zhang, Hongyu; Wu, Ming; Yang, Mao
- Relation
- ICSE '22: 44th International Conference on Software Engineering. Proceedings of the 44th International Conference on Software Engineering (Pittsburgh, PA 21-29 May, 2022) p. 1843-1855
- Publisher Link
- http://dx.doi.org/10.1145/3510003.3510077
- Publisher
- Institute of Electrical and Electronics Engineers (IEEE)
- Resource Type
- conference paper
- Date
- 2022
- Description
- 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.
- Subject
- deep learning; validity checking; type error; refinement type
- Identifier
- http://hdl.handle.net/1959.13/1465595
- Identifier
- uon:47314
- Identifier
- ISBN:9781450392211
- Language
- eng
- Reviewed
- Hits: 1299
- Visitors: 1298
- Downloads: 0