Uns understanding model (EmbeddingGemma, on-device)

The on-device sentence embedder of the Uns app: it reads what a person writes in a check-in (in English, Indonesian, Malay, Turkish, Bengali, Arabic, Urdu or Persian) and places it among a closed set of feelings and life situations, so the app can choose among human-reviewed verses. It produces vectors only β€” it does not generate text.

Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms

Use is subject to the restrictions in Section 3.2 of those terms and the Gemma Prohibited Use Policy. Copies of both are in this repository (GEMMA_TERMS_OF_USE.md, GEMMA_PROHIBITED_USE_POLICY.md).

Modified files β€” notice

These files are modified from google/embeddinggemma-300m. Modifications:

  1. Fine-tuned on a multilingual feeling/situation taxonomy (batch semi-hard triplet loss, margin 0.5, lr 2e-5, 4 epochs; ~4,000 labelled phrases and sentences in 8 languages).
  2. Weight-averaged 50/50 with the original checkpoint (WiSE-FT), to keep its general and religious vocabulary.
  3. Converted to LiteRT (model.tflite): the whole sentence-transformers pipeline in one graph β€” encoder β†’ mean pooling β†’ Dense 768β†’3072 β†’ Dense 3072β†’768 β†’ L2 β€” with int8 dynamic-range weights. Key/value heads are broadcast rather than copied in attention (numerically identical; works around a converter mistranslation). Parity with PyTorch: cosine β‰₯ 0.998.
  4. tokenizer.bin is Gemma's tokenizer (tokenizer.json) re-encoded as integers (pieces, merges, added tokens); token-for-token identical on 36,081 test texts.
  5. centroids.json is new: the mean vector of each feeling / situation's labelled phrases.

Files

File What
model.tflite int8 LiteRT model. Inputs args_0 input ids, args_1 attention mask, int32 [1,128]; output float32 [1,768], L2-normalised
tokenizer.bin GTK1 binary tokenizer (format in tools/export_gemma_tokenizer.py of the Uns repo)
centroids.json per-axis term codes, their unit centroids (base64 float32), and the abstention margin
*.sig Ed25519 signatures (Uns release key 354c14a4…); the app installs nothing that fails them
manifest.json sizes, sha256, sequence length, prompt

Prompt: every input is prefixed with task: classification | query: and tokenised together with it.

Evaluation (held-out, never trained on)

feelings top-1 (dev / v2 / v3) situations top-1 Islamic concepts, 8 langs verse β†’ topic hit@3
previous model (MiniLM, fine-tuned) 77 / 51 / 64 66 / 68 / 79 55.5% 34.6%
google/embeddinggemma-300m 71 / 54 / 60 60 / 59 / 72 88.1% 42.5%
this model 79 / 73 / 94 79 / 81 / 88 85.7% 58.5%

Zero unsafe serves across all three sets through the app's own retrieval and do-not-serve rules.

Downloads last month
15
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for graphemetech/understanding-v2

Finetuned
(303)
this model