Text Classification
Transformers
ONNX
English
modernbert
int8
vox
memory-graph
edge-classifier
Eval Results (legacy)
Instructions to use addyo07/modernbert-vox-cognitive-edge-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use addyo07/modernbert-vox-cognitive-edge-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="addyo07/modernbert-vox-cognitive-edge-classifier")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("addyo07/modernbert-vox-cognitive-edge-classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
ModernBERT Vox v7 Cognitive Edge Classifier
ModernBERT-base (149M encoder) fine-tuned on the 6,000-pair Vox v7 Cognitive Edge Dataset to predict inter-domain graph operational labels (SHAPES, DEPENDS_ON, CONFLICTS_WITH, NONE) for memory graph orchestration in the Vox voice AI desktop application (Tauri v2 / Rust / CPU-first runtime).
Model Description
- Architecture:
answerdotai/ModernBERT-base(149M parameters, 22 layers, 768 hidden dim) - Quantization: Dynamic INT8 (
onnxruntimequantization) - Input: Two domain fact strings (
fact_a,fact_b) separated by[SEP] - Output: Multi-class logits corresponding to operational graph labels:
0:SHAPESβ Modifies or evolves user taste/persona profile1:DEPENDS_ONβ Explicit workflow dependency or execution precondition2:CONFLICTS_WITHβ Direct contradiction, rule violation, or mutually exclusive directive3:NONEβ No semantic connection (or low-confidence fallback)
- Inference Latency: ~28ms / pair on single-thread CPU (
intra_op_threads=1)
Performance Summary
| Metric | Phase 1 Zero-Shot | 3-Epoch Baseline | 6-Epoch Model (This Model) | Delta vs 3-Epoch |
|---|---|---|---|---|
| Holdout Test Accuracy | 18.14% | 83.53% | 87.50% | +3.97% π |
| Holdout Test Macro F1 | 0.1575 | 0.8314 | 0.8722 | +0.0408 π |
| Peak Validation Accuracy | 18.14% | 83.53% | 88.17% | +4.64% π |
| Validation Loss | 1.8412 | 0.4921 | 0.3881 | -0.1040 |
| Quantized INT8 Size | 143.67 MB | 143.67 MB | 143.67 MB | 0.00 MB |
| CPU Latency | ~32ms | ~32ms | ~28ms | -4ms |
Graph Conservation & Confidence Threshold Sweep
To prevent memory graph bloat and minimize false positive edge creation in the Turso SQLite graph database, predictions default to NONE whenever the maximum positive edge probability is less than threshold $\tau$:
| Confidence Threshold ($\tau$) | Overall Accuracy | Positive Edge Precision | False Positive Rate | NONE Recall |
Graph Action |
|---|---|---|---|---|---|
| $\tau = 0.50$ (Raw) | 85.36% | 84.14% | 11.54% | 88.46% | Standard Edge Creation |
| $\tau = 0.75$ | 83.36% | 85.91% | 10.00% | 90.00% | Balanced Filtering |
| $\tau = 0.80$ (Recommended) | 82.70% | 86.67% | 7.69% | 92.31% | Lean Semantic Graph |
| $\tau = 0.85$ | 81.70% | 87.09% | 7.69% | 92.31% | Ultra-Strict Graph |
Repository Structure
modernbert-vox-cognitive-edge-classifier/
βββ README.md # Model card (this file)
βββ dataset/
β βββ gate3_v7_ontology_6000p.json # 6,000 verified ground-truth fact pairs
β βββ dataset_record.md # Master dataset ledger and quality stats
βββ model/
β βββ pytorch/ # PyTorch tokenizer & model configuration
β β βββ config.json # Model architecture configuration
β β βββ tokenizer.json # HuggingFace tokenizer
β β βββ tokenizer_config.json
β β βββ vocab.txt
β β βββ special_tokens_map.json
β βββ onnx/ # ONNX INT8 quantized (for CPU inference)
β βββ config.json # Model architecture configuration
β βββ model_quantized.onnx # INT8 quantized model (~143.67 MB)
βββ scripts/ # Training & calibration pipeline
βββ train_modernbert_remote.py # Pure CPU 6-epoch training + ONNX export
Usage
Python (with transformers + ONNX Runtime)
import numpy as np
import onnxruntime as ort
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained(
"addyo07/modernbert-vox-cognitive-edge-classifier",
subfolder="model/pytorch"
)
session = ort.InferenceSession("model/onnx/model_quantized.onnx")
fact_a = "User prefers concise 2-sentence responses"
fact_b = "System prompt enforces brief explanations"
inputs = tokenizer(fact_a, fact_b, return_tensors="np", truncation=True, max_length=128)
inputs_ort = {
"input_ids": inputs["input_ids"].astype(np.int64),
"attention_mask": inputs["attention_mask"].astype(np.int64)
}
logits = session.run(None, inputs_ort)[0]
probs = np.exp(logits) / np.sum(np.exp(logits), axis=-1, keepdims=True)
labels = ["SHAPES", "DEPENDS_ON", "CONFLICTS_WITH", "NONE"]
pred_id = int(np.argmax(probs, axis=-1)[0])
confidence = float(probs[0][pred_id])
# Apply conservative graph purity threshold (tau = 0.80)
if pred_id != 3 and confidence < 0.80:
pred_label = "NONE"
else:
pred_label = labels[pred_id]
print(f"Predicted Edge: {pred_label} (Confidence: {confidence:.2f})")
Rust Integration (Tauri v2 / Vox v7 Subsystem)
use ort::{GraphOptimizationLevel, Session};
use tokenizers::Tokenizer;
let tokenizer = Tokenizer::from_file("model/pytorch/tokenizer.json")?;
let session = Session::builder()?
.with_optimization_level(GraphOptimizationLevel::Level3)?
.with_intra_threads(1)?
.commit_from_file("model/onnx/model_quantized.onnx")?;
Download Individual Files
# ONNX model (for CPU inference)
wget https://huggingface.co/addyo07/modernbert-vox-cognitive-edge-classifier/resolve/main/model/onnx/model_quantized.onnx
# Dataset (6,000 ground-truth pairs)
wget https://huggingface.co/addyo07/modernbert-vox-cognitive-edge-classifier/resolve/main/dataset/gate3_v7_ontology_6000p.json
Dataset Details
Located in dataset/gate3_v7_ontology_6000p.json:
- Total Verified Pairs: 6,000
- Hard Negative (
NONE) Pairs: 1,293 (21.55%) - Primary Key Duplicates: 0 (0.00%)
- Policy Matrix Violations: 0 (0.00%)
- Fact Group Leakage across Splits: 0 (Grouped via
StratifiedGroupKFoldonfact_a)
License
MIT License. Vox Voice AI Team.
Evaluation results
- Accuracy on vox-cognitive-edge-datasettest set self-reported0.875
- Precision on vox-cognitive-edge-datasettest set self-reported0.876
- Recall on vox-cognitive-edge-datasettest set self-reported0.873
- F1 on vox-cognitive-edge-datasettest set self-reported0.872