CoolFace
Modelpublic

DominicTWHV/Horizon-1-Text-Large

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
2likes34downloads
Model Card

Horizon 1

A larger and more modern variant of Constellation-One for Cockatoo from answerdotai/modernBERT-large

This model is licensed under the Apache-2.0 license

Note:

lmsys/toxic-chat is licensed under CC-BY-NC-4.0, meaning this model cannot be legally used for commercial purposes.

Architecture

<a href="https://hfviewer.com/DominicTWHV/Horizon-1-Text-Large?utmsource=huggingface&amp;utmmedium=embeddedmodelcard&amp;utmcampaign=DominicTWHVHorizon-1-Text-Largecard" target="_blank" rel="noopener"> <img src="https://hfviewer.com/api/card.svg?source=DominicTWHV%2FHorizon-1-Text-Large&amp;v=20260501clipcard" alt="Open DominicTWHV/Horizon-1-Text-Large in hfviewer" width="100%" /> </a>

Hardware:

This model was fine-tuned on two NVIDIA A40s with a batch size of 32 and gradient accumulation of 2, totaling to an effective batch size of (32*2) * 2 = 128

Fine-tuned on a dataset size of 232k entries aggregated from:

csv
- ealvaradob/phishing-dataset
- ucberkeley-dlab/measuring-hate-speech
- cardiffnlp/tweet_eval
- lmsys/toxic-chat
- tasksource/jigsaw_toxicity

Software

Training was executed on the Cockatoo_ML_Training server. Metrics are publicly visible at Cockatoo.dev .

Techniques: or label merging, merge_labels on conflict. There have been no manual intervention in data sanitization before/after merging.

Asymmetric losses:

csv
γ- = 3.5
γ+ = 0.5
clipping = 0.05

Optimizer:

csv
adamw

betas = (0.9, 0.999)
eps = 1e-8
momentum = 0.9

LLRD:

csv
decay_factor = 0.98

Hyperparameters:

csv
epoch = 3

batch_size = 32
gradient_accumulation = 2

learning_rate = 5e-5
weight_decay = 0.1
warmup_ratio = 0.1

fp16 = false
bf16 = true
tf32 = true

gradient_checkpointng = false
gradient_clipping = true
gradient_clipping_val = 1.0

attention_implementation = "flash_attention_2"

Available Labels:

json
"id2label": {
  "0": "scam",
  "1": "violence",
  "2": "harassment",
  "3": "hate_speech",
  "4": "toxicity",
  "5": "obscenity",
  "6": "genocide" # genocide is a new addition compared to Constellation
}

Performance

All evaluation metrics are from macro averaging, may contain slight deviations with other data entries due to the discrepancy in different evaluation runs. Metrics from zero-shot evaluation split (not present in training data)

Horizon 1 achieves very high recall values out of the box (0.94 raw) with a comparable precision compared to Constellation (0.566 raw vs. 0.605).

However, this model really shines when trigger thresholds have been fine-tuned:

Default:

CategoryThresholdF1-Score
scam0.50.8758
violence0.50.6891
harassment0.50.8279
hate_speech0.50.6581
toxicity0.50.6430
obscenity0.50.6428
genocide0.50.5630
Average-0.7000

[image] [image] [image]

Tuned:

CategoryThresholdF1-ScoreDelta (vs. default)
scam0.71290.9131+0.0373
violence0.62380.7252+0.0361
harassment0.65350.8712+0.0433
hate_speech0.60400.7082+0.0501
toxicity0.62380.7371+0.0941
obscenity0.62380.7309+0.0881
genocide0.63370.5929+0.0299
Average-0.7541+0.0541

[image] [image] [image]

Comparison with Constellation One (tuned):

MetricConstellation OneHorizon 1Delta (H1 - C1)
Loss0.16030.0245-0.1358
Overall Precision0.69400.6809-0.0131
Overall Recall0.81510.8554+0.0403
Overall F10.74750.7448-0.0027
Scam Precision0.92550.9330+0.0075
Scam Recall0.94670.9009-0.0459
Scam F10.93600.9167-0.0194
Violence Precision0.51410.6293+0.1152
Violence Recall0.71910.8828+0.1637
Violence F10.59950.7348+0.1353
Harassment Precision0.82380.8329+0.0091
Harassment Recall0.88300.9240+0.0410
Harassment F10.85240.8761+0.0237
Hate Speech Precision0.56070.5965+0.0358
Hate Speech Recall0.69600.8652+0.1692
Hate Speech F10.62110.7061+0.0850
Toxicity Precision0.68910.6946+0.0056
Toxicity Recall0.80250.7481-0.0544
Toxicity F10.74150.7204-0.0211
Obscenity Precision0.65070.6828+0.0321
Obscenity Recall0.84310.7160-0.1271
Obscenity F10.73450.6990-0.0355
Genocide PrecisionN/A0.3972N/A
Genocide RecallN/A0.9511N/A
Genocide F1N/A0.5604N/A
[!NOTE] This model is more "trigger-happy" compared to Constellation One, albeit this can be mitigated in production by increasing thresholds (current values optimized for macro F1).

A newer version is planned to mitigate this behavior.

Resources:

Training/Inferencing server: https://github.com/DominicTWHV/CockatooMLTraining/

Training Metrics: https://cockatoo.dev/ml-training.html

Datasets Used | Citations

DatasetLicenseLink
Phishing DatasetMITHugging Face
Measuring Hate SpeechCC-BY-4.0Hugging Face
Tweet Eval (SemEval-2019)[See Citation]*Hugging Face
Toxic ChatCC-BY-NC-4.0Hugging Face
Jigsaw ToxicityApache-2.0Hugging Face

Citation: ucberkeley-dlab/measuring-hate-speech

bibtex
@article{kennedy2020constructing,
  title={Constructing interval variables via faceted Rasch measurement and multitask deep learning: a hate speech application},
  author={Kennedy, Chris J and Bacon, Geoff and Sahn, Alexander and von Vacano, Claudia},
  journal={arXiv preprint arXiv:2009.10277},
  year={2020}
}

Citation: cardiffnlp/tweet_eval

bibtex
@inproceedings{basile-etal-2019-semeval,
    title = "{S}em{E}val-2019 Task 5: Multilingual Detection of Hate Speech Against Immigrants and Women in {T}witter",
    author = "Basile, Valerio and Bosco, Cristina and Fersini, Elisabetta and Nozza, Debora and Patti, Viviana and Rangel Pardo, Francisco Manuel and Rosso, Paolo and Sanguinetti, Manuela",
    booktitle = "Proceedings of the 13th International Workshop on Semantic Evaluation",
    year = "2019",
    address = "Minneapolis, Minnesota, USA",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/S19-2007",
    doi = "10.18653/v1/S19-2007",
    pages = "54--63"
}

Citation: lmsys/toxic-chat

bibtex
@misc{lin2023toxicchat,
      title={ToxicChat: Unveiling Hidden Challenges of Toxicity Detection in Real-World User-AI Conversation}, 
      author={Zi Lin and Zihan Wang and Yongqi Tong and Yangkun Wang and Yuxin Guo and Yujia Wang and Jingbo Shang},
      year={2023},
      eprint={2310.17389},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}