arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.22306cs.SEcs.AI
收藏

利用大型语言模型混淆代码风格计量学:GPT-3.5与GPT-4的对比研究

Leveraging Large Language Models to Obscure Code Stylometry: A Comparative Study of GPT-3.5 and GPT-4

UNIVERSITY OF CALGARY(卡尔加里大学)

Saman Pordanesh, Benjamin Tan

AI总结:

研究GPT-3.5和GPT-4在保持代码功能的同时混淆代码风格计量学的能力,通过随机森林分类器评估不同提示工程策略的效果,发现单次与多次提示方法存在显著差异,并强调了详细结构化提示的重要性。

摘要:

在快速发展的软件开发领域,代码风格计量学分析程序员的独特风格特征,在作者归属和网络安全中起着关键作用。人工智能的最新进展,特别是大型语言模型(LLMs)如GPT-3.5和GPT-4,为这一领域引入了新的维度,挑战了传统的风格计量学技术。本研究调查了LLMs在保持功能的同时改变代码风格计量学的有效性,并评估了各种提示工程策略的影响。通过全面的实验,我们评估了这些模型在多大程度上能够混淆风格特征,以避免被训练用于作者归属的随机森林分类器检测。结果揭示了单次和多次方法在有效性上的显著差异,并强调了详细结构化提示的重要性。此外,功能保持检查展示了在修改后维护代码完整性的挑战。这项研究为作者归属技术对抗先进AI能力的鲁棒性提供了关键见解,为未来的网络安全和软件工程发展提供了信息。

英文摘要:

In the rapidly evolving field of software development, code stylometry analyzing unique stylistic signatures of programmers plays a crit-ical role in authorship attribution and cybersecurity. Recent advancements in artificial intelligence, particularly Large Language Models (LLMs) like GPT-3.5 and GPT-4, have introduced new dimensions to this field, challenging traditional stylometry techniques. This study investigates the effectiveness of LLMs in altering code stylometry while preserving functionality and evaluates the impact of various prompt engineering strategies. Through comprehensive experiments, we assess how well these models can obscure stylistic signatures to avoid detection by a Random Forest classifier trained for authorship attribution. The results reveal significant differences in effectiveness between single-shot and multi-shot methods and highlight the importance of detailed, structured prompts. Additionally, functionality preservation checks demonstrate the challenges in maintaining code integrity post-modification. This research provides critical insights into the robustness of authorship attribution techniques against advanced AI capabilities, informing future cybersecurity and software engineering developments

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

↑