paperbot · PL 论文追踪

全部论文 待读 收藏

P1 Learning type annotation: is big data enough?

学习类型注解:大数据足够吗?
FSE Proceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering2021匹配度 5/10 · 论文处于 PL 与机器学习交叉,关注类型注解预测这一静态类型相关任务,与用户对 ML 用于程序分析的兴趣有部分重叠;但它并非用户核心关注的 Agentic 程序静态分析、LLM/Agent 改进静态分析、浮点程序分析或贝叶斯程序分析,且主要基于 BERT 式模型与大数据,而非当前强 LLM/Agent 工具。引用 37 inbox
Kevin Jesse, Premkumar T. Devanbu, Toufique Ahmed
crossref: 2026-09-12

AI 速览

一句话:提出 TypeBert,用简单 token 序列归纳偏置与大规模数据,在 TypeScript 类型注解预测上超越复杂模型。

TypeScript 的可选类型允许“按需支付”类型化,但也带来类型注解税:为新旧代码补类型需要人力。已有自动方法多采用概率机器学习,归纳偏置从简单 token 序列到复杂图神经网络,并常通过手工设计利用软件形式特性。本文追问:与其为代码部署精巧归纳偏置,能否直接用“大数据”学习与类型相关的自然模式?作者提出 TypeBert,采用 BERT 式简单 token 序列归纳偏置并扩大数据规模。在类型注解任务上,TypeBert 的性能可超过最复杂的模型,表明足够数据下简单模型即可奏效。

问题
TypeScript 可选类型带来类型注解税,自动类型注解可减少人工负担;核心问题是复杂、手工设计的归纳偏置是否必要,还是大数据足以学习类型相关模式。
方法
提出 TypeBert,采用 BERT 式简单 token 序列归纳偏置,并在大规模数据上学习类型标注模式。
评估
在类型注解任务上与使用复杂归纳偏置(如 GNN)的最先进模型比较,报告其性能可被 TypeBert 超越。
原文摘要(Abstract)

TypeScript is a widely used optionally-typed language where developers can adopt “pay as you go” typing: they can add types as desired, and benefit from static typing. The “type annotation tax” or manual effort required to annotate new or existing TypeScript can be reduced by a variety of automatic methods. Probabilistic machine-learning (ML) approaches work quite well. ML approaches use different inductive biases, ranging from simple token sequences to complex graphical neural network (GNN) models capturing syntax and semantic relations. More sophisticated inductive biases are hand-engineered to exploit the formal nature of software. Rather than deploying fancy inductive biases for code, can we just use “big data” to learn natural patterns relevant to typing? We find evidence suggesting that this is the case. We present TypeBert, demonstrating that even with simple token-sequence inductive bias used in BERT-style models and enough data, type-annotation performance of the most sophisticated models can be surpassed.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot6302,
  title = {Learning type annotation: is big data enough?},
  author = {Kevin Jesse and Premkumar T. Devanbu and Toufique Ahmed},
  booktitle = {FSE},
  year = {2021},
  doi = {10.1145/3468264.3473135}
}