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97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
1
00:00:00,840 --> 00:00:05,920
okay so uh let's get started um today

2
00:00:04,200 --> 00:00:08,000
I'm going to be talking about learning

3
00:00:05,920 --> 00:00:09,480
from Human feedback I wrote

4
00:00:08,000 --> 00:00:12,160
reinforcement learning from Human

5
00:00:09,480 --> 00:00:14,519
feedback because that's what um you know

6
00:00:12,160 --> 00:00:15,759
a lot of people talk about nowadays but

7
00:00:14,519 --> 00:00:18,880
actually there's other methods of

8
00:00:15,759 --> 00:00:21,840
learning from Human feedback so first

9
00:00:18,880 --> 00:00:24,760
I'm going to be talking about the ways

10
00:00:21,840 --> 00:00:27,920
we can get uh human feedback for the

11
00:00:24,760 --> 00:00:31,039
generations of models and mostly focus

12
00:00:27,920 --> 00:00:32,960
on generation tasks because is um

13
00:00:31,039 --> 00:00:35,800
generation tasks are harder than like

14
00:00:32,960 --> 00:00:38,559
classification tasks that we uh we deal

15
00:00:35,800 --> 00:00:40,000
with normally so I'll spend a fair

16
00:00:38,559 --> 00:00:42,239
amount of time talking about how we do

17
00:00:40,000 --> 00:00:45,760
that and then after I talk about how we

18
00:00:42,239 --> 00:00:48,360
do that we'll move into um how we

19
00:00:45,760 --> 00:00:51,160
actually learn from that

20
00:00:48,360 --> 00:00:53,399
signal so normally what we've done up

21
00:00:51,160 --> 00:00:56,399
until this point is maximum likelihood

22
00:00:53,399 --> 00:00:58,199
training uh this is just an overview

23
00:00:56,399 --> 00:00:59,559
slide so we what we want to do is we

24
00:00:58,199 --> 00:01:00,760
want to maximize the likelihood of

25
00:00:59,559 --> 00:01:03,280
predicting the next word and the

26
00:01:00,760 --> 00:01:05,960
reference given the previous words uh

27
00:01:03,280 --> 00:01:08,119
which gives us the loss of the output

28
00:01:05,960 --> 00:01:09,799
given the input uh where you know the

29
00:01:08,119 --> 00:01:13,960
input can be the prompt the output can

30
00:01:09,799 --> 00:01:16,080
be the answer to uh the output but

31
00:01:13,960 --> 00:01:18,360
there's uh lots of problems with

32
00:01:16,080 --> 00:01:20,439
learning from Maximum likelihood and I'm

33
00:01:18,360 --> 00:01:22,079
going to give three examples here I

34
00:01:20,439 --> 00:01:24,159
think all of these are actually real

35
00:01:22,079 --> 00:01:26,880
problems uh that we need to be worried

36
00:01:24,159 --> 00:01:30,240
about so the first one is that some

37
00:01:26,880 --> 00:01:32,439
mistakes are worse than others so um in

38
00:01:30,240 --> 00:01:33,560
the end we want good outputs and some

39
00:01:32,439 --> 00:01:36,520
mistaken

40
00:01:33,560 --> 00:01:38,200
predictions uh can be a bigger problem

41
00:01:36,520 --> 00:01:42,680
for the output being

42
00:01:38,200 --> 00:01:46,000
good so to give an example uh let's say

43
00:01:42,680 --> 00:01:47,600
what we actually wanted from like a

44
00:01:46,000 --> 00:01:49,320
speech recognition system or a

45
00:01:47,600 --> 00:01:54,040
translation system or something like

46
00:01:49,320 --> 00:01:54,040
that is uh please send this package to

47
00:01:54,280 --> 00:01:58,920
Pittsburgh if I write please send a

48
00:01:56,880 --> 00:02:01,560
package to Pittsburgh then this is not a

49
00:01:58,920 --> 00:02:03,560
huge problem

50
00:02:01,560 --> 00:02:06,479
if I write uh please send this package

51
00:02:03,560 --> 00:02:07,719
to Tokyo then that might be a big

52
00:02:06,479 --> 00:02:09,640
problem because the package you wanted

53
00:02:07,719 --> 00:02:12,760
to come to Pittsburgh goes to Tokyo

54
00:02:09,640 --> 00:02:13,680
instead and uh you might not want that

55
00:02:12,760 --> 00:02:16,080
to

56
00:02:13,680 --> 00:02:18,000
happen you might also have it say

57
00:02:16,080 --> 00:02:20,400
bleeping send this package to Pittsburgh

58
00:02:18,000 --> 00:02:22,200
instead of pleas um and that would be a

59
00:02:20,400 --> 00:02:24,200
problem in a customer service system

60
00:02:22,200 --> 00:02:28,400
right because your customer would uh

61
00:02:24,200 --> 00:02:28,400
leave and never come back

62
00:02:28,840 --> 00:02:32,040
so

63
00:02:30,360 --> 00:02:33,720
determiner like this is not going to

64
00:02:32,040 --> 00:02:35,640
cause a huge issue U messing up other

65
00:02:33,720 --> 00:02:37,519
things is going to cause a larger

66
00:02:35,640 --> 00:02:39,519
issue but from the point of view of

67
00:02:37,519 --> 00:02:42,680
Maximum likelihood all of these are just

68
00:02:39,519 --> 00:02:44,560
tokens and messing up one token is the

69
00:02:42,680 --> 00:02:47,519
same as messing up another token so

70
00:02:44,560 --> 00:02:50,040
that's uh you know an

71
00:02:47,519 --> 00:02:52,080
issue another problem is that the gold

72
00:02:50,040 --> 00:02:54,640
standard and maximum likelihood

73
00:02:52,080 --> 00:02:57,480
estimation can be bad it can be like not

74
00:02:54,640 --> 00:02:59,239
what you want and uh corpa are full of

75
00:02:57,480 --> 00:03:02,400
outputs that we wouldn't want a language

76
00:02:59,239 --> 00:03:05,400
model producing so for example uh toxic

77
00:03:02,400 --> 00:03:07,799
comments on Reddit uh

78
00:03:05,400 --> 00:03:09,959
disinformation um another thing that a

79
00:03:07,799 --> 00:03:13,000
lot of people don't think about uh quite

80
00:03:09,959 --> 00:03:15,640
as much is a lot of the data online is

81
00:03:13,000 --> 00:03:17,680
uh from is automatically generated

82
00:03:15,640 --> 00:03:19,720
nowadays for example from machine

83
00:03:17,680 --> 00:03:24,080
translation a lot of the translations

84
00:03:19,720 --> 00:03:25,720
online are from uh 2016 Google translate

85
00:03:24,080 --> 00:03:27,560
uh when Google translate was a lot less

86
00:03:25,720 --> 00:03:29,120
good than it is now and so you have like

87
00:03:27,560 --> 00:03:31,760
poor quality translations that were

88
00:03:29,120 --> 00:03:31,760
automatically

89
00:03:33,040 --> 00:03:37,959
a final problem is uh something that's

90
00:03:35,280 --> 00:03:40,360
called exposure bias and exposure bias

91
00:03:37,959 --> 00:03:44,000
basically what it means is mle training

92
00:03:40,360 --> 00:03:46,000
doesn't consider um the necessarity the

93
00:03:44,000 --> 00:03:48,599
necessity for generation and it relies

94
00:03:46,000 --> 00:03:51,360
on gold standard context so if we go

95
00:03:48,599 --> 00:03:54,159
back to the mle equation when we're

96
00:03:51,360 --> 00:03:57,200
calculating mle this y less than T is

97
00:03:54,159 --> 00:03:59,200
always correct it's always a good output

98
00:03:57,200 --> 00:04:01,439
and so what the model does is it learns

99
00:03:59,200 --> 00:04:04,280
to over rely on good

100
00:04:01,439 --> 00:04:06,079
outputs and one example of a problem

101
00:04:04,280 --> 00:04:08,360
that this causes is models tend to

102
00:04:06,079 --> 00:04:10,560
repeat themselves over and over again

103
00:04:08,360 --> 00:04:12,319
for example um when you use some

104
00:04:10,560 --> 00:04:15,079
generation algorithms and the reason why

105
00:04:12,319 --> 00:04:18,519
this happens is because in a gold

106
00:04:15,079 --> 00:04:22,079
standard output if a word has appeared

107
00:04:18,519 --> 00:04:25,840
previously that word is more likely to

108
00:04:22,079 --> 00:04:28,560
happen next so like if you say um like I

109
00:04:25,840 --> 00:04:29,759
am going um I am going to Pittsburgh

110
00:04:28,560 --> 00:04:31,880
you're much more likely to say

111
00:04:29,759 --> 00:04:33,000
Pittsburgh again in the future because

112
00:04:31,880 --> 00:04:35,720
you're talking about Pittsburgh

113
00:04:33,000 --> 00:04:37,400
topically as coherent so what you get is

114
00:04:35,720 --> 00:04:38,639
you get mle trained models saying I'm

115
00:04:37,400 --> 00:04:40,160
going to Pittsburgh I am going to

116
00:04:38,639 --> 00:04:41,680
Pittsburgh I am going to Pittsburgh I

117
00:04:40,160 --> 00:04:45,280
going to Pittsburgh you've probably seen

118
00:04:41,680 --> 00:04:47,320
this before uh at some point and so um

119
00:04:45,280 --> 00:04:49,320
exposure bias is basically that the

120
00:04:47,320 --> 00:04:51,039
model has never been exposed to mistakes

121
00:04:49,320 --> 00:04:55,240
in the past and so it can't deal with

122
00:04:51,039 --> 00:04:56,840
them so what this does is um if you have

123
00:04:55,240 --> 00:04:58,560
an alternative training algorithm you

124
00:04:56,840 --> 00:05:02,120
can fix this by generating a whole bunch

125
00:04:58,560 --> 00:05:04,880
of outputs uh down like scoring some of

126
00:05:02,120 --> 00:05:06,880
them poorly and penalizing the model for

127
00:05:04,880 --> 00:05:09,960
uh generating po outputs and so that can

128
00:05:06,880 --> 00:05:09,960
fix these problems as

129
00:05:10,800 --> 00:05:18,440
well uh any questions about this all

130
00:05:15,199 --> 00:05:20,800
good Okay cool so now I'd like to get

131
00:05:18,440 --> 00:05:23,919
into how we measure how good an output

132
00:05:20,800 --> 00:05:26,360
is and there's different ways of doing

133
00:05:23,919 --> 00:05:30,319
this um the first one is objective

134
00:05:26,360 --> 00:05:32,680
assessment so for some uh tasks or for

135
00:05:30,319 --> 00:05:35,400
many tasks there's kind of objectively a

136
00:05:32,680 --> 00:05:37,280
correct answer there's also human

137
00:05:35,400 --> 00:05:40,360
subjective annotations so you can ask

138
00:05:37,280 --> 00:05:42,919
humans to do annotation for you there's

139
00:05:40,360 --> 00:05:45,400
machine prediction of human

140
00:05:42,919 --> 00:05:48,319
preferences and there's also use in

141
00:05:45,400 --> 00:05:50,840
another system in a downstream

142
00:05:48,319 --> 00:05:52,960
task so the way objective assessment

143
00:05:50,840 --> 00:05:54,919
works is you have an annotated correct

144
00:05:52,960 --> 00:05:57,080
answer in match against this so like if

145
00:05:54,919 --> 00:06:00,600
you're solving math problems uh

146
00:05:57,080 --> 00:06:02,560
answering objective questions and and

147
00:06:00,600 --> 00:06:04,280
you know you can pick any arbitrary

148
00:06:02,560 --> 00:06:06,840
example you can pick your classification

149
00:06:04,280 --> 00:06:09,800
example from uh like your text

150
00:06:06,840 --> 00:06:11,880
classification tasks an even clearer

151
00:06:09,800 --> 00:06:13,880
example is if you have math problems

152
00:06:11,880 --> 00:06:15,639
there's kind of objectively one answer

153
00:06:13,880 --> 00:06:18,080
to any math problem and there's no other

154
00:06:15,639 --> 00:06:19,680
answer that could be correct so this

155
00:06:18,080 --> 00:06:21,160
makes your life easy if you're handling

156
00:06:19,680 --> 00:06:22,560
this type of problem but of course

157
00:06:21,160 --> 00:06:24,120
there's many other types of problems we

158
00:06:22,560 --> 00:06:26,039
want to handle that don't have objective

159
00:06:24,120 --> 00:06:29,039
answers like

160
00:06:26,039 --> 00:06:31,440
this so let's say we're handling a gener

161
00:06:29,039 --> 00:06:34,680
a generation task where we don't have an

162
00:06:31,440 --> 00:06:36,360
objective answer um in this Cas kind of

163
00:06:34,680 --> 00:06:39,440
one of our gold standards is human

164
00:06:36,360 --> 00:06:42,360
evaluation so we might have a source

165
00:06:39,440 --> 00:06:44,919
input like a prompt or an input text for

166
00:06:42,360 --> 00:06:47,240
machine translation we have one or

167
00:06:44,919 --> 00:06:49,960
several hypotheses and we ask a human

168
00:06:47,240 --> 00:06:53,280
annotator to basically give uh a score

169
00:06:49,960 --> 00:06:55,759
for them or do some sort of other

170
00:06:53,280 --> 00:06:59,759
annotation and the different varieties

171
00:06:55,759 --> 00:07:03,080
of annotation that we can give are um

172
00:06:59,759 --> 00:07:04,599
something called direct assessment so uh

173
00:07:03,080 --> 00:07:06,599
direct assessment is a term that comes

174
00:07:04,599 --> 00:07:09,280
from machine translation uh so you might

175
00:07:06,599 --> 00:07:11,039
not see it used uh lots of other places

176
00:07:09,280 --> 00:07:13,120
but it's basically just give a score

177
00:07:11,039 --> 00:07:15,759
directly to how good the output is so

178
00:07:13,120 --> 00:07:17,199
you can say like if you say please send

179
00:07:15,759 --> 00:07:18,960
this translation is please send this

180
00:07:17,199 --> 00:07:21,759
package to Tokyo we give it a score of

181
00:07:18,960 --> 00:07:24,360
two out of 10 or something like

182
00:07:21,759 --> 00:07:28,000
this

183
00:07:24,360 --> 00:07:30,840
so the the question here is like what

184
00:07:28,000 --> 00:07:32,400
does like let's say I gave a score of

185
00:07:30,840 --> 00:07:34,520
two out of 10 for please send this

186
00:07:32,400 --> 00:07:37,680
package to Tokyo what score should I

187
00:07:34,520 --> 00:07:40,240
give for please send a package to Tokyo

188
00:07:37,680 --> 00:07:42,360
anyone have any ideas the the correct

189
00:07:40,240 --> 00:07:46,520
answer is please send this package to

190
00:07:42,360 --> 00:07:48,000
take out of eight out of 10 yeah but you

191
00:07:46,520 --> 00:07:50,440
might disagree on that right it's kind

192
00:07:48,000 --> 00:07:52,159
of like subjective um one of the

193
00:07:50,440 --> 00:07:54,039
difficulties of direct assessment is

194
00:07:52,159 --> 00:07:55,520
giving a number like this is pretty

195
00:07:54,039 --> 00:07:57,800
difficult if you don't have a very clear

196
00:07:55,520 --> 00:07:59,720
rubric and very skilled annotators and

197
00:07:57,800 --> 00:08:02,879
it's hard to get consistency between

198
00:07:59,720 --> 00:08:04,400
people when you do this so the advantage

199
00:08:02,879 --> 00:08:05,599
is it kind of gives you an idea of how

200
00:08:04,400 --> 00:08:07,520
good things are overall but the

201
00:08:05,599 --> 00:08:09,280
disadvantage is it's more difficult to

202
00:08:07,520 --> 00:08:11,319
annotate and get

203
00:08:09,280 --> 00:08:13,159
consistency um another thing that I

204
00:08:11,319 --> 00:08:15,319
should point out is often scores are

205
00:08:13,159 --> 00:08:18,680
assigned separately based on desirable

206
00:08:15,319 --> 00:08:20,960
traits so um we don't necessarily just

207
00:08:18,680 --> 00:08:23,479
say how good is it we say how fluent is

208
00:08:20,960 --> 00:08:26,120
it like is it fluent uh

209
00:08:23,479 --> 00:08:28,159
English in Translation there's a concept

210
00:08:26,120 --> 00:08:30,720
called adequacy which is how well does

211
00:08:28,159 --> 00:08:34,599
the output reflect the input

212
00:08:30,720 --> 00:08:36,519
semantics um and if you're assessing

213
00:08:34,599 --> 00:08:38,440
translation systems actually it's common

214
00:08:36,519 --> 00:08:40,519
to assess fluency without even looking

215
00:08:38,440 --> 00:08:43,200
at the input because then you can just

216
00:08:40,519 --> 00:08:44,880
say how fluent is it but for adequacy

217
00:08:43,200 --> 00:08:46,320
you definitely need to understand the

218
00:08:44,880 --> 00:08:49,600
input so you need to be a bilingual

219
00:08:46,320 --> 00:08:54,680
speaker to be able to assess

220
00:08:49,600 --> 00:08:57,560
that um factuality um and so factuality

221
00:08:54,680 --> 00:09:00,160
is tricky um it can either be factuality

