Every time an AI-powered app gets smarter, most people assume there is a trade-off: the more the AI knows, the more of your data it must have seen. For years that assumption was basically correct. Machine learning models were trained the way exams are graded — gather everyone's work in one place, analyse it, and hand back a verdict.
There is a newer way to train AI that inverts the whole process. It is called federated learning, and it removes the trade-off instead of asking you to accept it.
The Old Way: Bring the Data to the Model
Traditional machine learning works like this: collect data from thousands of users, send it to a central server, and train a model on the combined dataset. The model learns patterns — "this behaviour looks like spyware" — and is deployed back to users.
The problem is obvious. Your raw data has to leave your device. Photos, typing patterns, app usage, location history — all of it travels to someone else's computer. Even with encryption in transit, the data sits at rest in a place you do not control, protected only by that company's security and policies.
For a privacy product, that is a contradiction. A security app that needs to see your most sensitive data in order to protect you is asking you to trust it with exactly the things you are trying to protect.
The New Way: Bring the Model to the Data
Federated learning flips the architecture. Instead of the data travelling to the model, the model travels to the data.
The cycle has five steps:
- Deploy. A global base model is distributed to devices — for example, to every phone running a security app.
- Learn locally. Each device trains the model on its own data, entirely on-device. No raw data leaves.
- Share only the lesson. The device sends back a small, encrypted update — the mathematical "lesson learned", not the underlying data. A student summarising a book without ever photocopying the pages.
- Aggregate. A server combines the updates from many devices (using an algorithm called FedAvg) to improve the global model.
- Replace. The improved model goes back to the devices, and the cycle repeats.
The result: the model gets better with every cycle, and your raw data never leaves the device. Not to the server, not to the company, not to anyone.
Why This Matters for Mobile Security
Security is one of the most sensitive categories of software on your phone. A security app monitors your camera, microphone, network traffic and app behaviour — by design. That is exactly why it should be held to the highest privacy standard.
Malloc uses federated learning in its threat detection. The work is grounded in two European research projects: the Pre-Seed project "Preventing unattended data recording and leakage in smart devices" (grant #PRE_SEED/0719/0201), and Project DAEMON-AI (grant #CODEVELOP/0824), led by Malloc LTD in collaboration with The Cyprus Institute.
Using the open-source Flower federated learning framework, Malloc's models train on-device on local sensor data. Before a weight update leaves the device it is clipped and given Gaussian noise — DP-SGD — so only privacy-budgeted gradients travel back to the aggregator. Raw user telemetry stays on the phone. You can read more on our research page.
The Privacy Maths Finally Works
Federated learning does not just reduce data exposure. It changes the threat model:
- No honeypot. There is no central database of user behaviour for an attacker to breach.
- No metadata trail. We cannot reconstruct what an individual user's device observed.
- Compliance by architecture. When data never leaves the device, GDPR stops being a paperwork exercise and becomes a design property.
The Takeaway
The next time someone tells you an app is "AI-powered", it is worth asking a simple question: does the AI learn from your data, or does it learn without ever seeing it?
Federated learning is proof that you do not have to choose between smart and private. The model can come to you, learn from you, and leave with nothing but a better understanding of threats — while your data stays exactly where it belongs.
Malloc is a mobile security app combining on-device AI threat detection, a VPN with no logs by design, and real-time spyware detection. To learn more about its research and federated learning architecture, visit mallocprivacy.com/research.
Relevant tags:
Published on Medium