Skip to contents

z_hat = argmax_{z in Z} score(f_fill(x, z)). theta scores the FILLED prompt; argmax is invariant to any monotone map.

Usage

morie_kamath_ch3_prompt_search_argmax(x, z, theta, f_fill = NULL)

Arguments

x

Template.

z

Candidate answers.

theta

Scorer.

f_fill

Optional filler; default substitutes [z], else appends.

Value

List with estimate, z_hat, filled_prompt, scores.

Examples

morie_kamath_ch3_prompt_search_argmax("Paris is [z].", c("great",
    "terrible"), function(s) nchar(s))
#> $estimate
#> [1] 18
#> 
#> $z_hat
#> [1] "terrible"
#> 
#> $filled_prompt
#> [1] "Paris is terrible."
#> 
#> $scores
#>    great terrible 
#>       15       18 
#> 
#> $n
#> [1] 2
#> 
#> $method
#> [1] "argmax answer search over filled prompts (Kamath Eq 3.3)"
#>