mlsanityData to 7 Oct 2026

Learning Type Inference for Enhanced Dataflow Analysis

arXiv 2310.00673 ↗First posted 1 Oct 2023cs.LG cs.CRcited by 0

Not on the map. Why?

Abstract (arXiv)

Statically analyzing dynamically-typed code is a challenging endeavor, as even seemingly trivial tasks such as determining the targets of procedure calls are non-trivial without knowing the types of objects at compile time. Addressing this challenge, gradual typing is increasingly added to dynamically-typed languages, a prominent example being TypeScript that introduces static typing to JavaScript. Gradual typing improves the developer's ability to verify program behavior, contributing to robust, secure and debuggable programs. In practice, however, users only sparsely annotate types directly. At the same time, conventional type inference faces performance-related challenges as program size grows. Statistical techniques based on machine learning offer faster inference, but although recent approaches demonstrate overall improved accuracy, they still perform significantly worse on user-defined types than on the most common built-in types. Limiting their real-world usefulness even more, they rarely integrate with user-facing applications. We propose CodeTIDAL5, a Transformer-based model trained to reliably predict type annotations. For effective result retrieval and re-integration, we extract usage slices from a program's code property graph. Comparing our approach against recent neural type inference systems, our model outperforms the current state-of-the-art by 7.85% on the ManyTypes4TypeScript benchmark, achieving 71.27% accuracy overall. Furthermore, we present JoernTI, an integration of our approach into Joern, an open source static analysis tool, and demonstrate that the analysis benefits from the additional type information. As our model allows for fast inference times even on commodity CPUs, making our system available through Joern leads to high accessibility and facilitates security research.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 17 of its 46 references that are in the map. First posted on arXiv 1 Oct 2023.

Builds on

17 of 46 references.

References · 17

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  5. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
  6. 2018Deep contextualized word representationscited by 2,285
  7. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  8. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
  9. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  10. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
  11. 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 327
  12. 2020LambdaNet: Probabilistic Type Inference using Graph Neural Networkscited by 44
5 more
  1. 2019TypeWriter: Neural Type Prediction with Search-based Validationcited by 32
  2. 2020OptTyper: Probabilistic Type Inference by Optimising Logical and Natural Constraintscited by 14
  3. 2021Static Inference Meets Deep Learning: A Hybrid Type Inference Approach for Pythoncited by 12
  4. 2023TypeT5: Seq2seq Type Inference using Static Analysiscited by 12
  5. 2020Advanced Graph-Based Deep Learning for Probabilistic Type Inferencecited by 1

Built on by

Not cited yet.