A confidence score is an additional prediction field that expresses how certain a model is about its answer. In DSPy, add `confidence` to the signature; fields default to strings, but a type annotation can request a numeric value. section 2.5.1
"question -> answer, confidence: float"
Use a float annotation when the confidence output should be numeric. section 2.5.1
Requesting confidence
For “What is the capital of France?”, a prediction can return Paris with confidence 1.0, indicating complete confidence. section 2.5.1
Confidence can also affect evaluation scores: reward higher confidence on correct predictions and penalize high confidence on incorrect ones. If ideal confidence is known for an example, compare the prediction with that target; an ambiguous intent might have an ideal confidence of about 80%. section 4.2.1












