This article outlines DoorDash's journey in building SafeChat, an AI-powered content moderation platform designed to operate at scale within a real-time marketplace environment. It details an architectural pattern that combines fast, cheaper internal models for obvious cases with more expensive, nuanced LLM scoring for complex decisions, enabling graduated actions and significantly reducing safety incidents. The system evolved into a content-agnostic platform adaptable to various moderation use cases beyond its initial scope.
Read original on InfoQ ArchitectureDoorDash faces the challenge of moderating millions of daily messages, calls, and images exchanged between users, Dashers, and merchants in real time. The key requirement is to classify content as safe or unsafe within a fraction of a second to avoid disrupting the user experience, while simultaneously minimizing operational costs. Initially, a pure Large Language Model (LLM) approach was considered but quickly discarded due to high latency (2-10 seconds per call) and prohibitive costs for 4 million daily calls.
DoorDash adopted a hybrid architectural pattern to overcome the LLM limitations. This involved a multi-layered approach:
Design Principle: Score, Don't Boolean
When using AI/ML models for moderation or decision-making, especially with LLMs, prefer asking for scores or classifications across multiple dimensions rather than a simple true/false. Scores enable more flexible, graduated responses, future-proofing for new categories, and adjustable thresholds, making the system more robust and adaptable.
After successfully reducing verbal abuse incidents by 50%, the SafeChat system evolved into a content-agnostic moderation platform. The underlying "cheap first, expensive second, then graduated action" pattern proved valuable for various use cases beyond chat, including moderating profile pictures, names at signup, food reviews, and even fraud detection. This platform approach avoids rebuilding similar moderation logic for each new content type (images, voice), using appropriate "cheap layers" like commercial vision APIs for images or voice-to-text with immediate action for voice calls, while leveraging the same scoring engine.