Skip to content

Conversation

@rabah-khalek
Copy link
Contributor

@rabah-khalek rabah-khalek commented Nov 10, 2023

@linear
Copy link

linear bot commented Nov 10, 2023

GSK-2035 Complete refactoring of prompt injection detector

  • removing PromptInject library
  • concatenate all injection prompts in a dataset
  • refactor the evaluator, dataset generator, etc.

@rabah-khalek rabah-khalek self-assigned this Nov 10, 2023
@rabah-khalek rabah-khalek marked this pull request as draft November 11, 2023 16:46
@rabah-khalek rabah-khalek requested a review from mattbit November 15, 2023 16:02
@rabah-khalek rabah-khalek marked this pull request as ready for review November 15, 2023 16:02
Copy link
Member

@mattbit mattbit left a comment

Choose a reason for hiding this comment

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

I would rethink a bit the structure to reduce complexity. It is not strictly needed to use the "generator" structure, I feel something simpler and customized could work better in this case. But open to discussion on this.

@rabah-khalek
Copy link
Contributor Author

For the verification, I've ran this notebook with gpt-3.5-turbo.

this is what I get:

results = scan(giskard_model, giskard_dataset, only=["jailbreak"])
Screenshot 2023-12-06 at 13 39 00
test_suite = results.generate_test_suite("Test suite generated by scan")
test_suite.run()
Screenshot 2023-12-06 at 13 39 15

The display of the test_suite is not optimal, as it displays all the list of evaluator configs, but we should solve this in a different PR

@kevinmessiaen kevinmessiaen requested a review from mattbit December 8, 2023 14:09
@kevinmessiaen kevinmessiaen marked this pull request as draft December 8, 2023 14:12
@rabah-khalek rabah-khalek marked this pull request as ready for review December 13, 2023 16:01
Copy link
Member

@mattbit mattbit left a comment

Choose a reason for hiding this comment

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

Last round @rabah-khalek

@rabah-khalek rabah-khalek requested a review from mattbit December 20, 2023 13:13
@sonarqubecloud
Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

2 New issues
0 Security Hotspots
84.6% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Member

@mattbit mattbit left a comment

Choose a reason for hiding this comment

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

Looks good, I just need to do some QA locally.

def data_loader(self):
if self._data_loader is None:
self._data_loader = PromptInjectionDataLoader(num_samples=self.num_samples)
return self._data_loader
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: last line inside the if is not needed

@mattbit mattbit merged commit 858c3c1 into main Dec 22, 2023
@mattbit mattbit deleted the gsk-2035-refac branch December 22, 2023 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants