Abstract
As artificial intelligence (AI) technologies become increasingly powerful and prominent in society, their misuse is a growing concern. In educational settings, AI technologies could be used by students to cheat on assignments and exams. In this paper we explore whether transformers can be used to solve introductory level programming assignments while bypassing commonly used AI tools to detect similarities between pieces of software. We find that a student using GPT-J [Wang and Komatsuzaki, 2021] can complete introductory level programming assignments without triggering suspicion from MOSS [Aiken, 2000], a widely used software similarity and plagiarism detection tool. This holds despite the fact that GPT-J was not trained on the problems in question and is not provided with any examples to work from. We further find that the code written by GPT-J is diverse in structure, lacking any particular tells that future plagiarism detection techniques may use to try to identify algorithmically generated code. We conclude with a discussion of the ethical and educational implications of large language models and directions for future research.
Introduction
For decades, computer science instructors have relied on automated tools to maintain academic integrity. The industry standard, MOSS (Measure of Software Similarity), operates by "fingerprinting" code to identify structural similarities between submissions. This approach is highly effective at catching students who copy from peers or perform superficial obfuscation, such as renaming variables or reordering independent statements.
However, the emergence of Large Language Models (LLMs) like GPT-J presents a novel threat: "contract plagiarism" without a human contractor. Unlike traditional plagiarism, which involves modifying an existing source file, LLMs generate code de novo from natural language descriptions. This study investigates whether a publicly available model can produce correct, stylistically diverse code that evades detection by appearing as original, independent human work.
Methodology
The researchers simulated a "threat model" involving a student with minimal programming expertise using GPT-J-6B, an open-source autoregressive model. GPT-J was selected as a baseline representative of tools a determined student could run locally without relying on proprietary APIs.
The experimental setup involved:
- Prompting: The model was provided with LaTeX descriptions of seven introductory Java programming tasks from the Karnalim dataset. To ensure the correct output language, the prompts were minimally modified to include the word "Java."
- Human-in-the-Loop: A "novice student" persona was maintained, allowing for minor edits that a beginner could reasonably perform. This included adding missing imports identified by the compiler and fixing trivial syntax or "off-by-one" errors.
- Evaluation: The generated code was compared against a benchmark dataset containing original solutions, six levels of human-created plagiarism (ranging from simple renaming to complex structural changes), and independent "non-plagiarized" solutions written by different Teaching Assistants. GPT-J successfully produced 31 correct solutions across the seven tasks with minimal human intervention.
Evading MOSS Detection
The primary finding is that AI-generated code successfully bypasses MOSS detection. Because the AI builds a solution from scratch based on a prompt, it shares no common structural "ancestor" with the official solution. Consequently, the similarity scores for AI code are indistinguishable from those of independent human solutions.
As shown in the boxplot above, while traditional human plagiarism (Levels 1-3) results in high similarity scores, the AI-generated solutions ("AI") cluster closely with the "non-plagiarized" ("non") baseline. This suggests that MOSS cannot reliably distinguish between a student who wrote their own code and one who used GPT-J. For example, in Exercise 1, while simple human plagiarism scored a 1.0 (100% match), the AI solutions scored around 0.69, well within the range of "safe," independent work.
Stylistic Diversity
A common hypothesis is that AI-generated code might possess a consistent "fingerprint" or stylistic bias that could be used for future detection. To test this, the authors used Isomap embeddings to visualize the stylistic space of the code submissions.
The Isomap analysis reveals that GPT-J's solutions are remarkably diverse. Rather than forming a tight cluster of "AI-style" code, the model's outputs are scattered throughout the space of genuine, independent human solutions. This lack of a distinct signature makes it extremely difficult for clustering-based detection algorithms to flag AI-generated work.
Discussion and Conclusion
The study also noted that GPT-J often makes "human-like" errors, such as using bitwise operators where exponents are intended. While these are technical failures, they ironically aid in evading detection by making the code look like the work of a struggling novice rather than a "perfect" machine. Furthermore, a check against the model's training data confirmed that these solutions were not simply memorized, but generated in response to the prompts.
The findings suggest a significant shift is needed in computer science education. As automated similarity tools become less effective against generative AI, instructors may need to move toward modernized curricula that integrate these tools into the learning process or adopt assessment methods that focus on the process of creation rather than just the final code artifact.
Summary updated