222
00:08:57,560 --> 00:09:03,880
grounded in a particular input text in

223
00:09:00,160 --> 00:09:05,600
which case um the facts would have to be

224
00:09:03,880 --> 00:09:07,680
you know things that were said in the

225
00:09:05,600 --> 00:09:09,399
input or it can be just kind of is the

226
00:09:07,680 --> 00:09:11,120
statement factual in general in which

227
00:09:09,399 --> 00:09:13,720
case you need to go online you need to

228
00:09:11,120 --> 00:09:16,480
search for things and like uh check

229
00:09:13,720 --> 00:09:18,480
whether the statement is factual or not

230
00:09:16,480 --> 00:09:20,480
um other things are like coherence does

231
00:09:18,480 --> 00:09:21,480
the output fit coherently within the

232
00:09:20,480 --> 00:09:23,680
larger

233
00:09:21,480 --> 00:09:25,680
discs um and there's many many other

234
00:09:23,680 --> 00:09:28,120
ones of these this is also task

235
00:09:25,680 --> 00:09:29,760
dependent so like the things you will

236
00:09:28,120 --> 00:09:31,000
evaluate for machine transl are

237
00:09:29,760 --> 00:09:32,880
different than the ones you would do for

238
00:09:31,000 --> 00:09:35,760
dialog which are different than the ones

239
00:09:32,880 --> 00:09:38,200
you would do for a general purpose

240
00:09:35,760 --> 00:09:41,279
chatot uh which is different kind things

241
00:09:38,200 --> 00:09:44,120
you would do for um summarization for

242
00:09:41,279 --> 00:09:46,320
example so if you're interested in doing

243
00:09:44,120 --> 00:09:47,519
something like this uh then I definitely

244
00:09:46,320 --> 00:09:48,800
encourage you to look at what other

245
00:09:47,519 --> 00:09:51,399
people have done for the tasks you're

246
00:09:48,800 --> 00:09:53,079
interested in uh previously and uh find

247
00:09:51,399 --> 00:09:54,880
out the different types of traits that

248
00:09:53,079 --> 00:09:58,320
did

249
00:09:54,880 --> 00:10:00,760
last uh any any questions about this

250
00:09:58,320 --> 00:10:03,079
also

251
00:10:00,760 --> 00:10:06,920
okay the next type of feedback is

252
00:10:03,079 --> 00:10:09,839
preference ratings um and so this is uh

253
00:10:06,920 --> 00:10:12,600
basically what you do is you have two or

254
00:10:09,839 --> 00:10:14,240
more outputs from different models or

255
00:10:12,600 --> 00:10:16,440
different Generations from an individual

256
00:10:14,240 --> 00:10:18,839
model and you ask a human which one is

257
00:10:16,440 --> 00:10:22,320
better like is one better than the other

258
00:10:18,839 --> 00:10:23,839
or are they tied and so in this case um

259
00:10:22,320 --> 00:10:26,320
you might have please send this package

260
00:10:23,839 --> 00:10:28,880
to Tokyo please send a package to

261
00:10:26,320 --> 00:10:31,040
Tokyo we might disagree on how like good

262
00:10:28,880 --> 00:10:33,959
or bad each of them are but I think most

263
00:10:31,040 --> 00:10:35,959
people would agree that this one is like

264
00:10:33,959 --> 00:10:37,480
despite the fact that it got this wrong

265
00:10:35,959 --> 00:10:40,160
the second one is better than the first

266
00:10:37,480 --> 00:10:42,240
one so this is a little bit of an easier

267
00:10:40,160 --> 00:10:45,040
task it's easier to uh get people to

268
00:10:42,240 --> 00:10:46,839
annotate these things

269
00:10:45,040 --> 00:10:50,519
consistently however it has the

270
00:10:46,839 --> 00:10:52,839
disadvantage that you can't really tell

271
00:10:50,519 --> 00:10:55,360
uh whether systems are really good or

272
00:10:52,839 --> 00:10:57,200
really bad so let's say you have a bunch

273
00:10:55,360 --> 00:11:00,279
of really bad systems that you're

274
00:10:57,200 --> 00:11:01,839
comparing with each other um you might

275
00:11:00,279 --> 00:11:03,680
find that one is better than the other

276
00:11:01,839 --> 00:11:06,000
but that still doesn't mean it's ready

277
00:11:03,680 --> 00:11:07,399
to be deployed or if you have a bunch of

278
00:11:06,000 --> 00:11:11,040
really good systems they're all

279
00:11:07,399 --> 00:11:13,000
basically you know very very similar to

280
00:11:11,040 --> 00:11:14,399
another but one is like slightly more

281
00:11:13,000 --> 00:11:18,639
fluent than the other you might still

282
00:11:14,399 --> 00:11:20,680
get a similar result um and so that also

283
00:11:18,639 --> 00:11:22,760
makes it uh you know a little bit

284
00:11:20,680 --> 00:11:24,880
difficult to use practically in some

285
00:11:22,760 --> 00:11:27,040
ways I didn't put it on the slide but

286
00:11:24,880 --> 00:11:30,680
there's another way you can kind of get

287
00:11:27,040 --> 00:11:33,920
the best of both worlds um which is a

288
00:11:30,680 --> 00:11:35,560
side by side assessment and side by-side

289
00:11:33,920 --> 00:11:38,440
assessment basically what you would do

290
00:11:35,560 --> 00:11:40,560
is you would say um please send this

291
00:11:38,440 --> 00:11:43,399
package to Tokyo please send a package

292
00:11:40,560 --> 00:11:47,279
to Pittsburgh give each of them a direct

293
00:11:43,399 --> 00:11:48,839
score um but you can use decimal places

294
00:11:47,279 --> 00:11:51,120
and you can't use the same score for all

295
00:11:48,839 --> 00:11:55,920
of them and so it's

296
00:11:51,120 --> 00:11:57,480
like five 500 and 4.99 out of five or

297
00:11:55,920 --> 00:11:59,519
something like that like you like one

298
00:11:57,480 --> 00:12:02,639
slightly better than the other or or

299
00:11:59,519 --> 00:12:04,480
something like that um so there are ways

300
00:12:02,639 --> 00:12:07,240
to kind of get Best of Both Worlds if

301
00:12:04,480 --> 00:12:11,720
you're interested in doing

302
00:12:07,240 --> 00:12:11,720
that um

303
00:12:14,920 --> 00:12:20,519
so one problem one other problem with

304
00:12:18,279 --> 00:12:22,519
preference rankings is that there's a

305
00:12:20,519 --> 00:12:24,440
limited number of things that humans can

306
00:12:22,519 --> 00:12:28,160
compare before they get really

307
00:12:24,440 --> 00:12:32,360
overwhelmed so if you say I

308
00:12:28,160 --> 00:12:35,560
want like I want to

309
00:12:32,360 --> 00:12:36,920
rate 15 systems or 20 systems with

310
00:12:35,560 --> 00:12:39,120
respect to how good they are with

311
00:12:36,920 --> 00:12:40,639
respect to each other it's going to be

312
00:12:39,120 --> 00:12:43,680
impossible for humans to come up with a

313
00:12:40,639 --> 00:12:46,959
good preference ranking between them and

314
00:12:43,680 --> 00:12:49,480
so the typical way around this um which

315
00:12:46,959 --> 00:12:52,360
is also used in uh things like the

316
00:12:49,480 --> 00:12:55,440
chatbot Arena by lmis and other things

317
00:12:52,360 --> 00:12:58,720
like this is to use uh something like an

318
00:12:55,440 --> 00:13:00,959
ELO or true skill ranking and what these

319
00:12:58,720 --> 00:13:03,079
are is these are things that were

320
00:13:00,959 --> 00:13:05,760
created for the ranking of like chess

321
00:13:03,079 --> 00:13:09,160
players or video game players or other

322
00:13:05,760 --> 00:13:11,720
things where they like b battle against

323
00:13:09,160 --> 00:13:13,920
each other in multiple matches uh

324
00:13:11,720 --> 00:13:16,440
pair-wise and then you put all of the

325
00:13:13,920 --> 00:13:18,399
wins and losses into these ranking

326
00:13:16,440 --> 00:13:20,600
algorithms and they give you a score

327
00:13:18,399 --> 00:13:22,920
about how good like each of the each of

328
00:13:20,600 --> 00:13:27,079
the players are so if you do something

329
00:13:22,920 --> 00:13:29,480
like this you can um get basically a

330
00:13:27,079 --> 00:13:32,120
ranking of systems despite the that you

331
00:13:29,480 --> 00:13:35,240
only did pairwise assessments so these

332
00:13:32,120 --> 00:13:35,240
are also a good thing to know

333
00:13:37,399 --> 00:13:43,839
about a final variety of human feedback

334
00:13:40,600 --> 00:13:45,320
uh that we create is uh air annotation

335
00:13:43,839 --> 00:13:47,519
and this can be useful for a number of

336
00:13:45,320 --> 00:13:49,839
reasons um but basically the way it

337
00:13:47,519 --> 00:13:53,839
works is you annotate individual errors

338
00:13:49,839 --> 00:13:55,639
within the outputs and um oh one thing I

339
00:13:53,839 --> 00:13:58,120
should mention is that um I'm giving a

340
00:13:55,639 --> 00:14:00,880
lot of examples from machine translation

341
00:13:58,120 --> 00:14:02,800
um I feel like machine translation has

342
00:14:00,880 --> 00:14:04,519
been doing evaluation of generated

343
00:14:02,800 --> 00:14:07,600
outputs for a lot longer than a lot of

344
00:14:04,519 --> 00:14:09,000
other uh fields of NLP have and

345
00:14:07,600 --> 00:14:11,800
therefore their methodology is more

346
00:14:09,000 --> 00:14:13,480
developed than a lot of other fields um

347
00:14:11,800 --> 00:14:16,199
but a lot of these things can also be

348
00:14:13,480 --> 00:14:18,079
applied to uh other uh other tasks as

349
00:14:16,199 --> 00:14:19,079
well but anyway getting back to this

350
00:14:18,079 --> 00:14:20,680
there's something for machine

351
00:14:19,079 --> 00:14:23,639
translation called multi-dimensional

352
00:14:20,680 --> 00:14:26,240
quality metrics and the multidimensional

353
00:14:23,639 --> 00:14:29,160
quality metrics basically what they do

354
00:14:26,240 --> 00:14:32,199
is they annotate spans in the output

355
00:14:29,160 --> 00:14:34,800
where each Span in the output is given a

356
00:14:32,199 --> 00:14:38,079
severity ranking of the error and it's

357
00:14:34,800 --> 00:14:40,199
given a type of the error and there's

358
00:14:38,079 --> 00:14:42,600
about eight different types of Errors

359
00:14:40,199 --> 00:14:44,839
like this doesn't violate or this

360
00:14:42,600 --> 00:14:47,399
violates linguistic conventions of using

361
00:14:44,839 --> 00:14:49,880
the word this instead of uh here by

362
00:14:47,399 --> 00:14:51,639
using the word uh instead of this here

363
00:14:49,880 --> 00:14:55,079
and then this is an accuracy error

364
00:14:51,639 --> 00:14:57,839
because it's not accurately con uh uh

365
00:14:55,079 --> 00:15:01,720
conveying the output and then this error

366
00:14:57,839 --> 00:15:04,600
is minor uh this error is Major um and

367
00:15:01,720 --> 00:15:06,399
then there's also like severe severe

368
00:15:04,600 --> 00:15:07,440
versus major but minor and major is a

369
00:15:06,399 --> 00:15:09,680
more important

370
00:15:07,440 --> 00:15:11,839
distinction um so the advantage of this

371
00:15:09,680 --> 00:15:14,279
is a couple fold number one it gives you

372
00:15:11,839 --> 00:15:16,440
more fine grained feedback uh in that

373
00:15:14,279 --> 00:15:19,199
you can say okay this system has a lot

374
00:15:16,440 --> 00:15:22,199
of uh accuracy errors this system has a

375
00:15:19,199 --> 00:15:24,880
lot of linguistic conventions errors um

376
00:15:22,199 --> 00:15:28,600
it also can be more consistent because

377
00:15:24,880 --> 00:15:29,839
if you just say to people which output

378
00:15:28,600 --> 00:15:31,800
is better

379
00:15:29,839 --> 00:15:34,560
or what is the score of this output

380
00:15:31,800 --> 00:15:36,360
people have trouble deciding about that

381
00:15:34,560 --> 00:15:39,560
because it's a more subjective

382
00:15:36,360 --> 00:15:41,680
evaluation but if I say is this word

383
00:15:39,560 --> 00:15:43,000
correct it's a little bit easier for

384
00:15:41,680 --> 00:15:44,759
people to do so you can get more

385
00:15:43,000 --> 00:15:46,920
consistent annotations

386
00:15:44,759 --> 00:15:49,720
here the problem with this is this can

387
00:15:46,920 --> 00:15:50,839
be very time consuming so um you know

388
00:15:49,720 --> 00:15:52,480
obviously you need to go through and

389
00:15:50,839 --> 00:15:56,440
annotate every single error if it's for

390
00:15:52,480 --> 00:15:56,440
a long outputs or something your

391
00:15:56,959 --> 00:16:03,519
problem so anyway these are just three

392
00:15:59,800 --> 00:16:05,680
uh ways of collecting human feedback um

393
00:16:03,519 --> 00:16:08,639
and then there's an alternative which is

394
00:16:05,680 --> 00:16:10,079
automatic evaluation of outputs and um

395
00:16:08,639 --> 00:16:14,399
there's a bunch of different ways we can

396
00:16:10,079 --> 00:16:16,800
do this the basic idea here is we have a

397
00:16:14,399 --> 00:16:20,199
source um we have a couple

398
00:16:16,800 --> 00:16:22,800
hypotheses and uh we have an automatic

399
00:16:20,199 --> 00:16:26,000
system that generates outputs uh like

400
00:16:22,800 --> 00:16:28,279
scores and we optionally have a

401
00:16:26,000 --> 00:16:30,839
reference output so the reference output

402
00:16:28,279 --> 00:16:33,519
is a human created gold standard output

403
00:16:30,839 --> 00:16:35,120
with respect to how good that um uh with

404
00:16:33,519 --> 00:16:38,240
respect to like what the output should

405
00:16:35,120 --> 00:16:38,240
be in an ideal

406
00:16:38,279 --> 00:16:47,079
case and basically the goal of automatic

407
00:16:43,199 --> 00:16:50,199
evaluation is to

408
00:16:47,079 --> 00:16:52,839
predict human preferences or to predict

409
00:16:50,199 --> 00:16:56,240
what the human scores would be um

410
00:16:52,839 --> 00:16:58,600
because still at this point um we mostly

411
00:16:56,240 --> 00:16:59,480
view what humans think of the output to

412
00:16:58,600 --> 00:17:01,680
be

413
00:16:59,480 --> 00:17:03,280
uh kind of the

414
00:17:01,680 --> 00:17:06,199
standard

415
00:17:03,280 --> 00:17:08,439
and this is called a variety of things

416
00:17:06,199 --> 00:17:10,600
depending on what field you're in um in

417
00:17:08,439 --> 00:17:12,559
machine translation and summarization

418
00:17:10,600 --> 00:17:13,520
it's called automatic evaluation also a

419
00:17:12,559 --> 00:17:16,520
lot in

420
00:17:13,520 --> 00:17:18,400
dialogue um if you're talking about

421
00:17:16,520 --> 00:17:21,000
people from reinforcement learning or

422
00:17:18,400 --> 00:17:24,600
other things um or chat Bots or things

423
00:17:21,000 --> 00:17:28,240
like that uh a lot of people or uh like

424
00:17:24,600 --> 00:17:31,280
AGI or whatever um a lot of people call

425
00:17:28,240 --> 00:17:32,520
it uh word model um because that

426
00:17:31,280 --> 00:17:34,480
specifically comes from the point of

427
00:17:32,520 --> 00:17:36,440
view of like learning from this feedback

428
00:17:34,480 --> 00:17:37,960
but essentially they're the same thing

429
00:17:36,440 --> 00:17:41,080
uh from my point of view they're trying

430
00:17:37,960 --> 00:17:42,520
to predict how good an output is and how

431
00:17:41,080 --> 00:17:44,240
much you should reward the model for

432
00:17:42,520 --> 00:17:46,559
producing that

433
00:17:44,240 --> 00:17:48,679
output

434
00:17:46,559 --> 00:17:50,520
um so there's a bunch of different

435
00:17:48,679 --> 00:17:51,720
methods to do this I'm not going to

436
00:17:50,520 --> 00:17:53,799
cover all of them I'm just going to

437
00:17:51,720 --> 00:17:55,240
cover three paradigms for doing this so

438
00:17:53,799 --> 00:17:57,880
you know where to look further if you're

439
00:17:55,240 --> 00:18:00,039
interested in doing these things um the

440
00:17:57,880 --> 00:18:02,400
first one is embedding based

441
00:18:00,039 --> 00:18:04,679
evaluation and the way embedding based

442
00:18:02,400 --> 00:18:06,600
evaluation works is usually it's

443
00:18:04,679 --> 00:18:11,400
unsupervised calculation based on

444
00:18:06,600 --> 00:18:14,880
embeding similarity between um

445
00:18:11,400 --> 00:18:18,080
the output that the model generated and

446
00:18:14,880 --> 00:18:20,840
a reference output that uh you have

