Improve agent score comprehensibility #3175
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In complex scenarios, it can be quite difficult to understand why agents chose a certain plan over another. We may see the total score at the end, but may not be aware what led to that score. In my opinion, a good understanding about all separate factors in the scoring function is very useful, especially when calibrating or debugging scenarios.
This PR tries to address this by adding a
explainScore(StringBuilder out)
method to the scoring interface. By implementing this method, scoring functions may write out individual components of the scoring process.These score explanations are attached as attributes to a plan if
ScoringConfigGroup.writeScoreExplanations
is enabled.The implementation tries to not cause any overhead if the feature is disabled, in this case no strings are constructed.
In this PR the functionality has been implemented for the default
CharyparNagelScoring
.Scores can be slightly different now at the last significant digits (~10e-15), because the order of floating point operations is now different.
Feedback for the implementation or the idea in general is very welcome.