wikillm

Paper · 2018-02-01 · cs.CL, cs.SI

A Unified Deep Learning Architecture for Abuse Detection

One GRU over GloVe word vectors and one dense network over tweet, user and network metadata, concatenated into a single classifier. Each mini-batch updates only one of the two paths, alternating between them. Author-reported AUC of 0.92 to 0.98 across four Twitter abuse datasets under 10-fold cross-validation, above the baselines they compare against.

Multimodal fusionTransfer learningText classificationToxicity detectionclassificationsocial-mediamulti-input-networktext-and-metadata

arXivPDFMarkdown11 min read

AI-compiled by claude-haiku-5-5 on 2026-11-06, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.

In plain words

Online platforms have to catch many kinds of abusive posts: hate speech, sexism, racism, bullying, sarcasm. Most detectors are built for one of these and tuned to one platform, so they miss the others. This paper asks whether a single neural network can handle all of them.

The model reads two kinds of input about each tweet. One is the words of the tweet, turned into vectors that a pretrained word table supplies. The other is facts about the tweet and its author, such as counts of mentions, emotion scores, follower numbers and account age. Each input gets its own branch, and the two branches are joined near the end to make one decision.

Training two branches inside one network is tricky, because one branch can learn faster and drown out the other. The authors' fix is to let the branches take turns: on each batch, the whole network sees the data, but only one branch is allowed to change. The authors report that this turn-taking works best on all four datasets they tried, and that the same settings worked without retuning.

TL;DR

A single two-branch Keras model combines a GRU over pretrained word vectors with a dense network over Twitter metadata, trained with alternating updates between the branches § Deep Learning Architectures [§ Training the Combined Network]. On four Twitter abuse datasets, the authors report AUC between 0.92 and 0.98 under 10-fold cross-validation, above the baselines they compare against tab. 2. The paper's sections are unnumbered in the source, so the citations use section titles. There is no official code.

Problem

Abusive behaviour on Twitter takes several forms, and detectors are typically built for one type and one platform § Introduction. Text-only classifiers are the common approach, but the authors argue that text alone is not enough, and that per-task feature engineering is costly § Introduction § Deep Learning Architectures. They therefore want one architecture that takes text and metadata together, with no retuning per task § Introduction § Summary.

Method

The model has three parts: a text branch, a metadata branch and a classifier over their concatenated outputs fig. 2 [§ Combining the Two Classification Paths]. Each branch can also be trained alone, as a standalone classifier fig. 1 § Deep Learning Architectures.

Text branch § Text Classification Network:

  1. Tweets are cut or left-padded with zeros to 30 words. The length is the 95th percentile of tweet length in the corpus. Words that occur only once are removed.
  2. Each word is mapped to a 200-dimensional GloVe vector. Words missing from GloVe get random vectors, which the embedding layer then learns.
  3. A GRU with 128 units reads the sequence. Recurrent dropout is 0.5. Attention is switched off for tweets.
  4. The text branch outputs 128 activations, one per RNN unit.

Metadata branch § Metadata Network:

  1. The raw features are numeric. Categorical features are enumerated or one-hot encoded, and the features are listed in § Dataset and [§ Feature Extraction].
  2. A batch-normalisation layer standardises the batch.
  3. Five dense layers of sizes 512, 245, 128, 64 and 32 form a bottleneck, with tanh activations. A sixth dense layer brings the output to 128 units, the same width as the text branch.

Combined classifier § Combining the Two Classification Paths:

Concatenate the 128-unit text output and the 128-unit metadata output into 256 features, then apply a softmax dense layer with one unit per class fig. 2.

Training § Training the Combined Network § Experimental Setup:

The paper compares four ways to train the combined model. Naive training updates all weights at once. Transfer learning pretrains each branch, freezes them, and trains a new joining layer. Fine-tuning does the same but leaves the branches trainable. The interleaved method is the one the paper proposes and reports as best on every dataset § Experimental Results tab. 2. Its procedure:

Pseudocode
# Interleaved training  [§ Training the Combined Network]
# Input:  text (N, 30) word ids; metadata (N, M); labels (N, C) one-hot
# Output: the trained combined network