447
00:18:18,080 --> 00:18:23,400
created so sorry this is very small but

448
00:18:20,840 --> 00:18:25,559
we have a reference here that says the

449
00:18:23,400 --> 00:18:27,640
weather is cold today and we have a

450
00:18:25,559 --> 00:18:30,240
candidate that says it is freezing today

451
00:18:27,640 --> 00:18:33,000
so this is probably you know like a good

452
00:18:30,240 --> 00:18:35,480
um a reasonably good

453
00:18:33,000 --> 00:18:37,640
output and we run this through some

454
00:18:35,480 --> 00:18:39,120
embedding model uh it was called Bert

455
00:18:37,640 --> 00:18:40,679
score and so of course you can run it

456
00:18:39,120 --> 00:18:42,240
through Bert but basically it can be any

457
00:18:40,679 --> 00:18:43,799
embedding model that gives you embedding

458
00:18:42,240 --> 00:18:46,200
for each token in the

459
00:18:43,799 --> 00:18:47,640
sequence and so there are five tokens in

460
00:18:46,200 --> 00:18:49,720
this sequence four tokens in this

461
00:18:47,640 --> 00:18:51,960
sequence you get five tokens and then

462
00:18:49,720 --> 00:18:54,799
four sorry five embeddings and then four

463
00:18:51,960 --> 00:18:57,400
embeddings you calculate carewise cosine

464
00:18:54,799 --> 00:18:59,880
similarity between all of them and this

465
00:18:57,400 --> 00:19:03,480
gives you cosine

466
00:18:59,880 --> 00:19:06,480
similarity Matrix and then you take the

467
00:19:03,480 --> 00:19:09,120
ARG Max or you take the maximum

468
00:19:06,480 --> 00:19:11,280
similarity along either the

469
00:19:09,120 --> 00:19:15,799
rows or the

470
00:19:11,280 --> 00:19:19,559
columns and here the rows correspond

471
00:19:15,799 --> 00:19:22,400
to tokens in the reference and because

472
00:19:19,559 --> 00:19:24,039
the rows correspond to tokens in the

473
00:19:22,400 --> 00:19:26,960
reference

474
00:19:24,039 --> 00:19:28,320
the how well you find something that is

475
00:19:26,960 --> 00:19:31,679
similar to each of the tokens in the

476
00:19:28,320 --> 00:19:34,000
reference is like a recall based method

477
00:19:31,679 --> 00:19:35,919
because it's saying how many tokens in

478
00:19:34,000 --> 00:19:39,520
the reference have a good match in the

479
00:19:35,919 --> 00:19:41,120
output and then if you look at the

480
00:19:39,520 --> 00:19:42,799
columns if you look at the max and the

481
00:19:41,120 --> 00:19:44,960
columns this is like a precision based

482
00:19:42,799 --> 00:19:47,000
metric because it's saying how many of

483
00:19:44,960 --> 00:19:49,360
the things in the output are similar

484
00:19:47,000 --> 00:19:51,240
have a similar match in the reference so

485
00:19:49,360 --> 00:19:54,480
basically you can calculate recall and

486
00:19:51,240 --> 00:19:56,200
precision over all of the tokens and

487
00:19:54,480 --> 00:20:00,200
then feed this into something that looks

488
00:19:56,200 --> 00:20:02,400
like fmeasure and you can also use tfidf

489
00:20:00,200 --> 00:20:06,000
waiting um like what I talked about in

490
00:20:02,400 --> 00:20:07,799
the rag lecture uh to upweight low

491
00:20:06,000 --> 00:20:09,520
frequency words because low frequency

492
00:20:07,799 --> 00:20:11,440
words tend to be more content words and

493
00:20:09,520 --> 00:20:13,120
going back to my example you know if you

494
00:20:11,440 --> 00:20:14,280
make a mistake from Pittsburgh to Tokyo

495
00:20:13,120 --> 00:20:17,880
that's going to be more painful than

496
00:20:14,280 --> 00:20:21,000
making a mistake from this to um so

497
00:20:17,880 --> 00:20:22,520
actually if you'll uh if you were paying

498
00:20:21,000 --> 00:20:25,480
close attention to the rag lecture this

499
00:20:22,520 --> 00:20:27,360
looks really similar to the co bear um

500
00:20:25,480 --> 00:20:29,559
the co bear retrieval objective that I

501
00:20:27,360 --> 00:20:30,960
talked about in the r lecture um I don't

502
00:20:29,559 --> 00:20:32,840
think it's a coincidence they both came

503
00:20:30,960 --> 00:20:34,360
out around the same time uh so people

504
00:20:32,840 --> 00:20:36,360
were thinking about the same thing but

505
00:20:34,360 --> 00:20:37,600
um this is one method that's pretty

506
00:20:36,360 --> 00:20:40,200
widely

507
00:20:37,600 --> 00:20:43,480
use the bird Square code base is also

508
00:20:40,200 --> 00:20:45,440
really nice and easy to use so um if uh

509
00:20:43,480 --> 00:20:47,640
you want to try it out feel free to take

510
00:20:45,440 --> 00:20:47,640
a

511
00:20:48,159 --> 00:20:53,840
look cool um the next one I'd like to

512
00:20:51,600 --> 00:20:56,080
talk about is a regression based

513
00:20:53,840 --> 00:20:58,760
evaluation and the way this works is

514
00:20:56,080 --> 00:21:02,600
this is usually used in a supervised uh

515
00:20:58,760 --> 00:21:04,320
setting so uh the way what you have to

516
00:21:02,600 --> 00:21:07,600
do is you have to calculate a whole

517
00:21:04,320 --> 00:21:09,799
bunch of like actual human

518
00:21:07,600 --> 00:21:12,440
judgments and

519
00:21:09,799 --> 00:21:15,000
usually these judgments can either be

520
00:21:12,440 --> 00:21:16,960
direct assessment uh where you actually

521
00:21:15,000 --> 00:21:19,120
have a score or they can be pairwise

522
00:21:16,960 --> 00:21:20,840
judgments and then if you have direct

523
00:21:19,120 --> 00:21:23,640
assessment you use a regression based

524
00:21:20,840 --> 00:21:26,039
loss like uh minimum squared error if

525
00:21:23,640 --> 00:21:27,520
you have pairwise uh you use a ranking

526
00:21:26,039 --> 00:21:29,039
based loss that tries to upweight the

527
00:21:27,520 --> 00:21:31,360
ones that are higher scoring downward

528
00:21:29,039 --> 00:21:33,200
the ones that are lower scoring one

529
00:21:31,360 --> 00:21:35,720
typical example of this is Comet which

530
00:21:33,200 --> 00:21:37,200
is or has been at least for a very long

531
00:21:35,720 --> 00:21:39,880
time the state-of-the art and machine

532
00:21:37,200 --> 00:21:41,279
translation evaluation and the reason

533
00:21:39,880 --> 00:21:43,440
why it works so well is because we have

534
00:21:41,279 --> 00:21:44,720
a bunch of evaluations for machine

535
00:21:43,440 --> 00:21:46,080
translation they've been doing

536
00:21:44,720 --> 00:21:47,600
evaluation and machine translation

537
00:21:46,080 --> 00:21:50,480
systems for years and you can use that

538
00:21:47,600 --> 00:21:52,720
as lots of supervised training data so

539
00:21:50,480 --> 00:21:54,640
basically you just take um these

540
00:21:52,720 --> 00:21:56,440
evaluation data you have human

541
00:21:54,640 --> 00:21:59,080
annotations you have the output

542
00:21:56,440 --> 00:22:00,320
according to a model like comet um you

543
00:21:59,080 --> 00:22:02,679
calculate the difference between them

544
00:22:00,320 --> 00:22:05,640
and you update model

545
00:22:02,679 --> 00:22:07,080
parameters um the problem this is great

546
00:22:05,640 --> 00:22:08,520
if you have lots of training data the

547
00:22:07,080 --> 00:22:10,640
problem with this is for a lot of tasks

548
00:22:08,520 --> 00:22:12,360
we don't have lots of training data so

549
00:22:10,640 --> 00:22:14,720
um you know training these is a little

550
00:22:12,360 --> 00:22:14,720
bit less

551
00:22:15,400 --> 00:22:22,919
feasible and now recently uh what we

552
00:22:19,600 --> 00:22:25,279
have been moving into is is a QA based

553
00:22:22,919 --> 00:22:27,120
evaluation which is basically where we

554
00:22:25,279 --> 00:22:30,760
ask a language model how good the output

555
00:22:27,120 --> 00:22:32,279
is and so uh gmba is an example one of

556
00:22:30,760 --> 00:22:34,559
the early examples of this for machine

557
00:22:32,279 --> 00:22:37,320
translation evaluation uh where they

558
00:22:34,559 --> 00:22:39,840
basically just ask a g gp4 like score

559
00:22:37,320 --> 00:22:41,600
the following translation from Source

560
00:22:39,840 --> 00:22:44,000
language to target language with respect

561
00:22:41,600 --> 00:22:47,080
to the human reference um on a

562
00:22:44,000 --> 00:22:49,200
continuous scale from Z to 100 uh where

563
00:22:47,080 --> 00:22:51,320
the score of zero means no meaning

564
00:22:49,200 --> 00:22:54,039
preserved and the score of 100 means a

565
00:22:51,320 --> 00:22:56,880
perfect meaning in grammar uh you feed

566
00:22:54,039 --> 00:22:58,760
in the source um you feed in the T the

567
00:22:56,880 --> 00:23:01,000
human reference optionally if you have a

568
00:22:58,760 --> 00:23:03,320
human reference and then you feed in the

569
00:23:01,000 --> 00:23:06,760
Target um and you get a

570
00:23:03,320 --> 00:23:09,919
score and um so this this works pretty

571
00:23:06,760 --> 00:23:12,720
well this can give you uh better results

572
00:23:09,919 --> 00:23:15,159
um there's a especially if you have a

573
00:23:12,720 --> 00:23:16,960
strong language model the problem is

574
00:23:15,159 --> 00:23:18,279
it's very unpredictable whether this is

575
00:23:16,960 --> 00:23:20,120
going to work well and it's very

576
00:23:18,279 --> 00:23:23,039
dependent on the prompt that you're

577
00:23:20,120 --> 00:23:25,279
using so um right now A lot of people

578
00:23:23,039 --> 00:23:27,279
are using gp4 without actually

579
00:23:25,279 --> 00:23:29,039
validating whether it does a good job at

580
00:23:27,279 --> 00:23:33,080
evaluation and

581
00:23:29,039 --> 00:23:34,919
and my the results are all across the

582
00:23:33,080 --> 00:23:36,880
board it can be anywhere from very very

583
00:23:34,919 --> 00:23:38,640
good to very very bad at evaluating

584
00:23:36,880 --> 00:23:41,320
particular tasks so I would be at least

585
00:23:38,640 --> 00:23:43,559
a little bit suspicious of whether gp4

586
00:23:41,320 --> 00:23:45,679
is doing a good job evaluating for your

587
00:23:43,559 --> 00:23:49,320
task especially more complex

588
00:23:45,679 --> 00:23:51,960
tests um I would especially be

589
00:23:49,320 --> 00:23:54,000
suspicious if you're doing two uh any of

590
00:23:51,960 --> 00:23:56,760
the two following things number one if

591
00:23:54,000 --> 00:23:59,880
you're comparing gp4 or any model

592
00:23:56,760 --> 00:24:02,400
against itself in another model because

593
00:23:59,880 --> 00:24:05,200
gp4 really likes

594
00:24:02,400 --> 00:24:06,880
gp4 it really likes its own outputs and

595
00:24:05,200 --> 00:24:08,120
there are papers uh sorry I don't

596
00:24:06,880 --> 00:24:09,679
actually have the references here but I

597
00:24:08,120 --> 00:24:11,200
can follow up if people are interested

598
00:24:09,679 --> 00:24:13,080
but there are papers that demonstrate

599
00:24:11,200 --> 00:24:15,799
that gp4 likes it you know its own

600
00:24:13,080 --> 00:24:19,200
outputs more than others also if you're

601
00:24:15,799 --> 00:24:22,120
explicitly optimizing the outputs using

602
00:24:19,200 --> 00:24:24,640
rlf um there is something called good

603
00:24:22,120 --> 00:24:27,120
Hearts law which is basically anytime

604
00:24:24,640 --> 00:24:29,520
you uh start optimizing towards a metric

605
00:24:27,120 --> 00:24:32,559
it becomes a bad metric and that also

606
00:24:29,520 --> 00:24:35,000
happens for gp4 based evaluations so if

607
00:24:32,559 --> 00:24:37,200
you start optimizing for gp4 based

608
00:24:35,000 --> 00:24:38,960
evaluations especially for reference

609
00:24:37,200 --> 00:24:41,679
list metrics that don't use a reference

610
00:24:38,960 --> 00:24:44,840
output then um you start basically

611
00:24:41,679 --> 00:24:47,440
exploiting the metric

612
00:24:44,840 --> 00:24:49,840
um another thing that you can do with QA

613
00:24:47,440 --> 00:24:53,279
based evaluation is ask about fine grade

614
00:24:49,840 --> 00:24:54,919
mistakes and so this is a paper by um uh

615
00:24:53,279 --> 00:24:56,480
Patrick Fernandez who's a student who's

616
00:24:54,919 --> 00:25:02,080
working with me and basically what we

617
00:24:56,480 --> 00:25:05,240
did is we asked the model to um not give

618
00:25:02,080 --> 00:25:07,360
a particular score but actually identify

619
00:25:05,240 --> 00:25:08,880
the mistakes in the output and when we

620
00:25:07,360 --> 00:25:10,559
asked it to identify the mistakes in the

621
00:25:08,880 --> 00:25:13,720
output we found that this gave more

622
00:25:10,559 --> 00:25:17,320
consistent uh results so kind of

623
00:25:13,720 --> 00:25:18,840
interestingly we ask humans to identify

624
00:25:17,320 --> 00:25:21,120
individual mistakes and the output that

625
00:25:18,840 --> 00:25:24,240
gives humans more consistent results

626
00:25:21,120 --> 00:25:25,559
it's the same thing for gp4 so um that

627
00:25:24,240 --> 00:25:27,320
that's another paper you can look at if

628
00:25:25,559 --> 00:25:29,640
you're

629
00:25:27,320 --> 00:25:32,679
interested

630
00:25:29,640 --> 00:25:38,000
cool um so I I mentioned that you could

631
00:25:32,679 --> 00:25:38,000
or could not uh trust uh yeah sorry go

632
00:25:44,679 --> 00:25:51,279
ahead uh correct so yeah B basically

633
00:25:47,360 --> 00:25:53,279
just what you do is you have the source

634
00:25:51,279 --> 00:25:54,960
um ideally you'll also have a reference

635
00:25:53,279 --> 00:25:57,840
output that was created by skilled

636
00:25:54,960 --> 00:25:59,720
humans and then you put in the Target

637
00:25:57,840 --> 00:26:02,279
you know output basically you have the

638
00:25:59,720 --> 00:26:08,000
input ideally a reference output created

639
00:26:02,279 --> 00:26:08,000
by Good by skilled humans and uh like

640
00:26:15,159 --> 00:26:20,240
hypothesis yeah I

641
00:26:17,919 --> 00:26:24,559
mean it's a good question and I don't

642
00:26:20,240 --> 00:26:26,919
know if we actually have a a very clear

643
00:26:24,559 --> 00:26:31,399
empirical like evidence of why this is

644
00:26:26,919 --> 00:26:33,320
the case but my hypothesis about this is

645
00:26:31,399 --> 00:26:36,159
yes we kind of would expect models to be

646
00:26:33,320 --> 00:26:38,200
more biased towards their own outputs

647
00:26:36,159 --> 00:26:40,919
and the reason why is because

648
00:26:38,200 --> 00:26:43,080
essentially you know models

649
00:26:40,919 --> 00:26:44,279
are within their embeddings they're

650
00:26:43,080 --> 00:26:45,760
encoding when they're in a high

651
00:26:44,279 --> 00:26:47,600
probability part of the space and when

652
00:26:45,760 --> 00:26:50,200
they're in a low probability part of the

653
00:26:47,600 --> 00:26:51,120
space and like the high probability part

654
00:26:50,200 --> 00:26:54,600
of the

655
00:26:51,120 --> 00:26:56,200
space is going to be the high

656
00:26:54,600 --> 00:26:58,600
probability part of the space is going

657
00:26:56,200 --> 00:27:02,559
to be associated with good outputs

658
00:26:58,600 --> 00:27:07,000
because like when

659
00:27:02,559 --> 00:27:08,600
models are more sure of their outputs

660
00:27:07,000 --> 00:27:11,960
they're more likely to be

661
00:27:08,600 --> 00:27:13,520
good just because that indicates that

662
00:27:11,960 --> 00:27:15,240
like they're closer to the training data

663
00:27:13,520 --> 00:27:17,760
that it had and other things like that

664
00:27:15,240 --> 00:27:21,600
so model probabilities are associated

665
00:27:17,760 --> 00:27:23,760
with outputs uh with uh with good

666
00:27:21,600 --> 00:27:26,600
outputs but just

667
00:27:23,760 --> 00:27:29,440
correla separately from

668
00:27:26,600 --> 00:27:32,120
that I believe a model can identify when

669
00:27:29,440 --> 00:27:33,320
it's in a high probability segment of

