Supersonic: Learning to Generate Source Code Optimizations in C/C++

IF 6.5 1区 计算机科学 Q1 COMPUTER SCIENCE, SOFTWARE ENGINEERING IEEE Transactions on Software Engineering Pub Date : 2024-07-22 DOI:10.1109/TSE.2024.3423769
Zimin Chen;Sen Fang;Martin Monperrus
{"title":"Supersonic: Learning to Generate Source Code Optimizations in C/C++","authors":"Zimin Chen;Sen Fang;Martin Monperrus","doi":"10.1109/TSE.2024.3423769","DOIUrl":null,"url":null,"abstract":"Software optimization refines programs for resource efficiency while preserving functionality. Traditionally, it is a process done by developers and compilers. This paper introduces a third option, automated optimization at the source code level. We present \n<small>Supersonic</small>\n, a neural approach targeting minor source code modifications for optimization. Using a seq2seq model, \n<small>Supersonic</small>\n is trained on C/C++ program pairs (\n<inline-formula><tex-math>$x_{t}$</tex-math></inline-formula>\n, \n<inline-formula><tex-math>$x_{t+1}$</tex-math></inline-formula>\n), where \n<inline-formula><tex-math>$x_{t+1}$</tex-math></inline-formula>\n is an optimized version of \n<inline-formula><tex-math>$x_{t}$</tex-math></inline-formula>\n, and outputs a diff. \n<small>Supersonic</small>\n's performance is benchmarked against OpenAI's GPT-3.5-Turbo and GPT-4 on competitive programming tasks. The experiments show that \n<small>Supersonic</small>\n not only outperforms both models on the code optimization task but also minimizes the extent of the change with a model more than 600x smaller than GPT-3.5-Turbo and 3700x smaller than GPT-4.","PeriodicalId":13324,"journal":{"name":"IEEE Transactions on Software Engineering","volume":"50 11","pages":"2849-2864"},"PeriodicalIF":6.5000,"publicationDate":"2024-07-22","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=10606318","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"IEEE Transactions on Software Engineering","FirstCategoryId":"94","ListUrlMain":"https://ieeexplore.ieee.org/document/10606318/","RegionNum":1,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 0

Abstract

Software optimization refines programs for resource efficiency while preserving functionality. Traditionally, it is a process done by developers and compilers. This paper introduces a third option, automated optimization at the source code level. We present Supersonic , a neural approach targeting minor source code modifications for optimization. Using a seq2seq model, Supersonic is trained on C/C++ program pairs ( $x_{t}$ , $x_{t+1}$ ), where $x_{t+1}$ is an optimized version of $x_{t}$ , and outputs a diff. Supersonic 's performance is benchmarked against OpenAI's GPT-3.5-Turbo and GPT-4 on competitive programming tasks. The experiments show that Supersonic not only outperforms both models on the code optimization task but also minimizes the extent of the change with a model more than 600x smaller than GPT-3.5-Turbo and 3700x smaller than GPT-4.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
超级:学习用 C/C++ 生成优化源代码
软件优化是对程序进行改进,在保留功能的同时提高资源效率。传统上,这是一个由开发人员和编译器完成的过程。本文介绍了第三种选择,即源代码级的自动优化。我们提出的 Supersonic 是一种神经方法,针对源代码的细微修改进行优化。Supersonic 使用 seq2seq 模型,对 C/C++ 程序对($x_{t}$, $x_{t+1}$)进行训练,其中$x_{t+1}$ 是$x_{t}$ 的优化版本,并输出差异。在竞争性编程任务上,Supersonic 的性能以 OpenAI 的 GPT-3.5-Turbo 和 GPT-4 为基准。实验结果表明,Supersonic 不仅在代码优化任务中的表现优于这两种模型,而且还能最大限度地减少变化程度,其模型比 GPT-3.5-Turbo 小 600 多倍,比 GPT-4 小 3700 多倍。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
IEEE Transactions on Software Engineering
IEEE Transactions on Software Engineering 工程技术-工程:电子与电气
CiteScore
9.70
自引率
10.80%
发文量
724
审稿时长
6 months
期刊介绍: IEEE Transactions on Software Engineering seeks contributions comprising well-defined theoretical results and empirical studies with potential impacts on software construction, analysis, or management. The scope of this Transactions extends from fundamental mechanisms to the development of principles and their application in specific environments. Specific topic areas include: a) Development and maintenance methods and models: Techniques and principles for specifying, designing, and implementing software systems, encompassing notations and process models. b) Assessment methods: Software tests, validation, reliability models, test and diagnosis procedures, software redundancy, design for error control, and measurements and evaluation of process and product aspects. c) Software project management: Productivity factors, cost models, schedule and organizational issues, and standards. d) Tools and environments: Specific tools, integrated tool environments, associated architectures, databases, and parallel and distributed processing issues. e) System issues: Hardware-software trade-offs. f) State-of-the-art surveys: Syntheses and comprehensive reviews of the historical development within specific areas of interest.
期刊最新文献
Triple Peak Day: Work Rhythms of Software Developers in Hybrid Work GenProgJS: a Baseline System for Test-based Automated Repair of JavaScript Programs On Inter-dataset Code Duplication and Data Leakage in Large Language Models Line-Level Defect Prediction by Capturing Code Contexts with Graph Convolutional Networks Does Treatment Adherence Impact Experiment Results in TDD?
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1