def train_interleaved(text, metadata, labels, max_epochs):
    # Two identical combined networks, A and B  [fig. 2]
    model_a = build_combined_network()
    model_b = build_combined_network()
    # Freeze the text path of A and the metadata path of B
    # [§ Training the Combined Network]
    freeze(model_a.text_path)
    freeze(model_b.metadata_path)
    for epoch_number in range(max_epochs):
        for batch_number, (text_batch, meta_batch, y) in enumerate(
            minibatches(text, metadata, labels, batch_size=512)
        ):
            # Even (batch + epoch) uses A; odd uses B
            # [§ Training the Combined Network]
            if (batch_number + epoch_number) % 2 == 0:
                active, other = model_a, model_b
            else:
                active, other = model_b, model_a
            # Full forward pass; only the unfrozen path gets gradients
            # [§ Training the Combined Network]
            train_on_batch(active, [text_batch, meta_batch], y)
            # Copy the updated weights so both models match
            # [§ Training the Combined Network]
            other.set_weights(active.get_weights())
    return model_a

Key loss: categorical cross-entropy over the whole network, optimised with Adam § Experimental Setup. There is no numbered equation in the source.

Hyperparameters

NameValueWhereNotes
FrameworkKeras functional API, Theano backend§ Experimental Setup
Hardwarethree Tesla K40c GPUs§ Experimental Setup
Input length30 words§ Text Classification Network95th percentile of tweet length; longer tweets truncated, shorter left-padded with zeros
Minimum word frequencywords occurring once removed§ Text Classification Network
Word embeddingGloVe, 200 dimensions§ Text Classification Network § Feature ExtractionGloVe variant not named; words absent from GloVe get random init; embedding trainability is implied, not stated
Recurrent unitGRU§ Text Classification NetworkLSTM and bidirectional RNNs were tried and not chosen
RNN units128§ Text Classification Network
Recurrent dropout0.5§ Text Classification Networksource defines p as the probability a neuron is available; see Pitfalls
Attentionoff for tweets; on for texts over 100 words and for the gaming dataset§ Text Classification Network § Generalizing to Other Platformsthe gaming attention layer's details are not stated
Metadata normalisationbatch normalisation§ Metadata Networkplacement, momentum and epsilon not stated
Metadata dense sizes512, 245, 128, 64, 32, then 128§ Metadata Networkthe value "245" is as printed; see Pitfalls
Metadata activationtanh§ Metadata Networkwhich layers it covers is not stated explicitly
Joiningconcatenation of 128 and 128§ Combining the Two Classification Paths
Outputsoftmax, one unit per class§ Text Classification Network § Combining the Two Classification Paths
Losscategorical cross-entropy§ Experimental Setup
OptimiserAdam§ Experimental Setuplearning rate, betas and decay not stated
Max epochs100§ Experimental Setup
Early stoppingstop after 10 epochs without validation-loss drop; restore best weights§ Experimental Setupvalidation split size not stated
Mini-batch (interleaved)512§ Training the Combined Network64 to 512 gave similar results; batch size for other methods not stated
Transfer-learning joining layerconverges in 3 to 5 epochs (observed)§ Experimental Results
Standalone epochs (observed)text 25 to 40; metadata 7 to 12§ Experimental Results
Trainable parametersabout 250,000, excluding embeddings§ Experimental Setup
Cross-validation10-fold§ Evaluation
Naive Bayes baselineTF-IDF; top 10,000 words; lowercasing; stop-word removal§ Experimental Setupstemmer and lemmatiser variants were tried; the chosen one is not named

Results

Author-reported. Setup: 10-fold cross-validation; four Twitter datasets tab. 1; the same architecture and settings on each; baselines are a TF-IDF Naive Bayes model and each dataset's published method [§ Experimental Setup] § Experimental Results.

Datasets tab. 1, as printed:

DatasetTweetsClasses (share)UsersWVTFUFNF
Cyberbullying (WebSci)6091Bully 8.5%, aggressive 5.5%, normal 86%891yesyesyesyes
Racism and sexism (Offensive/NAACL)16059racism 12%, sexism 20%, none 68%1236yesyesyesno
Hate (ICWSM)24783hate 6%, offensive 77%, neither 17%blankyesyesnono
Sarcasm (WSDM)61075sarcastic 10.5%, normal 89.5%60255yesyesyesno