670
00:27:32,120 --> 00:27:35,799
the space and when it's in a low

671
00:27:33,320 --> 00:27:39,399
probability segment of the space and

672
00:27:35,799 --> 00:27:39,399
because of that I expect

673
00:27:39,519 --> 00:27:45,519
that I like there are segments of the

674
00:27:43,240 --> 00:27:47,120
embedding space where it's more likely

675
00:27:45,519 --> 00:27:48,360
to answer yes about something being good

676
00:27:47,120 --> 00:27:50,960
or not and those are going to be

677
00:27:48,360 --> 00:27:54,760
associated with high uh like high

678
00:27:50,960 --> 00:27:56,159
probability outbreaks as well and also

679
00:27:54,760 --> 00:27:57,760
models are more likely to generate

680
00:27:56,159 --> 00:28:00,240
outputs that are high probability

681
00:27:57,760 --> 00:28:02,320
according into their model by definition

682
00:28:00,240 --> 00:28:03,880
so all three of those effects together

683
00:28:02,320 --> 00:28:05,640
would basically go into a model being

684
00:28:03,880 --> 00:28:09,120
bios supports its own outputs compared

685
00:28:05,640 --> 00:28:11,559
to that puts in another model but um

686
00:28:09,120 --> 00:28:13,279
yeah this is a very handwavy explanation

687
00:28:11,559 --> 00:28:15,519
but like putting the two the three

688
00:28:13,279 --> 00:28:18,600
together models output high probability

689
00:28:15,519 --> 00:28:20,880
things from their own probability Space

690
00:28:18,600 --> 00:28:23,440
by definition

691
00:28:20,880 --> 00:28:25,760
um things that are high probability are

692
00:28:23,440 --> 00:28:27,519
associated with being good uh just

693
00:28:25,760 --> 00:28:29,279
because otherwise a model would be

694
00:28:27,519 --> 00:28:31,840
outputting garbage

695
00:28:29,279 --> 00:28:33,840
and um the final thing which is more

696
00:28:31,840 --> 00:28:35,679
tenuous is if the model is in a high

697
00:28:33,840 --> 00:28:37,919
probability segment of the space it's

698
00:28:35,679 --> 00:28:39,760
more likely to Output yes according to a

699
00:28:37,919 --> 00:28:41,480
question of it being good and I I think

700
00:28:39,760 --> 00:28:44,360
that's probably true but I'm not 100%

701
00:28:41,480 --> 00:28:44,360
sure about the the

702
00:28:45,559 --> 00:28:51,039
fin um maybe maybe someone wants to

703
00:28:49,000 --> 00:28:52,840
examinate examine that as a final

704
00:28:51,039 --> 00:28:54,200
project it seems like a interesting

705
00:28:52,840 --> 00:28:57,080
interesting

706
00:28:54,200 --> 00:29:00,039
question um cool uh were there any other

707
00:28:57,080 --> 00:29:00,039
questions about these methods

708
00:29:00,159 --> 00:29:07,120
here um okay so when I say like an

709
00:29:03,960 --> 00:29:11,080
evaluation metric is good or not what do

710
00:29:07,120 --> 00:29:13,200
I mean by this being good or not um or a

711
00:29:11,080 --> 00:29:16,880
reward model or whatever else and

712
00:29:13,200 --> 00:29:18,440
basically the um the way we typically do

713
00:29:16,880 --> 00:29:19,840
this is by doing something called meta

714
00:29:18,440 --> 00:29:22,440
evaluation so it's called meta

715
00:29:19,840 --> 00:29:25,799
evaluation because it's evaluation of

716
00:29:22,440 --> 00:29:29,279
evaluation and uh the way we do this is

717
00:29:25,799 --> 00:29:32,519
we have human uh scores and we have

718
00:29:29,279 --> 00:29:34,760
automatic scores and we usually

719
00:29:32,519 --> 00:29:38,640
calculate some sort of correlation

720
00:29:34,760 --> 00:29:41,000
between the scores so um typical ones

721
00:29:38,640 --> 00:29:46,440
are rank correlations like Pearson's

722
00:29:41,000 --> 00:29:48,799
correlation or tendle uh Tow and uh so

723
00:29:46,440 --> 00:29:51,200
the more Associated the automatic scores

724
00:29:48,799 --> 00:29:53,960
are with the human scores the higher

725
00:29:51,200 --> 00:29:55,159
these correlations are going to be um

726
00:29:53,960 --> 00:29:57,559
there's other things that you can

727
00:29:55,159 --> 00:30:00,080
calculate so if you're trying to figure

728
00:29:57,559 --> 00:30:01,640
out whether a model um matches human

729
00:30:00,080 --> 00:30:04,279
pairwise preferences you can just

730
00:30:01,640 --> 00:30:06,440
calculate accuracy so I didn't put that

731
00:30:04,279 --> 00:30:08,080
on um I didn't put that on the slide

732
00:30:06,440 --> 00:30:10,880
here but you can just calculate accuracy

733
00:30:08,080 --> 00:30:13,120
of pairwise preferences um you can also

734
00:30:10,880 --> 00:30:15,360
calculate the absolute error between the

735
00:30:13,120 --> 00:30:19,320
the judgments if you want to know uh

736
00:30:15,360 --> 00:30:21,720
whether the absolute error matches so um

737
00:30:19,320 --> 00:30:24,159
the these are good things to do if you

738
00:30:21,720 --> 00:30:25,600
want to use an evaluation metric but you

739
00:30:24,159 --> 00:30:27,200
aren't sure whether it's good or not I

740
00:30:25,600 --> 00:30:29,640
would check to see whether the authors

741
00:30:27,200 --> 00:30:32,000
have done this sort of meta evaluation

742
00:30:29,640 --> 00:30:33,760
if they haven't be a little bit

743
00:30:32,000 --> 00:30:36,960
suspicious if they have be a little bit

744
00:30:33,760 --> 00:30:39,799
less suspicious but um

745
00:30:36,960 --> 00:30:42,960
yeah how do people do this typically uh

746
00:30:39,799 --> 00:30:45,640
usually they create uh data sets like

747
00:30:42,960 --> 00:30:49,440
the WM they use data sets like the WMT

748
00:30:45,640 --> 00:30:53,960
shared tasks um or

749
00:30:49,440 --> 00:30:57,679
uh uh like some evl um but there's also

750
00:30:53,960 --> 00:30:59,960
other ways to create um uh there's also

751
00:30:57,679 --> 00:31:01,639
Lots other data sets but in order to do

752
00:30:59,960 --> 00:31:05,639
this reliably you need a fairly large

753
00:31:01,639 --> 00:31:05,639
data set so it's one thing to be aware

754
00:31:07,080 --> 00:31:10,760
of

755
00:31:08,720 --> 00:31:14,200
cool

756
00:31:10,760 --> 00:31:16,360
um then the final thing um all of the

757
00:31:14,200 --> 00:31:17,919
automatic evaluation methods that I

758
00:31:16,360 --> 00:31:20,240
talked about now are trying to match

759
00:31:17,919 --> 00:31:22,679
human preferences but that's not the

760
00:31:20,240 --> 00:31:24,960
only thing that you necessarily want to

761
00:31:22,679 --> 00:31:28,440
do the final thing that you might want

762
00:31:24,960 --> 00:31:30,840
to do is uh use the model outputs in a

763
00:31:28,440 --> 00:31:34,200
downstream system and see whether they

764
00:31:30,840 --> 00:31:36,399
are effective for that so there's two

765
00:31:34,200 --> 00:31:39,080
concepts of intrinsic evaluation and

766
00:31:36,399 --> 00:31:41,720
extrinsic evaluation so intrinsic

767
00:31:39,080 --> 00:31:44,159
evaluation um evaluates the quality of

768
00:31:41,720 --> 00:31:45,720
the output itself and so that would be

769
00:31:44,159 --> 00:31:48,639
like asking a human directly about how

770
00:31:45,720 --> 00:31:50,720
good is this output extrinsic evaluation

771
00:31:48,639 --> 00:31:53,679
is evaluating output quality by its

772
00:31:50,720 --> 00:31:57,000
utility um and so just to give one

773
00:31:53,679 --> 00:31:58,360
example um if you can evaluate large

774
00:31:57,000 --> 00:32:00,200
language model summary

775
00:31:58,360 --> 00:32:04,200
through question answering

776
00:32:00,200 --> 00:32:05,880
accuracy um and so you can take the

777
00:32:04,200 --> 00:32:07,399
output of an llm and feed it through a

778
00:32:05,880 --> 00:32:09,600
question answering model and see whether

779
00:32:07,399 --> 00:32:12,399
you're able to answer questions based on

780
00:32:09,600 --> 00:32:15,799
this and that kind of gives you a better

781
00:32:12,399 --> 00:32:18,279
idea of whether the summary require uh

782
00:32:15,799 --> 00:32:20,120
incorporates requisite information but

783
00:32:18,279 --> 00:32:22,120
if you think about anything an llm can

784
00:32:20,120 --> 00:32:23,760
be used for usually it's part of a

785
00:32:22,120 --> 00:32:26,679
bigger system so you can evaluate it as

786
00:32:23,760 --> 00:32:28,399
a part of that bigger system um the

787
00:32:26,679 --> 00:32:30,639
problem with this is it's a very

788
00:32:28,399 --> 00:32:33,960
indirect way of assessing things so like

789
00:32:30,639 --> 00:32:36,080
let's say your QA model is just bad uh

790
00:32:33,960 --> 00:32:38,480
how can you disentangle the effect of

791
00:32:36,080 --> 00:32:41,679
the L summary versus the QA model that's

792
00:32:38,480 --> 00:32:44,120
not a trivial thing to do so ideally

793
00:32:41,679 --> 00:32:47,000
like a combination of these two is

794
00:32:44,120 --> 00:32:47,000
practically the best way

795
00:32:48,039 --> 00:32:52,200
go cool so

796
00:32:56,039 --> 00:32:59,960
yeah yeah it wouldn't necessar

797
00:32:58,360 --> 00:33:05,679
say it's harder to do it might even be

798
00:32:59,960 --> 00:33:05,679
easier to do um which is like let's

799
00:33:06,679 --> 00:33:11,720
say Let me let me see if I can come up

800
00:33:09,360 --> 00:33:11,720
with

801
00:33:12,639 --> 00:33:17,600
example what let's

802
00:33:15,000 --> 00:33:19,670
say you

803
00:33:17,600 --> 00:33:22,979
are trying

804
00:33:19,670 --> 00:33:22,979
[Music]

805
00:33:24,639 --> 00:33:29,760
to let's say you're trying to

806
00:33:30,559 --> 00:33:33,559
guess

807
00:33:39,000 --> 00:33:45,399
whether let's say you're trying to guess

808
00:33:42,399 --> 00:33:46,559
whether a someone will be hired at a

809
00:33:45,399 --> 00:33:52,039
company or

810
00:33:46,559 --> 00:33:53,880
not based on an llm generated summary of

811
00:33:52,039 --> 00:33:58,880
their qualifications for a position or

812
00:33:53,880 --> 00:34:01,799
something like that um and

813
00:33:58,880 --> 00:34:03,080
you what actually maybe this is not a

814
00:34:01,799 --> 00:34:04,720
great example because whether you should

815
00:34:03,080 --> 00:34:06,960
be doing this ethically is a little bit

816
00:34:04,720 --> 00:34:08,159
unclear but let's say you were doing

817
00:34:06,960 --> 00:34:09,560
let's say you were doing something like

818
00:34:08,159 --> 00:34:11,520
that just because it's one example I can

819
00:34:09,560 --> 00:34:14,320
think of right now whether they will get

820
00:34:11,520 --> 00:34:16,320
hired or not is um is clear because you

821
00:34:14,320 --> 00:34:19,399
have a objective answer right whether

822
00:34:16,320 --> 00:34:21,480
they were hired or not um or maybe maybe

823
00:34:19,399 --> 00:34:23,800
another example would be like let's say

824
00:34:21,480 --> 00:34:26,320
um let's say you want to predict the

825
00:34:23,800 --> 00:34:29,599
diagnosis in a medical application based

826
00:34:26,320 --> 00:34:32,960
on an llm generated some of somebody's

827
00:34:29,599 --> 00:34:35,919
uh you know LM generated summary of

828
00:34:32,960 --> 00:34:38,480
somebody's you know past medical history

829
00:34:35,919 --> 00:34:40,839
and all this stuff and here you want the

830
00:34:38,480 --> 00:34:43,440
llm generated summary you definitely

831
00:34:40,839 --> 00:34:44,879
want the summary because the summary is

832
00:34:43,440 --> 00:34:47,560
going to be viewed by a doctor who will

833
00:34:44,879 --> 00:34:49,359
make the final decision but you also

834
00:34:47,560 --> 00:34:50,760
have information about the diagnoses of

835
00:34:49,359 --> 00:34:52,399
all the people in your medical system

836
00:34:50,760 --> 00:34:54,560
later because you know they went through

837
00:34:52,399 --> 00:34:56,480
your medical system for years and you

838
00:34:54,560 --> 00:34:58,200
know later like through lots of tests

839
00:34:56,480 --> 00:35:00,800
and stuff uh whether how they were

840
00:34:58,200 --> 00:35:02,320
diagnosed so you generate an LM based

841
00:35:00,800 --> 00:35:05,000
summary and then you predict the

842
00:35:02,320 --> 00:35:06,599
diagnosis from the summary so there the

843
00:35:05,000 --> 00:35:08,040
evaluation of the diagnosis is very

844
00:35:06,599 --> 00:35:11,480
clear because you kind of have a gold

845
00:35:08,040 --> 00:35:12,599
standard answer um but the EV intrinsic

846
00:35:11,480 --> 00:35:14,839
evaluation of whether it's a good

847
00:35:12,599 --> 00:35:16,839
summary or not is not as clear because

848
00:35:14,839 --> 00:35:19,400
you'd have pass do whether it's good and

849
00:35:16,839 --> 00:35:21,079
understandable summary so the extrinsic

850
00:35:19,400 --> 00:35:24,920
evaluation might be easier because it's

851
00:35:21,079 --> 00:35:26,480
clearer um so there are cases like that

852
00:35:24,920 --> 00:35:30,720
um the problem is you would have to have

853
00:35:26,480 --> 00:35:33,800
that data in order to do that um yeah do

854
00:35:30,720 --> 00:35:38,240
like evaluation yeah I was just

855
00:35:33,800 --> 00:35:40,800
wondering typically the

856
00:35:38,240 --> 00:35:42,880
like like how do you accomodate the

857
00:35:40,800 --> 00:35:47,160
diversity oh yeah that's a great that's

858
00:35:42,880 --> 00:35:50,240
a great question um so how do you how do

859
00:35:47,160 --> 00:35:50,240
you get these scores

860
00:35:50,720 --> 00:35:55,800
here there's a number of different

861
00:35:53,200 --> 00:35:59,160
things in the WMT shared tasks what they

862
00:35:55,800 --> 00:36:00,280
did is they did

863
00:35:59,160 --> 00:36:03,200
the first thing they do is they

864
00:36:00,280 --> 00:36:06,319
normalize by annotator and what they do

865
00:36:03,200 --> 00:36:10,400
is they basically take the zcore or Z

866
00:36:06,319 --> 00:36:12,240
score of the um of the human annotator's

867
00:36:10,400 --> 00:36:14,880
actual scores because some people are

868
00:36:12,240 --> 00:36:16,400
more harsh than other people and so what

869
00:36:14,880 --> 00:36:20,680
that means is you basically normalize to

870
00:36:16,400 --> 00:36:22,119
have zero mean in unit variance um and

871
00:36:20,680 --> 00:36:24,119
then after they've normalized to zero

872
00:36:22,119 --> 00:36:29,560
mean and unit variance then I think they

873
00:36:24,119 --> 00:36:29,560
average together different humans so um

874
00:36:30,160 --> 00:36:36,520
then for how do you deal with the fact

875
00:36:33,680 --> 00:36:38,040
that humans disagree on things and I

876
00:36:36,520 --> 00:36:39,480
think it's pretty varied I don't know if

877
00:36:38,040 --> 00:36:42,160
there's any gold standard way of doing

878
00:36:39,480 --> 00:36:43,839
it but sometimes you just average

879
00:36:42,160 --> 00:36:46,359
sometimes you throw away examples where

880
00:36:43,839 --> 00:36:47,960
humans disagree a lot um because like

881
00:36:46,359 --> 00:36:50,200
you can't get the humans to agree how

882
00:36:47,960 --> 00:36:53,319
could you expect how could you expect a

883
00:36:50,200 --> 00:36:55,119
machine to do well um so I think it it's

884
00:36:53,319 --> 00:36:59,200
a little bit test

885
00:36:55,119 --> 00:37:01,560
defending yeah so for

886
00:36:59,200 --> 00:37:04,560
generation inin

887
00:37:01,560 --> 00:37:06,280
andin yeah so for code generation that's

888
00:37:04,560 --> 00:37:08,200
I I I love this example because I've

889
00:37:06,280 --> 00:37:09,960
worked on code generation a lot of

890
00:37:08,200 --> 00:37:12,680
people only think about extrinsic

891
00:37:09,960 --> 00:37:14,400
evaluation of code Generation Um or I

892
00:37:12,680 --> 00:37:16,160
don't know if it's extrinsic but only

893
00:37:14,400 --> 00:37:19,160
think about execution based evaluation

