guidance-ai / guidance

A guidance language for controlling large language models.
MIT License
18.16k stars 1.01k forks source link

Enhancing Decision-Making with Confidence Scores for Select Function Outputs #622

Open SimoneRaponi opened 5 months ago

SimoneRaponi commented 5 months ago

I want to start by expressing my sincere appreciation for this project. It has been instrumental in advancing my experiments, and I am genuinely grateful for the work you've put into developing such a powerful tool.

As I've integrated guidance into my workflows, I've encountered a scenario where an enhancement could significantly augment its utility, specifically regarding the select function and the associated confidence in its outputs.

Current Limitation

When utilizing the select function to present the model with multiple choices (e.g., "Which one do you think is more appropriate? A, B, C, None of the above"), the model invariably selects one of the provided options with a default confidence score of 1. This behavior implies a certainty that may not always align with the model's actual predictive confidence, especially in scenarios where the most accurate answer might be "None of the above." The current mechanism does not accommodate the expression of uncertainty or the preference for an option outside the provided list.

Proposed Feature

I propose the introduction of a feature that provides confidence scores for the outputs generated by the select function. This enhancement would not only indicate the model's chosen option but also reflect how confident it is in that selection. Such a feature would be invaluable for cases where the correct answer might not be explicitly listed among the options, enabling the model to suggest "None of the above" with a corresponding confidence level.

Benefits

shawnz commented 4 months ago

related to #590 ?