How On-Device AI Detects Scams While Protecting Privacy

Peter Bubenik ยท Google DeepMind ยท ยท Source
Image for On-Device AI Against Scams: Google DeepMind & MDDI

Step-by-Step Study Material

Step 1: Understand the Problem Being Solved

What is the threat?

Before understanding the solution, you need to understand why it was built.

FactorDetail
ScaleScams = over 50% of Singapore's reported crimes
Financial damageS$4 billion+ in losses since 2019
Evolving tacticsShifted from simple phishing โ†’ complex social engineering
Social engineering shareUp to 80% of all scam losses

๐Ÿ”‘ Key Concept: Social Engineering

Social engineering means manipulating a person through conversation โ€” building trust, creating urgency, or impersonating authority โ€” before requesting money or credentials. It is harder to detect than a suspicious link because it looks like a normal chat.

Why does this matter technically? Simple keyword filters fail because the conversation sounds legitimate until the final manipulation. You need a model that understands conversational intent, not just suspicious words.


Step 2: Understand Why Traditional Detection Falls Short

The Server-Side Problem

Traditional scam detection works like this:

User's Phone โ†’ Message sent to Cloud Server โ†’ Server scans for threats โ†’ Result returned

Two critical problems arise:

Problem 1 โ€” End-to-End Encryption (E2EE)

  • Most modern messaging apps (WhatsApp, Signal, etc.) encrypt messages so that only sender and receiver can read them
  • The cloud server cannot inspect the content
  • Therefore, server-side scanning is blocked by design

Problem 2 โ€” Privacy Trade-off

  • Even if encryption were bypassed, sending private conversations to a server creates a surveillance risk
  • Citizens should not have to choose between safety and privacy

๐Ÿ”‘ Key Concept: End-to-End Encryption

E2EE means messages are scrambled at the sender's device and can only be unscrambled at the receiver's device. No third party โ€” including the platform provider or a cloud server โ€” can read the content.


Step 3: Understand the Core Solution โ€” On-Device AI

The Fundamental Shift

Instead of bringing the message to the analysis, bring the analysis to the message:

Traditional:  Message โ†’ Cloud โ†’ Analysis โ†’ Warning
On-Device:    Message โ†’ On-Phone Analysis โ†’ Warning
              (nothing leaves the device)

Why This Solves Both Problems

ProblemHow On-Device AI Solves It
E2EE blocks server scanningAnalysis happens locally โ€” encryption is irrelevant
Privacy risk from cloud accessConversation data never leaves the phone
Speed/latency from cloud round-tripFaster real-time analysis on-device

๐Ÿ”‘ Key Concept: On-Device AI (Edge AI)

Running an AI model directly on a smartphone or local device rather than on a remote server. The device does the computation itself, keeping data local and reducing dependency on internet connectivity.


Step 4: Understand the Technical Architecture โ€” The Two-Stage Pipeline

Running a powerful AI model on a smartphone is challenging because:

  • Phones have limited processing power compared to servers
  • Battery life must be preserved
  • Analysis must happen in real time

The solution is a two-stage pipeline โ€” think of it as a coarse filter followed by a fine filter:

Stage 1: Lightweight Classifier (The Gatekeeper)

Incoming Message
      โ†“
[Lightweight Classifier]
      โ†“              โ†“
 Looks Safe      Potentially Suspicious
      โ†“                    โ†“
  No action         โ†’ Pass to Stage 2
  • Purpose: Quickly screen every inbound message
  • Design priority: Minimal battery/power usage
  • Function: Flag messages that might be threats โ€” does not need to be perfect, just fast and efficient

Stage 2: Fine-Tuned Gemma Model (The Analyst)

Flagged Conversation
        โ†“
[Fine-Tuned Gemma Model]
Analyzes larger conversation snapshot
        โ†“                    โ†“
  False Alarm           Confirmed Threat
        โ†“                    โ†“
  No action        Real-time warning on device
  • Purpose: Deep contextual analysis of the full conversation
  • Design priority: Accuracy โ€” confirm or dismiss the Stage 1 flag
  • Function: Detect manipulative intent across the conversation arc

