gregH commited on
Commit
9c89cde
·
verified ·
1 Parent(s): e46826a

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +32 -32
index.html CHANGED
@@ -192,38 +192,38 @@ gradient norm and then apply soft removal on them to mitigate the potential jail
192
 
193
  <script>
194
 
195
- function selectExample(exampleId) {
196
- const examples = {
197
- example1: "High-level speaking, successful jailbreaks share a common principle that they are trying to make the LLMs willing to affirm the user request which will be rejected at the beginning.",
198
- example2: "Drawing upon this inspiration, our proposed defense aims to find the tokens that are most critical in forcing the LLM to generate such affirmative responses, decrease their importance in the generation, and thereby resolve the potential jailbreak risks brought by these tokens.",
199
- example3: "To identify these tokens, we propose a new concept called the Affirmation Loss. We then use the loss's gradient norm with respect to each token in the user input prompt to find the jailbreak-critical tokens.",
200
- example4: "We select those tokens with the larger gradient norm and then apply soft removal on them to mitigate the potential jailbreak risks."
201
- };
202
-
203
- const exampleText = document.getElementById('exampleText');
204
- exampleText.innerHTML = examples[exampleId];
205
-
206
- // Highlight specific parts of the text
207
- switch (exampleId) {
208
- case 'example1':
209
- highlightText(exampleText, 'successful jailbreaks');
210
- break;
211
- case 'example2':
212
- highlightText(exampleText, 'our proposed defense');
213
- break;
214
- case 'example3':
215
- highlightText(exampleText, 'Affirmation Loss');
216
- break;
217
- case 'example4':
218
- highlightText(example text, 'soft removal');
219
- break;
220
- }
221
- }
222
-
223
- function highlightText(element, keyword) {
224
- const regex = new RegExp(`(${keyword})`, 'gi');
225
- element.innerHTML = element.innerHTML.replace(regex, '<span class="highlight">$1</span>');
226
- }
227
 
228
  </script>
229
 
 
192
 
193
  <script>
194
 
195
+ function selectExample(exampleId) {
196
+ const examples = {
197
+ example1: "High-level speaking, successful jailbreaks share a common principle that they are trying to make the LLMs willing to affirm the user request which will be rejected at the beginning.",
198
+ example2: "Drawing upon this inspiration, our proposed defense aims to find the tokens that are most critical in forcing the LLM to generate such affirmative responses, decrease their importance in the generation, and thereby resolve the potential jailbreak risks brought by these tokens.",
199
+ example3: "To identify these tokens, we propose a new concept called the Affirmation Loss. We then use the loss's gradient norm with respect to each token in the user input prompt to find the jailbreak-critical tokens.",
200
+ example4: "We select those tokens with the larger gradient norm and then apply soft removal on them to mitigate the potential jailbreak risks."
201
+ };
202
+
203
+ const exampleText = document.getElementById('exampleText');
204
+ exampleText.innerHTML = examples[exampleId];
205
+
206
+ // Highlight specific parts of the text
207
+ switch (exampleId) {
208
+ case 'example1':
209
+ highlightText(exampleText, 'successful jailbreaks');
210
+ break;
211
+ case 'example2':
212
+ highlightText(exampleText, 'our proposed defense');
213
+ break;
214
+ case 'example3':
215
+ highlightText(exampleText, 'Affirmation Loss');
216
+ break;
217
+ case 'example4':
218
+ highlightText(example text, 'soft removal');
219
+ break;
220
+ }
221
+ }
222
+
223
+ function highlightText(element, keyword) {
224
+ const regex = new RegExp(`(${keyword})`, 'gi');
225
+ element.innerHTML = element.innerHTML.replace(regex, '<span class="highlight">$1</span>');
226
+ }
227
 
228
  </script>
229