Skip to main content
QUICK REVIEW

[论文解读] Language Models for Code Optimization: Survey, Challenges and Future Directions

Jingzhi Gong, Vardan Voskanyan|arXiv (Cornell University)|Jan 2, 2025
Model-Driven Software Engineering TechniquesComputer Science被引用 5
一句话总结

本文对基于语言模型的代码优化进行系统性文献综述,分析了53项研究,以识别改进代码性能的趋势、挑战和未来方向。

ABSTRACT

Language models (LMs) built upon deep neural networks (DNNs) have recently demonstrated breakthrough effectiveness in software engineering tasks such as code generation, completion, and repair. This has paved the way for the emergence of LM-based code optimization techniques, which are crucial for enhancing the performance of existing programs, such as accelerating program execution time. However, a comprehensive survey dedicated to this specific application has been lacking. To fill this gap, we present a systematic literature review of over 50 primary studies, identifying emerging trends and addressing 11 specialized questions. Our findings reveal five critical open challenges, such as balancing model complexity with practical usability, cross-language/performance generalizability, and building trust in AI-driven solutions. Furthermore, we provide eight future research directions to facilitate more efficient, robust, and reliable LM-based code optimization. Thereby, this study aims to provide actionable insights and foundational references for both researchers and practitioners in this rapidly evolving field.

研究动机与目标

  • 在53项原始研究中调查基于语言模型的代码优化的前沿技术。
  • 识别用于代码优化的语言模型的特征与类别(通用型、代码专用、 transformers)。
  • 考察训练方案、模型规模和集成方法以指导未来研究。
  • 综合尚存的挑战并提出可操作的方向以提升鲁棒性、可用性和泛化能力。

提出的方法

  • 遵循 Kitchenham 和 Charters 指南进行系统性文献综述。
  • 检索六个学术索引并应用纳入/排除标准以选择53项原始研究。
  • 提取数据以解决四个研究问题和11个子问题。
  • 按 LM 类型、规模和使用情景对研究进行分类;总结发现和建议。
  • 基于综合证据讨论局限性、挑战和未来方向。
Figure 1 . Visualization of the survey scope.
Figure 1 . Visualization of the survey scope.

实验结果

研究问题

  • RQ1RQ1:用于代码优化的语言模型特征有哪些(类型、规模和类别)。
  • RQ2RQ2:语言模型如何进行训练与配置(预训练 vs 微调、数据来源和提示词)。
  • RQ3RQ3:语言模型在代码优化中的应用方式(生成、评估、转换和工具化)。
  • RQ4RQ4:基于语言模型的代码优化的主要挑战和未来方向。

主要发现

  • 通用型语言模型因具备广泛的理解与推理能力而在代码优化中使用最多。
  • 代码专用的语言模型提供有针对性的改进,但在跨任务的通用性方面可能受限。
  • 大型(甚至超大)模型使复杂优化任务成为可能,但会带来资源和集成方面的担忧。
  • 提示工程和专用建模方法是应对数据效率和任务特异性的常见策略。
  • 识别出五个关键挑战:计算/资源需求、集成与信任、跨语言与度量的泛化性、对合成数据集的依赖,以及潜在的输出幻觉。
  • 提出八个未来方向,以提升效率、鲁棒性和现实世界的适用性。
Figure 3 . Development of code optimization methods: strengths and weaknesses
Figure 3 . Development of code optimization methods: strengths and weaknesses

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。