Text Generation
Safetensors
GGUF
English
phi3
rag
groundedness
hallucination-detection
llm-as-a-judge
micro-cot
first-principles
phi-3.5
conversational
custom_code
Eval Results (legacy)
Instructions to use knss12/Aphelion-Judge-3.8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use knss12/Aphelion-Judge-3.8B with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf knss12/Aphelion-Judge-3.8B:Q4_K_M # Run inference directly in the terminal: llama cli -hf knss12/Aphelion-Judge-3.8B:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf knss12/Aphelion-Judge-3.8B:Q4_K_M # Run inference directly in the terminal: llama cli -hf knss12/Aphelion-Judge-3.8B:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf knss12/Aphelion-Judge-3.8B:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf knss12/Aphelion-Judge-3.8B:Q4_K_M
Use Docker
docker model run hf.co/knss12/Aphelion-Judge-3.8B:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use knss12/Aphelion-Judge-3.8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "knss12/Aphelion-Judge-3.8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "knss12/Aphelion-Judge-3.8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/knss12/Aphelion-Judge-3.8B:Q4_K_M
- Ollama
How to use knss12/Aphelion-Judge-3.8B with Ollama:
ollama run hf.co/knss12/Aphelion-Judge-3.8B:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use knss12/Aphelion-Judge-3.8B with Docker Model Runner:
docker model run hf.co/knss12/Aphelion-Judge-3.8B:Q4_K_M
- Lemonade
How to use knss12/Aphelion-Judge-3.8B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull knss12/Aphelion-Judge-3.8B:Q4_K_M
Run and chat with the model
lemonade run user.Aphelion-Judge-3.8B-Q4_K_M
List all available models
lemonade list
- Atomic Chat
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_MGGUF) - Depth & Width:
32Transformer blocks, hidden dimensiond_model = 3072, SwiGLU MLP intermediate dimension8192 - Attention & Positional Encoding:
32attention heads with LongRoPE (max_position_embeddings = 131,072tokens) and RMSNorm pre-normalization - Adaptation & Merging: Trained via 4-bit NF4 QLoRA (
rank = 16,lora_alpha = 32, targetingqkv_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)
- 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.82Bparameters with native128KLongRoPE context, Aphelion-Judge fits comfortably on single edge/consumer GPUs (or CPU via 4-bit GGUF) while handling long passages at<3slatency. - Why Causal Micro-CoT (
reasonbeforegrounded)? Predicting a boolean token immediately after a long context compresses multi-claim comparison into one forward pass, causing high false-negative rates (0.562OOD F1 in our Direct-JSON baseline). Generating a single-sentence atomic audit (reason) before emittinggroundedgives the model explicit working memory, boosting OOD F1 by +17.9 points (0.562 -> 0.741) while keeping output compact (~40 tokensvs130+ tokensin verbose judges). - Why Baked-In First-Principles System Prompt?
The tokenizer's
chat_templateembeds a strict default system prompt enforcing zero outside knowledge, atomic claim decomposition, and uncertainty-as-ungrounded (false), guaranteeing consistent behavior acrosstransformers,vLLM, andllama.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
- -
Model tree for knss12/Aphelion-Judge-3.8B
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-reported0.741
- OOD F1 (Cascade Fast -> Micro-CoT) on Aphelion OOD RAG Benchmark (test_ood_pure, n=468)self-reported0.744
- Strict JSON Compliance on Aphelion OOD RAG Benchmark (test_ood_pure, n=468)self-reported0.998