text-classification · 66-class form field classification · 15.32 MB WASM q8 · MPL-2.0

TinyBERT Address Autofill

rolf-mozilla/tinybert-address-autofill (v0.2.2, MPL-2.0) is Firefox's compact 4-layer TinyBERT encoder (TinyBERT_General_4L_312D, 15.32 MB total / 14.60 MB q8 ONNX) trained for text-classification across 66 HTML form autofill classes — mapping field signatures (label, name, id, placeholder, type) to standard WHATWG & Firefox autocomplete attributes in a few milliseconds locally on CPU WASM.

1. Live 66-Class Form Field Classifier

Pick a form field signature, edit any HTML attribute below, or drop an .html / .txt input snippet:

Drop an .html or .txt form snippet to extract its first field automatically, or pick a local file.

6
Normalized Firefox v0.2.2 Input Signature (strip_type_marker = true) –
Predicted Class–
WHATWG autocomplete–
Top-1 Softmax · Logit–
Top-1 / #2 Margin–
Latency · Backend–
Tokens · Entropy · NaN–

Top-k Softmax Probabilities & Raw Logits

66-class softmax · BertForSequenceClassification

Download or initialise the local model above, then classify a form field signature.

Model ID rolf-mozilla/tinybert-address-autofill
Pipeline Task text-classification · 66-class form field classification
Download & Quant 15.32 MB (14.60 MB q8) · CPU WASM
Architecture TinyBERT 4L / 312d / 12 heads · 512 max tok
Output Shape [1, 66] raw logits · softmax (id2label 1–66)
License MPL-2.0

2. See Inside — 66-Class Raw Logit Telemetry & WordPiece Tokens

Inspect the exact [1, 66] raw classifier logits produced before softmax alongside the uncased WordPiece tokens fed into ONNX Runtime. Notice that config.json maps Mozilla's 1-indexed labels 1 (other) through 65 (reference-point), while index 0 stays an unassigned negative-logit padding slot.

All 66 Raw Classifier Logits

min / max / slot-0

WordPiece Tokenization

BertTokenizer · 30,522 vocab

Classify a field above to inspect uncased WordPiece tokens.

3. Why On-Device Autofill Classification Matters

Use-Case Ladder

4. How the API Works & Code Inspection

import { AutoModelForSequenceClassification, AutoTokenizer } from "@huggingface/transformers";

const tokenizer = await AutoTokenizer.from_pretrained("rolf-mozilla/tinybert-address-autofill");
const classifier = await AutoModelForSequenceClassification.from_pretrained(
  "rolf-mozilla/tinybert-address-autofill",
  { device: "wasm", dtype: "q8" },
);

// Normalized Firefox v0.2.2 field signature (no ** type marker; camelCase split & lowercased)
const encoded = await tokenizer("shipping zip postal code 02138 zip postal code", {
  padding: false,
  truncation: true,
  max_length: 512,
});
const { logits } = await classifier(encoded); // Float32Array(66) -> softmax + id2label[String(idx)]
Show the code · worker.js — runSingleClassify() raw 66-logit inference
Show the code · autofill-core.mjs — decodeAutofillLogits() stable softmax & telemetry

5. References