894
00:37:16,160 --> 00:37:20,520
of code generation which is like you

895
00:37:19,160 --> 00:37:22,400
execute the code you see whether it

896
00:37:20,520 --> 00:37:25,040
passs unit tests and other things like

897
00:37:22,400 --> 00:37:26,839
this but in reality actually there's a

898
00:37:25,040 --> 00:37:28,599
lot of other important things for code

899
00:37:26,839 --> 00:37:30,560
like readability and other stuff like

900
00:37:28,599 --> 00:37:32,160
that and you should be evaluating those

901
00:37:30,560 --> 00:37:34,920
things but I think a lot of people like

902
00:37:32,160 --> 00:37:36,520
kind of ignore that so um there there

903
00:37:34,920 --> 00:37:38,880
are a few Pap that do that but most of

904
00:37:36,520 --> 00:37:41,000
the time people just execute the Cod

905
00:37:38,880 --> 00:37:45,520
process

906
00:37:41,000 --> 00:37:47,760
un cool okay um so yeah moving on to the

907
00:37:45,520 --> 00:37:51,160
learning part so now I'd like to talk

908
00:37:47,760 --> 00:37:55,280
about uh learning and the first thing

909
00:37:51,160 --> 00:37:59,480
I'll cover is error and risk and so

910
00:37:55,280 --> 00:38:02,280
basically um the way we calculate air is

911
00:37:59,480 --> 00:38:03,119
we generate an output and we calculate

912
00:38:02,280 --> 00:38:07,680
its

913
00:38:03,119 --> 00:38:09,480
Badness um and so generating the output

914
00:38:07,680 --> 00:38:13,160
could be argmax it could be sampling it

915
00:38:09,480 --> 00:38:15,800
could be anything else like that um and

916
00:38:13,160 --> 00:38:18,640
we calculate its Badness uh which is one

917
00:38:15,800 --> 00:38:21,040
minus in which could be like how bad is

918
00:38:18,640 --> 00:38:22,720
the output uh if you're you have a

919
00:38:21,040 --> 00:38:24,760
Badness measure or it could be one minus

920
00:38:22,720 --> 00:38:28,400
the evaluation Square to calculate its

921
00:38:24,760 --> 00:38:30,160
Badness and this is defined as error

922
00:38:28,400 --> 00:38:31,440
and generally what you want to do is you

923
00:38:30,160 --> 00:38:33,520
want to minimize

924
00:38:31,440 --> 00:38:36,800
error

925
00:38:33,520 --> 00:38:39,400
um because in the end you're going to be

926
00:38:36,800 --> 00:38:42,359
deploying A system that just outputs you

927
00:38:39,400 --> 00:38:46,079
know one thing and uh you're going to

928
00:38:42,359 --> 00:38:49,800
want that to be as good a thing as

929
00:38:46,079 --> 00:38:53,000
possible um but the problem with this is

930
00:38:49,800 --> 00:38:56,400
there's no easy way to actually optimize

931
00:38:53,000 --> 00:38:59,079
this value in especially in a text

932
00:38:56,400 --> 00:39:01,800
generation sty setting but even in the

933
00:38:59,079 --> 00:39:06,839
classification setting we can't easily

934
00:39:01,800 --> 00:39:06,839
maximize err because um if you look at

935
00:39:09,040 --> 00:39:14,200
the if you look at the surface of air uh

936
00:39:12,760 --> 00:39:15,960
at some point you're going to have a

937
00:39:14,200 --> 00:39:18,319
non-differentiable part when you take

938
00:39:15,960 --> 00:39:21,119
the argmax and or when you do sampling

939
00:39:18,319 --> 00:39:23,319
or anything like that so um you're not

940
00:39:21,119 --> 00:39:27,119
going to be able to do gradient based

941
00:39:23,319 --> 00:39:29,200
optimization so what we do normally is

942
00:39:27,119 --> 00:39:33,400
um

943
00:39:29,200 --> 00:39:37,000
we instead calculate something uh called

944
00:39:33,400 --> 00:39:38,560
risk and what risk looks like is uh we

945
00:39:37,000 --> 00:39:40,599
talked a little bit about minimum based

946
00:39:38,560 --> 00:39:43,520
risk for decoding but this is for uh

947
00:39:40,599 --> 00:39:46,160
training time and what it looks like is

948
00:39:43,520 --> 00:39:49,040
it's essentially the expected err of the

949
00:39:46,160 --> 00:39:52,359
output and the expected err of the

950
00:39:49,040 --> 00:39:54,760
output um includes a probability in the

951
00:39:52,359 --> 00:39:58,240
objective function here and that

952
00:39:54,760 --> 00:40:01,079
probability uh is differential basically

953
00:39:58,240 --> 00:40:02,319
so we can um uh we can easily do

954
00:40:01,079 --> 00:40:05,720
gradient based

955
00:40:02,319 --> 00:40:09,119
optimization through it um the problem

956
00:40:05,720 --> 00:40:12,200
with this is It's differentiable but for

957
00:40:09,119 --> 00:40:17,160
text generation for example the sum is

958
00:40:12,200 --> 00:40:20,319
intractable because we have a combinator

959
00:40:17,160 --> 00:40:23,880
large number of potential outputs um

960
00:40:20,319 --> 00:40:25,520
because you know if this is we've talked

961
00:40:23,880 --> 00:40:28,720
about this before but if this is like

962
00:40:25,520 --> 00:40:30,680
link you know 50 and we have a 30,000

963
00:40:28,720 --> 00:40:32,839
vocabul that's 30,000 to the 50

964
00:40:30,680 --> 00:40:34,599
possibilities we can't take a su over

965
00:40:32,839 --> 00:40:36,359
that many

966
00:40:34,599 --> 00:40:38,400
possibilities

967
00:40:36,359 --> 00:40:42,680
um

968
00:40:38,400 --> 00:40:45,839
so minimum R risk training uh tries to

969
00:40:42,680 --> 00:40:48,440
minimize risk reinforcement learning

970
00:40:45,839 --> 00:40:50,040
also many of the models especially

971
00:40:48,440 --> 00:40:53,599
policy gradient models are trying to

972
00:40:50,040 --> 00:40:55,240
minimize risk as well so um but the

973
00:40:53,599 --> 00:40:58,040
reason why I wanted to talk about risk

974
00:40:55,240 --> 00:41:00,440
first is because this is very simple to

975
00:40:58,040 --> 00:41:01,640
get to from the uh the point of view of

976
00:41:00,440 --> 00:41:06,560
like all the things that we've studied

977
00:41:01,640 --> 00:41:06,560
so so I think it's talking about

978
00:41:06,760 --> 00:41:11,800
that

979
00:41:08,319 --> 00:41:15,520
um one other thing that I should mention

980
00:41:11,800 --> 00:41:18,400
about is

981
00:41:15,520 --> 00:41:23,079
um or no sorry I'll I'll talk about that

982
00:41:18,400 --> 00:41:26,880
later so when we want to optimize risk

983
00:41:23,079 --> 00:41:30,560
um what we do is we sample in order to

984
00:41:26,880 --> 00:41:35,520
make this trct so a very simple way to

985
00:41:30,560 --> 00:41:37,640
minimize risk is instead of um instead

986
00:41:35,520 --> 00:41:39,359
of summing over all of the possible

987
00:41:37,640 --> 00:41:42,760
outputs we sum over a small number of

988
00:41:39,359 --> 00:41:46,079
possible outputs and we upgrade uh and

989
00:41:42,760 --> 00:41:47,359
we uh sorry normalize uh to make this

990
00:41:46,079 --> 00:41:51,200
all add up to

991
00:41:47,359 --> 00:41:52,839
one and so this normalizer here is

992
00:41:51,200 --> 00:41:55,319
basically the sum over all of the

993
00:41:52,839 --> 00:41:58,599
probabilities that we have uh on the top

994
00:41:55,319 --> 00:42:02,119
part here and and these samples can be

995
00:41:58,599 --> 00:42:05,480
created either using sampling or n best

996
00:42:02,119 --> 00:42:07,040
search we don't need to have from the

997
00:42:05,480 --> 00:42:11,040
point of view of doing this sort of

998
00:42:07,040 --> 00:42:13,960
minimum risk training the kind of

999
00:42:11,040 --> 00:42:16,880
correct way of doing this is sampling

1000
00:42:13,960 --> 00:42:19,880
using ancestral sampling uh like we

1001
00:42:16,880 --> 00:42:23,079
talked about before and um in minimizing

1002
00:42:19,880 --> 00:42:25,839
the output based on the the samples but

1003
00:42:23,079 --> 00:42:28,480
the problem with that is um as many of

1004
00:42:25,839 --> 00:42:31,440
you also might have seen when you were

1005
00:42:28,480 --> 00:42:33,599
sampling from your language model uh

1006
00:42:31,440 --> 00:42:35,160
from assignment one if you sample with

1007
00:42:33,599 --> 00:42:38,040
temperature one it gives you a lot of

1008
00:42:35,160 --> 00:42:40,720
like not very good outlets right and so

1009
00:42:38,040 --> 00:42:43,400
if you're sampling with temperature one

1010
00:42:40,720 --> 00:42:45,000
um you'll be exploring a a very large

1011
00:42:43,400 --> 00:42:47,880
part of the space that actually isn't

1012
00:42:45,000 --> 00:42:49,720
very good and so because of this uh some

1013
00:42:47,880 --> 00:42:51,480
other Alternatives that you can use is

1014
00:42:49,720 --> 00:42:53,400
you can just do endb search to find the

1015
00:42:51,480 --> 00:42:55,280
best outputs or you can sample with a

1016
00:42:53,400 --> 00:42:58,079
temperature that's not one or something

1017
00:42:55,280 --> 00:43:00,240
like that and basically create uh you

1018
00:42:58,079 --> 00:43:02,520
know a list of possible hypotheses and

1019
00:43:00,240 --> 00:43:04,079
then normalize other B so that's another

1020
00:43:02,520 --> 00:43:06,240
option and very often not using

1021
00:43:04,079 --> 00:43:11,200
temperature one is a better

1022
00:43:06,240 --> 00:43:15,280
way um if you're sampling with not

1023
00:43:11,200 --> 00:43:18,640
temperature one and you are um

1024
00:43:15,280 --> 00:43:20,920
potentially getting multiple outputs you

1025
00:43:18,640 --> 00:43:23,400
should try to D duplicate or sample

1026
00:43:20,920 --> 00:43:25,480
without replacement because if you get

1027
00:43:23,400 --> 00:43:27,559
multiple outputs here it messes up your

1028
00:43:25,480 --> 00:43:30,680
equations if you basically uh have the

1029
00:43:27,559 --> 00:43:30,680
same one in there multiple

1030
00:43:32,160 --> 00:43:37,800
times cool so so this is a really simple

1031
00:43:35,880 --> 00:43:40,079
example of how you can do minimal risk

1032
00:43:37,800 --> 00:43:42,119
training but now I want to get into uh

1033
00:43:40,079 --> 00:43:44,640
like reinforcement learning which is the

1034
00:43:42,119 --> 00:43:48,119
framing that most um

1035
00:43:44,640 --> 00:43:50,760
modern Works about this Paulo uh one

1036
00:43:48,119 --> 00:43:52,559
thing I should mention is there are

1037
00:43:50,760 --> 00:43:55,240
actually other alternatives to learning

1038
00:43:52,559 --> 00:43:57,359
from uh human feedback including like

1039
00:43:55,240 --> 00:43:59,359
margin loss margin based losses and

1040
00:43:57,359 --> 00:44:00,960
other stuff like that but most people

1041
00:43:59,359 --> 00:44:03,440
nowadays use reinforcement learning so

1042
00:44:00,960 --> 00:44:06,359
I'm only going to cover that

1043
00:44:03,440 --> 00:44:08,440
here so what is reinforcement learning

1044
00:44:06,359 --> 00:44:11,000
um learning reinforcement learning is

1045
00:44:08,440 --> 00:44:14,559
learning where we have an environment uh

1046
00:44:11,000 --> 00:44:16,079
x uh ability to make actions a and get a

1047
00:44:14,559 --> 00:44:20,160
delayed reward

1048
00:44:16,079 --> 00:44:21,880
R and um there's a really nice example

1049
00:44:20,160 --> 00:44:24,400
uh if you're not familiar with the

1050
00:44:21,880 --> 00:44:27,480
basics of policy gradient by Andre

1051
00:44:24,400 --> 00:44:28,800
karpathy which I linked in the um in the

1052
00:44:27,480 --> 00:44:29,680
recommended reading so you can take a

1053
00:44:28,800 --> 00:44:34,680
look at

1054
00:44:29,680 --> 00:44:37,240
that um but in that example gives an

1055
00:44:34,680 --> 00:44:39,440
example of pong uh where you're playing

1056
00:44:37,240 --> 00:44:42,640
the game pong where X is your observed

1057
00:44:39,440 --> 00:44:45,640
image a is up or down and R is the wind

1058
00:44:42,640 --> 00:44:47,480
loss at the end of the game uh does

1059
00:44:45,640 --> 00:44:50,559
anyone have an idea about uh what this

1060
00:44:47,480 --> 00:44:52,119
looks like for any arbitrary NLP task

1061
00:44:50,559 --> 00:44:56,520
that we might want to do reinforcement

1062
00:44:52,119 --> 00:44:59,040
learning for so what what is X what is a

1063
00:44:56,520 --> 00:44:59,040
and what is

1064
00:45:00,040 --> 00:45:04,680
are pick your favorite uh your favorite

1065
00:45:06,920 --> 00:45:09,920
Trask

1066
00:45:10,960 --> 00:45:18,400
anybody

1067
00:45:12,520 --> 00:45:18,400
yeah be or what what's X first

1068
00:45:19,680 --> 00:45:28,720
yeah you have generate okay is the

1069
00:45:24,440 --> 00:45:29,720
next be like the Buton like whether or

1070
00:45:28,720 --> 00:45:32,520
not

1071
00:45:29,720 --> 00:45:35,240
you okay yeah I I think this is very

1072
00:45:32,520 --> 00:45:37,119
close just to repeat it it's like X is

1073
00:45:35,240 --> 00:45:39,599
what you've generated so far a is the

1074
00:45:37,119 --> 00:45:41,559
next token and R is the button that the

1075
00:45:39,599 --> 00:45:45,400
user clicks about whether it's good or

1076
00:45:41,559 --> 00:45:46,920
not um I think that's reasonably good

1077
00:45:45,400 --> 00:45:48,760
although I don't know if we'd expect

1078
00:45:46,920 --> 00:45:52,960
them to click the button every token we

1079
00:45:48,760 --> 00:45:54,880
generate right so um it might be that X

1080
00:45:52,960 --> 00:45:57,880
is the conversational history up till

1081
00:45:54,880 --> 00:46:02,319
this point um a

1082
00:45:57,880 --> 00:46:04,280
a could be a next token generation and

1083
00:46:02,319 --> 00:46:06,520
then R is a reward we get in an

1084
00:46:04,280 --> 00:46:08,280
arbitrary time point it might not be

1085
00:46:06,520 --> 00:46:09,960
like immediately after generating the

1086
00:46:08,280 --> 00:46:12,040
next token but it might be later and

1087
00:46:09,960 --> 00:46:13,480
that's actually really really important

1088
00:46:12,040 --> 00:46:15,040
from the point of view of reinforcement

1089
00:46:13,480 --> 00:46:19,599
learning and I'll I'll talk about that

1090
00:46:15,040 --> 00:46:23,040
in a second um anyone have an idea from

1091
00:46:19,599 --> 00:46:24,960
I don't know uh code generation or

1092
00:46:23,040 --> 00:46:28,119
translation or some other

1093
00:46:24,960 --> 00:46:31,160
things C generation maybe s is a

1094
00:46:28,119 --> 00:46:33,040
compiler or like the gra scpt and then

1095
00:46:31,160 --> 00:46:37,000
the

1096
00:46:33,040 --> 00:46:42,520
is the actual code that right and reward

1097
00:46:37,000 --> 00:46:44,839
is yep um so X could be the compiler

1098
00:46:42,520 --> 00:46:47,559
it's probably the compiler and all of

1099
00:46:44,839 --> 00:46:50,200
the surrounding code context like what

1100
00:46:47,559 --> 00:46:52,520
what is the natural language output and

1101
00:46:50,200 --> 00:46:53,960
it's also um you know what is the

1102
00:46:52,520 --> 00:46:57,280
project that you're you're working on

1103
00:46:53,960 --> 00:47:00,079
and stuff like that um a i think

1104
00:46:57,280 --> 00:47:02,800
typically we would treat each token in

1105
00:47:00,079 --> 00:47:04,160
the code to be an action um and then R

1106
00:47:02,800 --> 00:47:06,599
would be the reward after a long

1107
00:47:04,160 --> 00:47:08,640
sequence of actions um and it could be

1108
00:47:06,599 --> 00:47:11,119
the reward from the compiler it could be

1109
00:47:08,640 --> 00:47:13,160
the reward from a code readability model

1110
00:47:11,119 --> 00:47:15,720
it could be the reward from a speed

1111
00:47:13,160 --> 00:47:17,079
execution speed and stuff like that so

1112
00:47:15,720 --> 00:47:18,839
like one of the interesting things about

1113
00:47:17,079 --> 00:47:22,640
R is you can be really creative about

1114
00:47:18,839 --> 00:47:25,400
how you form R um which is not easy to

