Engineering6 min read

Cheap layers, then a judge: the architecture of a moderation filter

Why a small calibrated model in the middle is better than either a keyword list or a big model on every message.

By TG Filter Team

Three stages

  • Normalize: make obfuscation irrelevant before matching.
  • Gather evidence: signatures, URL reputation, campaigns, obfuscation signals.
  • Judge the grey zone: only messages scoring between the two thresholds.

The judge is a decision model, not a chatbot

The useful shape is a typed question with a probability answer: "is this message spam?" -> 0.92. A probability can be thresholded, logged and calibrated. A paragraph of prose cannot. The judge answers exactly this kind of yes/no question with a probability.

Operational rules that matter

  • Fail open: if the judge is down or rate-limited, the message stays in Review. Never delete on an error.
  • Quota per account: a daily allowance caps judge calls, so spam waves cannot run up a bill you did not expect.
  • Cache by content hash: a repeated blast is judged once, not per delivery.
  • Record everything: verdict, score, reasons, judge, ruleset version, and any human override.

That's the whole architecture. Nothing here is exotic; the discipline is in the measurement: precision first, recall from evidence, and a regression gate so the numbers don't drift.