liveBook · Manning

Filtering

As explained in Introduction to Generative AI, Second Edition

Content filtering is the computational screening, blocking, or removal of content according to specified safety or policy criteria.

A developer preparing web data for a large language model (LLM) might remove material identified as hateful or explicit. This is content filtering: screening and removing content according to safety or policy criteria. The aim is to reduce the chance that the model generates inappropriate responses. section 3.2 section 3.20

Filtering can happen before training. A classifier—a system trained to sort content into categories—screens pretraining data for potentially toxic or unsafe material. Developers can then remove the identified data. This differs from conditional pretraining, which keeps data but labels it so the model can be directed toward safer examples when generating responses. section 3.7

Filtering a training source

If Reddit is one source of pretraining data, developers might identify subreddits containing substantial toxic speech and exclude them. Alternatively, conditional pretraining could label those subreddits unsafe and other texts safe, rather than removing them. section 3.7

Filtering has trade-offs. Classifying enormous datasets is expensive, and a small, efficient classifier may be less accurate than a large model. Filters can also suppress the voices of LGBTQ+ people and other marginalized groups when removing harmful content. More sophisticated methods seek to preserve diverse voices, but remain imperfect and are often proprietary. section 3.7 section 3.2

Filtering can also screen inputs to AI agents. Alongside safeguards such as logging, permission boundaries, and human oversight, it can help address risks from malicious instructions or sensitive information. No single defense is fully effective, especially against adversarial pressure. section 8.19 section 8.22

How Introduction to Generative AI, Second Edition covers it

How deep it goes
Explains classifier-based pretraining screening and its trade-offs at a high level, without implementation details.
Examples
Illustrates filtering through the removal of toxic subreddits and web content that may include marginalized voices.
What you can do after
Evaluate filtering as a safety measure against its costs, classification errors, and potential effects on representation.
How it connects
Connects filtering with classification, conditional pretraining, representational bias, and prompt injection.

Also explained in

Compare how 34 books explain filtering →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Introduction to Generative AI, Second Edition. The section links point to the parts of the book it draws on.