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).
microsoft/Phi-3.5-mini-instruct)3,821,079,552 (~3.82B, FP16 Safetensors + Q4_K_M GGUF)32 Transformer blocks, hidden dimension d_model = 3072, SwiGLU MLP intermediate dimension 819232 attention heads with LongRoPE (max_position_embeddings = 131,072 tokens) and RMSNorm pre-normalizationrank = 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.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.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).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.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 |
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)
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
Training splits, QLoRA adapters, and cascade evaluation logs are archived at knss12/aphelion-judge.