Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve agent score comprehensibility #3175

Merged
merged 15 commits into from
Jun 25, 2024
Merged

Improve agent score comprehensibility #3175

merged 15 commits into from
Jun 25, 2024

Conversation

rakow
Copy link
Contributor

@rakow rakow commented Mar 18, 2024

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.

@jfbischoff
Copy link
Collaborator

I think this would be totally appropriate to merge, anything against it @rakow ?

@rakow
Copy link
Contributor Author

rakow commented Jun 25, 2024

No, I think it would be great to merge if others can make use of it as well. Just be aware, scores change, so very restrictive tests might fail now.

@jfbischoff
Copy link
Collaborator

Oh, indeed - now it's failing :-D

@rakow
Copy link
Contributor Author

rakow commented Jun 25, 2024

Locally it worked fine, I restarted the test on GitHub and now it just works. The test did not seem related to the changes, but still very strange behavior.

@jfbischoff jfbischoff merged commit 12335a8 into master Jun 25, 2024
49 checks passed
@jfbischoff jfbischoff deleted the score-explanation branch June 25, 2024 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants