WhatsApp is implementing an on-device machine learning feature, "Scam Alert," to detect scam messages from non-contacts. The system design prioritizes user privacy by performing message classification locally, while leveraging confidential computing, differential privacy, and transparency ledgers for performance measurement and secure model distribution.
Read original on InfoQ ArchitectureWhatsApp's new "Scam Alert" feature exemplifies a robust system design for integrating on-device machine learning with stringent privacy requirements. The core challenge is to identify scam patterns effectively without compromising user message content or privacy during model evaluation and performance analytics.
The architecture distinctly separates message classification from performance measurement and model distribution. Message classification occurs entirely on the user's device, using a downloaded ML model to analyze conversational structure and linguistic signals from non-contact messages. This ensures that sensitive message content never leaves the device for scam detection.
Why OHTTP and Confidential Computing?
OHTTP and confidential computing are critical for preserving user privacy in analytics. OHTTP prevents servers from linking telemetry data to individual users, while confidential computing provides a hardware-protected environment for processing sensitive aggregated data, ensuring that even the cloud provider cannot access the plaintext data or computations.
Model distribution is treated as a security boundary. Each model version, along with its SHA-256 hash, is published to a third-party append-only transparency ledger. Clients verify this ledger entry, the model's signature, freshness, and hash before loading a model, preventing malicious model injections. Model downloads also use anonymous credentials and OHTTP, with experiment assignment occurring locally to prevent server-side targeting of specific model variants to individual users.
This architectural approach builds upon Meta's PAPAYA federated analytics system, adapting it for consumer messaging where telemetry data itself is considered sensitive. It highlights a strong commitment to privacy by design, particularly for features leveraging AI/ML in sensitive contexts.