MLX
Safetensors
gemma4
swedish
public-administration
decision-making
decision-router
calibration
lora
renaissance-labs
4-bit precision

Swedish & Multilingual Decision Gemma 4 E4B MLX (RenaissanceLabsEU/swedish-decision-gemma4-e4b-mlx)

A 4-bit Apple Silicon MLX LoRA-finetuned Gemma 4 E4B decision specialist trained on Swedish public-administration tasks + multilingual EU/Global decision cases from RenaissanceLabsEU/swedish-public-decisions-v1 and RenaissanceLabsEU/global-decisions-v1.

Standalone, swedish-decision-gemma4-e4b-mlx is our strongest single decision model (63.7% accuracy, 0.931 NLL, 0.065 ECE-10 on swedish-decision-dataset-v1, and 61.4% on the unseen Elsäkerhetsverket holdout — +22.7pp over Qwen3-1.7B LoRA). Combined with our 3-Specialist Hierarchical Decision Router (router/ included in this repo), accuracy reaches 69.5% (0.861 NLL, 0.057 ECE-10, 95.5% selective accuracy at conf ≥ 0.90).

Gemma 4 E4B LoRA and 3-Specialist Hierarchical Decision Router Results

Frozen Holdout Results

All models were evaluated strictly once on the untouched FROZEN.json-verified holdouts using official evaluate.py --split test, with scalar temperatures $T$ fitted strictly on calibration/.

1. Primary Benchmark: swedish-decision-dataset-v1 (n = 532, 22 agency clusters)

System Accuracy Macro-F1 NLL ↓ Brier ↓ ECE-10 ↓ Selective Acc (conf ≥ 0.70) Selective Acc (conf ≥ 0.90)
Qwen3-1.7B Zero-Shot (cal.) 34.0% 0.154 1.356 0.712 0.184 76.4% (20.7% cov.) —
swedish-decision-qwen3-1.7b-mlx 53.8% 0.206 1.116 0.587 0.080 78.8% (19.5% cov.) —
swedish-decision-saga-v1 (SagaEmbed) 56.0% 0.330 1.168 0.596 0.168 67.8% (58.5% cov.) 77.7% (22.7% cov.)
swedish-decision-gemma4-e4b-mlx (this model, $T=1.829$) 63.7% (+10.0pp vs Qwen3, CI [+4.5%, +20.2%]) 0.348 0.931 0.488 0.065 78.8% (51.3% cov.) 89.7% (12.8% cov.)
3-Specialist Decision Router (Saga + Qwen3 + Gemma4) 69.5% (+5.8pp vs Gemma4, CI [+2.7%, +14.9%]) 0.383 0.861 0.442 0.057 84.1% (49.6% cov.) 95.5% (12.6% cov.)

Per-Decision-Type Breakdown (swedish-decision-dataset-v1, n = 532)

Decision Type Qwen3-1.7B LoRA SagaEmbed (saga-v1) Gemma 4 E4B LoRA 3-Specialist Router
relevance 33.9% 81.2% 65.2% 89.3%
evidence_sufficiency 78.1% 70.5% 78.1% 78.1%
uncertainty 78.1% 49.5% 74.3% 78.1%
next_step 40.0% 40.0% 51.4% 51.4%
rule_application 40.0% 37.1% 49.5% 49.5%
Overall 53.8% 56.0% 63.7% 69.5%

2. Unseen-Agency Holdout: swedish-workflow-training-v1 (Elsäkerhetsverket, n = 88)

Model Overall Acc relevance uncertainty rule_application next_step evidence_sufficiency
Qwen3-1.7B Zero-Shot (cal.) 33.0% — — — — —
swedish-decision-qwen3-1.7b-mlx 38.6% 56.3% 55.6% 11.1% 16.7% 55.6%
swedish-decision-gemma4-e4b-mlx (this model) 61.4% (+22.7pp) 87.5% 66.7% 61.1% 55.6% 38.9%

Decision Models All the Way Down (router/)

This repository ships the full Hierarchical Decision Router in router/:

  • Level 0 (level0_router.pkl): Calibrated task-type decision model trained strictly on combined-with-v1.jsonl (train split) predicting P(task_type | state, instructions, criteria).
  • Level 1 (routing_policy.json): Maps the Level-0 posterior into calibrated mixture weights across SagaEmbed, Qwen3-1.7B, and Gemma 4 E4B.
  • Level 2 (router.py): Lazy-invokes only active specialists and blends their calibrated posteriors.
  • Level 3 (server.py, POST /v1/decide): Applies a calibrated confidence gate (commit vs abstain_escalate for human review) and returns the full routing_trace.

Training Configuration

  • Base model: mlx-community/gemma-4-e4b-it-4bit (Gemma license, 7.46B total / 4B effective parameters)
  • Adapter: LoRA (rank=8, num_layers=16, 6.914M trainable params = 0.093%), fused via mlx_lm fuse
  • Optimizer: Adam, lr=1e-5 (conservative LR is essential for Gemma 4's 256K vocab on single-token supervision; 5e-5 oscillated around val 1.92–2.54), batch_size=1, grad_accumulation_steps=8, max_seq_length=2048, --mask-prompt, --grad-checkpoint
  • Convergence: Validation cross-entropy dropped monotonically from 14.969 → 0.211 at total iteration 250 (216 stratified validation tasks) in ~10 minutes on an Apple M5 (32 GB).
  • Training mix (3,725 train / 216 valid):

Known Limitations

  • Single-token non-thinking inference: While Gemma 4 E4B jumped +9.5pp on rule_application (49.5%) and +50.0pp on unseen-agency rule_application (61.1%), explicit <think> chain-of-thought trained on oracle-verified traces remains the clearest path past 80%+ on symbolic date/numeric rules.
  • Provisional benchmark labels: Holdout labels in swedish-decision-dataset-v1 and swedish-workflow-training-v1 are source-grounded programmatic labels pending independent legal review.
  • Not legal advice: Intended strictly for research, calibration evaluation, and decision-support prototyping — never automated binding administrative rulings.
Downloads last month
-
Safetensors
Model size
7B params
Tensor type
U32
·
BF16
·
MLX
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for RenaissanceLabsEU/swedish-decision-gemma4-e4b-mlx

Adapter
(7)
this model

Datasets used to train RenaissanceLabsEU/swedish-decision-gemma4-e4b-mlx