arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2412.13467cs.SEcs.AIcs.CL
收藏

Transducer Tuning:使用代码属性图进行软件任务的高效模型适配

Transducer Tuning: Efficient Model Adaptation for Software Tasks Using Code Property Graphs

School of Computing and Information Systems, Singapore Management University(新加坡管理大学计算与信息系统学院)

Imam Nur Bani Yusuf, Lingxiao Jiang

AI总结:

本文提出Transducer Tuning方法,利用代码属性图(CPGs)通过图向量化引擎和基于注意力的融合层将结构信息融入代码嵌入,在减少高达99%可训练参数的同时,实现与全参数微调及其他方法相媲美的下游代码任务性能。

摘要:

大型语言模型在各种软件工程任务中展现出了令人期待的性能。虽然微调是使这些模型适配下游任务的常见做法,但在资源受限的环境中,由于越来越大的语言模型中可训练参数不断增加导致内存需求上升,这变得具有挑战性。我们引入了\approach,一种使用代码属性图(CPGs)适配大型模型以处理下游代码任务的技术。我们的方法引入了一个名为\transducer的模块化组件,该组件利用来自CPGs的结构和依赖信息来丰富代码嵌入。Transducer包含两个关键组件:图向量化引擎(GVE)和基于注意力的融合层(ABFL)。GVE从输入源代码中提取CPGs并将其转换为图特征向量。随后ABFL将这些图特征向量与来自大型语言模型的初始代码嵌入进行融合。通过针对不同的下游任务优化这些transducer,我们的方法无需针对特定任务微调模型即可增强模型能力。我们在三个下游任务上评估了\approach:代码摘要、断言生成和代码翻译。结果表明,与全参数微调相比,该方法具有竞争力的性能,同时减少了高达99%的可训练参数以节省内存。与其它微调方法(例如,LoRA、Prompt-Tuning、Prefix-Tuning)相比,\approach也保持竞争力,同时仅使用其1.5%-80%的可训练参数。我们的研究结果表明,通过Transducer Tuning集成结构和依赖信息能够实现更高效的模型适配,使用户在资源受限的环境中更容易适配大型模型。

英文摘要:

Large language models have demonstrated promising performance across various software engineering tasks. While fine-tuning is a common practice to adapt these models for downstream tasks, it becomes challenging in resource-constrained environments due to increased memory requirements from growing trainable parameters in increasingly large language models. We introduce \approach, a technique to adapt large models for downstream code tasks using Code Property Graphs (CPGs). Our approach introduces a modular component called \transducer that enriches code embeddings with structural and dependency information from CPGs. The Transducer comprises two key components: Graph Vectorization Engine (GVE) and Attention-Based Fusion Layer (ABFL). GVE extracts CPGs from input source code and transforms them into graph feature vectors. ABFL then fuses those graphs feature vectors with initial code embeddings from a large language model. By optimizing these transducers for different downstream tasks, our approach enhances the models without the need to fine-tune them for specific tasks. We have evaluated \approach on three downstream tasks: code summarization, assert generation, and code translation. Our results demonstrate competitive performance compared to full parameter fine-tuning while reducing up to 99\% trainable parameters to save memory. \approach also remains competitive against other fine-tuning approaches (e.g., LoRA, Prompt-Tuning, Prefix-Tuning) while using only 1.5\%-80\% of their trainable parameters. Our findings show that integrating structural and dependency information through Transducer Tuning enables more efficient model adaptation, making it easier for users to adapt large models in resource-constrained settings.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