WV = word vectors, TF = tweet-based, UF = user-based, NF = network-based metadata. Counts are as printed; see Pitfalls for text-versus-table differences.

Table 2 tab. 2, as printed (AUC, Acc., Prec., Rec., F1):

DatasetMethodAUCAcc.Prec.Rec.F1
WebSci (3 classes)Baseline Naive Bayes0.730.880.880.880.88
WebSciChatzakou et al. 20170.910.910.900.920.91
WebSciDL metadata only0.930.880.910.880.89
WebSciDL text only0.920.890.910.890.89
WebSciDL text and metadata, naive0.940.890.900.900.90
WebSciDL text and metadata, transfer0.950.900.920.900.90
WebSciDL text and metadata, transfer + FT0.950.900.910.900.91
WebSciDL text and metadata, interleaved0.960.920.930.920.93
Racism/sexismBaseline Naive Bayes0.790.810.810.810.81
Racism/sexismWaseem and Hovy 2016--0.740.730.78
Racism/sexismDL metadata only0.910.740.810.740.76
Racism/sexismDL text only0.930.830.840.830.83
Racism/sexismDL text and metadata, naive0.930.850.860.860.86
Racism/sexismDL text and metadata, transfer0.950.850.860.850.85
Racism/sexismDL text and metadata, transfer + FT0.950.860.870.860.86
Racism/sexismDL text and metadata, interleaved0.960.870.880.870.87
HateBaseline Naive Bayes0.710.870.840.870.85
HateDavidson et al. 20170.870.890.910.900.90
HateDL metadata only0.750.610.800.610.66
HateDL text only0.910.870.890.870.88
HateDL text and metadata, naive0.900.870.890.870.88
HateDL text and metadata, transfer0.910.870.890.870.88
HateDL text and metadata, transfer + FT0.900.870.890.870.88
HateDL text and metadata, interleaved0.920.900.890.890.89
SarcasmBaseline Naive Bayes0.660.900.890.900.89
SarcasmRajadesingan et al. 20150.700.93---
SarcasmDL metadata only0.960.920.940.920.92
SarcasmDL text only0.810.890.890.890.89
SarcasmDL text and metadata, naive0.970.960.960.960.96
SarcasmDL text and metadata, transfer0.970.950.950.950.95
SarcasmDL text and metadata, transfer + FT0.970.950.950.950.95
SarcasmDL text and metadata, interleaved0.980.970.960.970.97

Metadata importance on WebSci, AUC only tab. 3:

FeaturesAUC
Network only (NF)0.641
Tweet only (TF)0.799
User only (UF)0.806
User and tweet (UF+TF)0.887
Network and tweet (NF+TF)0.908
Text only (WV)0.915
User and network (UF+NF)0.915
All metadata (TF+UF+NF)0.923
Text and tweet (WV+TF)0.930
Text and network (WV+NF)0.931
Text, user and tweet (WV+UF+TF)0.933
Text, network and tweet (WV+NF+TF)0.936
Text and user (WV+UF)0.938
Text, user and network (WV+UF+NF)0.955
All (WV+TF+UF+NF)0.961

Author-stated headline claims: the interleaved model is best on all four datasets § Classification performance; the abstract gives a 21 to 45% AUC improvement, which the body does not recompute as one figure § Abstract. On WebSci the paper itself says the comparison with Chatzakou et al. is not direct, because their results are user-level and this paper's are tweet-level § Experimental Results. On the toxic gaming dataset, the same model reaches accuracy 0.93 and AUC 0.89, which the authors say beats the easiest task in the original work § Generalizing to Other Platforms.

Paper vs code

No official code.

The arXiv abstract page lists no code link; its comments field holds only keywords. The source's commented-out line says an implementation is available at a link "redacted for double blind" § Introduction, commented in source. Searches: the arXiv abstract page; GitHub repository search for "abuse detection", "hate speech twitter metadata", "abuse detection unified architecture" and "hate speech founta" (no matching author repositories); a GitHub user search for "founta" (the matching account shows unrelated repositories). No project page was found.

