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 (onnxruntime quantization)
  • 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 profile
    • 1: DEPENDS_ON β€” Explicit workflow dependency or execution precondition
    • 2: CONFLICTS_WITH β€” Direct contradiction, rule violation, or mutually exclusive directive
    • 3: 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 StratifiedGroupKFold on fact_a)

License

MIT License. Vox Voice AI Team.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Evaluation results