📑 arXiv 2d ago
LLMSniffer: Detecting LLM-Generated Code via GraphCodeBERT and Supervised Contrastive Learning
LLMSniffer fine-tunes GraphCodeBERT with two-stage supervised contrastive learning to detect AI-generated code, improving accuracy from 70% to 78% on GPTSniffer and 91% to 94.65% on Whodunit. The approach combines comment removal preprocessing with an MLP classifier and produces well-separated embeddings confirmed by t-SNE visualization.