
Preference-based reward learning (Kamath Ch 5)
Source:R/kamath_llm2_native.R
morie_kamath_christiano_deep_rl_feedback.RdScores trajectory segment pairs with r_phi and hands the Bradley-Terry
loss to morie_alammar_reward_model_bt.
Examples
morie_kamath_christiano_deep_rl_feedback(list(c("w1", "l1"),
c("w2", "l2")), function(s) if (startsWith(s, "w")) 2 else 0.5)
#> $estimate
#> [1] 0.4028266
#>
#> $mean_loss
#> [1] 0.2014133
#>
#> $losses
#> [1] 0.2014133 0.2014133
#>
#> $pair_accuracy
#> [1] 1
#>
#> $returns_preferred
#> [1] 2 2
#>
#> $returns_rejected
#> [1] 0.5 0.5
#>
#> $n
#> [1] 2
#>
#> $method
#> [1] "preference-based reward learning (Kamath Ch 5)"
#>