Skip to content

Commit 8c0fc14

Browse files
authored
[Evaluation] Default to non-randomized order of template parameters (#38239)
* Default to non-randomized order of template parameters * small changelog update
1 parent 3df9e23 commit 8c0fc14

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

sdk/evaluation/azure-ai-evaluation/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@
1515
- Refined error messages for serviced-based evaluators and simulators.
1616
- Introduced environment variable `AI_EVALS_DISABLE_EXPERIMENTAL_WARNING` to disable the warning message for experimental features.
1717
- Changed the randomization pattern for `AdversarialSimulator` such that there is an almost equal number of Adversarial harm categories (e.g. Hate + Unfairness, Self-Harm, Violence, Sex) represented in the `AdversarialSimulator` outputs. Previously, for 200 `max_simulation_results` a user might see 140 results belonging to the 'Hate + Unfairness' category and 40 results belonging to the 'Self-Harm' category. Now, user will see 50 results for each of Hate + Unfairness, Self-Harm, Violence, and Sex.
18+
- For the `DirectAttackSimulator`, the prompt templates used to generate simulated outputs for each Adversarial harm category will no longer be in a randomized order by default. To override this behavior, pass `randomize_order=True` when you call the `DirectAttackSimulator`, for example:
19+
```python
20+
adversarial_simulator = DirectAttackSimulator(azure_ai_project=azure_ai_project, credential=DefaultAzureCredential())
21+
outputs = asyncio.run(
22+
adversarial_simulator(
23+
scenario=scenario,
24+
target=callback,
25+
randomize_order=True
26+
)
27+
)
28+
```
1829

1930
## 1.0.0b5 (2024-10-28)
2031

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/simulator/_direct_attack_simulator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ async def __call__(
190190
api_call_retry_sleep_sec=api_call_retry_sleep_sec,
191191
api_call_delay_sec=api_call_delay_sec,
192192
concurrent_async_task=concurrent_async_task,
193-
randomize_order=True,
193+
randomize_order=False,
194194
randomization_seed=randomization_seed,
195195
)
196196
jb_sim = AdversarialSimulator(azure_ai_project=cast(dict, self.azure_ai_project), credential=self.credential)
@@ -204,7 +204,7 @@ async def __call__(
204204
api_call_delay_sec=api_call_delay_sec,
205205
concurrent_async_task=concurrent_async_task,
206206
_jailbreak_type="upia",
207-
randomize_order=True,
207+
randomize_order=False,
208208
randomization_seed=randomization_seed,
209209
)
210210
return {"jailbreak": jb_sim_results, "regular": regular_sim_results}

0 commit comments

Comments
 (0)