1115
00:47:22,640 --> 00:47:27,319
do uh if you're just doing maximum

1116
00:47:25,400 --> 00:47:29,240
likelihood also so you can come up with

1117
00:47:27,319 --> 00:47:32,920
a r that really matches with like what

1118
00:47:29,240 --> 00:47:36,559
you want um what you want in an output

1119
00:47:32,920 --> 00:47:40,079
so why reinforcement learning in NLP um

1120
00:47:36,559 --> 00:47:42,599
and I think there's basically three um

1121
00:47:40,079 --> 00:47:44,240
three answers the first one is you have

1122
00:47:42,599 --> 00:47:49,000
a typical reinforcement learning

1123
00:47:44,240 --> 00:47:51,119
scenario um where you have a dialogue

1124
00:47:49,000 --> 00:47:52,720
where you get lots of responses and then

1125
00:47:51,119 --> 00:47:54,559
you get a reward at the end so the

1126
00:47:52,720 --> 00:47:57,359
thumbs up and thumbs down from humans is

1127
00:47:54,559 --> 00:47:59,839
a very typical example of

1128
00:47:57,359 --> 00:48:02,800
uh reinforcement learning because you

1129
00:47:59,839 --> 00:48:05,000
get a delayed reward uh at some point in

1130
00:48:02,800 --> 00:48:07,599
the dialogue when a human presses up or

1131
00:48:05,000 --> 00:48:09,280
down um another like actually more

1132
00:48:07,599 --> 00:48:11,680
technical scenario where reinforcement

1133
00:48:09,280 --> 00:48:14,960
learning has been used um for a long

1134
00:48:11,680 --> 00:48:17,400
time is call centers so we've had

1135
00:48:14,960 --> 00:48:20,680
dialogue systems for call centers and

1136
00:48:17,400 --> 00:48:23,160
then if you complete a ticket purchase

1137
00:48:20,680 --> 00:48:24,839
um or you complete resolve a ticket

1138
00:48:23,160 --> 00:48:27,480
without ever having to go to a human

1139
00:48:24,839 --> 00:48:30,800
operator you get a really big reward

1140
00:48:27,480 --> 00:48:33,640
if you have to go to the human operator

1141
00:48:30,800 --> 00:48:36,400
you get maybe a smaller reward and if

1142
00:48:33,640 --> 00:48:39,200
the person yells at you and hangs up

1143
00:48:36,400 --> 00:48:41,640
then you get a really negative reward so

1144
00:48:39,200 --> 00:48:43,040
um this is kind of the typical example

1145
00:48:41,640 --> 00:48:45,599
reinforcement learning has been used for

1146
00:48:43,040 --> 00:48:48,520
a long time there another example is if

1147
00:48:45,599 --> 00:48:53,280
you have like latent variables uh chains

1148
00:48:48,520 --> 00:48:55,799
of thought where um you decide the

1149
00:48:53,280 --> 00:48:58,839
latent variable and then get a reward um

1150
00:48:55,799 --> 00:49:02,799
you get a reward based Bas on how those

1151
00:48:58,839 --> 00:49:03,920
latent variables affect the output so um

1152
00:49:02,799 --> 00:49:07,200
this

1153
00:49:03,920 --> 00:49:09,799
is uh this is another example

1154
00:49:07,200 --> 00:49:12,599
because the Chain of Thought itself

1155
00:49:09,799 --> 00:49:13,880
might not actually be good you might

1156
00:49:12,599 --> 00:49:15,839
have a bad Chain of Thought and still

1157
00:49:13,880 --> 00:49:17,760
get the correct answer so you don't

1158
00:49:15,839 --> 00:49:19,640
actually know for sure that a chain of

1159
00:49:17,760 --> 00:49:22,359
thought that was automatically generated

1160
00:49:19,640 --> 00:49:24,799
is good or not but um that so that kind

1161
00:49:22,359 --> 00:49:27,000
of makes it a reinforcement learning

1162
00:49:24,799 --> 00:49:29,520
problem and another thing is you might

1163
00:49:27,000 --> 00:49:32,520
have a sequence level evaluation metric

1164
00:49:29,520 --> 00:49:34,240
um so that you can't optimize the

1165
00:49:32,520 --> 00:49:36,839
evaluation metric without uh first

1166
00:49:34,240 --> 00:49:38,480
generating the whole like sequence so

1167
00:49:36,839 --> 00:49:40,880
that would be any of the evaluation

1168
00:49:38,480 --> 00:49:42,400
metrics that I talked about before so um

1169
00:49:40,880 --> 00:49:44,720
these are three scenarios where you can

1170
00:49:42,400 --> 00:49:47,079
use reinforcement

1171
00:49:44,720 --> 00:49:50,000
planning so

1172
00:49:47,079 --> 00:49:51,400
um I'm going to make a few steps through

1173
00:49:50,000 --> 00:49:54,640
but like let's start again with our

1174
00:49:51,400 --> 00:49:57,359
supervised mle loss and uh that's just

1175
00:49:54,640 --> 00:50:01,799
the log probability here um in the

1176
00:49:57,359 --> 00:50:04,160
context of reinforcement learning this

1177
00:50:01,799 --> 00:50:07,079
is also called imitation

1178
00:50:04,160 --> 00:50:08,880
learning because um essentially you're

1179
00:50:07,079 --> 00:50:12,680
learning how to perform actions by

1180
00:50:08,880 --> 00:50:14,559
imitating a teacher um and imitation

1181
00:50:12,680 --> 00:50:15,960
learning is not just supervised mle

1182
00:50:14,559 --> 00:50:18,440
there's also other varieties of

1183
00:50:15,960 --> 00:50:21,440
imitation learning but um this is one

1184
00:50:18,440 --> 00:50:21,440
variety of imitation

1185
00:50:22,520 --> 00:50:27,640
learning the next thing I'd like to talk

1186
00:50:24,599 --> 00:50:30,079
about is self-training and basically

1187
00:50:27,640 --> 00:50:31,760
self-training the idea is that you

1188
00:50:30,079 --> 00:50:33,720
sample or argmax according to the

1189
00:50:31,760 --> 00:50:36,119
current model so you have your current

1190
00:50:33,720 --> 00:50:38,000
model and you get a sample from it and

1191
00:50:36,119 --> 00:50:41,520
then you use the sample or samples to

1192
00:50:38,000 --> 00:50:43,680
maximize likelihood so um basically

1193
00:50:41,520 --> 00:50:47,520
instead of doing maximum likelihood with

1194
00:50:43,680 --> 00:50:49,520
respect to the a gold standard output

1195
00:50:47,520 --> 00:50:51,280
you're doing it with respect to your own

1196
00:50:49,520 --> 00:50:55,280
output

1197
00:50:51,280 --> 00:50:55,280
so does this seem like a good

1198
00:50:55,640 --> 00:51:03,880
idea I see a few people shaking heads um

1199
00:51:00,480 --> 00:51:03,880
any ideas why this is not a good

1200
00:51:04,680 --> 00:51:07,680
idea

1201
00:51:15,040 --> 00:51:20,599
yeah yeah exactly so if you don't have

1202
00:51:17,720 --> 00:51:23,760
any access to any notion well it's good

1203
00:51:20,599 --> 00:51:27,480
um this will be optimizing towards good

1204
00:51:23,760 --> 00:51:28,839
outputs and bad outputs right so um your

1205
00:51:27,480 --> 00:51:30,200
model might be outputting bad outputs

1206
00:51:28,839 --> 00:51:32,839
and you're just reinforcing the errors

1207
00:51:30,200 --> 00:51:35,160
set the model R already nonetheless like

1208
00:51:32,839 --> 00:51:37,799
self trining actually improves your

1209
00:51:35,160 --> 00:51:39,680
accuracy somewhat in some cases like for

1210
00:51:37,799 --> 00:51:43,040
example if your accuracy is if your

1211
00:51:39,680 --> 00:51:45,520
model is Right more often than not um

1212
00:51:43,040 --> 00:51:49,119
basically optimizing towards the more

1213
00:51:45,520 --> 00:51:51,720
often the not right outputs can actually

1214
00:51:49,119 --> 00:51:53,640
um due to the implicit regularization

1215
00:51:51,720 --> 00:51:55,000
that models have and early stopping and

1216
00:51:53,640 --> 00:51:56,559
other things like that it can actually

1217
00:51:55,000 --> 00:51:59,280
move you in the right direction and

1218
00:51:56,559 --> 00:52:01,559
improve accuracy

1219
00:51:59,280 --> 00:52:05,000
um

1220
00:52:01,559 --> 00:52:06,640
so there are alternatives to this that

1221
00:52:05,000 --> 00:52:09,520
further improve accuracy so like for

1222
00:52:06,640 --> 00:52:12,720
example if you have multiple models and

1223
00:52:09,520 --> 00:52:16,200
um you only generate sentences where the

1224
00:52:12,720 --> 00:52:17,760
models agree then this can improve your

1225
00:52:16,200 --> 00:52:20,000
uh overall accuracy

1226
00:52:17,760 --> 00:52:24,240
further um this is called code training

1227
00:52:20,000 --> 00:52:27,799
it was actually uh created by uh uh

1228
00:52:24,240 --> 00:52:30,160
people at at CMU as well and another

1229
00:52:27,799 --> 00:52:32,280
successful alternative uh is adding

1230
00:52:30,160 --> 00:52:34,920
noise to the input to match the noise

1231
00:52:32,280 --> 00:52:38,760
that you find in the output so if you uh

1232
00:52:34,920 --> 00:52:40,720
add like word uh word-based Dropout or

1233
00:52:38,760 --> 00:52:44,000
other things like that this can also

1234
00:52:40,720 --> 00:52:47,400
help uh accommodate these things but

1235
00:52:44,000 --> 00:52:48,920
anyway um so self trining is is useful

1236
00:52:47,400 --> 00:52:50,480
but there are better Alternatives if you

1237
00:52:48,920 --> 00:52:54,079
can get a reward

1238
00:52:50,480 --> 00:52:55,559
function so um the simplest variety of

1239
00:52:54,079 --> 00:52:56,960
this is something called policy gradient

1240
00:52:55,559 --> 00:52:59,720
or reinforce

1241
00:52:56,960 --> 00:53:02,319
um or more specifically reinforce and

1242
00:52:59,720 --> 00:53:06,280
basically what this does is this adds a

1243
00:53:02,319 --> 00:53:08,359
term that scales the loss by the reward

1244
00:53:06,280 --> 00:53:12,400
so if you can get a reward for each

1245
00:53:08,359 --> 00:53:15,680
output basically this

1246
00:53:12,400 --> 00:53:18,119
um you uh instead of doing self trining

1247
00:53:15,680 --> 00:53:21,760
entirely by itself you multiply it by a

1248
00:53:18,119 --> 00:53:23,119
reward and this allows you to increase

1249
00:53:21,760 --> 00:53:24,640
the likelihood of things that get a high

1250
00:53:23,119 --> 00:53:28,440
reward decrease the likelihood of things

1251
00:53:24,640 --> 00:53:28,440
that get a low reward

1252
00:53:29,680 --> 00:53:34,960
so uh a brief quiz here under what

1253
00:53:32,440 --> 00:53:37,599
conditions is this equal equivalent to

1254
00:53:34,960 --> 00:53:41,480
ml or essentially equivalent to maximum

1255
00:53:37,599 --> 00:53:43,079
leg uh estimation and so like in order

1256
00:53:41,480 --> 00:53:45,480
to make this quiz easier I'll go back to

1257
00:53:43,079 --> 00:53:47,720
maximum likelihood estimation so it

1258
00:53:45,480 --> 00:53:50,359
looked a bit like this um you calculated

1259
00:53:47,720 --> 00:53:53,440
the log probability of the true output

1260
00:53:50,359 --> 00:53:55,440
and now let me go uh to

1261
00:53:53,440 --> 00:53:56,960
here any

1262
00:53:55,440 --> 00:54:00,119
ideas

1263
00:53:56,960 --> 00:54:05,040
yeah when your reward equals to

1264
00:54:00,119 --> 00:54:05,040
one some sometimes in zero other times

1265
00:54:07,760 --> 00:54:10,960
what any

1266
00:54:12,760 --> 00:54:17,520
ideas what when when does your reward

1267
00:54:15,280 --> 00:54:19,640
need to be equal to one in order to make

1268
00:54:17,520 --> 00:54:23,400
this

1269
00:54:19,640 --> 00:54:23,400
equation equivalent this

1270
00:54:24,960 --> 00:54:31,680
equation yeah when Y and Y hat are the

1271
00:54:27,319 --> 00:54:36,119
same so um basically

1272
00:54:31,680 --> 00:54:38,880
this objective is equivalent to the mle

1273
00:54:36,119 --> 00:54:43,160
objective when you're using a zero1

1274
00:54:38,880 --> 00:54:44,480
loss um where or you're using an

1275
00:54:43,160 --> 00:54:46,359
evaluation function that gives you a

1276
00:54:44,480 --> 00:54:50,920
score of one when it's exact match and

1277
00:54:46,359 --> 00:54:51,720
zero when it's not exact match so um but

1278
00:54:50,920 --> 00:54:54,480
that

1279
00:54:51,720 --> 00:54:56,440
also demonstrates that this can be more

1280
00:54:54,480 --> 00:54:58,400
flexible because you can have other

1281
00:54:56,440 --> 00:55:00,160
rewards that are not just one and zero

1282
00:54:58,400 --> 00:55:02,599
for exact match but you can use things

1283
00:55:00,160 --> 00:55:05,359
that give you partial credit you can use

1284
00:55:02,599 --> 00:55:06,880
things that uplate multiple potential uh

1285
00:55:05,359 --> 00:55:08,880
potentially correct outputs and other

1286
00:55:06,880 --> 00:55:13,400
things like

1287
00:55:08,880 --> 00:55:17,160
that so one problem with these methods

1288
00:55:13,400 --> 00:55:21,799
is um how do we know which action led to

1289
00:55:17,160 --> 00:55:24,720
the reward so the best scenario is after

1290
00:55:21,799 --> 00:55:26,359
each action you get a reward so after

1291
00:55:24,720 --> 00:55:28,960
each token that you generated you get

1292
00:55:26,359 --> 00:55:31,240
get a thumbs up or thumbs down uh from

1293
00:55:28,960 --> 00:55:34,280
the user about whether they like that

1294
00:55:31,240 --> 00:55:36,000
token or not um and how much happier

1295
00:55:34,280 --> 00:55:37,720
they are after you generated that token

1296
00:55:36,000 --> 00:55:42,400
than they were before you generated that

1297
00:55:37,720 --> 00:55:44,200
token um the problem with this is that

1298
00:55:42,400 --> 00:55:45,799
that's completely infeasible right like

1299
00:55:44,200 --> 00:55:47,039
every time after you use chat GPD you're

1300
00:55:45,799 --> 00:55:50,480
not going to press thumbs up and thumbs

1301
00:55:47,039 --> 00:55:52,559
down after each token so um in reality

1302
00:55:50,480 --> 00:55:55,559
what we get is usually we get it at the

1303
00:55:52,559 --> 00:55:57,000
end of uh roll out of many many

1304
00:55:55,559 --> 00:55:58,640
different actions and we're not sure

1305
00:55:57,000 --> 00:55:59,720
which action is responsible for giving

1306
00:55:58,640 --> 00:56:02,559
us the

1307
00:55:59,720 --> 00:56:05,440
reward and

1308
00:56:02,559 --> 00:56:08,000
so there's a few typical ways of dealing

1309
00:56:05,440 --> 00:56:09,640
with this um the most typical way of

1310
00:56:08,000 --> 00:56:13,359
dealing with this right now is just not

1311
00:56:09,640 --> 00:56:15,440
dealing with it um and just hoping that

1312
00:56:13,359 --> 00:56:17,200
your optimization algorithm internally

1313
00:56:15,440 --> 00:56:21,480
will be able to do credit

1314
00:56:17,200 --> 00:56:24,520
assignment um and so what that entails

1315
00:56:21,480 --> 00:56:27,319
is essentially you um give an equal

1316
00:56:24,520 --> 00:56:29,880
reward for each token in the output

1317
00:56:27,319 --> 00:56:32,480
other ways that you can deal with it are

1318
00:56:29,880 --> 00:56:35,640
um you can assign decaying rewards from

1319
00:56:32,480 --> 00:56:37,559
future events so like let's say let's

1320
00:56:35,640 --> 00:56:41,839
say you're talking about a chat bot for

1321
00:56:37,559 --> 00:56:44,119
example maybe this is the the most uh

1322
00:56:41,839 --> 00:56:46,599
kind of intuitive way of thinking about

1323
00:56:44,119 --> 00:56:50,400
it but you you have a chat bot you have

1324
00:56:46,599 --> 00:56:52,599
like 20 chat turns and you have the user

1325
00:56:50,400 --> 00:56:55,640
give a thumbs up or a thumbs down on the

1326
00:56:52,599 --> 00:56:58,920
20th chat turn there you would assign a

1327
00:56:55,640 --> 00:57:01,440
reward of um like let's say it gave a

1328
00:56:58,920 --> 00:57:03,640
thumbs up there you would re assign a

1329
00:57:01,440 --> 00:57:06,559
reward of one for the previous chat turn

1330
00:57:03,640 --> 00:57:09,839
a reward of like 0.5 for the second to

