[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-123070-en":3,"doc-seo-123070-105":30,"detail-sidebar-cat-0-en-105":95},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":4,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":27,"seo_description":14,"update_tm":28,"read_time":29},123070,8796095461610,"Oliver","https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c",8,"Research & Report","Inferring Pluggable Types with Machine Learning - Research Paper Summary","Pluggable type systems let programmers extend a language’s type rules to enforce semantic properties, but adoption in legacy code is slowed by the need for manual type annotations. This paper studies how machine learning can infer type qualifiers automatically, proposing NaP-AST to encode minimal dataflow hints. It evaluates Graph Transformer Network, Graph Convolutional Network, and large language models, and validates results on 12 open-source programs from the NullAway setting. GTN achieves the best recall and precision, and class-size experiments indicate performance gains up to around 16k classes before overfitting. ","Inferring Pluggable Types with Machine Learning  \nKazi Amanul Islam Siddiqui  \nDepartment of Computer Science New Jersey Institute of Technology Newark, USA [ks225@njit.edu](ks225@njit.edu)  \nMartin Kellogg  \nDepartment of Computer Science New Jersey Institute of Technology Newark, USA [martin.kellogg@njit.edu](martin.kellogg@njit.edu)  \narXiv :2406 . 15676v1 [ cs . SE] 21 Jun 2024  \nAbstract—Pluggable type systems allow programmers to extend the type system of a programming language to enforce semantic properties defined by the programmer. Pluggable type systems are difficult to deploy in legacy codebases because they require programmers to write type annotations manually. This paper investigates how to use machine learning to infer type qualifiers automatically. We propose a novel representation, NaP-AST, that encodes minimal dataflow hints for the effective inference of type qualifiers. We evaluate several model architectures for inferring type qualifiers, including Graph Transformer Network, Graph Convolutional Network and Large Language Model. We further validated these models by applying them to 12 open-source programs from a prior evaluation of the NullAway pluggable typechecker, lowering warnings in all but one unannotated project. We discovered that GTN shows the best performance, with a recall of .89 and precision of 0.6. Furthermore, we conduct a study to estimate the number of Java classes needed for good performance of the trained model. For our feasibility study, performance improved around 16k classes, and deteriorated due to overfitting around 22k classes.  \nIndex Terms—component, formatting, style, styling, insert  \nI. INTRODUCTION  \nWhen programmers write code, they are often aware of semantic properties that a variable must adhere to but which are not checked by the type system of their programming language. Pluggable type systems are a method of adding custom type qualifiers to a language. A pluggable typechecker statically checks these user-defined qualifiers and warns about potential violations at compile time. For example, PUnits [1] adds qualifiers for scientific units, while Uber’s NullAway [2], Meta’s NullSafe [3], and the Checker Framework [4], [5] enforce programs do not crash due to null-pointer dereferences with a @Nullable qualifier. A key barrier to bringing legacy codebases into compliance with a typechecker is that developers must write these qualifiers into their code to see the full benefit of the tools. The state of the practice when deploying a new typechecker on a legacy codebase remains manual annotation: that is, in practice, type qualifiers are written by hand. The high cost of this manual process discourages developers from using these systems, despite their promise to improve code quality. This paper addresses the problem of bringing a legacy codebase into compliance with a typechecker by automatically inferring type qualifiers.  \nRecently, researchers have proposed using machine learning to solve a similar problem: inferring type annotations for untyped Python or TypeScript programs [6]–[11] . This problem  \nshares a key feature with our problem of inferring type qualifiers for a legacy codebase: in both cases, the programs were written without feedback from the typechecker, so we expect the programs not to typecheck cleanly (with any set of annotations) . Experimental results suggest that these techniques outperform traditional deductive type inference techniques, so in this paper we investigate whether a similar approach can work for the problem of inferring pluggable types.  \nHowever, techniques for inferring types in Python or JavaScript programs are not immediately transferrable to our setting, because of three key differences. First, when inferring types for Python or JavaScript, the property of interest is known in advance: the type system is fixed (it enforces“tradtional” type safety: objects do not try to perform invalid operations) . A key advantage of pluggable type syste","cbCaia6hLpAk2aPL","https://ap.wps.com/l/cbCaia6hLpAk2aPL","pdf",304614,1,12,"English","en",105,"# Introduction\n## Pluggable type systems and the manual annotation barrier\n## Related work: ML-based type inference in Python/JavaScript\n## Key differences and research questions\n## Proposed ML pipeline","[{\"question\":\"What problem does the paper address in pluggable type systems?\",\"answer\":\"It addresses the high cost of manually writing type qualifiers when deploying pluggable typecheckers to legacy codebases, which discourages adoption despite potential code-quality benefits.\"},{\"question\":\"What is NaP-AST and how is it used?\",\"answer\":\"NaP-AST is a proposed representation that encodes minimal dataflow hints to support effective inference of type qualifiers in a pluggable type setting.\"},{\"question\":\"Which models are evaluated and what is the best observed performance?\",\"answer\":\"The paper evaluates Graph Transformer Network, Graph Convolutional Network, and a Large Language Model for inferring type qualifiers, with GTN reporting the best performance (recall about 0.89 and precision 0.6).\"},{\"question\":\"How does the required training data size affect feasibility?\",\"answer\":\"A study estimates the number of Java classes needed for good performance, showing improvements around 16k classes and deterioration after about 22k classes due to overfitting.\"}]","Inferring Pluggable Types with Machine Learning - Research Paper Summary | PDF",1785814497,30,{"code":4,"msg":31,"data":32},"ok",{"site_id":24,"language":23,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":90,"head_meta":92,"extra_data":94,"updated_unix":28},"inferring-pluggable-types-with-machine-learning-research-paper-summary","",{"@graph":36,"@context":89},[37,54,68],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,51],{"item":41,"name":42,"@type":43,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":50},"https://docshare.wps.com/document/research-report/",3,{"item":52,"name":13,"@type":43,"position":53},"https://docshare.wps.com/document/inferring-pluggable-types-with-machine-learning-research-paper-summary/123070/",4,{"url":52,"name":13,"@type":55,"author":56,"headline":13,"publisher":58,"fileFormat":61,"inLanguage":23,"description":14,"dateModified":62,"datePublished":62,"encodingFormat":61,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":57},"Person",{"url":41,"name":59,"@type":60},"DocShare","Organization","application/pdf","2026-08-04",true,{"@type":65,"interactionType":66,"userInteractionCount":4},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81,85],{"name":72,"@type":73,"acceptedAnswer":74},"What problem does the paper address in pluggable type systems?","Question",{"text":75,"@type":76},"It addresses the high cost of manually writing type qualifiers when deploying pluggable typecheckers to legacy codebases, which discourages adoption despite potential code-quality benefits.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"What is NaP-AST and how is it used?",{"text":80,"@type":76},"NaP-AST is a proposed representation that encodes minimal dataflow hints to support effective inference of type qualifiers in a pluggable type setting.",{"name":82,"@type":73,"acceptedAnswer":83},"Which models are evaluated and what is the best observed performance?",{"text":84,"@type":76},"The paper evaluates Graph Transformer Network, Graph Convolutional Network, and a Large Language Model for inferring type qualifiers, with GTN reporting the best performance (recall about 0.89 and precision 0.6).",{"name":86,"@type":73,"acceptedAnswer":87},"How does the required training data size affect feasibility?",{"text":88,"@type":76},"A study estimates the number of Java classes needed for good performance, showing improvements around 16k classes and deterioration after about 22k classes due to overfitting.","https://schema.org",{"og:url":52,"og:type":91,"og:title":13,"og:site_name":59,"og:description":14},"article",{"robots":93,"canonical":52},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":96},[97,101,105,109,114,119,124,126,131,134,138],{"id":20,"doc_module":4,"doc_module_name":46,"category_name":98,"show_sort_weight":99,"slug":100},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":102,"show_sort_weight":103,"slug":104},"Literature",80,"literature",{"id":53,"doc_module":4,"doc_module_name":46,"category_name":106,"show_sort_weight":107,"slug":108},"Exam",70,"exam",{"id":110,"doc_module":4,"doc_module_name":46,"category_name":111,"show_sort_weight":112,"slug":113},5,"Comic",60,"comic",{"id":115,"doc_module":4,"doc_module_name":46,"category_name":116,"show_sort_weight":117,"slug":118},6,"Technology",50,"technology",{"id":120,"doc_module":4,"doc_module_name":46,"category_name":121,"show_sort_weight":122,"slug":123},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":29,"slug":125},"research-report",{"id":127,"doc_module":4,"doc_module_name":46,"category_name":128,"show_sort_weight":129,"slug":130},9,"Religion & Spirituality",20,"religion-spirituality",{"id":129,"doc_module":4,"doc_module_name":46,"category_name":132,"show_sort_weight":129,"slug":133},"World Cup","world-cup",{"id":135,"doc_module":4,"doc_module_name":46,"category_name":136,"show_sort_weight":135,"slug":137},10,"Lifestyle","lifestyle",{"id":139,"doc_module":4,"doc_module_name":46,"category_name":140,"show_sort_weight":110,"slug":141},19,"General","general"]