A classifier is a model or algorithm that assigns input data to one of a set of predefined categories. It is used for tasks whose outcome is a discrete category, such as spam detection, object recognition in images, and sentiment analysis of text. It is distinguished from regression, which predicts continuous values.
In LLM systems, lightweight classifiers are commonly placed before or after a generative model to screen prompts for sensitive information or attacks, route requests to an appropriate model based on their nature, or check whether outputs violate a policy. Because they are far smaller and faster than large generative models, they are often deployed as the first stage of safety and routing pipelines.