DocPrism: Multi-lingual Detection of Incorrectness Inconsistencies between Code and Documentation
Xiaomeng Xu, Zahin Wahab, Reid Holmes, Caroline Lemieux
Key points
From the paper's conclusion- We introduce and apply the Local Categorization, External Filtering (LCEF) methodology: LCEF uses an LLM’s local completion skills, rather than its long-term reasoning skills, to focus on reporting incorrectness inconsistencies.
Abstract
Code-documentation inconsistencies are common and undesirable: they can lead to developer misunderstandings and software defects. This paper introduces DocPrism, a lightweight multi-language, code-documentation inconsistency detection tool. DocPrism uses a standard large language model (LLM) to analyze and explain inconsistencies, and focuses on outputting incorrectness inconsistencies. Plain use of LLMs for this task yields unacceptably high inconsistency flag rates—i.e., over 90% of functions are flagged as inconsistent with their documentation. One substantial reason is that LLMs identify natural gaps between high-level documentation and code as incompleteness inconsistencies. We introduce and apply the Local Categorization, External Filtering (LCEF) methodology: LCEF uses an LLM’s local completion skills, rather than its long-term reasoning skills, to focus on reporting incorrectness inconsistencies. In our ablation study, LCEF reduces DocPrism’s inconsistency flag rate from 98% to 14%, and increases F1 score from 0.22 to 0.77, compared to standard prompting techniques. On a broad evaluation across Python, TypeScript, C++, and Java, DocPrism maintains a low flag rate of 17%, and achieves a precision of 0.63 without performing any fine-tuning. We also establish a conservative lower bound across four programming languages, showing that inconsistency errors are present in 11% of code-documentation pairs. In addition, DocPrism achieves precision comparable to the state-of-the-art on an established synthetic dataset, but substantially outperforms it on our real-world Java dataset in precision (DocPrism: 0.47–0.67 vs. SOTA: 0.05–0.14).
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- DefectReviewer: Towards Generating Defect-Focused Review Comment Based on Fine-Grained Defect LocalizationACM Transactions on Software Engineering and Methodology · 2026
- Standards-Guided and Dependency-Aware Code-Level Documentation GenerationarXiv · 2026
- CRJudgeBench: Can AI Detect Plausible but Invalid Code Reviews?arXiv · 2026
- CR-Bench-v2: Evaluating the Real-World Utility of AI Code Review AgentsarXiv · 2026
- CIVER: Causal Intervention Verification for Reliable Code ReviewarXiv · 2026
- DoGBench: Can Agents Meet Expert Standards for User-Facing Documentation?arXiv · 2026