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

Generator streamlining, docs #682

Merged
merged 4 commits into from
May 27, 2024
Merged

Generator streamlining, docs #682

merged 4 commits into from
May 27, 2024

Conversation

leondz
Copy link
Collaborator

@leondz leondz commented May 14, 2024

Added generator docs

Made streamlining changes to generators.base.Generator logic

Resolves #662

leondz added 3 commits May 14, 2024 11:55
…nerate() return would/would not be filtered for None that was predicated on whether a model supported multiple outputs
@leondz leondz added documentation Improvements or additions to documentation generators Interfaces with LLMs labels May 14, 2024
@leondz leondz requested a review from jmartin-tech May 14, 2024 09:58
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.

👍

My question may already be answered somewhere, it does not change that current expectations are as documented.

#. Otherwise, we need to assemble the outputs over multiple calls. There are two options here.
#. Is garak running with ``parallel_attempts > 1`` configured? In that case, start a multiprocessing pool with as many workers as the value of ``parallel_attempts``, and have each one of these work on building the required number of generations, in any order.
#. Otherwise, call ``_call_model()`` repeatedly to collect the requested number of generations.
#. Strip ``None`` responses from the outputs, and return the resulting list of prompt responses.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is the current practice, however I am interested in the reasoning for this. Is there value in knowing that call returned None, in theory we can determine this happened from inspection of configuration, however I wonder if a None response might be valuable in some probes patterns. Consider if a model is setup to mitigate certain responses by simply closing the connection. In practice this is not a good pattern as a 200 response with a rejection is the common response, yet I can akin it to the idea that if you call someone to ask a question they might simply hang up the phone.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was a great time to ask this question. None is intended to indicate that generation failed, so would definitely be good for the situation you mention. Perhaps then generate() should not filter out Nones at all. But also - perhaps when a model fails when given a blank prompt, it should return None, instead of exception handling and a string. I think that we're in a better place if any str-typed output from a generator is an indication that the model successfully output a string, and that this output is the string component of the output. Wdyt?

cf.: #689 (comment)

@leondz leondz merged commit b4c8c81 into main May 27, 2024
3 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 27, 2024
@leondz leondz deleted the docs/generator branch May 29, 2024 07:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation generators Interfaces with LLMs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

documentation: generation process
2 participants