English

DuoLens: A Framework for Robust Detection of Machine-Generated Multilingual Text and Code

Computation and Language 2025-10-23 v1 Artificial Intelligence Information Retrieval Machine Learning

Abstract

The prevalence of Large Language Models (LLMs) for generating multilingual text and source code has only increased the imperative for machine-generated content detectors to be accurate and efficient across domains. Current detectors, predominantly utilizing zero-shot methods, such as Fast DetectGPT or GPTZero, either incur high computational cost or lack sufficient accuracy, often with a trade-off between the two, leaving room for further improvement. To address these gaps, we propose the fine-tuning of encoder-only Small Language Models (SLMs), in particular, the pre-trained models of RoBERTA and CodeBERTa using specialized datasets on source code and other natural language to prove that for the task of binary classification, SLMs outperform LLMs by a huge margin whilst using a fraction of compute. Our encoders achieve AUROC =0.97= 0.97 to 0.990.99 and macro-F1 0.890.89 to 0.940.94 while reducing latency by 88-12×12\times and peak VRAM by 33-5×5\times at 512512-token inputs. Under cross-generator shifts and adversarial transformations (paraphrase, back-translation; code formatting/renaming), performance retains 92\geq 92% of clean AUROC. We release training and evaluation scripts with seeds and configs; a reproducibility checklist is also included.

Keywords

Cite

@article{arxiv.2510.18904,
  title  = {DuoLens: A Framework for Robust Detection of Machine-Generated Multilingual Text and Code},
  author = {Shriyansh Agrawal and Aidan Lau and Sanyam Shah and Ahan M R and Kevin Zhu and Sunishchal Dev and Vasu Sharma},
  journal= {arXiv preprint arXiv:2510.18904},
  year   = {2025}
}

Comments

Accepted to 39th Conference on Neural Information Processing Systems (NeurIPS 2025): 4th Workshop on Deep Learning for Code

R2 v1 2026-07-01T06:58:25.364Z