Transformer Models for Type Inference in the Simply Typed Lambda Calculus: A Case Study in Deep Learning for Code
Not on the map. Why?
Abstract (arXiv)
Despite a growing body of work at the intersection of deep learning and formal languages, there has been relatively little systematic exploration of transformer models for reasoning about typed lambda calculi. This is an interesting area of inquiry for two reasons. First, typed lambda calculi are the lingua franc of programming languages. A set of heuristics that relate various typed lambda calculi to effective neural architectures would provide a systematic method for mapping language features (e.g., polymorphism, subtyping, inheritance, etc.) to architecture choices. Second, transformer models are widely used in deep learning architectures applied to code, but the design and hyperparameter space for them is large and relatively unexplored in programming language applications. Therefore, we suggest a benchmark that allows us to explore exactly this through perhaps the simplest and most fundamental property of a programming language: the relationship between terms and types. Consequently, we begin this inquiry of transformer architectures for typed lambda calculi by exploring the effect of transformer warm-up and optimizer selection in the task of type inference: i.e., predicting the types of lambda calculus terms using only transformers. We find that the optimization landscape is difficult even in this simple setting. One particular experimental finding is that optimization by Adafactor converges much faster compared to the optimization by Adam and RAdam. We conjecture that such different performance of optimizers might be related to the difficulties of generalization over formally generated dataset.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 18 of its 29 references that are in the map. First posted on arXiv 15 Mar 2023.
Builds on
18 of 29 references.
References · 18
- 2017Attention Is All You Needcited by 60,361
- 2015Deep Residual Learning for Image Recognitioncited by 52,096
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2014Adam: A Method for Stochastic Optimizationcited by 37,240
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,305
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2013Playing Atari with Deep Reinforcement Learningcited by 3,274
- 2018Adafactor: Adaptive Learning Rates with Sublinear Memory Costcited by 905
- 2019On the Variance of the Adaptive Learning Rate and Beyondcited by 772
- 2022Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasetscited by 629
- 2020Generative Language Modeling for Automated Theorem Provingcited by 388
- 2021Mastering Atari Games with Limited Datacited by 237
6 more
- 2019Learning to Prove Theorems via Interacting with Proof Assistantscited by 109
- 2019TreeGen: A Tree-Based Transformer Architecture for Code Generationcited by 58
- 2017Deep Network Guided Proof Searchcited by 47
- 2018Neural-Guided Deductive Search for Real-Time Program Synthesis from Examplescited by 39
- 2019On the adequacy of untuned warmup for adaptive optimizationcited by 35
- 2019Neural Program Synthesis By Self-Learningcited by 5
Built on by
Citing papers per year: 2023: 1.
1 paper.
- 2023Is Pre-training Truly Better Than Meta-Learning?cited by 6
- 2023Is Pre-training Truly Better Than Meta-Learning?24 Jun 2023