Federated analytics is a technique for computing aggregate statistics over data that stays on user devices: a server sends a query to phones, PCs or embedded systems, each device computes a small local result, and only those results, usually protected by secure aggregation and differential privacy, are combined into a population-level answer. In Edge AI it is the measurement counterpart of federated learning, because it answers questions about how models and features behave in the field without collecting the underlying records.
The approach matters wherever raw data is too sensitive, too large or too regulated to upload. Typical questions include how often a keyboard suggestion is accepted, which songs are recognized most often, or how accurate an on-device model is across different hardware, all answered while individual records never leave the device.
How a federated analytics query runs
A federated analytics query runs as a coordinated round between a server and a sample of devices, in which computation moves to the data instead of data moving to the computation. The server defines the query, devices that meet eligibility rules execute it locally, and an aggregation layer releases only the combined result.
Eligibility rules usually require that a device is idle, charging and on an unmetered network, so the query does not drain the battery or consume mobile data. Each participating device reads its local log or cache, computes a compact summary such as a count, a histogram bucket or a sum, and encrypts or masks that summary before upload.
The following table shows the main stages of a typical round and what each stage protects.
| Stage | What happens | Privacy role |
|---|---|---|
| Query definition | Analyst specifies a metric, bucket scheme and minimum cohort | Limits what can be asked |
| Device selection | Server samples eligible devices from a large population | Hides who participated |
| Local computation | Device computes a count, sum or sketch on its own data | Raw records stay local |
| Masking or noise | Device adds secret-shared masks or local noise | Hides single contributions |
| Secure aggregation | Server combines masked values into one total | Server sees only the sum |
| Release | Result is published after thresholds and central noise | Limits re-identification |
A key design choice is that the server should be able to decode only the aggregate. With secure aggregation protocols, individual uploads are cryptographically masked so that the masks cancel out only when enough devices contribute, which also makes the system tolerant to devices that drop out mid-round.
Privacy mechanisms and their guarantees
Federated analytics is only as private as the mechanisms layered on top of decentralization, because a simple per-device answer can still reveal sensitive facts. Keeping data on the device reduces exposure, but a careful system adds formal protections against both the server and other analysts.
The table below compares the mechanisms most often combined in production deployments.
| Mechanism | What it protects against | Main cost |
|---|---|---|
| Secure aggregation | Server inspecting individual uploads | Extra rounds and bandwidth |
| Local differential privacy | Any observer of a single upload | High noise, needs large cohorts |
| Central differential privacy | Inference from the published result | Requires a trusted aggregator |
| Distributed differential privacy | Both server and output observers | Protocol complexity |
| Minimum cohort thresholds | Answers about tiny groups | Rare events go unreported |
| Trusted execution environments | Operator access to plaintext sums | Hardware trust assumptions |
The strength of differential privacy is expressed by the privacy budget epsilon. Smaller values give stronger protection and noisier answers; production systems often report per-query epsilon values in the low single digits and track cumulative spending, although the right setting depends on the threat model and is still debated among practitioners.
Federated analytics compared with related approaches
Federated analytics differs from federated learning in its output: statistics rather than model weights. Both rely on the same device orchestration, but analytics typically needs only one lightweight round per query, while training requires many rounds of gradient exchange.
| Approach | Output | Data location | Typical use |
|---|---|---|---|
| Federated analytics | Counts, histograms, quantiles | Stays on devices | Measuring usage and model quality |
| Cross-device federated learning | Updated global model | Stays on devices | Training keyboard or speech models |
| Centralized analytics | Any statistic | Uploaded to a warehouse | Business intelligence on server logs |
| Split learning | Partially trained model | Split between client and server | Collaborative training with few parties |
| On-device personalization | Locally adapted model | Stays on one device | Per-user tuning without sharing |
In practice, the two federated techniques are complementary parts of one pipeline: federated analytics finds which features or failure cases matter, federated averaging trains the model, and federated analytics again measures the deployed model across the fleet.
Typical queries and algorithms
Federated analytics supports a restricted but useful set of query types, chosen because they can be decomposed into per-device contributions that add up correctly. Arbitrary joins or free-form SQL are generally not available, which is a deliberate safety constraint.
- Counts and sums, such as how many devices triggered a wake word falsely in a day.
- Histograms over a predefined bucket scheme, for example inference latency per chipset.
- Heavy hitters discovery, finding frequent items such as popular new words without a known list, often with trie-based interactive algorithms.
- Quantiles and means for continuous metrics such as battery cost of a model.
- Model evaluation metrics, such as accuracy against labels that exist only on the device.
Heavy hitters discovery illustrates the craft involved. Because the vocabulary is unknown, the server grows a prefix tree round by round, asking devices whether their items extend popular prefixes, so that only strings shared by many users ever become visible.
Design decisions and common pitfalls
Successful deployments depend on planning queries around statistical and privacy limits instead of treating the fleet like a database. The table below lists frequent problems, their causes and practical remedies.
| Problem | Cause | Remedy |
|---|---|---|
| Noisy or useless results | Cohort too small for the noise level | Increase sample size or coarsen buckets |
| Biased estimates | Only idle, charging, Wi-Fi devices participate | Reweight or report participation bias |
| Privacy budget exhausted | Many overlapping queries on the same users | Central budget accounting and query review |
| Slow answers | Rounds wait for eligible devices | Schedule queries over hours or days |
| Inconsistent device data | Different app versions and log formats | Version the query and local schema |
The most underestimated issue is selection bias. Devices that are often idle on Wi-Fi tend to be newer, wealthier or used in particular ways, so results describe participating devices, not all users, unless the analysis corrects for it.
In everyday language
Federated analytics is a way to learn facts about a large group without collecting anyone’s personal data. Instead of asking every phone to send in its records, the company sends a small question to the phones. Each phone works out its own tiny answer and sends back only that number.
It is a bit like a secret ballot. Everyone drops a sealed vote in a box, and only the final tally is announced. Nobody sees an individual vote, yet everyone learns the overall result. Extra random noise is often added so that even the tally cannot reveal one person’s choice.
Seen in the real world
A team building a smartphone keyboard wants to know whether its new on-device next-word model performs equally well on older and newer phones. Typed text is far too sensitive to upload, so the team defines a federated analytics query: each phone records how often a suggestion was accepted over seven days and reports one bucketed acceptance rate together with its chipset class.
Over 48 hours, about 200,000 eligible phones answer while charging on Wi-Fi. Secure aggregation combines the masked values, and central noise is added before release, with groups smaller than 5,000 devices suppressed. The result shows that acceptance on older midrange chips is roughly four percentage points lower, traced to a latency timeout that dropped suggestions. The team shortens the model’s context window for those devices and confirms the fix with a second query, without reading a single typed word.