๐Ÿ”‘ Why Two Stages?

Running the powerful Gemma model on every message would drain the battery. Stage 1 acts as a cheap filter so Stage 2 only activates when genuinely needed โ€” balancing efficiency with accuracy.


Step 5: Understand Local Context Adaptation

The Problem with Generic Models

A general-purpose AI trained on global data may not recognize:

  • Impersonation of Singapore-specific institutions (local banks, government agencies)
  • Regional scam schemes trending in Southeast Asia
  • Local conversational patterns and language styles (e.g., Singlish)

The Solution: Fine-Tuning on Local Data

Google DeepMind's Gemma model was fine-tuned specifically on:

Training Data TypePurpose
Impersonations of public institutionsRecognize fake government/authority contacts
Bank impersonation scriptsDetect fake financial urgency tactics
Local public figure impersonationsCatch celebrity/authority trust exploitation
Trending regional scam schemesStay current with evolving local tactics

๐Ÿ”‘ Key Concept: Fine-Tuning

Taking a pre-trained AI model and further training it on a specific, targeted dataset to improve its performance in a particular domain โ€” in this case, Singapore-specific scam conversations.

Result: The model can distinguish between:

  • โœ… Normal social chatter ("Hey, want to grab lunch?")
  • โš ๏ธ Manipulative scam conversation ("I'm from MAS, your account is frozen, send funds now")

Step 6: Understand the Governance Framework

Building AI that handles sensitive security data requires strict ethical and legal controls. Three key principles were applied:

Principle 1: Sovereign Sandbox

  • Fine-tuning happened inside GovTech's own managed cloud environment (GCP)
  • Training data was isolated โ€” never exposed to external systems
  • The government retained control and oversight of the entire process

Principle 2: No Citizen Data

  • Training used zero private or personally identifiable information (PII)
  • Data sources: anonymised scam reports + intelligence feeds
  • Citizens' real conversations were never used to train the model

Principle 3: Stress-Testing

  • Model tested against synthetic dialogues (artificially created scam conversations)
  • Tested across diverse scam categories and impersonation tactics
  • Ensures robustness before public deployment

๐Ÿ”‘ Why Governance Matters

An AI safety tool that itself violates privacy or misuses data would undermine public trust. Governance ensures the solution does not become a new problem.


Step 7: Synthesize โ€” The Big Picture

Now connect all the pieces:

PROBLEM                          SOLUTION
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Scams use social engineering  โ†’  Model trained on conversational manipulation patterns
Server scanning blocked by E2EE โ†’ On-device processing bypasses this entirely
Privacy risk from cloud access โ†’  Data never leaves the phone
Generic models miss local scams โ†’ Fine-tuned on Singapore-specific scam data
Phones have limited resources  โ†’  Two-stage pipeline (efficient + accurate)
Risk of misusing citizen data  โ†’  Strict governance: no PII, sovereign sandbox

Step 8: Check Your Understanding

Test yourself with these questions:

Conceptual Questions

  1. Why does end-to-end encryption make server-side scam detection ineffective?
  2. What is the difference between Stage 1 and Stage 2 of the detection pipeline, and why are both needed?
  3. Why is fine-tuning on local data important for scam detection accuracy?

Application Questions

  1. A messaging platform wants to add scam detection but cannot access message content due to E2EE. How does the on-device approach solve this?
  2. Why would running only the Gemma model (without Stage 1) be impractical on a smartphone?
  3. A critic argues: "Training AI on scam data must use real user messages." How does the governance framework refute this?

Critical Thinking 7. What are potential limitations of on-device AI that this article does not address?


Summary Table

ConceptKey Takeaway
Social EngineeringManipulation through conversation, not just malicious links
E2EEEncrypts messages so servers cannot scan them
On-Device AIRuns analysis locally โ€” solves E2EE and privacy simultaneously
Two-Stage PipelineStage 1 = fast filter; Stage 2 = deep analysis โ€” balances battery vs. accuracy
Fine-TuningAdapts generic model to local scam patterns for higher accuracy
GovernanceNo citizen data, isolated training environment, rigorous testing

More to study