Я знаю, какой LLM написал ваш код прошлым летом: стилометрия для установления авторства кода, сгенерированного языковыми моделями
I Know Which LLM Wrote Your Code Last Summer: LLM generated Code Stylometry for Authorship Attribution
June 18, 2025
Авторы: Tamas Bisztray, Bilel Cherif, Richard A. Dubniczky, Nils Gruschka, Bertalan Borsos, Mohamed Amine Ferrag, Attila Kovacs, Vasileios Mavroeidis, Norbert Tihanyi
cs.AI
Аннотация
Обнаружение сгенерированного ИИ кода, дипфейков и другого синтетического контента представляет собой новую исследовательскую задачу. По мере того как код, созданный крупными языковыми моделями (LLM), становится все более распространенным, определение конкретной модели, стоящей за каждым образцом, приобретает все большую важность. В данной статье представлено первое систематическое исследование атрибуции авторства LLM для программ на языке C. Мы представили CodeT5-Authorship — новую модель, которая использует только слои энкодера из оригинальной архитектуры CodeT5 с энкодером и декодером, отбрасывая декодер для фокусировки на классификации. Выход энкодера модели (первый токен) передается через двухслойный классификационный блок с активацией GELU и dropout, что позволяет получить распределение вероятностей по возможным авторам. Для оценки нашего подхода мы представили LLM-AuthorBench — бенчмарк, содержащий 32 000 компилируемых программ на C, сгенерированных восемью передовыми LLM для различных задач. Мы сравнили нашу модель с семью традиционными классификаторами машинного обучения и восемью тонко настроенными трансформерными моделями, включая BERT, RoBERTa, CodeBERT, ModernBERT, DistilBERT, DeBERTa-V3, Longformer и LoRA-настроенную Qwen2-1.5B. В бинарной классификации наша модель достигает точности 97,56% в различении программ на C, сгенерированных близкими моделями, такими как GPT-4.1 и GPT-4o, и 95,40% точности для многоклассовой атрибуции среди пяти ведущих LLM (Gemini 2.5 Flash, Claude 3.5 Haiku, GPT-4.1, Llama 3.3 и DeepSeek-V3). В поддержку открытой науки мы публикуем архитектуру CodeT5-Authorship, бенчмарк LLM-AuthorBench и все соответствующие скрипты Google Colab на GitHub: https://github.com/LLMauthorbench/.
English
Detecting AI-generated code, deepfakes, and other synthetic content is an
emerging research challenge. As code generated by Large Language Models (LLMs)
becomes more common, identifying the specific model behind each sample is
increasingly important. This paper presents the first systematic study of LLM
authorship attribution for C programs. We released CodeT5-Authorship, a novel
model that uses only the encoder layers from the original CodeT5
encoder-decoder architecture, discarding the decoder to focus on
classification. Our model's encoder output (first token) is passed through a
two-layer classification head with GELU activation and dropout, producing a
probability distribution over possible authors. To evaluate our approach, we
introduce LLM-AuthorBench, a benchmark of 32,000 compilable C programs
generated by eight state-of-the-art LLMs across diverse tasks. We compare our
model to seven traditional ML classifiers and eight fine-tuned transformer
models, including BERT, RoBERTa, CodeBERT, ModernBERT, DistilBERT, DeBERTa-V3,
Longformer, and LoRA-fine-tuned Qwen2-1.5B. In binary classification, our model
achieves 97.56% accuracy in distinguishing C programs generated by closely
related models such as GPT-4.1 and GPT-4o, and 95.40% accuracy for multi-class
attribution among five leading LLMs (Gemini 2.5 Flash, Claude 3.5 Haiku,
GPT-4.1, Llama 3.3, and DeepSeek-V3). To support open science, we release the
CodeT5-Authorship architecture, the LLM-AuthorBench benchmark, and all relevant
Google Colab scripts on GitHub: https://github.com/LLMauthorbench/.