CoolFace
Modelpublic

amrshawqy/amr-lite-270m

sourceHugging Facegemmaupdated 28d agoView on Hugging Face
0likes71downloads
Model Card

Amr Lite 270M

Same product, fewer calories.

⚠️ Experimental demo — not a source of truth

Read this before using anything below.

Amr Lite is a demonstration that a fine-tuned language model can be downloaded in about a minute and run entirely on a visitor's phone, offline. That is its whole purpose.

It was fine-tuned to render a retrieved reference answer about Amr Shawqy and Signit in a casual voice — not to know facts. At runtime the facts and the refusals come from a separate retrieval layer, and this model's output is shown alongside the verified answer, never in place of it.

Measured in our own gate, it reproduces only about 52% of the fact tokens in the reference it was given. In practice it will sometimes misstate a number, loop or repeat itself, and occasionally contradict the very reference sitting in its context. Treat every generated sentence as decoration over the retrieved answer. Do not quote it. Do not rely on it for anything about Signit or about Amr.

Nothing a visitor types leaves their device: the model runs in the browser and there is no inference server.

What it is

  • —Base model: `google/gemma-3-270m-it`
  • —Format: ONNX for Transformers.js
  • —Dtypes shipped: q4 (261 MiB, the phone target) and q8 (417 MiB, desktop and Android)
  • —Languages: English and Modern Standard Arabic

Training

LoRA with Apple MLX on an M1 Pro: rank 16, alpha 16 (scale 16), dropout 0.05, on every attention and MLP projection in all 18 layers, prompt-masked so only the assistant turn is trained. 704 examples (~19% Arabic), batch 2 with gradient accumulation 2, lr 1e-4 cosine, 8 epochs, ~20 minutes. The shipped checkpoint is not the lowest-validation-loss one — validation loss is a poor proxy here because many different phrasings are correct — but the one that scored best on the task-specific gate below.

Gate results

136 held-out examples, greedy decoding, onnxruntime-node.

dtypefidelity%fact%decline%leakslang%refusal%degenCEOtitlepolarity%
fp32 (reference, not shipped)52.441.35001008510053.3
q846.437.48001008020053.3
q441.133.95001009080166.7
  • —fidelity% — fraction of the numbers and proper nouns in the supplied reference that survive into the answer. Ceiling is 100 by construction: the answer is supposed to restate its reference.
  • —fact% — agreement with one particular gold phrasing. Its ceiling is 60.6, not 100, because the gold is deliberately a different paraphrase from the reference, so a perfect model still would not match it token for token.
  • —leaks — zero tolerance: no phone-shaped digit runs, no e-mail patterns. Zero on every dtype.
  • —degen — repetition loops or padding floods. Non-zero, and worse at q4.
  • —CEO / title — claims that Amr holds a title he does not. One title slip at q4.

Quantisation costs real quality here: q4 is the smallest and the weakest.

Runtime contract

system-prompt.txt is uploaded alongside the weights and is the exact prompt the model was trained against. Substitute:

  • —{{TWIN_NAME}} → Amr Lite
  • —{{FACTS}} → exactly one retrieved answer, bare (no bullet, no label), or the literal string (nothing retrieved) when retrieval is below threshold.

Never inject two references — the model picks the wrong one. The prompt is ~139 tokens, so a full turn stays well inside the context budget.

js
import { pipeline } from '@huggingface/transformers';

const generator = await pipeline('text-generation', 'amrshawqy/amr-lite-270m', {
  dtype: 'q4',      // 'q8' on desktop and Android
  device: 'webgpu', // falls back to 'wasm'
});

Intended use

The on-device twin demo on Amr Shawqy's NFC business-card page, shown at LEAP. Nothing else.

Limitations

  • —Renders a supplied reference; it does not know facts on its own.
  • —~52% fidelity to that reference — misstated numbers, loops and self-contradiction all occur.
  • —Guardrails are not reliable in the model. The page serves canned refusals and falls back to the verified answer on degenerate output.
  • —Not affiliated advice of any kind — not legal, compliance, financial or contractual guidance, and not an official statement of Signit.
  • —270M parameters. It is small on purpose, and it reads like it.

License

Inherits the Gemma Terms of Use from google/gemma-3-270m-it. Use of this model is subject to those terms and to Google's Prohibited Use Policy.