Paxmod × AIML

How We Built Grooming Detection with the Australian Institute for Machine Learning

Alan Agon
Alan Agon
July 18, 2026 · 6 min read

Grooming is not a bad word. It is a pattern. Most chat moderation looks for a single toxic message: a slur, a threat, a link. Grooming defeats that entirely. A predator's early messages are indistinguishable from ordinary friendly chat. The danger is not any one line, it is the trajectory across dozens of turns, from building rapport, to isolation, to secret-keeping, to escalation. A per-message filter, however good, is structurally blind to it.

That is why we partnered with the Australian Institute for Machine Learning (AIML), through the Industrial AI SME Grant Program, to build a system that reads a conversation the way a trained analyst would: as a whole, not one message at a time.

What we built

Instead of scoring messages one at a time, the system models a conversation as a graph. Each message is a node, enriched with a fine-tuned BERT understanding of the text, and the connections between messages let a Graph Attention Network learn how risk builds across turns. It operates over a sliding window of recent messages, which keeps cost bounded even as conversations grow long enough to run at more than a million messages per day.

window of N msgs BERT encoder per-message embedding ONNX / TensorRT Conversation graph temporal edges Graph Attention Network one forward pass Risk score per user / message end-to-end < 50 ms / message stateless upstream · sliding window bounds cost at > 1M messages / day
Figure 1. Detection pipeline. A sliding window of recent messages is encoded once by a fine-tuned BERT model (served via ONNX / TensorRT), assembled into a conversation graph with temporal edges, and scored by a Graph Attention Network in a single forward pass. The window bounds compute as conversations grow, holding end-to-end latency under 50ms at production volume.

How the attention works

The attention mechanism is the heart of it. For each message, the model learns how much weight to give its neighbours. Phase-advanced messages (“how old r u”, “are u alone?”) draw the attention, while genuinely benign chatter is largely ignored. The result is a per-user risk score that no single message could produce on its own.

Step 1 — attention over neighbours Step 2 — weighted aggregation α=0.05 α=0.55 α=0.28 α=0.12 M1 "hey what's up" M2 "how old r u" M4 "are u alone?" M5 "i'm 14" M3 target — "where do u live?" edge width = attention weight α (neighbours sum to 1) h before ∑ αi W hi h′ after classifier   W h′ + b σ = 0.82 predator-likely a score no single message could produce alone
Figure 2. Attention update at a single node. The layer learns an attention weight for each edge; the phase-advanced neighbours M2 and M4 draw most of the attention while benign messages M1 and M5 are largely ignored. The node's new embedding is the attention-weighted sum of its neighbours, and the classifier reads from it to produce a predator probability.

The results

Adding conversational structure is what closes the gap. A BERT-only per-message classifier sits near 50 to 60% precision. Adding the Graph Attention Network over the conversation graph lifts precision to ~92% at 81% recall on the PAN12 benchmark. Precision is the operative metric: a system that raises constant false alarms gets switched off.

0 20 40 60 80 100 precision (%) ~55% BERT only per-message baseline 92% BERT + GAT graph-contextual +37 pts
Figure 3. Adding conversational structure closes the precision gap. A BERT-only per-message baseline near 50 to 60% precision rises to ~92% once the Graph Attention Network reasons over the conversation graph, at 81% recall on the PAN12 benchmark.
Predator-class metrics by graph edge-construction strategy
Edge strategyPrecisionRecallF1F2
Sequential0.920.820.870.84
Cross-speaker0.870.770.820.79
Full connectivity0.790.750.770.76

Table 1. Predator-class metrics by graph edge-construction strategy on the PAN12 test set. The simple sequential graph outperforms denser alternatives: added edges introduce more noise than signal.

Why trajectory beats keywords

Grooming escalates through phases, each weighted more heavily than the last. Individually benign messages accumulate into a rising risk signal, and the model flags the user as risk crosses the threshold, before explicitly sexual content ever appears. A per-message filter, seeing each turn alone, never accumulates this signal.

cumulative risk flag threshold flagged before escalation Neutral w 0 Friendship w 5 Relationship w 10 Risk assessment w 20 Exclusivity w 30 Sexual w 50 grooming phase (progressive, not strictly sequential) →
Figure 4. Why trajectory beats keywords. Grooming escalates through phases, each weighted more heavily than the last. Individually benign messages accumulate into a rising risk signal; the model flags the user during exclusivity, before explicitly sexual content appears.

Why this matters now

Regulators have caught up with the threat. The UK Online Safety Act now expects proactive protections against grooming, the EU Digital Services Act and renewed child-protection rules raise the bar, COPPA governs US kids' platforms, and Australia's under-16 measures are in force. “We filter profanity” no longer clears it. This is the research edge we are bringing into Paxmod, so studios get detection built with a world-class AI institute without standing up a trust-and-safety research team of their own.

Built through the Industrial AI SME Grant Program, an AIML initiative supported by the South Australian Government via the Department of State Development's Research and Innovation Fund. Benchmark figures are reported on the PAN12 Sexual Predator Identification corpus.