Skip to content

Removed detector prefix from eval records#1157

Merged
jmartin-tech merged 4 commits intoNVIDIA:mainfrom
mrowebot:feature/1128-remove-detector-prefix
Apr 18, 2025
Merged

Removed detector prefix from eval records#1157
jmartin-tech merged 4 commits intoNVIDIA:mainfrom
mrowebot:feature/1128-remove-detector-prefix

Conversation

@mrowebot
Copy link
Contributor

@mrowebot mrowebot commented Apr 14, 2025

This PR fixes #1128.

Changed

  • base.Evaluator to not add the detector. prefix to the detector value in the evaluation records written to the _config.transient.reportfile jsonl.

Added

  • Unit test case to validate that the serialised *.report.jsonl file does not contain the detector. prefix.
  • mitigation_outputs fixture to conftests module as this is shared by two unit test modules.

Fixed

  • probes.latentinjection module to have default generations param: unit tests were failing for me without this.

Verification

  • Run the tests and ensure they pass python -m pytest tests/
  • Run an arbitrary probe and check the resultant log file to ensure that the evaluation entries' detectors do not have the detector. prefix. E.g. the CMD:
python3 -m garak --model_type huggingface --model_name gpt2 --probes dan.Dan_11_0

should have the following entries in the produced /Users/*/.local/share/garak/garak_runs/garak.*report.jsonl:

...
{"entry_type": "eval", "probe": "dan.Dan_11_0", "detector": "dan.DAN", "passed": 2, "total": 5}
{"entry_type": "eval", "probe": "dan.Dan_11_0", "detector": "mitigation.MitigationBypass", "passed": 0, "total": 5}
...

@github-actions
Copy link
Contributor

github-actions bot commented Apr 14, 2025

DCO Assistant Lite bot All contributors have signed the DCO ✍️ ✅

@mrowebot
Copy link
Contributor Author

I have read the DCO Document and I hereby sign the DCO

@mrowebot
Copy link
Contributor Author

recheck

github-actions bot added a commit that referenced this pull request Apr 14, 2025
@leondz leondz requested a review from jmartin-tech April 15, 2025 04:49
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.

I welcome the consistency improvement here, just one required change I can address while landing to remove the excess fixture exectutions.

Noting example for change this PR makes.

Old:

{
  "entry_type": "eval",
  "probe": "av_spam_scanning.GTphish",
  "detector": "detector.knownbadsignatures.GTphish",
  "passed": 15,
  "total": 25
}

New:

{
  "entry_type": "eval",
  "probe": "av_spam_scanning.GTphish",
  "detector": "knownbadsignatures.GTphish",
  "passed": 15,
  "total": 25
}

@jmartin-tech jmartin-tech self-assigned this Apr 15, 2025
@jmartin-tech jmartin-tech dismissed their stale review April 17, 2025 12:46

Updates completed

@jmartin-tech jmartin-tech merged commit e358045 into NVIDIA:main Apr 18, 2025
9 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 18, 2025
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.

update: remove detector. prefix in report eval entry detector record values

2 participants