2025-10-01 · 专家 · 计算机视觉 · 机器学习 · 数据科学

Regression Language Models for Code

该论文提出了一种名为回归语言模型(RLM)的新方法,能够从文本直接预测代码执行的结果,如内存占用、延迟和神经网络性能,从而简化了代码性能预测任务。

更新于 2025-10-01。作者:Yash Akhauri、Xingyou Song、Arissa Wongpanich、Bryan Lewandowski、Mohamed S. Abdelfattah。

中文摘要

我们研究的是代码到度量回归:预测代码执行结果的数值,这是一个具有挑战性的任务,因为编程语言的开放性。虽然先前的方法依赖于沉重且特定领域的特征工程,但我们展示了一个单一的统一回归语言模型(RLM)可以同时直接从文本预测以下内容:(i) 多种高级语言(如Python和C++)中代码的内存占用;(ii) Triton GPU内核的延迟;(iii) 以ONNX表示的训练神经网络的准确性和速度。特别是,一个相对较小的300M参数的RLM,从T5Gemma初始化,在APPS的编程竞赛提交中获得了>0.9的Spearman等级评分,并且一个单一的统一模型在CodeNet的17种不同语言中实现了>0.5的平均Spearman等级评分。此外,RLM能够在五个以前由图神经网络主导的经典NAS设计空间中获得最高的平均Kendall-Tau系数0.46,并同时预测多个硬件平台上的架构延迟。

英文摘要

We study code-to-metric regression: predicting numeric outcomes of code executions, a challenging task due to the open-ended nature of programming languages. While prior methods have resorted to heavy and domain-specific feature engineering, we show that a single unified Regression Language Model (RLM) can simultaneously predict directly from text, (i) the memory footprint of code across multiple high-level languages such as Python and C++, (ii) the latency of Triton GPU kernels, and (iii) the accuracy and speed of trained neural networks represented in ONNX. In particular, a relatively small 300M parameter RLM initialized from T5Gemma, obtains > 0.9 Spearman-rank on competitive programming submissions from APPS, and a single unified model achieves > 0.5 average Spearman-rank across 17 separate languages from CodeNet. Furthermore, the RLM can obtain the highest average Kendall-Tau of 0.46 on five classic NAS design spaces previously dominated by graph neural networks, and simultaneously predict architecture latencies on numerous hardware platforms.

解读

一句话总结

该论文提出了一种名为回归语言模型(RLM)的新方法,能够从文本直接预测代码执行的结果,如内存占用、延迟和神经网络性能,从而简化了代码性能预测任务。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源