1331
00:57:06,559 --> 00:57:11,720
previous chat term a reward of 0.25 for

1332
00:57:09,839 --> 00:57:14,319
the third to previous chat term to

1333
00:57:11,720 --> 00:57:16,160
basically say yeah like the user is

1334
00:57:14,319 --> 00:57:18,240
feeling good at the moment they gave the

1335
00:57:16,160 --> 00:57:20,359
thumbs up and that's probably more

1336
00:57:18,240 --> 00:57:23,400
likely due to the things that happened

1337
00:57:20,359 --> 00:57:23,400
recently so

1338
00:57:23,559 --> 00:57:28,119
yeah we have a

1339
00:57:26,680 --> 00:57:32,280
like not

1340
00:57:28,119 --> 00:57:34,160
learning so the reward model can be any

1341
00:57:32,280 --> 00:57:35,839
of the methods that I talked about

1342
00:57:34,160 --> 00:57:37,480
before so it can be human feedback

1343
00:57:35,839 --> 00:57:39,000
directly like a thumbs up or a thumbs

1344
00:57:37,480 --> 00:57:42,200
down it could also be from a reward

1345
00:57:39,000 --> 00:57:44,599
model uh that was pre-trained you could

1346
00:57:42,200 --> 00:57:47,680
also theoretically learn the reward

1347
00:57:44,599 --> 00:57:52,720
model simultaneously but you'd have to

1348
00:57:47,680 --> 00:57:55,200
simultaneously with the model itself um

1349
00:57:52,720 --> 00:57:57,280
so yeah I'm going to talk a little bit

1350
00:57:55,200 --> 00:58:00,359
about DP which kind of does that a

1351
00:57:57,280 --> 00:58:01,720
little bit but um I I would basically

1352
00:58:00,359 --> 00:58:03,160
say that wherever you're getting your

1353
00:58:01,720 --> 00:58:06,280
reward is probably from one of the

1354
00:58:03,160 --> 00:58:06,280
things I talked about earlier

1355
00:58:06,359 --> 00:58:14,960
today cool any other

1356
00:58:09,319 --> 00:58:17,720
questions okay um so that's the basic

1357
00:58:14,960 --> 00:58:20,640
the basic idea the very simplest thing

1358
00:58:17,720 --> 00:58:23,359
that you can do is you can just sample

1359
00:58:20,640 --> 00:58:26,079
um optimize the subjective function this

1360
00:58:23,359 --> 00:58:28,359
is dead easy you it's not hard to imp

1361
00:58:26,079 --> 00:58:30,799
imp it all as long as you have some

1362
00:58:28,359 --> 00:58:32,760
source of reward signal um but the

1363
00:58:30,799 --> 00:58:35,559
problem is uh reinforcement learning can

1364
00:58:32,760 --> 00:58:38,599
be very unstable and it's hard to get it

1365
00:58:35,559 --> 00:58:40,160
to uh you know work properly if you uh

1366
00:58:38,599 --> 00:58:42,400
don't do some additional tricks so I'd

1367
00:58:40,160 --> 00:58:45,720
like to talk about this

1368
00:58:42,400 --> 00:58:45,720
next oh yeah

1369
00:58:48,880 --> 00:58:51,880
sir

1370
00:58:55,039 --> 00:58:58,039
yeah

1371
00:59:03,280 --> 00:59:08,960
yeah the typical the typical way is you

1372
00:59:05,440 --> 00:59:12,960
just have an exponential decay um so you

1373
00:59:08,960 --> 00:59:16,200
you multiply each time by what 0.5 0. or

1374
00:59:12,960 --> 00:59:19,400
something like that

1375
00:59:16,200 --> 00:59:19,400
um from

1376
00:59:20,319 --> 00:59:27,720
A6 um cool okay

1377
00:59:25,039 --> 00:59:30,720
so

1378
00:59:27,720 --> 00:59:33,319
and that's one option and sorry just to

1379
00:59:30,720 --> 00:59:35,760
clarify the most common option nowadays

1380
00:59:33,319 --> 00:59:37,920
um at least from the point of view of

1381
00:59:35,760 --> 00:59:39,839
models is not to Decay it at all and

1382
00:59:37,920 --> 00:59:43,880
just assign the same amount for each

1383
00:59:39,839 --> 00:59:45,319
token um I'm not actually 100% sure what

1384
00:59:43,880 --> 00:59:47,319
people are doing with respect to like

1385
00:59:45,319 --> 00:59:49,280
long chat things I think probably

1386
00:59:47,319 --> 00:59:51,720
they're only assigning it to the current

1387
00:59:49,280 --> 00:59:54,240
like utterance and then not optimizing

1388
00:59:51,720 --> 00:59:57,240
the previous utterances so like if they

1389
00:59:54,240 --> 00:59:59,039
get a thumbs up or thumbs down signal um

1390
00:59:57,240 --> 01:00:00,720
then they they would assign an

1391
00:59:59,039 --> 01:00:02,440
equivalent reward for all of the tokens

1392
01:00:00,720 --> 01:00:04,640
and the current utterance and zero

1393
01:00:02,440 --> 01:00:06,119
reward for the previous ones but I'm not

1394
01:00:04,640 --> 01:00:08,480
100% sure about that there might be

1395
01:00:06,119 --> 01:00:11,200
other methods that people are

1396
01:00:08,480 --> 01:00:13,960
using um

1397
01:00:11,200 --> 01:00:16,680
cool so uh stabilizing reinforcement

1398
01:00:13,960 --> 01:00:18,520
learning so um stabilizing reinforcement

1399
01:00:16,680 --> 01:00:21,839
learning there's a lot of reasons why

1400
01:00:18,520 --> 01:00:23,880
it's unstable um the first reason is

1401
01:00:21,839 --> 01:00:27,200
you're sampling an individual output and

1402
01:00:23,880 --> 01:00:30,160
calculating the um uh calculating based

1403
01:00:27,200 --> 01:00:32,039
on the S individual sampled output and

1404
01:00:30,160 --> 01:00:33,440
then there's an Infinity of other

1405
01:00:32,039 --> 01:00:36,480
outputs that you could be optimizing

1406
01:00:33,440 --> 01:00:39,119
over for mle this is not a problem

1407
01:00:36,480 --> 01:00:41,319
because for mle you're always

1408
01:00:39,119 --> 01:00:45,359
contrasting the gold standard output to

1409
01:00:41,319 --> 01:00:46,599
all of the other outputs in the space um

1410
01:00:45,359 --> 01:00:48,280
and you're saying I want to upweight the

1411
01:00:46,599 --> 01:00:51,200
gold standard output and down we all of

1412
01:00:48,280 --> 01:00:53,039
the other ones but for reinforcement

1413
01:00:51,200 --> 01:00:54,760
learning you only have a single sampled

1414
01:00:53,039 --> 01:00:57,520
output that output might be wrong and

1415
01:00:54,760 --> 01:00:59,359
that's a source of inst ility this is

1416
01:00:57,520 --> 01:01:02,079
particularly a problem when using bigger

1417
01:00:59,359 --> 01:01:05,960
output spaces like all of the in the

1418
01:01:02,079 --> 01:01:07,920
vocabul another problem is uh anytime

1419
01:01:05,960 --> 01:01:11,599
you start using negative

1420
01:01:07,920 --> 01:01:15,160
rewards um because if you start using

1421
01:01:11,599 --> 01:01:17,559
negative rewards those rewards will be

1422
01:01:15,160 --> 01:01:19,520
downweighting the probability of a

1423
01:01:17,559 --> 01:01:20,680
particular output sequence and that

1424
01:01:19,520 --> 01:01:22,440
might be a good idea maybe you're

1425
01:01:20,680 --> 01:01:24,319
getting a toxic output or something like

1426
01:01:22,440 --> 01:01:25,960
that and you want to down it but at the

1427
01:01:24,319 --> 01:01:28,280
same time in addition to that toxic

1428
01:01:25,960 --> 01:01:30,000
output there's like you know a

1429
01:01:28,280 --> 01:01:31,599
combinatorial number of completely

1430
01:01:30,000 --> 01:01:33,880
nonsense outputs that aren't even

1431
01:01:31,599 --> 01:01:36,599
English and so basically you can start

1432
01:01:33,880 --> 01:01:38,920
diverge from the N starting start to

1433
01:01:36,599 --> 01:01:40,799
diverge from the natural like language

1434
01:01:38,920 --> 01:01:44,720
modeling distribution that you have

1435
01:01:40,799 --> 01:01:49,079
before so this is a big uh a big

1436
01:01:44,720 --> 01:01:51,880
problem so a number of uh strategies can

1437
01:01:49,079 --> 01:01:53,880
be used to stabilize the first one is

1438
01:01:51,880 --> 01:01:55,480
this is completely obvious right now and

1439
01:01:53,880 --> 01:01:57,240
nobody in their right mind would avoid

1440
01:01:55,480 --> 01:02:00,119
doing this but the first one is

1441
01:01:57,240 --> 01:02:02,839
pre-training with mle and so you start

1442
01:02:00,119 --> 01:02:04,920
with a pre-trained model um and then

1443
01:02:02,839 --> 01:02:09,359
switch over to RL after you finished

1444
01:02:04,920 --> 01:02:11,520
pre-training the model um and so

1445
01:02:09,359 --> 01:02:13,279
this makes a lot of sense if you're

1446
01:02:11,520 --> 01:02:14,960
training a language model which I assume

1447
01:02:13,279 --> 01:02:17,039
that almost everybody in this class is

1448
01:02:14,960 --> 01:02:20,279
going to be doing but it does only work

1449
01:02:17,039 --> 01:02:22,720
in scenarios where you can run mle and

1450
01:02:20,279 --> 01:02:24,359
so it doesn't work if you're predicting

1451
01:02:22,720 --> 01:02:27,240
like latent variables that aren't

1452
01:02:24,359 --> 01:02:28,760
included in the original space

1453
01:02:27,240 --> 01:02:31,960
um it

1454
01:02:28,760 --> 01:02:34,279
also doesn't work in a setting where

1455
01:02:31,960 --> 01:02:36,640
like you want to learn a

1456
01:02:34,279 --> 01:02:40,799
chatbot you want to learn a chatbot for

1457
01:02:36,640 --> 01:02:44,200
customer service for a

1458
01:02:40,799 --> 01:02:48,039
company that

1459
01:02:44,200 --> 01:02:49,960
has like for example a product catalog

1460
01:02:48,039 --> 01:02:53,559
that the language model has never seen

1461
01:02:49,960 --> 01:02:56,000
before and so if the language model has

1462
01:02:53,559 --> 01:02:57,359
no information about the product catalog

1463
01:02:56,000 --> 01:02:59,920
whatsoever you don't provide it through

1464
01:02:57,359 --> 01:03:02,440
rag or something like that it's going to

1465
01:02:59,920 --> 01:03:04,039
have to explore infinitely or not

1466
01:03:02,440 --> 01:03:05,599
infinitely but it's going to have to

1467
01:03:04,039 --> 01:03:08,359
explore too large of a space and you're

1468
01:03:05,599 --> 01:03:10,000
never going to converge with um with

1469
01:03:08,359 --> 01:03:12,359
your language modeling objectives so you

1470
01:03:10,000 --> 01:03:15,000
need to basically be able to create at

1471
01:03:12,359 --> 01:03:16,079
least some supervised training data to

1472
01:03:15,000 --> 01:03:19,279
train with

1473
01:03:16,079 --> 01:03:20,720
mle um but assuming you can do that I'm

1474
01:03:19,279 --> 01:03:22,920
assuming that almost everybody is going

1475
01:03:20,720 --> 01:03:26,400
to do some sort of pre-training with

1476
01:03:22,920 --> 01:03:27,880
ML um The Next Step that people use uh

1477
01:03:26,400 --> 01:03:30,520
in reinforcement learning that's really

1478
01:03:27,880 --> 01:03:34,319
important to stabilize is regularization

1479
01:03:30,520 --> 01:03:35,880
to an existing model and you have an

1480
01:03:34,319 --> 01:03:39,039
existing model and you want to prevent

1481
01:03:35,880 --> 01:03:40,559
it from getting too far away and the

1482
01:03:39,039 --> 01:03:42,279
reason why you want to do this is like

1483
01:03:40,559 --> 01:03:45,720
let's say you start assigning a negative

1484
01:03:42,279 --> 01:03:47,440
reward to toxic utterances for example

1485
01:03:45,720 --> 01:03:49,200
if your model stops being a language

1486
01:03:47,440 --> 01:03:51,920
model whatsoever that's a bad idea so

1487
01:03:49,200 --> 01:03:53,400
you want to keep it as a language model

1488
01:03:51,920 --> 01:03:55,599
keep it close enough to still being a

1489
01:03:53,400 --> 01:03:57,559
competent language model while you know

1490
01:03:55,599 --> 01:03:59,599
like removing the toxic

1491
01:03:57,559 --> 01:04:03,039
utterances so there's a number of

1492
01:03:59,599 --> 01:04:05,680
methods that people use to do this um uh

1493
01:04:03,039 --> 01:04:08,359
the most prominent ones are kale

1494
01:04:05,680 --> 01:04:10,279
regularization uh well so the the first

1495
01:04:08,359 --> 01:04:13,119
most prominent one is K regularization

1496
01:04:10,279 --> 01:04:15,839
and the way this works is basically in

1497
01:04:13,119 --> 01:04:19,400
addition you add you have two

1498
01:04:15,839 --> 01:04:22,279
terms the first term is a term that

1499
01:04:19,400 --> 01:04:25,760
improves your reward so you have your

1500
01:04:22,279 --> 01:04:28,039
old model where your old model is

1501
01:04:25,760 --> 01:04:31,279
creating a

1502
01:04:28,039 --> 01:04:32,440
probability uh it has a probability here

1503
01:04:31,279 --> 01:04:34,960
and then you have the probability

1504
01:04:32,440 --> 01:04:38,160
assigned by your new model and then you

1505
01:04:34,960 --> 01:04:41,200
have your reward signal here and so this

1506
01:04:38,160 --> 01:04:43,599
is basically improving the log odds or

1507
01:04:41,200 --> 01:04:46,960
improving the odds of getting a good

1508
01:04:43,599 --> 01:04:49,720
reward for high reward

1509
01:04:46,960 --> 01:04:52,920
sequences separately from this you have

1510
01:04:49,720 --> 01:04:55,920
this K regularization term and this K

1511
01:04:52,920 --> 01:04:58,119
regularization term is keeping the

1512
01:04:55,920 --> 01:05:00,279
scores of or it's keeping the

1513
01:04:58,119 --> 01:05:02,400
probability distribution of your new

1514
01:05:00,279 --> 01:05:03,960
model similar to the probability

1515
01:05:02,400 --> 01:05:09,200
distribution of your old

1516
01:05:03,960 --> 01:05:11,359
model and this beta parameter basically

1517
01:05:09,200 --> 01:05:15,240
you can increase it or decrease it based

1518
01:05:11,359 --> 01:05:18,400
on how similar you want to keep the um

1519
01:05:15,240 --> 01:05:18,400
how similar you want to keep the

1520
01:05:20,720 --> 01:05:24,640
model another method that people use is

1521
01:05:23,160 --> 01:05:29,279
something called proximal policy

1522
01:05:24,640 --> 01:05:30,920
optimization or or Po and this is a

1523
01:05:29,279 --> 01:05:33,920
method that is based on

1524
01:05:30,920 --> 01:05:38,160
clipping uh the

1525
01:05:33,920 --> 01:05:40,920
outputs and we Define uh this ratio

1526
01:05:38,160 --> 01:05:43,880
here so this ratio is equivalent to this

1527
01:05:40,920 --> 01:05:46,160
here so it's basically um kind of the

1528
01:05:43,880 --> 01:05:47,839
amount that you're learning or the

1529
01:05:46,160 --> 01:05:51,720
amount that the new model up weights

1530
01:05:47,839 --> 01:05:54,039
High reward sequences and so here we

1531
01:05:51,720 --> 01:05:58,200
have the same thing that we had

1532
01:05:54,039 --> 01:06:01,200
above so it it looks like this but over

1533
01:05:58,200 --> 01:06:03,720
here we have a clipped version of this

1534
01:06:01,200 --> 01:06:07,000
where essentially what we do is we

1535
01:06:03,720 --> 01:06:07,000
clip this

1536
01:06:21,119 --> 01:06:27,880
ratio this ratio to be within uh a

1537
01:06:24,720 --> 01:06:32,160
certain range of the original ratio and

1538
01:06:27,880 --> 01:06:37,880
what this is doing is this is

1539
01:06:32,160 --> 01:06:41,400
essentially forcing the model to um not

1540
01:06:37,880 --> 01:06:44,000
reward large jumps in the space um

1541
01:06:41,400 --> 01:06:47,559
because if you take the

1542
01:06:44,000 --> 01:06:49,160
minimum and actually I'm I'm sorry I

1543
01:06:47,559 --> 01:06:50,720
just realized I I might have done

1544
01:06:49,160 --> 01:06:52,520
something confusing here because this is

1545
01:06:50,720 --> 01:06:53,960
actually higher as better so this isn't

1546
01:06:52,520 --> 01:06:56,079
really a loss function this is something

1547
01:06:53,960 --> 01:06:57,680
you're attempting to maximize so

1548
01:06:56,079 --> 01:06:59,839
in contrast to all of the other things I

