HN
Today

Detecting LLM-Generated Texts with “Classical” Machine Learning

This post reveals a surprisingly robust method for detecting LLM-generated text using 'classical' machine learning, defying common assumptions about AI's indistinguishability. The author, driven by frustration with low-quality AI fanfics, trained a simple TF-IDF + SVM model that achieves high accuracy. The project culminates in a client-side JavaScript demo that even uncovers a significant prevalence of AI content in current online trends, raising questions about the future of human-generated content.

34
Score
10
Comments
#4
Highest Rank
3h
on Front Page
First Seen
Jul 16, 5:00 PM
Last Seen
Jul 16, 7:00 PM
Rank Over Time
444

The Lowdown

Driven by personal frustration with the proliferation of low-quality, AI-generated fanfiction, an author set out to build a tool to detect such content. While initial attempts with perplexity-based methods proved unreliable, a return to 'classical' machine learning techniques yielded surprisingly effective results.

  • The author developed a binary classifier using TF-IDF and LinearSVC, trained on a diverse dataset of human-written and LLM-generated Chinese texts.
  • Data generation involved leveraging various low-cost or free LLM APIs (Gemini, Qwen, GLM-5, Kimi, Deepseek, Doubao) to create AI samples, matching human content genres.
  • The system achieved impressive sentence-level accuracy of over 85% for individual models, which improved further by using a majority-voting ensemble of seven classifiers.
  • A client-side JavaScript implementation allows for browser-based detection, sacrificing minimal accuracy for serverless deployment.
  • Tests showed strong generalization, detecting text from unseen LLMs (like Claude Sonnet and GPT 5.2) with high confidence, and exhibiting very low false positive rates on human-written works.
  • The tool revealed that over 32% of articles from trending tags on a Chinese platform scored above 50% AI, with no disclosure from authors.
  • Common bypass methods, such as roundtrip translation or 'magic prompts' designed to reduce 'AI-flavor,' proved largely ineffective against the detector.

The author expresses genuine surprise at the ease with which current LLM-generated text patterns can be identified, suggesting these models are fundamentally different from human creativity. The work highlights the growing challenge of distinguishing AI-generated content and laments the perceived decline in quality across online platforms.

The Gossip

Ephemeral Detection Debates

Commenters debate the longevity and efficacy of current AI text detection methods. Some are skeptical, believing LLMs will quickly evolve beyond current detection capabilities or that human writing patterns will merge with AI styles. Others argue that commercial LLMs' current 'AI slop' is a result of specific tuning for engagement, making it inherently detectable unless incentives change.

Browser-Based Bouncers

The discussion touches on the practical application of such a classifier as a browser extension. Users express a desire for tools, similar to ad blockers, that could automatically detect and filter LLM-generated content to combat the anticipated deluge of AI text on the internet.

Textual Tells and Truths

Comments delve into the characteristics that betray AI authorship. It's noted that 'clever' and 'snappy' phrasing often signals LLM generation, and that detection accuracy can vary depending on the length and information density of the text being analyzed.