SlideShare a Scribd company logo
Deep Learning Type Inference for Dynamic
Programming Languages
Amir M. Mir
PhD Student in Software Engineering Research Group
s.a.m.mir@tudelft.nl
SERG Lunch
April 22, 20201
Content
● Introduction
● Type annotations
● Existing Deep Learning-based approaches
● Major Research Problem
● Our current approach
2
Introduction
Dynamic programming languages such as Python and JavaScript are extremely
popular nowadays.
3
Introduction
Dynamic languages enable fast prototyping.
4
Issues of Dynamic Languages
● Type errors
● Suboptimal IDE support
● Unexpected runtime behavior
● Difficult-to-understand APIs
5
Type Annotations
● Type hints for Python 3 (PEP 484, Sep. 2014)
● TypeScript with optional static types (Oct. 2012)
6
Type Annotations
TypeScript example:
7
Type Annotations
Python example:
8
Type Annotations
Issues
● Relies on developers
● Cumbersome and error-prone process
● Two main approaches for inferring types:
○ Static analysis tools
○ ML-based approaches
9
Static Type Checkers
● Mypy (mypy-lang.org/)
● Pyre (pyre-check.org/)
● Flow (flow.org/)
10
Existing Deep learning-based Approaches
11
Existing Deep learning-based Approaches
● DeepTyper (Vincent et al., 2018)
● NL2Type (Malik et al., 2019)
● TypeWriter (Pradel et al., 2020)
● LAMBDANET (Wel et al., 2020)
12
DeepTyper
● Inspired by part-of-speech (POS) tagging in NLP research
● The task is modelled as a sequence of annotations.
● Employs a Bi-directional Recurrent Neural Network (bi-RNN).
● Adds a consistency layer to the bi-RNN for considering multiple usage of a
variable.
13
DeepTyper
14
NL2Type
● Considers natural language information embedded in code
○ Name of the function
○ Name of the formal parameters
○ Comment associated with the function
○ Comment associated with the parameters
○ Comment associated with return type of the function
● Learns two word embeddings for both comments and identifier names
● Adapts an RNN with long short-term memory (LSTM)
15
NL2Type
16
NL2Type
17
TypeWriter
● Considers four kinds of context information:
○ Identifiers names
○ Code occurrences
○ Function-level comments
○ Available type hints
● Similar to NL2Type, it trains two word embeddings
● Has three RNNs submodels:
○ Learning from identifiers
○ Learning from token sequences
○ Learning from comments
● Feedback-guided search for consistent types
18
TypeWriter
Available type hints
Identifiers
Comments
Code occurrences
19
TypeWriter
20
LAMBDANET
● Imposes hard constraints on types
● Contextual hints
● Type dependency graph, i.e. a set of predicates
● Uses a Graph Neural Network (GNNs) and proposes a pointer-like network
for handling user-defined types
21
LAMBDANET
Type Dependency Graph
22
LAMBDANET
Hyperedges in type dependency graph
23
Major Research Problem
Closed type vocabulary, i.e. limited to 1000 types.
24
Out-of-Vocabulary Problem
25
DNN Model
Unknown
Return type
Parameter type
Our Current Approach
New dataset
26
Re-implementation of TypeWriter with new dataset
27
~27% higher ~7% higher
Our Current Approach
Improved available type extractor
28
[AbstactResolver,
ClientConnectionError,
ClientHttpProxyError,
…]
1
1
0
0Python dataset Visible Type hints extractor
Type mask vector● Lightweight static analysis with importlab and LibCST
Our Current Approach
Future
● Refinements to the search part and/or the neural model
● Performing extensive experiments to show the effectiveness of the
approach
● Writing a paper draft by the end of June.
29
Thank You!
30
References
1. Hellendoorn, V. J., Bird, C., Barr, E. T., & Allamanis, M. (2018, October). Deep learning type inference. In Proceedings of the 2018 26th acm
joint meeting on european software engineering conference and symposium on the foundations of software engineering (pp. 152-162).
2. Malik, R. S., Patra, J., & Pradel, M. (2019, May). NL2Type: inferring JavaScript function types from natural language information. In 2019
IEEE/ACM 41st International Conference on Software Engineering (ICSE) (pp. 304-315). IEEE.
3. Pradel, M., Gousios, G., Liu, J., & Chandra, S. (2019). TypeWriter: Neural Type Prediction with Search-based Validation. arXiv preprint
arXiv:1912.03768.
4. Wei, J., Goyal, M., Durrett, G., & Dillig, I. (2020). LambdaNet: Probabilistic Type Inference using Graph Neural Networks. ICLR 2020.
5. Gage, P. (1994). A new algorithm for data compression. C Users Journal, 12(2), 23-38.
6. Sennrich, R., Haddow, B., & Birch, A. (2015). Neural machine translation of rare words with subword units. arXiv preprint arXiv:1508.07909.
31

