期刊文献+
共找到6篇文章
< 1 >
每页显示 20 50 100
以CodeBERT为基础的代码分类研究 被引量:2
1
作者 成思强 刘建勋 +1 位作者 彭珍连 曹奔 《计算机工程与应用》 CSCD 北大核心 2023年第24期277-288,共12页
随着代码大数据的不断发展,代码库中的源代码数量逐渐增长。如何快速有效地对代码库中的代码进行分类管理,对软件工程的发展具有十分重要的意义。第一次将预训练模型引入代码分类研究,并提出了一种优化的代码分类方法 CBBCC。CBBCC采用w... 随着代码大数据的不断发展,代码库中的源代码数量逐渐增长。如何快速有效地对代码库中的代码进行分类管理,对软件工程的发展具有十分重要的意义。第一次将预训练模型引入代码分类研究,并提出了一种优化的代码分类方法 CBBCC。CBBCC采用wordpiece对源代码进行数据预处理。采用CodeBERT预训练模型对源代码进行特征表征。在预训练模型的基础上进行分类任务的微调。为了验证所提模型的有效性,在POJ104数据集上进行实验分析。实验结果表明,相对于7种基准模型,CBBCC模型各项分类指标都在98%以上。其中准确率上比目前最优模型提高了1.1个百分点,达到了POJ104代码分类数据集上分类任务的SOTA值。CBBCC能有效地对代码进行标注,提高对开源社区源代码的管理,促进软件工程领域的发展。 展开更多
关键词 代码分类 代码表征 codebert 迁移训练 代码片段
在线阅读 下载PDF
基于CodeBERT的设计模式语言模型 被引量:3
2
作者 陈时非 刘东 江贺 《计算机科学》 CSCD 北大核心 2023年第12期75-81,共7页
设计模式是对实际软件设计方案的经验性总结,是软件开发中辅助软件设计的有效方案之一。现有设计模式挖掘研究的任务大多是在源代码中识别设计模式的实例,少有考虑用自然语言语料对设计模式建模。为了提升设计模式语言分类模型的推荐效... 设计模式是对实际软件设计方案的经验性总结,是软件开发中辅助软件设计的有效方案之一。现有设计模式挖掘研究的任务大多是在源代码中识别设计模式的实例,少有考虑用自然语言语料对设计模式建模。为了提升设计模式语言分类模型的推荐效果,将代码、类图或对象协作纳入考虑范围,提出了一种基于CodeBERT的设计模式分类挖掘模型dpCodeBERT,以实现自然语言与代码语言的对照理解。首先,通过随机组合合成多分类算法数据和代码搜索数据作为模型输入,dpCodeBERT模型能够获取transformer层中的模型为令牌生成的注意力权重;然后,分析令牌和语句注意力权重以发现更有效的模型输入类别,进一步改造训练输入;最后,dpCodeBERT模型能够通过全连接层将分布式特征映射到样本空间并输出复数值的方式实现具体软件工程任务,如设计模式选择和设计模式代码搜索任务。在拥有80个软件设计问题的设计模式选择任务的数据集上的实验结果显示,相比同类基准模型,所提模型在设计模式检测准确率(RCDDP)和平均倒数排名(MRR)两个指标上平均提升了10%~20%,设计模式选择更加准确。通过深度研究模型数据需求,dpCodeBERT挖掘了CodeBERT对类级代码的理解,探索了CodeBERT在设计模式挖掘中的应用,具有预测准确、拓展性强等特点。 展开更多
关键词 设计模式挖掘 自然语言处理 预训练语言模型 codebert 模型精调 向量化
在线阅读 下载PDF
基于CodeBERT的代码提交分类研究
3
作者 李英玲 兰宏富 +1 位作者 李苒 黄闽英 《西南民族大学学报(自然科学版)》 CAS 2023年第2期189-196,共8页
理解软件仓库中执行的软件维护活动,有助于确保高效的演化和开发活动.对代码提交(commit)进行准确地分类,能帮助软件管理人员更合理地进行资源分配,从而减少维护成本.然而,已有研究忽视了提交说明中关键词的上下文信息,或者未考虑变更... 理解软件仓库中执行的软件维护活动,有助于确保高效的演化和开发活动.对代码提交(commit)进行准确地分类,能帮助软件管理人员更合理地进行资源分配,从而减少维护成本.然而,已有研究忽视了提交说明中关键词的上下文信息,或者未考虑变更代码的语义信息,导致不准确的提交分类.提出了基于预训练模型CodeBERT的代码提交分类模型(CBEC),该模型首先获取公开数据集中commits的code diff信息,准备提交说明和diff信息对,并进行词元化表示;接着使用CodeBERT模型学习提交说明和diff信息的语义深度表示,同时从多个维度提取提交相关的手工设计特征;最后,融合commit的语义特征和传统手工特征,构建提交分类模型.提出的模型与当前具有代表性的2个方法进行比较,从准确率、精准率和召回率来看,分别高出基线方法5.0%~26.8%、4.9%~27.2%、5.4%~27.3%.能帮助软件从业者更好地理解和识别代码提交的变更意图,有利于提高开发效益. 展开更多
关键词 提交分类 codebert 迁移学习 卷积神经网络
在线阅读 下载PDF
基于联邦大模型的网络攻击检测方法研究
4
作者 康海燕 张义钒 王楠敏 《电子学报》 北大核心 2025年第6期1792-1804,共13页
为了解决真实Web应用攻击数据数量小、差异性大和攻击载荷多样化导致大模型训练效果差的问题,提出一种基于联邦大模型的网络攻击检测方法(Intrusion Detection methods based on Federal Large Language Model,FLLLMID).首先,提出一种... 为了解决真实Web应用攻击数据数量小、差异性大和攻击载荷多样化导致大模型训练效果差的问题,提出一种基于联邦大模型的网络攻击检测方法(Intrusion Detection methods based on Federal Large Language Model,FLLLMID).首先,提出一种面向大模型微调的联邦学习网络,服务器对客户端本地大模型通过增量数据训练产生的参数,进行增量聚合的方式,提高联邦学习中大模型的参数聚合效率以及避免网络流量数据暴露的问题;其次,基于大模型对代码的理解能力,提出面向应用层数据的攻击检测模型(CodeBERT-LSTM),通过对应用层数据报文进行分析,使用CodeBERT模型对有效字段进行向量编码后,结合长短期记忆网络(Long Short-Term Memory,LSTM)进行分类,实现对Web应用高效的攻击检测任务;最后,实验结果表明,FL-LLMID方法在面向应用层数据的攻击检测任务中准确率达到99.63%,与传统联邦学习相比,增量式学习的效率提升了12个百分点. 展开更多
关键词 联邦学习 大模型 长短期记忆网络 codebert 网络攻击检测 增量聚合
在线阅读 下载PDF
Interpretable Vulnerability Detection in LLMs:A BERT-Based Approach with SHAP Explanations
5
作者 Nouman Ahmad Changsheng Zhang 《Computers, Materials & Continua》 2025年第11期3321-3334,共14页
Source code vulnerabilities present significant security threats,necessitating effective detection techniques.Rigid rule-sets and pattern matching are the foundation of traditional static analysis tools,which drown de... Source code vulnerabilities present significant security threats,necessitating effective detection techniques.Rigid rule-sets and pattern matching are the foundation of traditional static analysis tools,which drown developers in false positives and miss context-sensitive vulnerabilities.Large Language Models(LLMs)like BERT,in particular,are examples of artificial intelligence(AI)that exhibit promise but frequently lack transparency.In order to overcome the issues with model interpretability,this work suggests a BERT-based LLM strategy for vulnerability detection that incorporates Explainable AI(XAI)methods like SHAP and attention heatmaps.Furthermore,to ensure auditable and comprehensible choices,we present a transparency obligation structure that covers the whole LLM lifetime.Our experiments on a comprehensive and extensive source code DiverseVul dataset show that the proposed method outperform,attaining 92.3%detection accuracy and surpassing CodeT5(89.4%),GPT-3.5(85.1%),and GPT-4(88.7%)under the same evaluation scenario.Through integrated SHAP analysis,this exhibits improved detection capabilities while preserving explainability,which is a crucial advantage over black-box LLM alternatives in security contexts.The XAI analysis discovers crucial predictive tokens such as susceptible and function through SHAP framework.Furthermore,the local token interactions that support the decision-making of the model process are graphically highlighted via attention heatmaps.This method provides a workable solution for reliable vulnerability identification in software systems by effectively fusing high detection accuracy with model explainability.Our findings imply that transparent AI models are capable of successfully detecting security flaws while preserving interpretability for human analysts. 展开更多
关键词 Attention mechanisms codebert explainable AI(XAI)for security large language model(LLM) trustworthy AI vulnerability detection
在线阅读 下载PDF
How Does Naming Affect Language Models on Code Analysis Tasks?
6
作者 Zhilong Wang Lan Zhang +3 位作者 Chen Cao Nanqing Luo Xinzhi Luo Peng Liu 《Journal of Software Engineering and Applications》 2024年第11期803-816,共14页
The Large Language Models (LLMs), such as GPT and BERT, were proposed for natural language processing (NLP) and have shown promising results as general-purpose language models. An increasing number of industry profess... The Large Language Models (LLMs), such as GPT and BERT, were proposed for natural language processing (NLP) and have shown promising results as general-purpose language models. An increasing number of industry professionals and researchers are adopting LLMs for program analysis tasks. However, one significant difference between programming languages and natural languages is that a programmer has the flexibility to assign any names to variables, methods, and functions in the program, whereas a natural language writer does not. Intuitively, the quality of naming in a program affects the performance of LLMs in program analysis tasks. This paper investigates how naming affects LLMs on code analysis tasks. Specifically, we create a set of datasets with code containing nonsense or misleading names for variables, methods, and functions, respectively. We then use well-trained models (CodeBERT) to perform code analysis tasks on these datasets. The experimental results show that naming has a significant impact on the performance of code analysis tasks based on LLMs, indicating that code representation learning based on LLMs heavily relies on well-defined names in code. Additionally, we conduct a case study on some special code analysis tasks using GPT, providing further insights. 展开更多
关键词 LLMs codebert Code Analysis
在线阅读 下载PDF
上一页 1 下一页 到第
使用帮助 返回顶部