Pitfalls

  • Dataset counts disagree. The text gives 9,484 WebSci tweets before spam removal § Dataset, while Table 1 lists 6,091 tab. 1. The sarcasm text says about 60k tweets kept § Dataset, while Table 1 lists 61,075 tweets and 60,255 users. Use the table counts and mark the discrepancy.
  • Hate dataset metadata is contradictory. The dataset section says no metadata is used beyond word vectors § Dataset. Table 1 marks tweet-based metadata as available for this dataset tab. 1, and the discussion says the classifier uses "the raw text and the tweet-based metadata" [§ Experimental Results]. Table 2's metadata-only row for this dataset (AUC 0.75) implies tweet-based features were used.
  • Layer size "245". The metadata network is given as 512, 245, 128, 64, 32 § Metadata Network. The value 245 is probably a typo, but the paper does not say. Do not silently change it to 256; either flag it or test both.
  • Recurrent dropout semantics. The paper says p=0.5 means each neuron is "available for activation with probability 0.5" [§ Text Classification Network]. Many frameworks define dropout as the probability of dropping a unit. Check which convention the implementation uses. The paper gives no code for this.
  • Which path updates on which batch. The text says even batches update only the text path and odd batches only the metadata path [§ Training the Combined Network]. The procedure says model A (text path frozen) is used when (batch + epoch) is even, which would update only the metadata path. The two statements conflict. The pseudocode above follows the procedure (model A, frozen text path, on even parity) and the Keras-style freeze; verify against any released code before relying on it.
  • Concatenation point. The 128 text activations are described as "one for each RNN unit" § Combining the Two Classification Paths. The paper does not say whether these are the last hidden state, a pooled sequence, or another reduction.
  • Tanh scope and metadata details. The tanh activation is mentioned in the metadata paragraph, but whether it applies to all dense layers, and whether dropout or other regularisation applies to the metadata branch, is not stated. The definitions of sentiment, emotion and offensiveness scores are not given § Feature Extraction.
  • Early stopping is underspecified. The validation-split size and which model's loss is monitored are not stated. Patience is 10 epochs [§ Experimental Setup].
  • Learning rate and batch size for non-interleaved modes are not stated. Only the interleaved batch size (512) is given [§ Training the Combined Network].
  • Architecture is not fully task-agnostic. The gaming experiment switches attention on § Generalizing to Other Platforms, and the paper concedes that per-task tuning could improve results § Summary. "No retuning" applies to the four Twitter datasets with the attention setting unchanged.
  • Metadata features depend on external scorers. Sentiment, emotion and offensiveness scores are used but their source is not named [§ Feature Extraction]. Replicating them exactly is not possible from the paper alone.
  • Cost. The authors trained on three GPUs § Experimental Setup. Interleaved training runs the whole network on every batch, but updates only one path, so each batch costs a full forward pass plus one weight copy [§ Training the Combined Network]. The paper gives no timing figures.
  • No variance reported. Scores are given without standard deviations across folds tab. 2.
  • Not directly comparable baselines. The WebSci comparison with Chatzakou et al. mixes user-level and tweet-level results § Experimental Results. The sarcasm experiments use the original imbalanced data, because the baseline's imbalanced results are the reference § Dataset.
  • Data availability. The gaming dataset was obtained from its authors § Generalizing to Other Platforms. No public release is stated.

Lineage

  • Builds on: interleaved training from Hidasi et al. 2016, which the paper cites for parallel recurrent networks in recommender settings [§ Training the Combined Network]. No arXiv id is given in the source. GloVe word vectors § Text Classification Network. Metadata features from Chatzakou et al. 2017 § Feature Extraction.
  • Compared against: Naive Bayes with TF-IDF; Chatzakou et al. 2017; Waseem and Hovy 2016; Davidson et al. 2017; Rajadesingan et al. 2015 tab. 2.
  • Superseded by: not known from content in this wiki.

Source and license

Adapted from “A Unified Deep Learning Architecture for Abuse Detection” by Antigoni-Maria Founta, Despoina Chatzakou, Nicolas Kourtellis, Jeremy Blackburn, Athena Vakali, Ilias Leontiadis (arXiv:1802.00385), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors.