
Label-word softmax (Kamath Eq 3.2)
Source:R/kamath_llm2_native.R
morie_kamath_ch3_prompt_softmax_label.Rdp(y|x) = exp(w_{M(y)}.h_z) / sum over the LABEL words only.
Examples
morie_kamath_ch3_prompt_softmax_label(list(great = c(1, 0), terrible = c(0,
1)), c(1, 0), list(pos = "great", neg = "terrible"))
#> $estimate
#> [1] 0.7310586
#>
#> $label
#> [1] "pos"
#>
#> $label_probs
#> pos neg
#> 0.7310586 0.2689414
#>
#> $logits
#> pos neg
#> 1 0
#>
#> $n
#> [1] 2
#>
#> $method
#> [1] "label-word softmax (Kamath Eq 3.2)"
#>