Skip to content

perf(classifiers): message labels without an LLM, a small classifier bake-off - #468

Open
leemour wants to merge 1 commit into
mainfrom
perf/message-labels
Open

leemour wants to merge 1 commit into
mainfrom
perf/message-labels

Conversation

@leemour

@leemour leemour commented Dec 1, 2026

Copy link
Copy Markdown
Member

Task

Label messages as spam/promo, bot/automated and "worth remembering" without a generative LLM, using local models
that send nothing out at run time. Add a content-type task for large groups and channels.

Why

The owner wants these labels in WireCat, and local models may see real data only if they stay silent on the
network. This page answers which cheap classifier is good enough and which libraries try to reach the network.

What

New area performance/classifiers with
message-labels: why it was run, setup, tables, what was not
measured, plus the scripts and the synthetic data that produced them.

Headline numbers (synthetic, 5-fold grouped by chat; gaps under ~5 points are noise):

Task Best Best silent cheap option
Spam/promo EmbeddingGemma + logreg 87.6 macro-F1 (stacked with metadata 92.3); alt-gnome transfer 97.5 fastText + metadata 81.2
Bot metadata only 96.9 (inflated: synthetic metadata follows the labels) same
Worth remembering EmbeddingGemma 87.6 fastText + metadata 85.9; not decided, the 22-message real smoke check disagrees
Content type (large groups) EmbeddingGemma 89.0 e5 81.7 trails by 7+

Speed on 4 threads: EmbeddingGemma ~15 msgs/s, e5 ~190, fastText ~53,000, potion/blink 120,000–470,000.

Network: direct onnxruntime runs (Python 1.32 and a raw Node probe of WireCat's native 1.30) try DNS for
mobile.events.data.microsoft.com unless ORT_DISABLE_TELEMETRY=1 is set. Shipped cli-core already sets it
(cli-core#3483). model2vec, scikit-learn and fastText were silent in every run.

Only totals from the owner's 22 real messages are in the page; nothing else from them is in the repository.

Testing

pnpm docs:check passes; biome check performance/classifiers passes. The numbers come from the committed
scripts, run in a bwrap --unshare-net sandbox under strace.

🤖 Generated with Claude Code

…bake-off

Why: the owner wants spam/promo, bot and "worth remembering" labels on messages without a generative LLM, from
local models that send nothing out at run time.

- 601 synthetic messages (71% Russian) in 100 chats, labels and a chat-grouped 5-fold split frozen and hashed
  before training; blind second pass on 20% agrees at kappa 0.91-1.00.
- Contestants: shipped rules, metadata only, char TF-IDF + logreg, fastText from scratch, logreg over
  multilingual-e5-small int8, EmbeddingGemma q4, potion-multilingual-128M and blink-multilingual-64M, plus
  stacked metadata, chat-level prior and zero-shot variants.
- EmbeddingGemma + head leads on spam (87.6 macro-F1; 97.5 on alt-gnome transfer) and content type in large
  groups (89.0) at ~15 msgs/s on 4 threads; bot is decided by metadata; "worth remembering" not decided
  (the owner's 22-message smoke check disagrees with the synthetic ranking).
- Network: every run in a bwrap no-network namespace under strace. Direct onnxruntime runs (Python 1.32, raw
  Node probe of 1.30) try DNS for mobile.events.data.microsoft.com unless ORT_DISABLE_TELEMETRY=1 is set;
  shipped cli-core sets it (cli-core#3483). model2vec, scikit-learn and fastText were silent.
- Only totals from the owner's 22 messages are published.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant