Skip to contents

Adversarial-trigger QA prompt (Kamath Eq 3.10)

Usage

morie_kamath_ch3_qa_trigger_template(x, y, T, z_adv, n_triggers = 3)

Arguments

x

Question.

y

Context.

T

Trigger token.

z_adv

Adversarial answer.

n_triggers

Repeats (3 in the book).

Value

List with prompt, tokens, n_triggers.

Examples

morie_kamath_ch3_qa_trigger_template("Where?", "Paris.", "the",
    "Rome")
#> $prompt
#> [1] "Question: Where? Context: Paris. Answer: the the the Rome"
#> 
#> $trigger
#> [1] "the"
#> 
#> $n_triggers
#> [1] 3
#> 
#> $adversarial_answer
#> [1] "Rome"
#> 
#> $tokens
#> [1] "Question:" "Where?"    "Context:"  "Paris."    "Answer:"   "the"      
#> [7] "the"       "the"       "Rome"     
#> 
#> $estimate
#> [1] 9
#> 
#> $n
#> [1] 9
#> 
#> $method
#> [1] "adversarial-trigger QA prompt (Kamath Eq 3.10)"
#>