More Related Content

What's hot

Introduction to Named Entity Recognition
Introduction to Named Entity RecognitionIntroduction to Named Entity Recognition
Introduction to Named Entity Recognition
Tomer Lieber
 
AINL 2016: Bastrakova, Ledesma, Millan, Zighed
AINL 2016: Bastrakova, Ledesma, Millan, ZighedAINL 2016: Bastrakova, Ledesma, Millan, Zighed
AINL 2016: Bastrakova, Ledesma, Millan, Zighed
Lidia Pivovarova
 
Semantic Technologies in ST&DL
Semantic Technologies in ST&DLSemantic Technologies in ST&DL
Semantic Technologies in ST&DL
Andrea Nuzzolese
 
I didn't know you could do that with groovy
I didn't know you could do that with groovyI didn't know you could do that with groovy
I didn't know you could do that with groovy
Steven Hicks
 
A hierarchical neural autoencoder for paragraphs and documents
A hierarchical neural autoencoder for paragraphs and documentsA hierarchical neural autoencoder for paragraphs and documents
A hierarchical neural autoencoder for paragraphs and documents
Hayahide Yamagishi
 
The Triplex Approach for Recognizing Semantic Relations from Noun Phrases, Ap...
The Triplex Approach for Recognizing Semantic Relations from Noun Phrases, Ap...The Triplex Approach for Recognizing Semantic Relations from Noun Phrases, Ap...
The Triplex Approach for Recognizing Semantic Relations from Noun Phrases, Ap...
Iman Mirrezaei
 
