Feature/implement the fuzz tests in robustness#1190
Merged
chakravarthik27 merged 7 commits intorelease/2.7.0from Apr 8, 2025
Merged
Feature/implement the fuzz tests in robustness#1190chakravarthik27 merged 7 commits intorelease/2.7.0from
chakravarthik27 merged 7 commits intorelease/2.7.0from
Conversation
…sks; implement AttackerLLM for adversarial learning in exam questions
…sage handling and reasoning prompt generation
…s; add MedFuzzSample for improved data handling
…d improved response handling
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements fuzz tests for robustness by introducing the MedFuzz feature. Key changes include:
- Refactoring CSV loading in utils.py to download remote files.
- Creating new LLM interaction classes (TargetLLM, AttackerLLM) and a MedFuzz class in clinical.py for processing clinical samples.
- Extending sample data types with HTML highlighting to display differences for MedFuzz samples.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| langtest/transform/utils.py | Refactored load_csv to download files; added TargetLLM and AttackerLLM classes. |
| langtest/transform/clinical.py | Introduced MedFuzz class and integrated LLM interactions for fuzz testing. |
| langtest/utils/custom_types/helpers.py | Added highlight_differences_both function for generating HTML diff highlights. |
| langtest/utils/custom_types/sample.py | Added MedFuzzSample subclass that overrides to_dict to incorporate HTML diff highlighting. |
Comments suppressed due to low confidence (3)
langtest/transform/utils.py:574
- The new CSV downloading mechanism uses requests.get on the 'filepath' variable assuming it is a URL. Consider validating the input or adding error handling to ensure that non-URL file paths are managed appropriately.
# save the csv file into `~/.langtest/` directory
langtest/transform/utils.py:1052
- The error message here is unclear. Consider rephrasing it to clearly indicate the unsupported configuration in the LLM client.
raise TypeError("Unsupported hub and model and Only LLM")
langtest/transform/clinical.py:981
- Slicing the joined expected_results with [:1] might unintentionally truncate the value. Verify that this behavior is intended, or adjust to preserve the full expected result as needed.
med_sample.expected_results = "".join(map(str, med_sample.expected_results))[:1]
…andling in MedFuzz transformation
…for original and perturbed data
Prikshit7766
approved these changes
Apr 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Harness Setup: