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

📅 2026-06-20
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This study investigates the use of large language models (GPT-3.5 and GPT-4) to effectively obfuscate programmer coding style while preserving functional equivalence, thereby evading style-based authorship attribution. By systematically comparing single-sample and multi-sample prompting strategies, the authors propose a structured, fine-grained multi-turn prompting approach and, for the first time, integrate functional equivalence verification into the evaluation framework. Experimental results demonstrate that the proposed method significantly weakens stylistic cues in source code, substantially degrading the performance of a random forest classifier in author identification tasks, while partially maintaining functional correctness. These findings highlight the vulnerability of current code authorship attribution techniques when confronted with advanced AI-driven code rewriting.
📝 Abstract
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
Problem

Research questions and friction points this paper is trying to address.

code stylometry
authorship attribution
Large Language Models
GPT-3.5
GPT-4
Innovation

Methods, ideas, or system contributions that make the work stand out.

code stylometry
Large Language Models
authorship attribution
prompt engineering
functionality preservation