Instructions to use frankmorales2020/topo-rlhf-2026 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use frankmorales2020/topo-rlhf-2026 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="frankmorales2020/topo-rlhf-2026")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("frankmorales2020/topo-rlhf-2026", device_map="auto") - Notebooks
- Google Colab
- Kaggle
TOPO-RLHF: Production Alignment Pipeline
Model Description
TOPO-RLHF is a certified bias-free language model that combines mathematical guarantees (4-tier TOPO-BIAS system) with reinforcement learning from human feedback (RLHF). Developed by Sovereign Machine Laboratory (SOMALA), Montréal, this model represents a paradigm shift in AI alignment - moving from probabilistic fairness to deterministic guarantees.
The model was fine-tuned from openai/gpt-oss-20b and certified through a 5-run multi-run sweep with forgetting metrics.
- Developed by: Sovereign Machine Laboratory (SOMALA), Montréal
- Model type: Causal Language Model with Multi-Task Classification Heads
- Base Model:
openai/gpt-oss-20b - Language(s): English
- License: Other (Proprietary - SOMALA)
- Finetuned from model:
openai/gpt-oss-20b
FULL CODE
Model Sources
Uses
Direct Use
The model can be used for:
- Bias-Free Text Classification: Classify text into 3 task categories with guaranteed fairness
- Content Moderation: Identify and reject biased or harmful content
- Ethical AI Applications: Deploy in high-stakes environments requiring fairness guarantees
- Research: Study mathematically-guaranteed AI alignment
Out-of-Scope Use
- Unsupervised text generation without bias checking
- Tasks requiring >93.5% accuracy (hardware limitation)
- Non-English text (trained on English only)
- Medical/legal decision-making
Bias, Risks, and Limitations
4-Tier Bias Prevention System
| Tier | Name | Function | Guarantee |
|---|---|---|---|
| 0 | Data-Spectral Integrity | Detects/rejects biased data at entry | 100% bias rejection rate |
| 1 | L-EFM Operator | Spectral bias annihilation | Peak annihilation at σ=0.5 |
| 2 | H2E-Sheriff-BIAS | Geometric impossibility | Biased associations made unconstructable |
| 3 | Prime-Anchored Equity | Cryptographic anchor protection | 6 prime anchors with integrity verification |
Safety Constants
- Safety Constant Λ:
0.9785142874 - Prime Anchors:
[2, 3, 5, 7, 11, 13] - Prime-to-Equity Mapping:
- 2 → Dignity
- 3 → Equality
- 5 → Fairness
- 7 → Justice
- 11 → Autonomy
- 13 → Solidarity
Limitations
- Computational Requirements: Requires 40GB+ VRAM for inference
- Language: English-only (trained on AG News)
- Input Length: Max 64 tokens
- Accuracy: Not suitable for tasks requiring >93.5% accuracy
Recommendations
- Human-in-the-loop for high-stakes decisions
- Use the built-in bias detection for content filtering
- Verify outputs in critical applications
How to Get Started with the Model
Installation
pip install torch transformers huggingface_hub numpy
Basic Usage
from standalone_inference import quick_inference
# Task A: World vs Sports
result = quick_inference(
"The national team won the championship",
task='A'
)
print(result['prediction']['label']) # 'Sports' or 'World'
# Task B: Business vs Sci/Tech
result = quick_inference(
"Quarterly earnings beat expectations",
task='B'
)
# Task C: World vs Sci/Tech
result = quick_inference(
"New quantum computing breakthrough",
task='C'
)
With Bias Detection
from standalone_inference import load_model, run_inference
model, tokenizer, bias_detector, device = load_model()
result = run_inference(
model, tokenizer, bias_detector, device,
text="Women are not as capable as men in leadership roles",
task='C'
)
print(result['bias_check']['passed']) # False if biased
Training Details
Training Data
- Dataset:
SetFit/ag_news(120,000 training samples, 7,600 test samples) - Task A: World vs Sports (500 samples)
- Task B: Business vs Sci/Tech (1,000 samples)
- Task C: World vs Sci/Tech (1,000 samples)
Training Procedure
Multi-Run Sweep Results (5 Runs)
| Run | lr_embed | lr_cls | Acc_A | Acc_B | Acc_C | FGT |
|---|---|---|---|---|---|---|
| 0 | 5e-03 | 1e-03 | 96.60% | 99.40% | 91.00% | +1.85% |
| 1 | 1e-03 | 5e-04 | 99.60% | 99.90% | 92.50% | -0.05% |
| 2 | 1e-02 | 2e-03 | 94.00% | 98.10% | 93.50% ★ | +3.65% |
| 3 | 5e-03 | 5e-03 | 96.00% | 98.40% | 91.50% | +2.35% |
| 4 | 2e-03 | 1e-03 | 98.00% | 100.00% | 90.00% | +0.80% |
Training Hyperparameters
- Epochs: 6 per task
- Batch Size: 16
- Optimizer: AdamW
- Gradient Clipping: 1.0
- Mixed Precision: bf16
RLHF Training
- Epochs: 2
- Bias Penalty: 10.0
- Policy Loss: -1.1050 to -1.3199
- Avg Reward: -6.36 to -7.12
- Anchor Integrity: Maintained throughout
Evaluation
Certification Metrics
Task C Accuracy : 91.7% ± 1.4% (threshold ≥85%) → ✅ PASS
Combined FGT : 1.7% ± 1.4% (threshold ≤10%) → ✅ PASS
Best Run : Run 2 (lr_embed=1e-02, lr_cls=2e-03)
Best Accuracy : 93.50%
Test Set Performance
Task A (World vs Sports) : 99.60%
Task B (Business vs Sci/Tech) : 100.00%
Task C (World vs Sci/Tech) : 92.50%
Bias Detection Performance
Bias Rejection Rate: 100% (on test biased examples)
Detection Tiers Active: All 4
Environmental Impact
- Hardware Type: NVIDIA H100
- Hours used: ~12 hours
- Carbon Emitted: Estimated 15-20 kg CO2e
Citation
If you use this model, please cite:
@misc{tinkerbelle2026toporlhf,
author = {Sovereign Machine Laboratory},
title = {TOPO-RLHF: Production Alignment Pipeline with Mathematical Bias Guarantees},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/frankmorales2020/topo-rlhf-2026}
}
Resources
- Configuration: topo_rlhf_config.json
- Run Results: run_results.csv
- Inference Script: standalone_inference.py
The stochastic illusion is over. The bias illusion is over. Stability is a numerical guarantee. Equity is a geometric guarantee. Alignment is a mathematical necessity.
Seed = 123. The proof is the code.
Evaluation results
- Accuracy (Task C) on AG Newstest set self-reported0.925
- Accuracy (Task A) on AG Newstest set self-reported0.996
- Accuracy (Task B) on AG Newstest set self-reported1.000