What kinds of contracts do ML APIs need?

被引:1
|
作者
Khairunnesa, Samantha Syeda [1 ]
Ahmed, Shibbir [2 ]
Imtiaz, Sayem Mohammad [2 ]
Rajan, Hridesh [2 ]
Leavens, Gary T. [3 ]
机构
[1] Bradley Univ, Dept Comp Sci & Informat Syst, Peoria, IL 61625 USA
[2] Iowa State Univ, Dept Comp Sci, Ames, IA USA
[3] Univ Cent Florida, Dept Comp Sci, Orlando, FL USA
关键词
Machine Learning; API contracts; Empirical software engineering; Software engineering for machine learning;
D O I
10.1007/s10664-023-10320-z
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Recent work has shown that Machine Learning (ML) programs are error-prone and called for contracts for ML code. Contracts, as in the design by contract methodology, help document APIs and aid API users in writing correct code. The question is: what kinds of contracts would provide the most help to API users? We are especially interested in what kinds of contracts help API users catch errors at earlier stages in the ML pipeline. We describe an empirical study of posts on Stack Overflow of the four most often-discussed ML libraries: TensorFlow, Scikit-learn, Keras, and PyTorch. For these libraries, our study extracted 413 informal (English) API specifications. We used these specifications to understand the following questions. What are the root causes and effects behind ML contract violations? Are there common patterns of ML contract violations? When does understanding ML contracts require an advanced level of ML software expertise? Could checking contracts at the API level help detect the violations in early ML pipeline stages? Our key findings are that the most commonly needed contracts for ML APIs are either checking constraints on single arguments of an API or on the order of API calls. The software engineering community could employ existing contract mining approaches to mine these contracts to promote an increased understanding of ML APIs. We also noted a need to combine behavioral and temporal contract mining approaches. We report on categories of required ML contracts, which may help designers of contract languages.
引用
收藏
页数:37
相关论文
共 50 条
  • [21] What astrocytes need to do
    Hardingham, Giles E.
    Petzold, Gabor C.
    Mehta, Arpan R.
    [J]. LANCET NEUROLOGY, 2021, 20 (04): : 260 - 260
  • [22] What do people need?
    Betteridge, Neil
    Camilleri, Connie
    Stoyanoff, Linda
    Kopansky-Giles, Deborah
    de Guzman, Josef
    Makri, Souzi
    Mwaniki, Lillian
    [J]. BEST PRACTICE & RESEARCH IN CLINICAL RHEUMATOLOGY, 2020, 34 (05):
  • [23] What do They Need to Know?
    Libby V. Morris
    [J]. Innovative Higher Education, 2013, 38 (2) : 89 - 90
  • [24] WHAT DO SCHOOLS NEED
    PRETLOW, DZ
    [J]. MANAGERS AND MISSIONARIES : LIBRARY SERVICES TO CHILDREN AND YOUNG ADULTS IN THE INFORMATION AGE, 1989, 28 : 141 - 146
  • [25] WHAT DO ELDERLY NEED
    不详
    [J]. LANCET, 1973, 2 (7833): : 833 - 834
  • [26] What do They Need to Know?
    Morris, Libby V.
    [J]. INNOVATIVE HIGHER EDUCATION, 2013, 38 (02) : 89 - 90
  • [27] WHAT DO YOU NEED
    WIVAGG, D
    [J]. AMERICAN BIOLOGY TEACHER, 1989, 51 (01): : 8 - 8
  • [28] WHAT WE DO NOT NEED
    不详
    [J]. NATION, 1968, 206 (03) : 67 - 68
  • [29] What are Smart Contracts and How Do They Work?
    Ma A.
    [J]. ITNOW, 2022, 64 (03) : 50 - 51
  • [30] Compensation and employment contracts: What to do and what to watch out for
    Thorne, J.D.
    [J]. Die Casting Engineer, 1997, 41 (06):