DominicTWHV/Horizon-1-Text-Large
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&utmmedium=embeddedmodelcard&utmcampaign=DominicTWHVHorizon-1-Text-Largecard" target="_blank" rel="noopener"> <img src="https://hfviewer.com/api/card.svg?source=DominicTWHV%2FHorizon-1-Text-Large&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:
- ealvaradob/phishing-dataset
- ucberkeley-dlab/measuring-hate-speech
- cardiffnlp/tweet_eval
- lmsys/toxic-chat
- tasksource/jigsaw_toxicitySoftware
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:
γ- = 3.5
γ+ = 0.5
clipping = 0.05Optimizer:
adamw
betas = (0.9, 0.999)
eps = 1e-8
momentum = 0.9LLRD:
decay_factor = 0.98Hyperparameters:
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:
"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:
Tuned:
Comparison with Constellation One (tuned):
[!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
Citation: ucberkeley-dlab/measuring-hate-speech
@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
@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
@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}
}