1549
01:06:57,680 --> 01:07:01,680
was talking about before um this is

1550
01:06:59,839 --> 01:07:04,400
something where higher is better instead

1551
01:07:01,680 --> 01:07:07,599
of lower is better but anyway basically

1552
01:07:04,400 --> 01:07:09,599
by taking the minimum of this you're

1553
01:07:07,599 --> 01:07:11,960
encouraging the model

1554
01:07:09,599 --> 01:07:16,279
to

1555
01:07:11,960 --> 01:07:18,559
uh keep examining the space where you

1556
01:07:16,279 --> 01:07:20,799
don't diverge much from the original

1557
01:07:18,559 --> 01:07:22,920
model and if the space where the

1558
01:07:20,799 --> 01:07:25,240
original model was in is better than the

1559
01:07:22,920 --> 01:07:27,440
new space that your model has moved into

1560
01:07:25,240 --> 01:07:30,920
you move back towards the original model

1561
01:07:27,440 --> 01:07:33,000
so basically like if you had um if you

1562
01:07:30,920 --> 01:07:34,960
learned a model if you started learning

1563
01:07:33,000 --> 01:07:37,960
a model that looked like it was

1564
01:07:34,960 --> 01:07:40,279
optimizing uh your your reward but then

1565
01:07:37,960 --> 01:07:43,119
suddenly the model went off the rails

1566
01:07:40,279 --> 01:07:45,000
and um it starts generating completely

1567
01:07:43,119 --> 01:07:47,319
nonsense outputs that get really bad

1568
01:07:45,000 --> 01:07:49,119
reward this will push it back towards

1569
01:07:47,319 --> 01:07:50,920
the original policy and that's the basic

1570
01:07:49,119 --> 01:07:54,279
idea behind

1571
01:07:50,920 --> 01:07:57,640
P um in terms of what I see people using

1572
01:07:54,279 --> 01:07:59,799
um po was like really really popular for

1573
01:07:57,640 --> 01:08:01,880
a while but I've started to see people

1574
01:07:59,799 --> 01:08:04,799
use alternative strategies that use K

1575
01:08:01,880 --> 01:08:06,880
regularization so I don't I don't think

1576
01:08:04,799 --> 01:08:08,520
either one of them is like particularly

1577
01:08:06,880 --> 01:08:10,039
more popular than any of the others and

1578
01:08:08,520 --> 01:08:13,720
this one's a little bit simpler

1579
01:08:10,039 --> 01:08:13,720
conceptually so I like the the

1580
01:08:14,880 --> 01:08:19,279
one cool um any questions about

1581
01:08:20,359 --> 01:08:26,759
this okay um and actually one thing I

1582
01:08:24,640 --> 01:08:29,679
should mention is um all of these things

1583
01:08:26,759 --> 01:08:32,120
are implemented uh in you know whatever

1584
01:08:29,679 --> 01:08:33,759
libraries you use like hugging face TRL

1585
01:08:32,120 --> 01:08:35,679
Transformer reinforcement learning as an

1586
01:08:33,759 --> 01:08:37,040
example Library all of these methods are

1587
01:08:35,679 --> 01:08:38,400
implemented there so if you actually

1588
01:08:37,040 --> 01:08:40,600
want to use these in practice that's

1589
01:08:38,400 --> 01:08:40,600
good

1590
01:08:40,839 --> 01:08:46,359
place the next thing is adding a

1591
01:08:42,920 --> 01:08:48,679
Baseline and so the basic idea is that

1592
01:08:46,359 --> 01:08:52,199
you have ex expectations about your

1593
01:08:48,679 --> 01:08:54,640
reward for a particular sentence and um

1594
01:08:52,199 --> 01:08:56,560
like let's say we wanted to uh translate

1595
01:08:54,640 --> 01:08:58,400
a sentence and we have uh something like

1596
01:08:56,560 --> 01:09:01,279
this is an easy sentence and buffalo

1597
01:08:58,400 --> 01:09:02,920
buffalo buffalo which is a harder

1598
01:09:01,279 --> 01:09:07,799
sentence to

1599
01:09:02,920 --> 01:09:09,679
translate and so we have a reward um if

1600
01:09:07,799 --> 01:09:11,759
if you're not familiar with this example

1601
01:09:09,679 --> 01:09:13,480
you can search on Wikipedia for buffalo

1602
01:09:11,759 --> 01:09:16,759
buffalo buffalo and you'll you'll find

1603
01:09:13,480 --> 01:09:19,520
out what I'm talking about um but uh

1604
01:09:16,759 --> 01:09:21,440
there's a reward uh and let's say you

1605
01:09:19,520 --> 01:09:24,359
got a reward of 0.8 for the first one

1606
01:09:21,440 --> 01:09:29,679
and a reward of 0.3 for the second

1607
01:09:24,359 --> 01:09:31,679
one but the problem is if um the first

1608
01:09:29,679 --> 01:09:33,640
one actually is really easy and the

1609
01:09:31,679 --> 01:09:36,120
second one is really hard getting a

1610
01:09:33,640 --> 01:09:37,799
reward of 0.8 for the second one for

1611
01:09:36,120 --> 01:09:40,080
like a translation or something is

1612
01:09:37,799 --> 01:09:41,120
actually bad right and a reward of 0.3

1613
01:09:40,080 --> 01:09:45,239
is good because you're moving in the

1614
01:09:41,120 --> 01:09:49,359
right direction and so you basically um

1615
01:09:45,239 --> 01:09:52,239
you have uh the Baseline uh minus reward

1616
01:09:49,359 --> 01:09:54,960
or sorry reward minus Baseline and this

1617
01:09:52,239 --> 01:09:56,520
would give you a negative value for this

1618
01:09:54,960 --> 01:09:59,320
first one a positive value for the

1619
01:09:56,520 --> 01:10:01,360
second one and so the basic idea is can

1620
01:09:59,320 --> 01:10:04,400
we predict a priori how difficult this

1621
01:10:01,360 --> 01:10:05,440
example is and then uh adjust our reward

1622
01:10:04,400 --> 01:10:08,360
based on

1623
01:10:05,440 --> 01:10:10,960
that and

1624
01:10:08,360 --> 01:10:13,679
so that's the basic idea you just have

1625
01:10:10,960 --> 01:10:15,560
kind of like a baseline model um you

1626
01:10:13,679 --> 01:10:19,320
have a baseline model that predicts this

1627
01:10:15,560 --> 01:10:19,320
and uh you adjust uh

1628
01:10:19,760 --> 01:10:25,000
appropriately um there's two major ways

1629
01:10:22,719 --> 01:10:27,600
you can do this the first one um the

1630
01:10:25,000 --> 01:10:29,800
Baseline doesn't need to be anything um

1631
01:10:27,600 --> 01:10:32,960
the only hope is that it decreases the

1632
01:10:29,800 --> 01:10:35,960
variance in your reward uh and makes

1633
01:10:32,960 --> 01:10:38,239
learning more stable um there's two

1634
01:10:35,960 --> 01:10:40,159
options that I see done pretty widely

1635
01:10:38,239 --> 01:10:43,000
the first one is predicting the final

1636
01:10:40,159 --> 01:10:47,360
reward um predicting the final reward

1637
01:10:43,000 --> 01:10:50,960
using a model that doesn't look at

1638
01:10:47,360 --> 01:10:53,400
all at the answer that you provided it

1639
01:10:50,960 --> 01:10:55,880
only looks at the input or it only looks

1640
01:10:53,400 --> 01:10:58,840
at the intermediate States of uh you

1641
01:10:55,880 --> 01:11:00,480
know a model or something and so at the

1642
01:10:58,840 --> 01:11:03,280
sentence level you can have one Baseline

1643
01:11:00,480 --> 01:11:04,719
per sentence um you can also do it at

1644
01:11:03,280 --> 01:11:10,560
each decoder

1645
01:11:04,719 --> 01:11:11,640
State and this is uh basically you can

1646
01:11:10,560 --> 01:11:13,040
do this anytime you're doing

1647
01:11:11,640 --> 01:11:15,199
reinforcement learning by just training

1648
01:11:13,040 --> 01:11:18,199
a regression model that does this for

1649
01:11:15,199 --> 01:11:19,679
you based on the rewards you get the

1650
01:11:18,199 --> 01:11:21,040
important thing is the Baseline is not

1651
01:11:19,679 --> 01:11:22,640
allowed to use any of your actual

1652
01:11:21,040 --> 01:11:25,679
predictions because once you start using

1653
01:11:22,640 --> 01:11:26,640
the predictions then um your uh it's not

1654
01:11:25,679 --> 01:11:28,679
a

1655
01:11:26,640 --> 01:11:30,840
baseline another option which is

1656
01:11:28,679 --> 01:11:33,440
relatively easy to implement but can

1657
01:11:30,840 --> 01:11:36,320
still be effective is you calculate the

1658
01:11:33,440 --> 01:11:38,719
mean of the rewards in a batch and so if

1659
01:11:36,320 --> 01:11:40,880
you have a big batch of data and your

1660
01:11:38,719 --> 01:11:44,440
average reward in the batch is like

1661
01:11:40,880 --> 01:11:46,480
0.4 uh then you just subtract that 0.4

1662
01:11:44,440 --> 01:11:50,080
uh and calculate your reward based on

1663
01:11:46,480 --> 01:11:50,080
that so that's another option that can

1664
01:11:51,800 --> 01:11:57,800
use

1665
01:11:53,639 --> 01:12:00,000
um a kind of extreme example of this uh

1666
01:11:57,800 --> 01:12:01,199
of creating a baseline is contrasting

1667
01:12:00,000 --> 01:12:03,639
pairwise

1668
01:12:01,199 --> 01:12:05,880
examples um or

1669
01:12:03,639 --> 01:12:08,280
contrasting different outputs for the

1670
01:12:05,880 --> 01:12:12,040
same input

1671
01:12:08,280 --> 01:12:13,920
and you can easily learn uh directly

1672
01:12:12,040 --> 01:12:16,239
from pairwise Human

1673
01:12:13,920 --> 01:12:18,199
preferences uh which can provide more

1674
01:12:16,239 --> 01:12:20,760
stability because you know one is better

1675
01:12:18,199 --> 01:12:23,880
than the other so you essentially can be

1676
01:12:20,760 --> 01:12:26,199
sure that uh you're upweighting a better

1677
01:12:23,880 --> 01:12:29,560
one and down weting a worse one

1678
01:12:26,199 --> 01:12:31,400
um this is the idea behind DPO which is

1679
01:12:29,560 --> 01:12:33,719
a recently pretty popular model but

1680
01:12:31,400 --> 01:12:36,800
there's also other previous methods that

1681
01:12:33,719 --> 01:12:40,199
did similar things and the way DPO works

1682
01:12:36,800 --> 01:12:45,040
is it basically calculates this ratio of

1683
01:12:40,199 --> 01:12:49,280
uh the probability of the new uh the new

1684
01:12:45,040 --> 01:12:51,639
model to the old model but it UPS this

1685
01:12:49,280 --> 01:12:53,639
probability for a good output and it

1686
01:12:51,639 --> 01:12:56,280
downweights this probability for a bad

1687
01:12:53,639 --> 01:12:57,679
output and so

1688
01:12:56,280 --> 01:13:00,120
here we have our better outputs over

1689
01:12:57,679 --> 01:13:02,040
here here we have our worse outputs and

1690
01:13:00,120 --> 01:13:03,600
you just it's basically learning to

1691
01:13:02,040 --> 01:13:05,639
upate the probability and downweight

1692
01:13:03,600 --> 01:13:09,320
probability

1693
01:13:05,639 --> 01:13:09,320
accordingly so

1694
01:13:09,360 --> 01:13:15,040
um you can notice that DPO is very

1695
01:13:12,280 --> 01:13:18,040
similar to PO um and that it's learning

1696
01:13:15,040 --> 01:13:19,679
uh it's using these ratios but the

1697
01:13:18,040 --> 01:13:21,520
disadvantage of this is you obviously

1698
01:13:19,679 --> 01:13:23,120
require pairwise judgments and you can't

1699
01:13:21,520 --> 01:13:26,120
learn a model if you don't have these

1700
01:13:23,120 --> 01:13:28,080
pawise judgments so

1701
01:13:26,120 --> 01:13:30,760
the

1702
01:13:28,080 --> 01:13:33,159
beta yeah so the beta term is is

1703
01:13:30,760 --> 01:13:35,840
basically a normalization term it's a

1704
01:13:33,159 --> 01:13:39,960
hyper parameter um

1705
01:13:35,840 --> 01:13:41,840
for DPO sorry I read the paper right

1706
01:13:39,960 --> 01:13:43,639
when it came out and I don't remember if

1707
01:13:41,840 --> 01:13:45,600
it's a direct derivation from the K

1708
01:13:43,639 --> 01:13:47,960
Divergence term or not but I think it

1709
01:13:45,600 --> 01:13:49,800
might be um I'd have to go back and look

1710
01:13:47,960 --> 01:13:50,480
at the look at the paper but basically

1711
01:13:49,800 --> 01:13:53,600
the

1712
01:13:50,480 --> 01:13:56,760
more the larger this is the larger

1713
01:13:53,600 --> 01:13:59,320
gradient steps you'll be

1714
01:13:56,760 --> 01:14:00,639
it also um like you'll notice there

1715
01:13:59,320 --> 01:14:03,400
sorry I didn't mention this but you'll

1716
01:14:00,639 --> 01:14:06,120
notice there's a sigmoid term here so

1717
01:14:03,400 --> 01:14:09,000
the the

1718
01:14:06,120 --> 01:14:10,080
beta the larger you increase the beta

1719
01:14:09,000 --> 01:14:13,239
the

1720
01:14:10,080 --> 01:14:16,600
more small differences in these

1721
01:14:13,239 --> 01:14:18,719
values like it basically like stretches

1722
01:14:16,600 --> 01:14:22,280
or shrinks the sigmoid with respect to

1723
01:14:18,719 --> 01:14:24,120
how beak the it is so it will um it will

1724
01:14:22,280 --> 01:14:25,800
affect how much like small differences

1725
01:14:24,120 --> 01:14:27,960
in this will affect

1726
01:14:25,800 --> 01:14:30,120
but I I think this was derived from the

1727
01:14:27,960 --> 01:14:31,760
K regularization term that we had

1728
01:14:30,120 --> 01:14:34,400
previously in

1729
01:14:31,760 --> 01:14:35,800
um in this slide here but I have to go

1730
01:14:34,400 --> 01:14:40,520
back and double check unless somebody

1731
01:14:35,800 --> 01:14:43,239
knows it is okay good yeah

1732
01:14:40,520 --> 01:14:45,000
so I don't want to say wrong things but

1733
01:14:43,239 --> 01:14:48,239
I also don't want

1734
01:14:45,000 --> 01:14:50,920
to okay cool um and so then increasing

1735
01:14:48,239 --> 01:14:55,080
batch size

1736
01:14:50,920 --> 01:14:57,360
um because each uh another thing is um

1737
01:14:55,080 --> 01:14:58,440
kind of NE necessarily reinforcement

1738
01:14:57,360 --> 01:14:59,920
learning is going to have higher

1739
01:14:58,440 --> 01:15:01,400
variance and maximum likelihood

1740
01:14:59,920 --> 01:15:04,199
estimation just because we're doing samp

1741
01:15:01,400 --> 01:15:07,840
playing and other things like this and

1742
01:15:04,199 --> 01:15:09,440
um so one very simple thing you can do

1743
01:15:07,840 --> 01:15:11,280
is just increase the number of examples

1744
01:15:09,440 --> 01:15:13,679
or rollouts that you do before an update

1745
01:15:11,280 --> 01:15:15,800
to stabilize and so I I would definitely

1746
01:15:13,679 --> 01:15:17,480
suggest that if you're seeing any

1747
01:15:15,800 --> 01:15:18,679
stability after doing all of the tricks

1748
01:15:17,480 --> 01:15:20,400
that I mentioned before that you

1749
01:15:18,679 --> 01:15:23,040
increase your batch size and often that

1750
01:15:20,400 --> 01:15:25,480
can just resolve your problems

1751
01:15:23,040 --> 01:15:28,760
um another uh

1752
01:15:25,480 --> 01:15:30,560
thing that people often do is um save

1753
01:15:28,760 --> 01:15:32,040
many many previous rollouts because

1754
01:15:30,560 --> 01:15:34,199
generally doing rollouts is more

1755
01:15:32,040 --> 01:15:37,840
expensive doing rollouts and collecting

1756
01:15:34,199 --> 01:15:39,560
rewards is more expensive and so um you

1757
01:15:37,840 --> 01:15:42,360
can save the roll outs that you have

1758
01:15:39,560 --> 01:15:43,840
done before and uh keep them around so

1759
01:15:42,360 --> 01:15:46,600
you can update parameters with larger

1760
01:15:43,840 --> 01:15:50,800
batches in a more efficient

1761
01:15:46,600 --> 01:15:53,120
way cool so that's all I have uh I just

1762
01:15:50,800 --> 01:15:54,400
realized we're exactly at time so uh I

1763
01:15:53,120 --> 01:15:56,440
should finish up here but I'll be happy

1764
01:15:54,400 --> 01:15:59,440
to take any

1765
01:15:56,440 --> 01:15:59,440
for

1766
01:16:01,679 --> 01:16:04,679
thanks