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

Flags for varying NIM seed and temperature every call #808

Merged
merged 8 commits into from
Jul 30, 2024

Conversation

leondz
Copy link
Collaborator

@leondz leondz commented Jul 30, 2024

NIMs tend to always give the same response for a given config. This breaks the method of using generations > 1 for stochastic testing. This PR adds two options to make sure the random seed or temperature are varied every call. Not all existing NIMs respect the values in these fields, so the options are both set True by default, to give the best chances of generations > 1 working as expected (i.e. generating multiple potentially different responses).

@leondz leondz requested a review from jmartin-tech July 30, 2024 13:53
Copy link
Collaborator

@jmartin-tech jmartin-tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer initializing seed in __init__ even if set to None as the value would be filtered from create_args before sending with the request.

Using _config.run values as shared state seems prone to issues and has been discussed.

garak/generators/nim.py Outdated Show resolved Hide resolved
garak/generators/openai.py Outdated Show resolved Hide resolved
@leondz leondz requested a review from jmartin-tech July 30, 2024 16:00
Signed-off-by: Jeffrey Martin <[email protected]>
Copy link
Collaborator

@jmartin-tech jmartin-tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor change pushed in 2779ede, another idea is also proposed to defer to Configurable pattern a bit more.

garak/generators/openai.py Outdated Show resolved Hide resolved
@leondz leondz merged commit b6792a4 into main Jul 30, 2024
10 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 30, 2024
@leondz leondz deleted the feature/nim_vary_seed_temp branch August 15, 2024 15:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants