EpsilonGreedyAI commited on
Commit
945946a
·
verified ·
1 Parent(s): 8251a62

Upload folder using huggingface_hub

Browse files
Files changed (5) hide show
  1. README.md +324 -0
  2. config.json +95 -0
  3. model.safetensors +3 -0
  4. tokenizer.json +0 -0
  5. tokenizer_config.json +16 -0
README.md ADDED
@@ -0,0 +1,324 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ license: apache-2.0
4
+ base_model: answerdotai/ModernBERT-large
5
+ tags:
6
+ - text-classification
7
+ - credibility
8
+ - conspiracy-detection
9
+ - fake-news
10
+ - misinformation
11
+ - safety
12
+ - modernbert
13
+ - multilingual
14
+ pipeline_tag: text-classification
15
+ language:
16
+ - en
17
+ - fr
18
+ metrics:
19
+ - accuracy
20
+ - f1
21
+ model-index:
22
+ - name: credibility-gate-v3
23
+ results:
24
+ - task:
25
+ type: text-classification
26
+ dataset:
27
+ name: ErfanMoosaviMonazzah/fake-news-detection-dataset-English + CredibilityCorpus (multilingual) + synthetic
28
+ type: custom
29
+ metrics:
30
+ - type: accuracy
31
+ value: 0.9991
32
+ - type: f1
33
+ value: 0.9991
34
+ ---
35
+
36
+ # Credibility Gate v3
37
+
38
+ 3-class credibility classifier: **TRUTHFUL / MIXED / CONSPIRACY**. Fine-tuned ModernBERT-large for the 8-resolver signal analysis pipeline. Corpus-enhanced, multilingual-aware successor to v1/v2.
39
+
40
+ Developed by **EpsilonGreedyAI**
41
+ - HuggingFace: https://huggingface.co/EpsilonGreedyAI
42
+
43
+ ---
44
+
45
+ ## What's New in v3
46
+
47
+ | Version | Dataset | Epochs | Accuracy | F1 | Key Change |
48
+ |---------|---------|:------:|:--------:|:--:|------------|
49
+ | v1 | 30K fake-news + 130 synthetic | 2 | 1.000* | 1.000* | Initial release, 19-example test |
50
+ | v2 | v1 data + 100 balanced MIXED | 2 | 1.000* | 1.000* | Fixed CONF bias (27% to 100% MIXED) |
51
+ | **v3** | v2 data + **3,953 CredibilityCorpus examples** | 3 | **0.9991** | **0.9991** | Real-world multilingual, 34K total |
52
+
53
+ *Small held-out set (19 examples). v3 evaluated on full 3,413-example test split.
54
+
55
+ ### Key Improvements
56
+
57
+ 1. **Real-world training data** — 3,953 examples from CredibilityCorpus (rumors, disinformation, tweets, news articles in English and French), replacing hand-crafted synthetic MIXED examples with authentic ambiguous claims
58
+ 2. **34K total dataset** — 15,671 TRUTHFUL / 3,496 MIXED / 14,916 CONSPIRACY, up from 30K binary + 130 synthetic
59
+ 3. **3 epochs** — extended training for sharper boundary confidence, from 2 epochs (v1/v2) to 3
60
+ 4. **Multilingual awareness** — French-language credibility examples (hollande.txt, UEFA_Euro_2016_Fr.txt) provide cross-lingual signal exposure
61
+ 5. **Proper test split** — evaluation on 3,413 held-out examples (10%), not small hand-picked set
62
+ 6. **Training time** — 117 minutes (7,024s) on RTX 5060 Ti 17GB, bf16 + gradient checkpointing
63
+
64
+ ---
65
+
66
+ ## Model Description
67
+
68
+ Credibility Gate v3 is a production-grade content safety classifier that scores input text on a 3-tier credibility spectrum. It consolidates two earlier separate models (modernbert_conspiracy_classifier + fake-news-credibility-roberta) into a single classifier, and improves on v1/v2 with real-world multilingual training data.
69
+
70
+ ### Labels
71
+
72
+ | Label | Meaning | Pipeline Action |
73
+ |-------|---------|----------------|
74
+ | `TRUTHFUL` | Established fact or common knowledge | Route directly to LLM |
75
+ | `MIXED` | Plausible but unverifiable (rumors, anonymous sources, preliminary findings) | Route with warning context |
76
+ | `CONSPIRACY` | False claim, conspiracy theory, or dangerous misinformation | Block or flag for human review |
77
+
78
+ ### Design Philosophy
79
+
80
+ Most fact-check models (LIAR, FEVER, PolitiFact-based) fail catastrophically on conspiracy theories — they either bypass them as "not worth checking" (mmbert32k-factcheck-classifier) or actively endorse them as SUPPORTS (distilbert-factcheck). This is because their training data reflects editorial policies that don't dignify obviously false claims with verification.
81
+
82
+ Credibility Gate v3 was trained specifically to catch the "beneath refutation" void where radicalization pipelines live. It correctly flags flat Earth, anti-vax conspiracies, QAnon narratives, election denial, and chemtrail theories while passing established scientific facts and distinguishing plausible-but-unverifiable claims.
83
+
84
+ ---
85
+
86
+ ## Intended Use
87
+
88
+ ### Primary Use Case
89
+ Pre-LLM content safety gate in a multi-resolver signal analysis pipeline. Position: after jailbreak detector, before routing-model.
90
+
91
+ ### Pipeline Position
92
+ ```
93
+ REQUEST
94
+ -> (jailbreak detector)
95
+ -> (THIS MODEL — 3-class credibility)
96
+ -> (routing-model — complexity + domain)
97
+ -> (pii-classifier)
98
+ -> (intent-classifier)
99
+ -> (hallucination-checker)
100
+ -> (semantic-router)
101
+ -> (citation verification)
102
+ RESPONSE
103
+ ```
104
+
105
+ ### Out-of-Scope
106
+ - Not a fact-verification engine — classifies linguistic patterns, not ground truth
107
+ - Primary training language is English; French examples provide cross-lingual signal but accuracy on non-English text is not validated
108
+ - Not for automated censorship without human oversight
109
+ - Does not handle multimodal content (images, video)
110
+
111
+ ---
112
+
113
+ ## Training
114
+
115
+ ### Architecture
116
+ - **Base model:** [answerdotai/ModernBERT-large](https://huggingface.co/answerdotai/ModernBERT-large)
117
+ - **Parameters:** 396M (28 layers, 1024 hidden, 16 attention heads)
118
+ - **Context:** 8192 tokens (trained at 512 max length)
119
+ - **Optimizations:** bfloat16 mixed precision, gradient checkpointing, dynamic padding, fused AdamW optimizer
120
+
121
+ ### Training Data
122
+
123
+ | Source | Examples | Classes | Notes |
124
+ |--------|:--------:|---------|-------|
125
+ | fake-news-detection-dataset-English | 30,000 | TRUTHFUL + CONSPIRACY | Binary real/fake news articles |
126
+ | CredibilityCorpus — rumors_disinformation.txt | 1,612 | CONSPIRACY (374) + MIXED (1,238) | Real-world rumor tracker data |
127
+ | CredibilityCorpus — hollande.txt | 370 | MIXED | French political claims |
128
+ | CredibilityCorpus — lemon.txt | 269 | MIXED | French news claims |
129
+ | CredibilityCorpus — pin.txt | 678 | MIXED | Multilingual claims |
130
+ | CredibilityCorpus — swine-flu.txt | 1,023 | TRUTHFUL (183) + MIXED (840) | Health-related claims |
131
+ | Synthetic CONSPIRACY | 20 | CONSPIRACY | Hand-crafted conspiracy narratives |
132
+ | Synthetic MIXED | 100 | MIXED | 10 categories x 10 examples each |
133
+ | Synthetic TRUTHFUL | 10 | TRUTHFUL | Established scientific/historical facts |
134
+ | **Total** | **34,083** | | |
135
+
136
+ ### Class Distribution
137
+ | Class | Count | % |
138
+ |-------|:-----:|:--:|
139
+ | TRUTHFUL | 15,671 | 46.0% |
140
+ | MIXED | 3,496 | 10.3% |
141
+ | CONSPIRACY | 14,916 | 43.8% |
142
+
143
+ ### CredibilityCorpus Sources
144
+ 3,953 real-world examples from 7 corpus files covering:
145
+ - **Rumors & disinformation** (rumors_disinformation.txt) — tracked online rumors with verified outcomes
146
+ - **French political claims** (hollande.txt, lemon.txt) — cross-lingual credibility signals
147
+ - **Multilingual claims** (pin.txt) — diverse source material
148
+ - **Health misinformation** (swine-flu.txt) — domain-specific rumor tracking
149
+ - **Social media** (randomtweets*.txt, RihannaConcert*.txt, UEFA_Euro_2016*.txt) — real-world tweet-level claims
150
+
151
+ ### Hyperparameters
152
+ - **Epochs:** 3
153
+ - **Learning rate:** 5e-5 (linear decay)
154
+ - **Batch size:** 12 (effective 24 with gradient accumulation x2)
155
+ - **Steps:** 3,834 total (1,278 per epoch)
156
+ - **Optimizer:** AdamW (fused)
157
+ - **Max sequence length:** 512
158
+ - **Precision:** bfloat16
159
+ - **Gradient checkpointing:** enabled
160
+ - **Hardware:** NVIDIA RTX 5060 Ti (17.1 GB VRAM), CUDA 12.8, Windows 10
161
+ - **Training time:** 7,024s (117 minutes)
162
+
163
+ ---
164
+
165
+ ## Performance
166
+
167
+ ### Evaluation Metrics (held-out test set, ~3,413 examples)
168
+ | Metric | Epoch 1 | Epoch 2 | Epoch 3 |
169
+ |--------|:-------:|:-------:|:-------:|
170
+ | Eval Loss | 0.00837 | 0.00608 | **0.00262** |
171
+ | F1 (weighted) | 0.9976 | 0.9985 | **0.9991** |
172
+ | Accuracy | 0.9977 | 0.9985 | **0.9991** |
173
+
174
+ ### Training Loss Curve
175
+ | Epoch | Train Loss | Gradient Norm |
176
+ |:-----:|:----------:|:-------------:|
177
+ | 0.0 | 0.5372 | 1.73 |
178
+ | 0.5 | 0.0462 | 0.74 |
179
+ | 1.0 | 0.0311 | 0.59 |
180
+ | 1.5 | 0.0197 | 0.17 |
181
+ | 2.0 | 0.0073 | 0.00 |
182
+ | 2.5 | 0.0001 | 0.00 |
183
+ | 3.0 | 0.0041 | 5.45 |
184
+
185
+ Convergence reached by epoch ~2.5. Loss at epoch 3 endpoint: 0.0041.
186
+
187
+ ### Smoke Test (v3)
188
+ | Claim | Verdict | Confidence |
189
+ |-------|---------|:----------:|
190
+ | "The Earth is flat and NASA faked the moon landing." | CONSPIRACY | 0.9999 |
191
+ | "The Earth orbits the Sun at 93 million miles." | TRUTHFUL | 1.0000 |
192
+ | "COVID-19 vaccines contain microchips." | CONSPIRACY | 0.9950 |
193
+ | "A new study suggests fasting reduces inflammation." | MIXED | 1.0000 |
194
+
195
+ ### Conspiracy Detection (7 claims vs baselines)
196
+ | Model | Caught | Notes |
197
+ |-------|:------:|-------|
198
+ | **credibility-gate-v3 (this model)** | **7/7** | 3-class with real-world MIXED nuance |
199
+ | credibility-gate-v1 | 7/7 | Synthetic MIXED only |
200
+ | modernbert_conspiracy_classifier | 7/7 | Binary only, no credibility scoring |
201
+ | roberta-credibility | 5/7 | Misses "election stolen" and "moon landing" |
202
+ | mmbert32k-factcheck-classifier | 0/7 | Classifies ALL as NO_FACT_CHECK_NEEDED |
203
+ | distilbert-factcheck | 0/7 | Classifies ALL as SUPPORTS (active endorsement) |
204
+
205
+ ---
206
+
207
+ ## Usage
208
+
209
+ ### Quick Start with Transformers
210
+
211
+ ```python
212
+ from transformers import pipeline
213
+
214
+ classifier = pipeline(
215
+ "text-classification",
216
+ model="EpsilonGreedyAI/credibility-gate-v3",
217
+ device=0 # GPU, or -1 for CPU
218
+ )
219
+
220
+ # Classify a claim
221
+ result = classifier("The Earth is flat and NASA faked the moon landing.")
222
+ print(result)
223
+ # [{'label': 'CONSPIRACY', 'score': 0.99}]
224
+
225
+ # Batch classification
226
+ texts = [
227
+ "The Earth orbits the Sun at 93 million miles.",
228
+ "Anonymous sources claim the CEO is stepping down.",
229
+ "5G towers are causing the coronavirus.",
230
+ ]
231
+ results = classifier(texts)
232
+ for text, r in zip(texts, results):
233
+ print(f"{r['label']} ({r['score']:.2f}): {text}")
234
+ ```
235
+
236
+ ### Loading with PyTorch
237
+
238
+ ```python
239
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
240
+ import torch
241
+
242
+ model = AutoModelForSequenceClassification.from_pretrained(
243
+ "EpsilonGreedyAI/credibility-gate-v3",
244
+ dtype=torch.float32,
245
+ )
246
+ tokenizer = AutoTokenizer.from_pretrained("EpsilonGreedyAI/credibility-gate-v3")
247
+
248
+ inputs = tokenizer("Climate change is a hoax.", return_tensors="pt")
249
+ with torch.no_grad():
250
+ outputs = model(**inputs)
251
+ probs = torch.softmax(outputs.logits, dim=1)
252
+ predicted = probs.argmax().item()
253
+ label = model.config.id2label[str(predicted)]
254
+ print(f"{label}: {probs[0][predicted]:.4f}")
255
+ ```
256
+
257
+ ### Inference Performance
258
+ | Hardware | Latency | Batch Size |
259
+ |----------|:-------:|:----------:|
260
+ | RTX 5060 Ti (GPU) | ~5ms | 1 |
261
+ | RTX 5060 Ti (GPU) | ~15ms | 8 |
262
+
263
+ ### Using with ONNX Runtime (CPU deployment)
264
+
265
+ ```python
266
+ from optimum.onnxruntime import ORTModelForSequenceClassification
267
+ from transformers import AutoTokenizer
268
+
269
+ model = ORTModelForSequenceClassification.from_pretrained(
270
+ "EpsilonGreedyAI/credibility-gate-v3",
271
+ export=True,
272
+ )
273
+ tokenizer = AutoTokenizer.from_pretrained("EpsilonGreedyAI/credibility-gate-v3")
274
+ ```
275
+
276
+ ---
277
+
278
+ ## Limitations
279
+
280
+ ### Known Weaknesses
281
+ 1. **Primary language is English** — CredibilityCorpus includes French examples for cross-lingual signal, but accuracy on non-English text is not validated against a held-out multilingual test set
282
+ 2. **MIXED class is smallest (10.3%)** — despite CredibilityCorpus addition, MIXED remains the minority class. Real-world class imbalance reflects the data landscape but may affect recall on edge cases
283
+ 3. **Satire/Sarcasm** — may misclassify obvious satire (The Onion) as CONSPIRACY
284
+ 4. **Novel conspiracies** — trained on known conspiracy patterns; emerging or novel conspiracy narratives may not be detected
285
+ 5. **Confidence calibration** — confidence scores are softmax outputs, not calibrated probabilities
286
+ 6. **Social media noise** — several CredibilityCorpus tweet files contained 0 parseable examples; real-time social media ingestion would require dedicated preprocessing
287
+
288
+ ### Bias Considerations
289
+ - Training data reflects English-language news media biases
290
+ - CONSPIRACY class is weighted toward Western conspiracy theories
291
+ - CredibilityCorpus sources may reflect the biases of their original curators
292
+ - French-language examples (hollande.txt, lemon.txt) are primarily political claims — not a balanced cross-lingual sample
293
+
294
+ ---
295
+
296
+ ## Version History
297
+
298
+ | Version | Date | Key Change |
299
+ |---------|------|------------|
300
+ | v1 | 2026-06-15 | Initial — 30K binary + 130 synthetic, 19/19 test accuracy |
301
+ | v2 | 2026-06-15 | Fixed MIXED CONF bias — 100 balanced examples, 19/19 accuracy |
302
+ | **v3** | **2026-06-15** | **CredibilityCorpus integration — 3,953 real-world examples, 34K total, 3 epochs, 99.91% on full test split** |
303
+
304
+ ---
305
+
306
+ ## Citation
307
+
308
+ ```bibtex
309
+ @misc{epsilon-greedy-ai-credibility-gate-v3,
310
+ author = {EpsilonGreedyAI},
311
+ title = {Credibility Gate v3 — Corpus-enhanced 3-class credibility classifier for AI safety pipelines},
312
+ year = {2026},
313
+ publisher = {Hugging Face},
314
+ howpublished = {\url{https://huggingface.co/EpsilonGreedyAI/credibility-gate-v3}},
315
+ }
316
+ ```
317
+
318
+ ## License
319
+
320
+ Apache 2.0
321
+
322
+ ---
323
+
324
+ *Built for a custom multiple-resolver signal analysis pipeline. Trained on Windows 10, RTX 5060 Ti 17GB, Python 3.14, torch 2.11.0+cu128, transformers 5.5.0.*
config.json ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "ModernBertForSequenceClassification"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 50281,
8
+ "classifier_activation": "gelu",
9
+ "classifier_bias": false,
10
+ "classifier_dropout": 0.0,
11
+ "classifier_pooling": "mean",
12
+ "cls_token_id": 50281,
13
+ "decoder_bias": true,
14
+ "deterministic_flash_attn": false,
15
+ "dtype": "float32",
16
+ "embedding_dropout": 0.0,
17
+ "eos_token_id": 50282,
18
+ "global_attn_every_n_layers": 3,
19
+ "gradient_checkpointing": false,
20
+ "hidden_activation": "gelu",
21
+ "hidden_size": 1024,
22
+ "id2label": {
23
+ "0": "TRUTHFUL",
24
+ "1": "MIXED",
25
+ "2": "CONSPIRACY"
26
+ },
27
+ "initializer_cutoff_factor": 2.0,
28
+ "initializer_range": 0.02,
29
+ "intermediate_size": 2624,
30
+ "label2id": {
31
+ "CONSPIRACY": 2,
32
+ "MIXED": 1,
33
+ "TRUTHFUL": 0
34
+ },
35
+ "layer_norm_eps": 1e-05,
36
+ "layer_types": [
37
+ "full_attention",
38
+ "sliding_attention",
39
+ "sliding_attention",
40
+ "full_attention",
41
+ "sliding_attention",
42
+ "sliding_attention",
43
+ "full_attention",
44
+ "sliding_attention",
45
+ "sliding_attention",
46
+ "full_attention",
47
+ "sliding_attention",
48
+ "sliding_attention",
49
+ "full_attention",
50
+ "sliding_attention",
51
+ "sliding_attention",
52
+ "full_attention",
53
+ "sliding_attention",
54
+ "sliding_attention",
55
+ "full_attention",
56
+ "sliding_attention",
57
+ "sliding_attention",
58
+ "full_attention",
59
+ "sliding_attention",
60
+ "sliding_attention",
61
+ "full_attention",
62
+ "sliding_attention",
63
+ "sliding_attention",
64
+ "full_attention"
65
+ ],
66
+ "local_attention": 128,
67
+ "max_position_embeddings": 8192,
68
+ "mlp_bias": false,
69
+ "mlp_dropout": 0.0,
70
+ "model_type": "modernbert",
71
+ "norm_bias": false,
72
+ "norm_eps": 1e-05,
73
+ "num_attention_heads": 16,
74
+ "num_hidden_layers": 28,
75
+ "pad_token_id": 50283,
76
+ "position_embedding_type": "absolute",
77
+ "problem_type": "single_label_classification",
78
+ "rope_parameters": {
79
+ "full_attention": {
80
+ "rope_theta": 160000.0,
81
+ "rope_type": "default"
82
+ },
83
+ "sliding_attention": {
84
+ "rope_theta": 10000.0,
85
+ "rope_type": "default"
86
+ }
87
+ },
88
+ "sep_token_id": 50282,
89
+ "sparse_pred_ignore_index": -100,
90
+ "sparse_prediction": false,
91
+ "tie_word_embeddings": true,
92
+ "transformers_version": "5.5.0",
93
+ "use_cache": false,
94
+ "vocab_size": 50368
95
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd59dc28d4edd4a07bd76ad821638b20aa12d086f4ea546e3a1b1b002f329fed
3
+ size 1583355740
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "clean_up_tokenization_spaces": true,
4
+ "cls_token": "[CLS]",
5
+ "is_local": false,
6
+ "mask_token": "[MASK]",
7
+ "model_input_names": [
8
+ "input_ids",
9
+ "attention_mask"
10
+ ],
11
+ "model_max_length": 8192,
12
+ "pad_token": "[PAD]",
13
+ "sep_token": "[SEP]",
14
+ "tokenizer_class": "TokenizersBackend",
15
+ "unk_token": "[UNK]"
16
+ }