Working Paper · In review

Explanation Is All You Need

Dr. Richard Kerr, PhD, MBA

Abstract

We present Explanation-Constrained Classification (ECC), a lightweight prompt engineering technique that dramatically reduces hallucination rates in large language model classification tasks. By requiring models to provide structured explanations for their classification decisions as a separate JSON output field, we observed hallucination rates drop from 22% to 1% in ablation experiments repeated in triplicate (n=891 per trial). This technique enables the use of faster, more economical models while maintaining accuracy levels previously requiring larger models, resulting in significant cost and latency improvements.

ECC represents a foundational approach for deploying LLMs as drop-in replacements for traditional machine learning classifiers, without the overhead typically associated with production ML systems. Our implementation required zero training data, no fine-tuning, and no retrieval-augmented generation infrastructure—the model was used entirely off-the-shelf. We classified 891 jobs for approximately $4 in API costs, a task that would require a compensation analyst several months and thousands of dollars to complete manually.

Critically, we combine low hallucination rates with an operational definition that enables automated detection: a hallucination occurs when the model selects a value outside the provided valid option set. This allows immediate re-prompting, achieving 100% structural validity within three attempts. The combination of high first-attempt accuracy and automated recovery creates a system reliable enough for self-service deployment at internet scale—transforming what would otherwise require expert oversight into a fully autonomous classification pipeline.

The paper is in review. To discuss the method or request the manuscript, start a conversation.