On-Device Commercial Intent Retrieval Under Size, Latency, and Privacy Constraints: A 3 MiB Retrieval System with Typed Egress Boundaries
Abstract
We study commercial intent inference that runs entirely on the user's device, under three constraints frozen before the work began: the downloaded payload under 3 MiB, Tier-0 inference under 20 ms at p95, and no raw text, content embedding, or stable identifier leaving the device. Under them we build a retrieval path over a 6,020-leaf commercial taxonomy: a static embedding table distilled from a Korean sentence transformer, quantized to 4 bits, no inference runtime. Our main result is where that constraint costs accuracy. On real Korean commerce text labelled by others (22,900 AI-Hub shopping reviews), mid-category top-5 on real product names is 75.0% against an 18.4% permutation baseline, but splits on one observable: a query containing some leaf name as a substring scores 83.5%, one containing none 45.2%. A generic 196.6x larger teacher seemed to localize the gap (+20.1 pp without an anchor, +0.1 with). That null was two effects cancelling: the same teacher fine-tuned on the student's own contrastive pairs reaches 0.8586 and beats the pure-encoder student by +10.6 pp with an anchor and +20.9 pp without. The cost is not uniform, but it is not free anywhere; where the anchor is absent, task adaptation buys the teacher nothing, so what the constrained encoder lacks there is capacity. The expensive regime is detectable on-device from the ranker's own score margin: declining the least confident fifth lifts the rest to 0.8296. A second axis we first reported, a manufacturer model code, does not survive source-category fixed effects (-4.0 pp, p=0.51); the anchor does (+13.0 pp). Payload is 2,942,652 bytes, all three library links measured. Tier-0 p95 is 4.431 and 3.670 ms on two iPhones (A14, A16) and 5.080 ms on a budget Android tablet (Snapdragon 695), all slower than three server CPUs on the same code. Taxonomy supervision is mostly synthetic Korean utterances.
Figures & tables
| Constraint | Falsifiable claim | Measured |
|---|---|---|
| Payload MiB | Downloaded bytes, data library code, | B ( ), worst of three measured links (Android); iOS B |
| Tier-0 latency ms | ms on the reference handsets | ms on an iPhone 12 Pro ( ) and ms on an iPhone 14 Pro Max ( ); ms on a Galaxy Tab A9+ ( ); – ms on three server CPUs |
| Zero raw text | No raw token appears in any byte the client sends | Canaries undetected in a -byte payload |
| Zero content embeddings | The upload schema has no field a vector can occupy | Type-checked; § 7 |
| Zero stable identifiers | The ad request type has no field an identifier can occupy | Type-checked; § 8 |
| System | Where inference runs | Intent granularity | Personal learning | Footprint |
|---|---|---|---|---|
| Adnostic [ 42 ] | browser extension | interest profile over a fixed category set | none | — |
| Privad [ 43 ] | client interposed broker | behavioural categories | none | — |
| Topics [ 45 ] | browser, platform-owned | a few hundred coarse topics | platform-managed | browser-owned |
| This work | app SDK, no runtime | -leaf taxonomy, shown at mid level | federated combiner (design; coefficients pending) | MB measured |
| On the device (raw data never leaves here) |
| Tier 0 (always on, MB of data, no runtime required) |
| recent text / search query / app context |
| tokenize static embedding lookup mean pooling L2 normalize |
| Tier 1 (only when the device has an OS model; SDK cost on iOS) |
| OS language-model summary / OS dense image embedding |
| into the space via projection or rectangular projection |
| Tier 0 | Tier 1 | |
|---|---|---|
| Availability | . We ship it | Device-dependent |
| SDK cost | Data MB + code KB | iOS B; Android varies by path |
| Latency | On the order of milliseconds | Hundreds of ms |
| What it does | Always-on intent vector | Deep interpretation of ambiguous context |
| If absent | There is no product | Only quality degrades |
| Slice | Length | Where |
|---|---|---|
| Projection head | To the server. Aggregated | |
| Combiner | To the server | |
| Combiner MLP (pilot arm) | To the server | |
| Per-user combiner (pilot arm) | To the server | |
| Personal intent head | Stays on the device |
| Tier | Character | What it carries |
|---|---|---|
| Service-use consent | Required | |
| Behavioral-data collection consent | Optional | Fixed 12-byte events. The fact of an interaction, such as “tapped” |
| Screen-content reading consent | Optional, higher tier | The embedding of the actual content the user read or wrote |
| Metric | Previous | Shipping | Delta (95% CI) |
|---|---|---|---|
| Leaf top-1 (objective) | pp | ||
| Leaf top-5 | pp | ||
| Product surface (L2 top-5) | pp | ||
| Catalog creative leaf | pp |
| Arm | emb gzip | KLUE-STS | taxo top-1 | YNAT | NSMC |
|---|---|---|---|---|---|
| native-64 (previous deployment) | |||||
| native-128 (trained directly) | |||||
| pca-trunc 128 (adopted) | |||||
| mrl-t128 |
| Configuration | L1 gzip | KLUE-STS | YNAT | NSMC |
|---|---|---|---|---|
| int8 (v1) | ||||
| int8 | ||||
| @ 4bit |
| Query distribution | L2 top-1 | L2 top-5 | Leaf top-1 | Leaf top-5 | |
|---|---|---|---|---|---|
| Unseen categories, colloquial | |||||
| All, colloquial | |||||
| Verbatim leaf-name queries | |||||
| Ad creative category |
| Leaf top-1 | Leaf top-5 | Product surface top-5 | |
| Deployed (2.14 MB static) | |||
| Teacher (768d, 421 MB) | n/a | ||
| Difference (leaf top-1) | pp, 95% CI | ||
| Axis | 8-bit | 4-bit | |
|---|---|---|---|
| taxonomy.bin catalog.bin (gzip) | B | ||
| Deployment payload (L1 L2, measured target) | B | ||
| Unseen categories, L2 top-5 (product surface) | pp | ||
| Unseen categories, L2 top-1 | pp | ||
| All colloquial, L2 top-5 | pp | ||
| Verbatim queries, leaf top-1 | pp |
| Arm | L2 top-5 | Leaf top-1 |
|---|---|---|
| baseline (current deployment) | ||
| off (new 3-channel weights, no perception input) | ||
| on (same weights, with perception input) | ||
| off baseline | pp | pp |
| on off | pp | pp |
| Arm | Accuracy | Upper bound on what |
|---|---|---|
| block_prior | Ceiling of the categorical signal. Even with the block correctly identified of the time, the best one can do inside it is the mode | |
| image_within | Dense embedding, candidates restricted to the correct block | |
| image_open | No candidate restriction | |
| image_master | Control on the coarse axis |
| Dense embedding | Cost | Categorical | Cost | |
|---|---|---|---|---|
| iOS | VNGenerateImageFeaturePrintRequest | Vision classification, text recognition | ||
| Android | MediaPipe ImageEmbedder , model bundled by the app | several MB | ML Kit unbundled | about KB |
| English | Korean | Multi-vertical | |
|---|---|---|---|
| Title-arm purity (the ceiling) | |||
| Image-arm purity | |||
| Image ceiling ratio | |||
| Mid-categories used by the title arm | — | ||
| L2 top-5 match |
| # | Invariant | Why |
|---|---|---|
| F1 ∗ | The server must not be able to see individual deltas | The privacy accounting in § 7.4 applies only under this condition |
| F2 | Deltas are clipped before upload | Noise without clipping provides no guarantee |
| F3 | The deadline is itself the straggler policy | Waiting for slow devices would prevent the round from ever closing |
| F4 | Late-arriving deltas are discarded | Mixing in deltas computed against a stale causes silent divergence |
| F5 | A round is cancelled if participation falls below the minimum | Aggregating too few participants exposes individuals |
| F6 | Rounds are logged reproducibly | Without this, regressions cannot be caught |
| Signal | What it says | Combiner | Personal head |
|---|---|---|---|
| Creative tap | The user pointed to one leaf | Positive | Positive |
| Positive feedback | The whole answer was acceptable | Unused | Positive |
| Negative feedback | The whole answer was wrong | Unused | Negative |
| In-session requery | The prior answer was possibly wrong | Unused | Unused |
| Assumption | Campaign |
|---|---|
| No amplification ( ) | (hand-computed zCDP ) |
| Population , cohort ( ) | |
| Population ( ) | |
| Composed including the attribution channel |
| Uniform weighting | Correction applied | |||
|---|---|---|---|---|
| Arm | Mid-level (L2) top-5 | Sub-category top-1 | Mid-level (L2) top-5 | Sub-category top-1 |
| B: Shipping build + personal head | pp | pp | pp | pp |
| C: Personal head + federated | pp | pp | pp | pp |
| D: Federated only | pp | pp | pp | pp |
| Current | Needed | Shortfall factor | |
|---|---|---|---|
| Creative-tap labels for training | roughly | ||
| Creative-tap labels for evaluation | roughly |
| Observation | Consequence |
|---|---|
| of evaluation rows had a single prior purchase | returns the same constant for all of them |
| Positive rate ( d), forced to 1 | the window truncation is being measured, not the model |
| Median inter-purchase gap days | one order split across items counted as a repurchase |
| of pairs dropped for having no repurchase | censored users removed from the evaluation |
| Arm | d | d | ||
| mPG (deployed) | — | — | ||
| Weibull | [ ] | [ ] | ||
| ① L2 base rate only | ||||
| ② frequency | ||||
| ③ purchase recency | [ ] | [ ] | ||
| ④ Weibull logit |
| Arm | KLUE-YNAT (7-way) | NSMC (binary sentiment) |
|---|---|---|
| Stage 1 (distill only) | ||
| Stage 2 (+ tokenlearn) | ||
| Public Korean static embedding (64d) | ||
| Teacher, 768d (upper bound) | ||
| Shipping build (128d, 4-bit; § 10.9 ) | ||
| Retention relative to teacher (Stage 2) |
| Query set | Accuracy | perm. | |
|---|---|---|---|
| Dataset 71603 — mid-category (L2) top-5, the product surface | |||
| Real product names, all | |||
| — leaf-name anchor present | — | ||
| — anchor absent | — | ||
| — anchor absent, model-code form | |||
| Real review sentences | |||
| Evidence | What it can settle | What it cannot |
|---|---|---|
| Synthetic held-out utterances | Task-aligned accuracy over our taxonomy, regression detection | Authored by us; not a real query distribution |
| ESCI queries translated to Korean | Behaviour on real production search queries | Amazon’s user distribution in translation; labels derived, not human |
| AI-Hub 71603 | Real Korean product and review text with externally assigned source labels | Not queries; crosswalk to our taxonomy is ours |
| AI-Hub 102 | Real Korean customer utterances, of them | Labels support only the top category, not the product surface |
| Naver Shopping reviews | The distribution of real Korean commerce text | No labels at all; supports distribution comparison only |
| Cell | top-5 | cell-matched null | |
|---|---|---|---|
| Anchor present, no model code | ( pp, ) | ||
| Anchor absent, no model code | ( pp, ) | ||
| Anchor present, model code | ( pp, ) | ||
| Anchor absent, model code | ( pp, ) | ||
| Marginal, anchor present | — | ||
| Marginal, anchor absent | — |
| Term | No fixed effects | source-category FE | Stratified |
|---|---|---|---|
| Lexical anchor | pp ( ) | pp ( ) | pp (16/20 cat.) |
| Model code | pp ( ) | pp ( ) | pp (10/20 cat.) |
| Anchor model code | pp ( ) | pp ( ) | — |
| — |
| Crosswalk | L2 per label | top-5 | null | lift |
|---|---|---|---|---|
| Hand-built (as reported above) | pp | |||
| Kept only where the training split supports it | pp | |||
| Single best-supported mid-category per label | pp | |||
| Same narrowed crosswalk, restricted to products absent from the training split | ||||
| Products unseen in training ( ) | pp | |||
| Arm | top-5 | anchor present / absent | vs deployed |
|---|---|---|---|
| BM25, leaf strings, char bigram | / | pp | |
| Lexical-primary ( ) | / | pp | |
| Dense-only ( ) | / | pp | |
| Deployed hybrid ( ) | / | — | |
| Teacher encoder, 768d / 421 MB | / | pp | |
| — same leaf construction as deployment | / | pp |
| Ranking signal | 100% | 90% | 80% | 70% | 60% |
|---|---|---|---|---|---|
| Score margin alone | |||||
| Anchor first, margin breaks ties | |||||
| penalize model-code form |
| Axis | Shipping | Previous | Diff | Significant |
|---|---|---|---|---|
| KLUE-STS ( ) | Yes | |||
| KLUE-YNAT (accuracy) | pp | Yes | ||
| NSMC (accuracy) | pp | No |
| Artifact | gzip bytes | Notes |
|---|---|---|
| embedding.bin | @ 4bit, per-row scaling. raw | |
| catalog.bin | Ad catalog, items (synthetic), 4bit per-row | |
| taxonomy.bin | leaves, 4bit per-row (§ 5.5 ) | |
| vocab.txt | Vocabulary of | |
| user_embedding.bin | User embedding, off by default | |
| head.bin | Trained intent head |
| Line | Measured | Cap | Share | Method |
|---|---|---|---|---|
| L1 data | gzip | |||
| L2 code | Native bytes left by the linker; development platform | |||
| Deployment payload (L1+L2) | worst measured target | |||
| L3 resident | Resident bytes after unpacking |
| Target | L2 code | L1 L2 | Share of 3 MiB |
|---|---|---|---|
| aarch64-apple-darwin | |||
| aarch64-apple-ios | |||
| aarch64-linux-android |
| Configuration (2,960-leaf probe) | |
|---|---|
| User embedding off (default) | ms |
| User embedding on, dense history | ms |
| Increase | ms |
| Device | SoC | ms | ms | range |
|---|---|---|---|---|
| iPhone 12 Pro ( iPhone13,3 ), iOS 26.4.2 | A14 (2020) | – | ||
| iPhone 14 Pro Max ( iPhone15,3 ), iOS 26.6.2 | A16 (2022) | – | ||
| Galaxy Tab A9+ ( SM-X210 ), Android 15 | Snapdragon 695 (2021) | – |
| CPU | ms | ms | range |
|---|---|---|---|
| AMD EPYC 9355 32-Core Processor (64 threads) | – | ||
| AMD Ryzen 7 7800X3D 8-Core Processor (16 threads) | – | ||
| Intel XEON PLATINUM 8592V (256 threads) | – |
| # | Claim | Judge | Measured |
|---|---|---|---|
| C1 | Deployment payload | size_gate.py | B ( ; L1 L2 , worst of the three measured targets, Android; iOS gives B) |
| C2 | ms | latency_gate.py | ms (iPhone 12 Pro) and ms (iPhone 14 Pro Max), § 10.6 ; – ms on three server CPUs; no development-Mac figure (§ 10.7 ) |
| C3 | No raw tokens in transmitted bytes | egress_gate.py | Canaries undetected; payload B of |
| C5 | Rounds converge despite dropout and latency, without masking applied | fl_round_gate.py | at dropout, BCE |
| I1 | wasm and native are bit-identical | parity_gate.py | max absolute diff over elements |
| C8 | Campaign within budget | dp_gate.py | Per-round ; campaign at (PLD, ) |
| Measurement | Training samples | Text accuracy | Behavior gain |
|---|---|---|---|
| Real logs (Amazon) | pp | ||
| Synthetic, templated utterances | pp | ||
| Synthetic, templated utterances, sample count reduced only | † | pp † | |
| Synthetic, LLM-generated utterances | pp | ||
| † no ledger — see caption | |||
| Synthetic utterances | Real reviews | |
|---|---|---|
| Mean length (characters) | ||
| Mid-categories predicted | ||
| Entropy of the L2 distribution (bits) | ||
| Share taken by the top 5 mid-categories |
On-Device Inference
On-device inference runs machine-learning models locally on phones, wearables, microcontrollers, and edge hardware to reduce latency, energy use, and data sharing.
See all 189 papers