ParallelPathdocumentation

The tone model

ParallelPath checks the tone of what people write before it goes into the family's permanent record: messages, edits, reasons, decline comments and change-request notes. It points out wording that may come across as hostile, suggests a calmer way to put it and, where it can, offers a calmer version. The person always decides.

Everything happens on the device. The check runs inside ParallelPath's own engine on Windows, Android and in the web app. No text is sent anywhere, there's no cloud AI and no model download, and it works offline.

How it works

Two layers, combined:

  1. A trained model (engine/tone) scores the text for seven kinds of hostility: toxicity, severe toxicity, obscenity, threats, insults, identity attacks and sexual content. It catches hostility even when it's phrased in ordinary words ("you are a complete failure as a mother").
  2. Co-parenting rules (engine/app/tone.go) catch what a general model doesn't know about: blame ("you always", "your fault"), legal threats ("see you in court"), dismissiveness ("whatever"), shouting in capitals and "!!!".

The result is a level (calm, careful, heated), the specific words to reconsider with a suggestion for each, and a calmer version. That version keeps the sentences about arrangements and drops the ones that attack, with shouting and "!!!" toned down. It's a starting point the person edits; it's never sent by itself.

It also gives a meter from 0 (calm) to 1 (very hostile) for the live tone bar under the message box: the highest of the model's insult, toxicity, threat (x1.4), obscene (x0.8) and identity-attack scores, plus 0.25 for each insult or threat found, 0.15 for blame, dismissiveness, hostility or obscenity, and 0.08 for shouting or "!!!", capped at 1. The apps check the draft 300 ms after the person stops typing; a check takes microseconds.

The Advice dialog shows the issues, the calmer version and writing tips, and answers questions from the built-in help (BM25 search over the user guide and FAQ, engine/help): also on the device, with no cloud AI.

The model

TypeMulti-output logistic regression over hashed features
FeaturesWords, word pairs, and character 3-5-grams of each word (catch misspellings and disguises), hashed into 262,144 buckets; text is normalised first (lower case, "@ss"/"sh1t"-style disguises undone, long letter runs squeezed)
Weightsint8, one scale per output: 1.8 MB, compiled into the engine
SpeedLoads in about 2 ms (once); checks a message in about 8 µs on one CPU core (AMD Ryzen 9 5950X)
Codeengine/tone/tone.go: the same Features function is used for training and on the device

Why the CPU, not a GPU or NPU

The model is small enough that a GPU or NPU wouldn't make it faster. Handing work to an accelerator (DirectML, NNAPI, WebGPU) costs more time to set up than the whole check takes on the CPU. A compiled-in model on the CPU is instant, the same on every device, and needs no drivers. The engine's interface leaves room for a larger accelerated model if one is ever worth it.

Android's on-device AI (not used)

Gemini Nano through Google's ML Kit GenAI APIs runs on the phone itself. But Google's ML Kit data disclosure says the SDK sends device and app information, installation identifiers and usage metrics to Google, with no setting to turn that off. That conflicts with ParallelPath's rule that nothing leaves the device, so ML Kit isn't used. Android uses the same built-in model as every other platform.

Training data

Training

tools/tonetrain (its own Go module; it isn't part of any app or the server):

go run ./tools/tonetrain <data folder> engine/tone/model.bin

Results (held-out test split, 97,320 comments)

ROC-AUC per label ("positive" = at least half the raters chose the label):

LabelAUCTest positives
toxicity0.9497,777
insult0.9615,776
threat0.979221
identity attack0.971687
obscene0.983543
sexual content0.986240

(Severe toxicity has no test comments at the 50% rater threshold, so it's only used together with the others.)

Cut-offs in the engine (toneCutoffs in engine/app/tone.go): insult and toxicity 40% (precision about 0.68, recall about 0.56), threat 30%, obscene and sexual content 40%, identity attack 50%. At these levels most ordinary messages aren't flagged, and a flag is a prompt to look again, never a block.

The current model.bin has SHA-256 58e3d2d95fd0b91b4d13f0424256c104827dee6715eb19d31a0605bbb7c36980. Training uses parallel updates, so each run's weights differ slightly; retraining gives the same quality, not the same file.

Limits

Tests

engine/tone/tone_test.go (calm messages score low, hostile ones high, disguises are undone, culprit words found, plus a benchmark) and engine/app/tone_test.go (levels, rules, the model catching plain-word hostility, the calmer version).