Regression Language Models for Code
Abstract
Lay Summary
Predicting how a program or computation graph will run -- such as its memory footprint, execution speed, or accuracy, is incredibly valuable but notoriously difficult. Traditionally, these predictions required researchers to perform feature engineering, by representing the code as abstract syntax trees or complicated graph features. To simplify this, we developed a unified "Regression Language Model" (RLM) using a frozen T5Gemma encoder that reads raw code as text and directly predicts numerical performance metrics. Using a specialized numeric decoder, it simply performs supervised next-token prediction on numeric outputs represented as tokens, and can make precise numeric predictions across vastly different scales. Our open-source package can be found at https://github.com/google-deepmind/regress-lm, and paves the way for research in LLM-based regression.