Do AI detectors work on code comments and technical documentation?
Your read matches how these classifiers work. They estimate how predictable text is to a language model. Boilerplate is predictable by construction, whoever wrote it. A "Returns: a list of strings" line is going to look machine-like because every human who writes docs writes it the same way.
Cite
AI Content Authenticity Forum, "Do AI detectors work on code comments and technical documentation?", https://forum.aicontentauthenticity.com/thread/do-ai-detectors-work-on-code-comments-and-technical-documentation/, accessed 2026-12-03.I build moderation pipelines for a developer community site. Members post tutorials, README files and long comment blocks in code samples. A product manager wants an "AI generated" signal on posts and asked me to wire a detector API into the intake queue.
I ran a small batch of our older tutorials, written years before any of this tooling existed, through two detector APIs. Prose paragraphs mostly looked fine. The pages that scored badly were the ones that were mostly comment blocks, API reference tables, step lists and templated "Parameters" sections. One of the worst was a human-written changelog.
My read is that these tools are tuned for essays and articles and fall over on anything formulaic. Before I write that into a design doc, has anyone seen vendor guidance on this? Do any detectors claim to handle code, comments or reference docs? And how would you set up the pipeline so that a bad score on a templated page does not turn into a moderation action?
Write something first.
Give people something to work with: at least 30 words on what happened and what you tried.
That is too long. Keep it under 6,000 characters.
Write the question as the title, 15 to 140 characters, no links.
Pick a category.
Add a name (2 to 40 characters, no links).
That email address does not look right.
That was quick. Read the thread, then try again.
The form expired. Reload the page and post again.
Something went wrong with the form. Reload and try again.
Please complete the check and post again.
Limit reached for now. Try again later.
This thread is closed to new replies.
This thread no longer accepts replies.
Something went wrong with the form. Reload and try again.
Post a reply or question first (name and email), then this browser can vote, edit and accept answers.
You cannot vote on your own post.
Only the author (within 30 days) or the forum team can do that.
That email already has an account. Use your sign-in link instead.
New accounts are paused for the moment. Try again later.
That was already posted.
7 answers
- Petra S.Member ·
Your read matches how these classifiers work. They estimate how predictable text is to a language model. Boilerplate is predictable by construction, whoever wrote it. A "Returns: a list of strings" line is going to look machine-like because every human who writes docs writes it the same way.
Turnitin's FAQ says its model tries to drop text it predicts is not real sentences, including lists, headers, references, tables and text that looks like code or formulas, and says it does not reliably detect AI text in non-prose or code. That is a vendor telling you the limit. Source: Turnitin AI writing detection FAQs.
- Quinn H.Member ·
Do not let a detector score trigger an action by itself. In our setup a score can add a post to a review queue and nothing else. Reviewers look at account history and edit history before anything happens to the author. Budget your false positives in terms of reviewer hours, not in terms of a percentage that sounds small.
- Devin K.Member ·
I write methods sections for papers, which are also very formulaic, and mine have been flagged before. The same thing happens: the more the genre has a fixed shape, the more a detector sees "predictable" text. Please do consider that your community may include many non-native writers who stick to templates on purpose.