
Input-alignment text-generation objective (Kamath Eq 9.2)
Source:R/kamath_llm2_native.R
morie_kamath_ch9_input_alignment_loss.RdL_txt-gen(LLM(P_X, F_T), t), minimised over the prompt candidates.
argmin is 0-BASED.
Examples
morie_kamath_ch9_input_alignment_loss(list(matrix(c(1, 2), 1),
matrix(0, 1, 2)), "ft", "t", llm = function(p, f) sum(p),
loss_fn = function(pr, t) abs(pr - 1))
#> $estimate
#> [1] 1
#>
#> $argmin
#> [1] 1
#>
#> $losses
#> [1] 2 1
#>
#> $n_candidates
#> [1] 2
#>
#> $n
#> [1] 2
#>
#> $method
#> [1] "input-alignment text-generation objective (Kamath Eq 9.2)"
#>