
RLAIF Bradley-Terry reward fit (Kamath Ch 5)
Source:R/kamath_llm2_native.R
morie_kamath_rlaif_objective.RdMM iteration for the BT strengths over the AI preference graph; a graph
that is not strongly connected has no finite MLE and is refused. The
pairwise loss comes from morie_kamath_reward_model_training_loss.
Examples
morie_kamath_rlaif_objective(list(c("a", "b"), c("b", "c"), c("c",
"a"), c("a", "c")))
#> $items
#> [1] "a" "b" "c"
#>
#> $strengths
#> [1] 0.4786203 0.3145962 0.2067835
#>
#> $scores
#> [1] -0.7368477 -1.1564653 -1.5760830
#>
#> $loss
#> [1] 0.6419534
#>
#> $accuracy
#> [1] 0.75
#>
#> $n_preferences
#> [1] 4
#>
#> $estimate
#> [1] 0.6419534
#>
#> $n
#> [1] 3
#>
#> $method
#> [1] "RLAIF Bradley-Terry reward fit (loss via kmrmloss)"
#>