
In-context learning conditional probability (Kamath Ch 3)
Source:R/kamath_llm2_native.R
morie_kamath_in_context_learning_prob.RdP(y | [ex_1..ex_K, x]) from a caller-supplied LM.
Usage
morie_kamath_in_context_learning_prob(
demonstrations,
query,
model,
answer = NULL,
sep = "\n"
)Examples
morie_kamath_in_context_learning_prob(c("e1", "e2"), "q", function(p,
a) 0.25)
#> $estimate
#> [1] 0.25
#>
#> $probability
#> [1] 0.25
#>
#> $log_prob
#> [1] -1.386294
#>
#> $prompt
#> [1] "e1\ne2\nq"
#>
#> $K
#> [1] 2
#>
#> $n
#> [1] 3
#>
#> $method
#> [1] "In-context learning conditional probability"
#>