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

probe: topic pushing #764

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open

probe: topic pushing #764

wants to merge 40 commits into from

Conversation

leondz
Copy link
Owner

@leondz leondz commented Jun 28, 2024

Add wordnet-based topic search probe. It takes a target term by config, and traverses Open English Wordnet nodes to find which terms adjacent to or below (i.e. more specific) in the hierarchy, the model will respond to.

@leondz leondz added the probes Content & activity of LLM probes label Jun 28, 2024
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.

This looks reasonable, I think there are some actions here that suggest some day there could be a built in mechanism to allow follow on prompts to be run by the original probe as a post detector hook.

Will do some more interactive testing to make sure I am understanding what the resulting set to Attempts really looks like and how those results should be interpreted.

garak/probes/topic.py Outdated Show resolved Hide resolved
garak/probes/topic.py Outdated Show resolved Hide resolved
garak/probes/topic.py Outdated Show resolved Hide resolved
garak/probes/topic.py Outdated Show resolved Hide resolved
garak/probes/topic.py Outdated Show resolved Hide resolved
garak/probes/topic.py Outdated Show resolved Hide resolved
garak/probes/topic.py Outdated Show resolved Hide resolved
logging.debug(
f"{self.__class__.__name__} {current_synset}, {current_synset.words()}"
)
for word in current_synset.words():
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see building the list of prompts dynamically as saving runtime memory, how big are these iterations in practice?

Copy link
Owner Author

@leondz leondz Jun 29, 2024

Choose a reason for hiding this comment

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

Typically <10, not infrequently 1-2.

This means ~2 * len(TEMPLATES) * words attempts per node

garak/probes/topic.py Outdated Show resolved Hide resolved
garak/probes/topic.py Show resolved Hide resolved
@leondz leondz marked this pull request as ready for review July 1, 2024 13:42
@leondz leondz requested a review from erickgalinkin July 2, 2024 18:43
Comment on lines +92 to +93
wn.download(self.lexicon)
self.w = wn.Wordnet(self.lexicon)
Copy link
Collaborator

@jmartin-tech jmartin-tech Jul 23, 2024

Choose a reason for hiding this comment

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

Could this use wn via nltk as is done in TAP? If possible it would be helpful if nltk access to could consolidated into a resources/common component. Some coordination with user storage refactor are likely in order to ensure these all store the datasets in the same place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
probes Content & activity of LLM probes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants