feat: Add Language Adaptation Transforms for Cross-Lingual AIRT Probing #285
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.
Add Language Adaptation Transforms for Cross-Lingual AIRT Probing
This PR introduces a comprehensive suite of language adaptation transforms to enable cross-lingual adversarial testing in AIRT workflows. These transforms allow red-teamers to test model robustness across different languages, dialects, and writing systems without relying on external translation APIs.
Key Changes:
Also,
In TAP and other attack workflows, transforms were receiving empty data because:
Solution:
When attack mode is detected (empty dataset + Message candidate), the candidate is injected into the dataset so transforms can access and modify it before it reaches the target model.
Added:
dreadnode/transforms/language.py:examples/airt/tree_of_attacks_with_pruning_transforms.ipynb:Changed:
dreadnode/optimization/study.py:Removed:
Generated Summary:
apply_transformsfunction for clarity and consistency.dreadnode/transforms/language.pywhich includes:adapt_language: A transform for adapting text to a target language with style adjustments.transliterate: Converts Latin script to various writing systems phonetically.code_switch: Mixes multiple languages in a single text.dialectal_variation: Adapts text to specific regional dialects or variations.dreadnode/optimization/study.pyto enhance handling of empty datasets and introduce a check for message types indataset_input_mapping.These changes expand the capabilities of the Dreadnode SDK for multilingual and dialectal text transformations, improving its utility for diverse language applications and security testing scenarios.
This summary was generated with ❤️ by rigging