Aphelion-Judge-3.8B

Aphelion-Judge-3.8B (3,821,079,552 parameters) is a specialized, first-principles RAG groundedness and hallucination verification model. Fine-tuned from microsoft/Phi-3.5-mini-instruct using Micro-Chain-of-Thought (Micro-CoT) supervision, it audits AI-generated responses strictly against retrieved Context documents and outputs a deterministic JSON verdict (reason + grounded).


Architecture & First-Principles Design Rationale

1. Model Architecture Specifications

  • Backbone: Dense Decoder-Only Causal Transformer (microsoft/Phi-3.5-mini-instruct)
  • Total Parameters: 3,821,079,552 (~3.82B, FP16 Safetensors + Q4_K_M GGUF)
  • Depth & Width: 32 Transformer blocks, hidden dimension d_model = 3072, SwiGLU MLP intermediate dimension 8192
  • Attention & Positional Encoding: 32 attention heads with LongRoPE (max_position_embeddings = 131,072 tokens) and RMSNorm pre-normalization
  • Adaptation & Merging: Trained via 4-bit NF4 QLoRA (rank = 16, lora_alpha = 32, targeting qkv_proj, o_proj, gate_up_proj, down_proj) and mathematically merged (W_merged = W_0 + (alpha / r) * B @ A) into standalone FP16 weights.

2. Why This Architecture? (First-Principles Rationale)

  1. Why Dense 3.8B + LongRoPE over 7B–70B Judges? RAG verification is a closed-book contextual entailment task, not an open-domain world-knowledge recall task. Massive 70B models waste compute storing encyclopedic facts that must actually be suppressed during RAG auditing. At 3.82B parameters with native 128K LongRoPE context, Aphelion-Judge fits comfortably on single edge/consumer GPUs (or CPU via 4-bit GGUF) while handling long passages at <3s latency.
  2. Why Causal Micro-CoT (reason before grounded)? Predicting a boolean token immediately after a long context compresses multi-claim comparison into one forward pass, causing high false-negative rates (0.562 OOD F1 in our Direct-JSON baseline). Generating a single-sentence atomic audit (reason) before emitting grounded gives the model explicit working memory, boosting OOD F1 by +17.9 points (0.562 -> 0.741) while keeping output compact (~40 tokens vs 130+ tokens in verbose judges).
  3. Why Baked-In First-Principles System Prompt? The tokenizer's chat_template embeds a strict default system prompt enforcing zero outside knowledge, atomic claim decomposition, and uncertainty-as-ungrounded (false), guaranteeing consistent behavior across transformers, vLLM, and llama.cpp.

Out-of-Distribution Benchmark (test_ood_pure, n=468)

Model / Variant Params Strict JSON OOD F1 (FAIL) Precision Recall Avg Output Tokens Latency p50
Phi-3.5-mini Zero-Shot 3.82B 0.00% 0.652 — — — 1,740.0 ms
Flow-Judge-v0.1 3.82B — 0.752 — — ~130+ 5,858.0 ms
Exp-01: Direct-JSON Baseline 3.82B 96.37% 0.562 0.872 0.415 7.33 645.6 ms
Aphelion-Judge-3.8B (Micro-CoT) 3.82B 99.79% 0.741 0.752 0.731 40.31 2,753.3 ms
Cascade (Exp-01 -> Aphelion-Judge) 3.82B 99.79% 0.744 0.749 0.740 36.53 3,435.8 ms

Quickstart

1. Python (transformers)

import json
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "knss12/Aphelion-Judge-3.8B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.float16,
    device_map="auto",
)

prompt = (
    "Context:\nApple reported $23,646 million in cash and cash equivalents as of September 2023.\n\n"
    "Question:\nHow much cash did Apple report?\n\n"
    "Response:\nApple reported $50 billion in cash reserves."
)

inputs = tokenizer.apply_chat_template(
    [{"role": "user", "content": prompt}],
    tokenize=True,
    add_generation_prompt=True,
    return_tensors="pt",
).to(model.device)

with torch.inference_mode():
    output_ids = model.generate(inputs)

verdict_raw = tokenizer.decode(output_ids[0][inputs.shape[-1]:], skip_special_tokens=True).strip()
verdict = json.loads(verdict_raw)
print(verdict)

2. Local Deployment (Ollama / llama.cpp Q4_K_M)

huggingface-cli download knss12/Aphelion-Judge-3.8B --include "gguf/*" --local-dir .
ollama create aphelion-judge -f gguf/Modelfile

Experimental Archive

Training splits, QLoRA adapters, and cascade evaluation logs are archived at knss12/aphelion-judge.

Downloads last month
-
Safetensors
Model size
4B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 1 Ask for provider support

Model tree for knss12/Aphelion-Judge-3.8B

Quantized
(206)
this model
Quantizations
1 model

Space using knss12/Aphelion-Judge-3.8B 1

Evaluation results

  • OOD F1 (Micro-CoT Solo) on Aphelion OOD RAG Benchmark (test_ood_pure, n=468)
    self-reported
    0.741
  • OOD F1 (Cascade Fast -> Micro-CoT) on Aphelion OOD RAG Benchmark (test_ood_pure, n=468)
    self-reported
    0.744
  • Strict JSON Compliance on Aphelion OOD RAG Benchmark (test_ood_pure, n=468)
    self-reported
    0.998