[Paper Review] Fooling MOSS Detection with Pretrained Language Models
This paper demonstrates that GPT-J, a large language model, can generate introductory-level programming solutions that evade detection by MOSS, a widely used plagiarism detection tool, even without fine-tuning or example inputs. The generated code is structurally diverse and indistinguishable from human-written code in MOSS similarity scores, revealing a critical vulnerability in current anti-plagiarism systems based on code similarity analysis.
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.
Motivation & Objective
- To investigate whether large language models can generate programming solutions that evade detection by MOSS, a standard plagiarism detection tool.
- To assess the feasibility of using GPT-J to complete introductory programming assignments without triggering MOSS similarity alerts.
- To evaluate the structural diversity and detectability of AI-generated code in comparison to human-written code.
- To examine the implications of such capabilities for academic integrity, curriculum design, and future detection systems.
- To explore the ethical and practical challenges posed by AI-generated content in educational settings.
Proposed method
- The study uses GPT-J, a publicly available, instruction-tuned language model, to generate code solutions for introductory programming assignments from a published dataset.
- Solutions are generated via zero-shot prompting, without fine-tuning or example demonstrations.
- MOSS is used to compute similarity scores between GPT-J generated code and original human-written solutions.
- The model's output is analyzed for structural diversity, syntactic variation, and similarity to known human-written patterns.
- A comparison is made between original solutions, human-plagiarized versions (Level N), and AI-generated code in terms of MOSS scores.
- The study evaluates the need for human editing and the robustness of detection under varying prompt conditions.

Experimental results
Research questions
- RQ1Can GPT-J generate programming solutions that are undetected by MOSS, a widely used plagiarism detection system, without fine-tuning or example inputs?
- RQ2How does the structural diversity of GPT-J-generated code compare to human-written code, and does it reduce detectability?
- RQ3To what extent can AI-generated code bypass similarity-based detection tools like MOSS in academic settings?
- RQ4What are the implications of such evasion for academic integrity and curriculum design in computer science education?
- RQ5How might future detection systems be redesigned to identify algorithmically generated code despite its diversity?
Key findings
- GPT-J successfully generated code for introductory programming assignments that received no similarity alerts from MOSS, even when compared to original human solutions.
- The model produced structurally diverse code with no consistent patterns or 'tells' that could be exploited by future detection systems.
- Minimal human editing was required to produce solutions that would receive full marks in a course, indicating high usability for academic misconduct.
- The results suggest that MOSS-based detection tools are vulnerable to evasion by modern language models, even when the models are not trained on the specific assignment data.
- The study confirms that GPT-J-generated code is not memorized but genuinely de novo, as verified through inspection and comparison to training data.
- The findings highlight a critical gap in current anti-plagiarism systems, necessitating new detection strategies such as watermarking or behavioral analysis.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.