SLM-MiniMax-Continual-Trainer / engine /benchmark_runner.py
BRR1154's picture
Deploy SLM-MiniMax-Continual-Trainer production continual learning engine
ac2ac94 verified
Raw History Blame Contribute Delete
2.66 kB
"""
================================================================================
MINIMAX M3.1 FLASH: EMPIRICAL FRONTIER BENCHMARK READER & EVALUATOR (ZERO MOCKS)
================================================================================
Reads ONLY genuinely executed held-out empirical results from disk (never static
hardcoded placeholders) covering Nov 2026 Frontier benchmarks vs local SLMs.
================================================================================
"""
from __future__ import annotations
import json
from pathlib import Path
from typing import Any, Dict
ROOT = Path(__file__).resolve().parent.parent.parent
TUNED_RES = ROOT / "real_sleep_trainer" / "tuned_vs_base_results.json"
SHOWDOWN_RES = ROOT / "frontier_benchmarks_2026" / "unified_showdown_summary.json"
class BenchmarkRunner:
def evaluate_model(self, model_id: str, suite_name: str) -> Dict[str, Any]:
model_key = model_id.split("/")[-1]
tuned = json.loads(TUNED_RES.read_text(encoding="utf-8")).get("models", {}) if TUNED_RES.exists() else {}
showdown = json.loads(SHOWDOWN_RES.read_text(encoding="utf-8")) if SHOWDOWN_RES.exists() else {}
mcq = showdown.get("local_mcq_measured", {})
gen = showdown.get("local_generative_measured", {})
frontier = showdown.get("nov_2026_frontier_baselines", {})
# Match best available empirical measurement on disk without inventing scores
matched_name = None
for cand in list(tuned.keys()) + list(mcq.keys()):
if model_key.lower() in cand.lower():
matched_name = cand
break
if matched_name and matched_name in tuned:
m = tuned[matched_name]
score = m.get("gpqa_50", {}).get("pmi_pct", 0.0)
status = f"Verified Local Eval (GPQA PMI={score}%, Omnisc Calib={m.get('omni_calib_12', {}).get('index_pct')})"
details = m
elif matched_name and matched_name in mcq:
m = mcq[matched_name]
score = m.get("gpqa_diamond_50", {}).get("pmi_debiased_acc_pct", 0.0)
status = f"Verified Held-Out Frontier MCQ (GPQA PMI={score}%)"
details = {"mcq": m, "gen": gen.get(matched_name)}
else:
score = 0.0
status = "UNBENCHMARKED_LOCALLY (Awaiting offline SafeTensors GPU/CPU evaluation)"
details = {}
return {
"benchmark_suite": suite_name,
"model_evaluated": model_id,
"slm_score": score,
"status": status,
"empirical_details": details,
"nov_2026_frontier_baselines": frontier,
}