Divyamshah/llm-reliability-evaluation
LLM Reliability Evaluation Framework
A confidence-calibrated decision gating system that evaluates whether an AI should:
Respond
Ask for clarification
Defer
Remain silent
before invoking an LLM.
๐ What This Project Does
Instead of blindly generating responses, this system first decides:
Should the AI act at all?
It uses semantic embeddings + a trained classifier to output:
Decision
Confidence score
Decision margin
Risk category
๐ System Architecture
Pipeline:
User Input โ SentenceTransformer Embedding (MiniLM-L6-v2) โ 3-layer PyTorch classifier โ Softmax confidence + margin โ Calibration logic โ Final decision
๐ Output Signals
Confidence โ Probability of predicted class
Decision Margin โ Gap between top-2 probabilities
Risk Category โ trusted / ambiguous / high_risk / noise
๐ง Calibration Logic
Rules applied on top of raw model prediction:
Low confidence โ silent
Low margin โ ask_clarify
Empty input โ silent
High confidence + strong margin โ trusted
This ensures controlled AI behavior.
๐ Deployment
Built with PyTorch + SentenceTransformers
Deployed on Hugging Face Spaces (Gradio UI)
Fully interactive reliability evaluation
๐ฏ Why It Matters
Most AI demos generate text.
This project measures and controls when generation should happen.
Focus: โ Reliability โ Confidence gating โ Safe AI activation โ Deployable evaluation system
