
Answer search over filled prompts (Kamath Eq 3.3)
Source:R/kamath_llm2_native.R
morie_kamath_ch3_prompt_search_argmax.Rdz_hat = argmax_{z in Z} score(f_fill(x, z)). theta scores the FILLED
prompt; argmax is invariant to any monotone map.
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)"
#>