NotifDetox reads each notification on your phone and moves marketing out of the way. It does this with a 32-million-parameter classifier that runs through llama.cpp on the phone’s GPU. That classifier replaced the first model we picked, the 421-million-parameter Laya decision model. The new one is 13× smaller, 31× faster (42 ms against 1,298 ms on a Pixel 8) and more accurate on our test set (95.8% against 73.6%).
We built it because Android notification channels don’t solve the problem: many apps post promotions on the same channel as order updates. So the app judges the content of each notification, not its channel, and nothing is sent off the phone to decide.
The stack is native: Kotlin and Jetpack Compose on Android, over a portable C++ core that links llama.cpp for inference. It runs on Android 8 and newer.
How a notification is decided
Each notification passes the user’s own rules and a few built-in ones before the model, so calls and alarms never wait on inference.

No Android app can edit another app’s notification. So “collapse” means hiding the original and re-posting a copy in one silent group, with the original tap action, so a tap still opens the right screen.
The model: from Laya to Ettin-32M
We started with Laya, an open “System One” decision model, and shipped Ettin-32M fine-tuned as a plain 7-way classifier instead. Laya is general-purpose: you ask it a typed question with options, and it returns a calibrated probability per option in one forward pass. It’s an open, local take on TypeSafe’s cloud-only Jev, and llama.cpp could already run it.
Laya, the first pick. It uses a ModernBERT-large-shaped encoder: 28 layers, hidden size 1024, 16 attention heads. It has 421.3M parameters, is Apache-2.0, and was trained by its authors with reinforcement learning for calibrated decisions. We asked it one choice question per notification, “What kind of phone notification is this?”, over our 7 categories. Laya has no head per task: the category descriptions go into the prompt, so each call reads about 250 tokens. That’s why it was slow.
Ettin-32M, shipped. jhu-clsp/ettin-encoder-32m is a small ModernBERT encoder under the MIT license. We added a classification head and fine-tuned it on our own data. It reads only the notification, because its labels are fixed at training time, so each call reads far fewer tokens.
| Laya (first pick) | Ettin-32M (shipped) | |
|---|---|---|
| Parameters | 421,293,830 | 32,033,671 |
| of which token embeddings | — | 19,341,312 (60%) |
| Layers · hidden · heads | 28 · 1024 · 16 | 10 · 384 · 6 |
| How it’s asked | choice question + 7 option descriptions in the prompt | notification text only, 7-way head |
| GGUF on device | 449 MB (Q8_0) | 35.8 MB (Q8_0) |
| Accuracy, 144 test notifications | 73.6% | 95.8% |
| Spam precision / recall | 0.96 / 0.52 | 1.00 / 0.94 |
| Pixel 8, GPU (Mali-G715, Vulkan) | 1,298 ms | 42 ms |
| realme 12 Pro 5G, CPU (Snapdragon 6 Gen 1) | — | under 50 ms |
| License | Apache-2.0 | MIT |
The Ettin-32M shape: a vocabulary of 50,368 tokens with tied embeddings, FFN size 576, local attention over 128 tokens, and full attention every 3rd layer. Its transformer layers hold only 12.7M parameters; the rest is the vocabulary.
Variants we also built. Ettin-17M (16,865,031 parameters, 19 MB at Q8_0) scored 96.5%, which is level with 32M on a test set this small. We kept 32M for its extra capacity on real-world variety, and we’ll re-decide once we have real data. At Q4_0 the 32M model is 28 MB and scores 94.4%; at F16 it is 63 MB and scores 95.1%.
The app can still run Laya-style decision models, so a general model remains an option.
Training
We fine-tuned Ettin-32M on 200,000 synthetic notifications for one epoch, in about 16 to 19 minutes on an M1 Pro laptop. There is no public corpus of phone notifications, so we wrote our own generator.
The data. The generator has 31 intents across the 7 categories, such as promotional/cart or transactional/upi, each with several phrasings. Slots are filled from vocabularies of Indian and global apps, brands, names, INR and USD amounts, dates, codes and Hinglish. Augmentation adds the noise real notifications have: shouted or lower-case titles, emoji tails, truncated previews, and a missing title.
It also writes deliberate hard cases:
- marketing worded like a personal message
- promotions posted on an “Order updates” channel
- a real order or payment message with a promo tail, which stays transactional
- news or personal messages that mention a sale, which are not marketing
The model sees four fields of each notification: the app’s name, the channel, the title and the text.
| Category | Train | Validation | Test (hand-written) |
|---|---|---|---|
| promotional | 69,786 | 1,853 | 50 |
| transactional | 61,031 | 1,391 | 30 |
| personal | 25,684 | 558 | 15 |
| news | 12,643 | 433 | 11 |
| security | 11,339 | 257 | 9 |
| social | 10,295 | 211 | 13 |
| system | 9,222 | 297 | 16 |
| Total | 200,000 | 5,000 | 144 |
The 144 test notifications were written by hand, separately from the generator, and never trained on.
The recipe:
| Setting | Value |
|---|---|
| Base | jhu-clsp/ettin-encoder-32m |
| Head | 7-way linear classifier, mean pooling (llama.cpp’s default for ModernBERT) |
| Loss | cross-entropy, label smoothing 0.05 |
| Optimizer | AdamW, peak learning rate 8e-5 |
| Batch · steps · epochs | 64 · 3,125 · 1 |
| Calibration | temperature fitted on validation, never below 1.0, folded into the head’s weights |
Validation accuracy reached 100% by step 1,000, which tells us synthetic data is easier than real notifications. For the same reason the fitted temperature (0.27) was clamped to 1.0 rather than sharpening the probabilities.
Why supervised and not RL. Every training example has a known label, so cross-entropy directly optimises what an RL reward of “picked the right category” would, with lower variance. Cross-entropy is also a proper scoring rule, which keeps the probabilities meaningful. RL still makes sense later for signals without labels, such as users’ “Mark as Not Promotional” taps.
Inference on the phone with llama.cpp
The classifier runs through llama.cpp, the open-source inference engine, and takes 42 ms per notification on a Pixel 8 GPU. We export with llama.cpp’s own tools, so the model on the phone is the one we measured on the laptop:
- Convert the fine-tuned checkpoint to an F16 GGUF (63 MB).
- Quantize it to the Q8_0 file that ships (35.8 MB).
- Score it on the test set through the same engine the app uses.
The model ships inside the app and is memory-mapped, not copied. Each notification takes one forward pass, then a softmax over the 7 outputs. For Laya, we re-implemented llama.cpp’s decision path for use on the phone.
GPU first. On arm64 the app ships ggml’s Vulkan backend and offloads every layer to the GPU. It falls back to the CPU on phones without a recent enough Vulkan driver, such as emulators and older phones. Two things mattered on the Pixel 8’s Mali-G715:
- A recent shader compiler. The one in the Android NDK is too old for int8 dot-product shaders and silently drops them. With them Laya ran in 1,300 ms; without them, 2,410 ms.
- Cooperative-matrix shaders off. On Mali they ran Laya 5× slower (7,100 ms).
CPU fallback. ggml compiles its CPU backend 7 times, once per arm64 instruction-set level, from armv8.0 up through dotprod, fp16, i8mm, SVE2 and SME. At start-up it loads the best one the phone supports. KleidiAI kernels are on.
Small models change the trade-off. At 32M parameters the GPU’s fixed cost of about 40 ms per call dominates. The CPU is close behind and may cost less battery. On a realme 12 Pro 5G, whose Adreno 710 driver is too old for the GPU path, the CPU classifies a notification in under 50 ms. Laya’s mapped weights grew the app’s process by about 430 MiB; on a 2 GB-RAM emulator that caused swapping and 10 to 30× slowdowns. Ettin-32M maps 34 MiB.
Around the model. Notifications are decided one at a time, in order. Apps re-post the same notification often, so the app reuses its earlier decision instead of running the model again.
Privacy
Every notification is classified on the phone. The model is built into the app, so it needs no network to decide, and notifications are never sent anywhere to be classified.
Limits and next steps
The 95.8% is an upper bound. The test set has only 144 notifications, and the same team wrote both it and the generator, so real notifications will score lower.
- Real labelled data. A few hundred real, labelled notifications become the test and calibration sets, and the hard ones go into training.
- Wider generator. More intents and phrasings, Hindi script and Tamil, and paraphrases written by a larger LLM.
- Smaller model. Ettin-17M already matches 32M on today’s test set, at 19 MB.
- More GPUs. The Vulkan defaults were tuned on Mali. They still need checking on Adreno (Snapdragon) and Xclipse (Exynos).
- No iOS. iOS doesn’t let apps read other apps’ notifications, so the product can’t exist there as it stands.