A Low Dimensionality Representation for Language Variety Identification (CICL...
A Low Dimensionality Representation for Language Variety Identification (CICL...A Low Dimensionality Representation for Language Variety Identification (CICL...
A Low Dimensionality Representation for Language Variety Identification (CICL...
Francisco Manuel Rangel Pardo
 
Splitup Syllabus for Class XII
Splitup Syllabus for Class XIISplitup Syllabus for Class XII
Splitup Syllabus for Class XII
Praveen M Jigajinni
 
AINL 2016: Eyecioglu
AINL 2016: EyeciogluAINL 2016: Eyecioglu
AINL 2016: Eyecioglu
Lidia Pivovarova
 
Icpc16.ppt
Icpc16.pptIcpc16.ppt
AINL 2016: Malykh
AINL 2016: MalykhAINL 2016: Malykh
AINL 2016: Malykh
Lidia Pivovarova
 
Language Variety Identification using Distributed Representations of Words an...
Language Variety Identification using Distributed Representations of Words an...Language Variety Identification using Distributed Representations of Words an...
Language Variety Identification using Distributed Representations of Words an...
Francisco Manuel Rangel Pardo
 
Opinion mining for social media and news items in Romanian
Opinion mining for social media and news items in RomanianOpinion mining for social media and news items in Romanian
Opinion mining for social media and news items in Romanian
Traian Rebedea
 
OntoLex-TEI: Inspiration from Global WordNet
OntoLex-TEI: Inspiration from Global WordNetOntoLex-TEI: Inspiration from Global WordNet
OntoLex-TEI: Inspiration from Global WordNet
PretaLLOD
 
Studi Penerapan Ontologi dalam Bahasa Inggris sebagai Kerangka
Studi Penerapan Ontologi dalam Bahasa Inggris sebagai KerangkaStudi Penerapan Ontologi dalam Bahasa Inggris sebagai Kerangka
Studi Penerapan Ontologi dalam Bahasa Inggris sebagai Kerangka
Metilova Sitorus
 
kite
kitekite
kite
miso_uam
 
Topic Modeling for Learning Analytics Researchers LAK15 Tutorial
Topic Modeling for Learning Analytics Researchers LAK15 TutorialTopic Modeling for Learning Analytics Researchers LAK15 Tutorial
Topic Modeling for Learning Analytics Researchers LAK15 Tutorial
Vitomir Kovanovic
 
Chinese Character Decomposition for Neural MT with Multi-Word Expressions
Chinese Character Decomposition for  Neural MT with Multi-Word ExpressionsChinese Character Decomposition for  Neural MT with Multi-Word Expressions
Chinese Character Decomposition for Neural MT with Multi-Word Expressions
Lifeng (Aaron) Han
 
Scam 08
Scam 08Scam 08
Scam 08
ClarkTony
 
ADAPT Centre and My NLP journey: MT, MTE, QE, MWE, NER, Treebanks, Parsing.
ADAPT Centre and My NLP journey: MT, MTE, QE, MWE, NER, Treebanks, Parsing.ADAPT Centre and My NLP journey: MT, MTE, QE, MWE, NER, Treebanks, Parsing.
ADAPT Centre and My NLP journey: MT, MTE, QE, MWE, NER, Treebanks, Parsing.
Lifeng (Aaron) Han
 

What's hot (20)

Introduction to Named Entity Recognition
Introduction to Named Entity RecognitionIntroduction to Named Entity Recognition
Introduction to Named Entity Recognition
 
AINL 2016: Bastrakova, Ledesma, Millan, Zighed
AINL 2016: Bastrakova, Ledesma, Millan, ZighedAINL 2016: Bastrakova, Ledesma, Millan, Zighed
AINL 2016: Bastrakova, Ledesma, Millan, Zighed
 
Semantic Technologies in ST&DL
Semantic Technologies in ST&DLSemantic Technologies in ST&DL
Semantic Technologies in ST&DL
 
I didn't know you could do that with groovy
I didn't know you could do that with groovyI didn't know you could do that with groovy
I didn't know you could do that with groovy
 
A hierarchical neural autoencoder for paragraphs and documents
A hierarchical neural autoencoder for paragraphs and documentsA hierarchical neural autoencoder for paragraphs and documents
A hierarchical neural autoencoder for paragraphs and documents
 
The Triplex Approach for Recognizing Semantic Relations from Noun Phrases, Ap...
The Triplex Approach for Recognizing Semantic Relations from Noun Phrases, Ap...The Triplex Approach for Recognizing Semantic Relations from Noun Phrases, Ap...
The Triplex Approach for Recognizing Semantic Relations from Noun Phrases, Ap...
 
A Low Dimensionality Representation for Language Variety Identification (CICL...
A Low Dimensionality Representation for Language Variety Identification (CICL...A Low Dimensionality Representation for Language Variety Identification (CICL...
A Low Dimensionality Representation for Language Variety Identification (CICL...
 
Splitup Syllabus for Class XII
Splitup Syllabus for Class XIISplitup Syllabus for Class XII
Splitup Syllabus for Class XII
 
AINL 2016: Eyecioglu
AINL 2016: EyeciogluAINL 2016: Eyecioglu
AINL 2016: Eyecioglu
 
Icpc16.ppt
Icpc16.pptIcpc16.ppt
Icpc16.ppt
 
AINL 2016: Malykh
AINL 2016: MalykhAINL 2016: Malykh
AINL 2016: Malykh
 
Language Variety Identification using Distributed Representations of Words an...
Language Variety Identification using Distributed Representations of Words an...Language Variety Identification using Distributed Representations of Words an...
Language Variety Identification using Distributed Representations of Words an...
 
Opinion mining for social media and news items in Romanian
Opinion mining for social media and news items in RomanianOpinion mining for social media and news items in Romanian
Opinion mining for social media and news items in Romanian
 
OntoLex-TEI: Inspiration from Global WordNet
OntoLex-TEI: Inspiration from Global WordNetOntoLex-TEI: Inspiration from Global WordNet
OntoLex-TEI: Inspiration from Global WordNet
 
Studi Penerapan Ontologi dalam Bahasa Inggris sebagai Kerangka
Studi Penerapan Ontologi dalam Bahasa Inggris sebagai KerangkaStudi Penerapan Ontologi dalam Bahasa Inggris sebagai Kerangka
Studi Penerapan Ontologi dalam Bahasa Inggris sebagai Kerangka
 
kite
kitekite
kite
 
Topic Modeling for Learning Analytics Researchers LAK15 Tutorial
Topic Modeling for Learning Analytics Researchers LAK15 TutorialTopic Modeling for Learning Analytics Researchers LAK15 Tutorial
Topic Modeling for Learning Analytics Researchers LAK15 Tutorial
 
Chinese Character Decomposition for Neural MT with Multi-Word Expressions
Chinese Character Decomposition for  Neural MT with Multi-Word ExpressionsChinese Character Decomposition for  Neural MT with Multi-Word Expressions
Chinese Character Decomposition for Neural MT with Multi-Word Expressions
 
Scam 08
Scam 08Scam 08
Scam 08
 
ADAPT Centre and My NLP journey: MT, MTE, QE, MWE, NER, Treebanks, Parsing.
ADAPT Centre and My NLP journey: MT, MTE, QE, MWE, NER, Treebanks, Parsing.ADAPT Centre and My NLP journey: MT, MTE, QE, MWE, NER, Treebanks, Parsing.
ADAPT Centre and My NLP journey: MT, MTE, QE, MWE, NER, Treebanks, Parsing.
 

Similar to Deep learning Type Inference for Dynamic Programming Languages

The presentation of Type4Py at the ICSE'22 conference
The presentation of Type4Py at the ICSE'22 conferenceThe presentation of Type4Py at the ICSE'22 conference
The presentation of Type4Py at the ICSE'22 conference
Amir M. Mir
 
The Object Model
The Object Model  The Object Model
The Object Model
yndaravind
 
A Primer on High-Quality Identifier Naming [ASE 2022]
A Primer on High-Quality Identifier Naming [ASE 2022]A Primer on High-Quality Identifier Naming [ASE 2022]
A Primer on High-Quality Identifier Naming [ASE 2022]
University of Hawai‘i at Mānoa
 
CIS 5 Project.pdf
CIS 5 Project.pdfCIS 5 Project.pdf
CIS 5 Project.pdf
RayvonneEvans1
 
cis5-204-Project-ch11c - Evan, Le, Mata.pdf
cis5-204-Project-ch11c - Evan, Le, Mata.pdfcis5-204-Project-ch11c - Evan, Le, Mata.pdf
cis5-204-Project-ch11c - Evan, Le, Mata.pdf
MinhLe595264
 
What do Practitioners Expect from the Meta-modeling Tools? A Survey
What do Practitioners Expect from the Meta-modeling Tools? A SurveyWhat do Practitioners Expect from the Meta-modeling Tools? A Survey
What do Practitioners Expect from the Meta-modeling Tools? A Survey
Obeo
 
Text categorization
Text categorizationText categorization
Text categorization
Shubham Pahune
 
Miso-McGill
Miso-McGillMiso-McGill
Miso-McGill
miso_uam
 
GE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_NotesGE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_Notes
Asst.prof M.Gokilavani
 
Graph-to-Text Generation and its Applications to Dialogue
Graph-to-Text Generation and its Applications to DialogueGraph-to-Text Generation and its Applications to Dialogue
Graph-to-Text Generation and its Applications to Dialogue
Jinho Choi
 
ResearchPaper
ResearchPaperResearchPaper
ResearchPaper
Prajakta Yerpude
 
ALGORITHM FOR TEXT TO GRAPH CONVERSION AND SUMMARIZING USING NLP: A NEW APPRO...
ALGORITHM FOR TEXT TO GRAPH CONVERSION AND SUMMARIZING USING NLP: A NEW APPRO...ALGORITHM FOR TEXT TO GRAPH CONVERSION AND SUMMARIZING USING NLP: A NEW APPRO...
ALGORITHM FOR TEXT TO GRAPH CONVERSION AND SUMMARIZING USING NLP: A NEW APPRO...
kevig
 
ALGORITHM FOR TEXT TO GRAPH CONVERSION
ALGORITHM FOR TEXT TO GRAPH CONVERSION ALGORITHM FOR TEXT TO GRAPH CONVERSION
ALGORITHM FOR TEXT TO GRAPH CONVERSION
ijnlc
 
Recent Trends in Translation of Programming Languages using NLP Approaches
Recent Trends in Translation of Programming Languages using NLP ApproachesRecent Trends in Translation of Programming Languages using NLP Approaches
Recent Trends in Translation of Programming Languages using NLP Approaches
IRJET Journal
 
Python Mastery: A Comprehensive Guide to Setting Up Your Development Environment
Python Mastery: A Comprehensive Guide to Setting Up Your Development EnvironmentPython Mastery: A Comprehensive Guide to Setting Up Your Development Environment
Python Mastery: A Comprehensive Guide to Setting Up Your Development Environment
Python Devloper
 
An Empirical Comparison of Knowledge Graph Embeddings for Item Recommendation
An Empirical Comparison of Knowledge Graph Embeddings for Item RecommendationAn Empirical Comparison of Knowledge Graph Embeddings for Item Recommendation
An Empirical Comparison of Knowledge Graph Embeddings for Item Recommendation
Enrico Palumbo
 
Lecture1.pptx
Lecture1.pptxLecture1.pptx
Lecture1.pptx
akabiradam13
 
Open Chemistry, JupyterLab and data: Reproducible quantum chemistry
Open Chemistry, JupyterLab and data: Reproducible quantum chemistryOpen Chemistry, JupyterLab and data: Reproducible quantum chemistry
Open Chemistry, JupyterLab and data: Reproducible quantum chemistry
Marcus Hanwell
 
Modern Programming Languages classification Poster
Modern Programming Languages classification PosterModern Programming Languages classification Poster
Modern Programming Languages classification Poster
Saulo Aguiar
 
Who models the world? Collaborative ontology creation and user roles in Wikidata
Who models the world? Collaborative ontology creation and user roles in WikidataWho models the world? Collaborative ontology creation and user roles in Wikidata
Who models the world? Collaborative ontology creation and user roles in Wikidata
Alessandro Piscopo
 

Similar to Deep learning Type Inference for Dynamic Programming Languages (20)

The presentation of Type4Py at the ICSE'22 conference
The presentation of Type4Py at the ICSE'22 conferenceThe presentation of Type4Py at the ICSE'22 conference
The presentation of Type4Py at the ICSE'22 conference
 
The Object Model
The Object Model  The Object Model
The Object Model
 
A Primer on High-Quality Identifier Naming [ASE 2022]
A Primer on High-Quality Identifier Naming [ASE 2022]A Primer on High-Quality Identifier Naming [ASE 2022]
A Primer on High-Quality Identifier Naming [ASE 2022]
 
CIS 5 Project.pdf
CIS 5 Project.pdfCIS 5 Project.pdf
CIS 5 Project.pdf
 
cis5-204-Project-ch11c - Evan, Le, Mata.pdf
cis5-204-Project-ch11c - Evan, Le, Mata.pdfcis5-204-Project-ch11c - Evan, Le, Mata.pdf
cis5-204-Project-ch11c - Evan, Le, Mata.pdf
 
What do Practitioners Expect from the Meta-modeling Tools? A Survey
What do Practitioners Expect from the Meta-modeling Tools? A SurveyWhat do Practitioners Expect from the Meta-modeling Tools? A Survey
What do Practitioners Expect from the Meta-modeling Tools? A Survey
 
Text categorization
Text categorizationText categorization
Text categorization
 
Miso-McGill
Miso-McGillMiso-McGill
Miso-McGill
 
GE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_NotesGE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_Notes
 
Graph-to-Text Generation and its Applications to Dialogue
Graph-to-Text Generation and its Applications to DialogueGraph-to-Text Generation and its Applications to Dialogue
Graph-to-Text Generation and its Applications to Dialogue
 
ResearchPaper
ResearchPaperResearchPaper
ResearchPaper
 
ALGORITHM FOR TEXT TO GRAPH CONVERSION AND SUMMARIZING USING NLP: A NEW APPRO...
ALGORITHM FOR TEXT TO GRAPH CONVERSION AND SUMMARIZING USING NLP: A NEW APPRO...ALGORITHM FOR TEXT TO GRAPH CONVERSION AND SUMMARIZING USING NLP: A NEW APPRO...
ALGORITHM FOR TEXT TO GRAPH CONVERSION AND SUMMARIZING USING NLP: A NEW APPRO...
 
ALGORITHM FOR TEXT TO GRAPH CONVERSION
ALGORITHM FOR TEXT TO GRAPH CONVERSION ALGORITHM FOR TEXT TO GRAPH CONVERSION
ALGORITHM FOR TEXT TO GRAPH CONVERSION
 
Recent Trends in Translation of Programming Languages using NLP Approaches
Recent Trends in Translation of Programming Languages using NLP ApproachesRecent Trends in Translation of Programming Languages using NLP Approaches
Recent Trends in Translation of Programming Languages using NLP Approaches
 
Python Mastery: A Comprehensive Guide to Setting Up Your Development Environment
Python Mastery: A Comprehensive Guide to Setting Up Your Development EnvironmentPython Mastery: A Comprehensive Guide to Setting Up Your Development Environment
Python Mastery: A Comprehensive Guide to Setting Up Your Development Environment
 
An Empirical Comparison of Knowledge Graph Embeddings for Item Recommendation
An Empirical Comparison of Knowledge Graph Embeddings for Item RecommendationAn Empirical Comparison of Knowledge Graph Embeddings for Item Recommendation
An Empirical Comparison of Knowledge Graph Embeddings for Item Recommendation
 
Lecture1.pptx
Lecture1.pptxLecture1.pptx
Lecture1.pptx
 
Open Chemistry, JupyterLab and data: Reproducible quantum chemistry
Open Chemistry, JupyterLab and data: Reproducible quantum chemistryOpen Chemistry, JupyterLab and data: Reproducible quantum chemistry
Open Chemistry, JupyterLab and data: Reproducible quantum chemistry
 
Modern Programming Languages classification Poster
Modern Programming Languages classification PosterModern Programming Languages classification Poster
Modern Programming Languages classification Poster
 
Who models the world? Collaborative ontology creation and user roles in Wikidata
Who models the world? Collaborative ontology creation and user roles in WikidataWho models the world? Collaborative ontology creation and user roles in Wikidata
Who models the world? Collaborative ontology creation and user roles in Wikidata
 

Recently uploaded

Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
PauloRodrigues104553
 
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.pptPROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
bhadouriyakaku
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
awadeshbabu
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
This is my Environmental physics presentation
This is my Environmental physics presentationThis is my Environmental physics presentation
This is my Environmental physics presentation
ZainabHashmi17
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
yokeleetan1
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
iemerc2024
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 

Recently uploaded (20)

Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
 
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.pptPROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
This is my Environmental physics presentation
This is my Environmental physics presentationThis is my Environmental physics presentation
This is my Environmental physics presentation
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 

Deep learning Type Inference for Dynamic Programming Languages

  • 1. Deep Learning Type Inference for Dynamic Programming Languages Amir M. Mir PhD Student in Software Engineering Research Group s.a.m.mir@tudelft.nl SERG Lunch April 22, 20201
  • 2. Content ● Introduction ● Type annotations ● Existing Deep Learning-based approaches ● Major Research Problem ● Our current approach 2
  • 3. Introduction Dynamic programming languages such as Python and JavaScript are extremely popular nowadays. 3
  • 5. Issues of Dynamic Languages ● Type errors ● Suboptimal IDE support ● Unexpected runtime behavior ● Difficult-to-understand APIs 5
  • 6. Type Annotations ● Type hints for Python 3 (PEP 484, Sep. 2014) ● TypeScript with optional static types (Oct. 2012) 6
  • 9. Type Annotations Issues ● Relies on developers ● Cumbersome and error-prone process ● Two main approaches for inferring types: ○ Static analysis tools ○ ML-based approaches 9
  • 10. Static Type Checkers ● Mypy (mypy-lang.org/) ● Pyre (pyre-check.org/) ● Flow (flow.org/) 10
  • 12. Existing Deep learning-based Approaches ● DeepTyper (Vincent et al., 2018) ● NL2Type (Malik et al., 2019) ● TypeWriter (Pradel et al., 2020) ● LAMBDANET (Wel et al., 2020) 12
  • 13. DeepTyper ● Inspired by part-of-speech (POS) tagging in NLP research ● The task is modelled as a sequence of annotations. ● Employs a Bi-directional Recurrent Neural Network (bi-RNN). ● Adds a consistency layer to the bi-RNN for considering multiple usage of a variable. 13
  • 15. NL2Type ● Considers natural language information embedded in code ○ Name of the function ○ Name of the formal parameters ○ Comment associated with the function ○ Comment associated with the parameters ○ Comment associated with return type of the function ● Learns two word embeddings for both comments and identifier names ● Adapts an RNN with long short-term memory (LSTM) 15
  • 18. TypeWriter ● Considers four kinds of context information: ○ Identifiers names ○ Code occurrences ○ Function-level comments ○ Available type hints ● Similar to NL2Type, it trains two word embeddings ● Has three RNNs submodels: ○ Learning from identifiers ○ Learning from token sequences ○ Learning from comments ● Feedback-guided search for consistent types 18
  • 21. LAMBDANET ● Imposes hard constraints on types ● Contextual hints ● Type dependency graph, i.e. a set of predicates ● Uses a Graph Neural Network (GNNs) and proposes a pointer-like network for handling user-defined types 21
  • 23. LAMBDANET Hyperedges in type dependency graph 23
  • 24. Major Research Problem Closed type vocabulary, i.e. limited to 1000 types. 24
  • 27. Re-implementation of TypeWriter with new dataset 27 ~27% higher ~7% higher
  • 28. Our Current Approach Improved available type extractor 28 [AbstactResolver, ClientConnectionError, ClientHttpProxyError, …] 1 1 0 0Python dataset Visible Type hints extractor Type mask vector● Lightweight static analysis with importlab and LibCST
  • 29. Our Current Approach Future ● Refinements to the search part and/or the neural model ● Performing extensive experiments to show the effectiveness of the approach ● Writing a paper draft by the end of June. 29
  • 31. References 1. Hellendoorn, V. J., Bird, C., Barr, E. T., & Allamanis, M. (2018, October). Deep learning type inference. In Proceedings of the 2018 26th acm joint meeting on european software engineering conference and symposium on the foundations of software engineering (pp. 152-162). 2. Malik, R. S., Patra, J., & Pradel, M. (2019, May). NL2Type: inferring JavaScript function types from natural language information. In 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE) (pp. 304-315). IEEE. 3. Pradel, M., Gousios, G., Liu, J., & Chandra, S. (2019). TypeWriter: Neural Type Prediction with Search-based Validation. arXiv preprint arXiv:1912.03768. 4. Wei, J., Goyal, M., Durrett, G., & Dillig, I. (2020). LambdaNet: Probabilistic Type Inference using Graph Neural Networks. ICLR 2020. 5. Gage, P. (1994). A new algorithm for data compression. C Users Journal, 12(2), 23-38. 6. Sennrich, R., Haddow, B., & Birch, A. (2015). Neural machine translation of rare words with subword units. arXiv preprint arXiv:1508.07909. 31