[Paper Review] Language Models for Code Optimization: Survey, Challenges and Future Directions
This paper conducts a systematic literature review of LM-based code optimization, analyzing 53 studies to identify trends, challenges, and future directions in improving code performance.
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.
Motivation & Objective
- Survey the state-of-the-art LM-based code optimization techniques across 53 primary studies.
- Identify characteristics and categories of LMs used for code optimization (general-purpose, code-specialized, transformers).
- Examine training regimes, model sizes, and integration approaches to guide future research.
- Synthesize open challenges and propose actionable directions to improve robustness, usability, and generalization.
Proposed method
- Perform a systematic literature review following Kitchenham and Charters guidelines.
- Search six academic indexes and apply inclusion/exclusion criteria to select 53 primary studies.
- Extract data to address four research questions and 11 sub-questions.
- Classify studies by LM type, size, and usage scenarios; summarize findings and recommendations.
- Discuss limitations, challenges, and future directions based on synthesized evidence.

Experimental results
Research questions
- RQ1RQ1: What LM characteristics are used for code optimization (types, sizes, and categories).
- RQ2RQ2: How are LMs trained and configured (pre-training vs fine-tuning, data sources, and prompts).
- RQ3RQ3: In what ways are LMs employed in code optimization (generation, evaluation, transformation, and tooling).
- RQ4RQ4: What are the main challenges and future directions for LM-based code optimization.
Key findings
- General-purpose LMs are the most widely used for code optimization due to broad understanding and reasoning capabilities.
- Code-specialized LMs offer targeted improvements but may lack versatility across tasks.
- Large (and very large) models enable complex optimization tasks but raise resource and integration concerns.
- Prompt engineering and dedicated modeling approaches are common strategies to address data efficiency and task specificity.
- Five key challenges are identified: computational/resource demands, integration and trust, generalizability across languages and metrics, reliance on synthetic datasets, and potential output hallucinations.
- Eight future directions are proposed to enhance efficiency, robustness, and real-world applicability.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.