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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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
WEBVTT

00:00:00.840 --> 00:00:05.920
okay so uh let's get started um today

00:00:04.200 --> 00:00:08.000
I'm going to be talking about learning

00:00:05.920 --> 00:00:09.480
from Human feedback I wrote

00:00:08.000 --> 00:00:12.160
reinforcement learning from Human

00:00:09.480 --> 00:00:14.519
feedback because that's what um you know

00:00:12.160 --> 00:00:15.759
a lot of people talk about nowadays but

00:00:14.519 --> 00:00:18.880
actually there's other methods of

00:00:15.759 --> 00:00:21.840
learning from Human feedback so first

00:00:18.880 --> 00:00:24.760
I'm going to be talking about the ways

00:00:21.840 --> 00:00:27.920
we can get uh human feedback for the

00:00:24.760 --> 00:00:31.039
generations of models and mostly focus

00:00:27.920 --> 00:00:32.960
on generation tasks because is um

00:00:31.039 --> 00:00:35.800
generation tasks are harder than like

00:00:32.960 --> 00:00:38.559
classification tasks that we uh we deal

00:00:35.800 --> 00:00:40.000
with normally so I'll spend a fair

00:00:38.559 --> 00:00:42.239
amount of time talking about how we do

00:00:40.000 --> 00:00:45.760
that and then after I talk about how we

00:00:42.239 --> 00:00:48.360
do that we'll move into um how we

00:00:45.760 --> 00:00:51.160
actually learn from that

00:00:48.360 --> 00:00:53.399
signal so normally what we've done up

00:00:51.160 --> 00:00:56.399
until this point is maximum likelihood

00:00:53.399 --> 00:00:58.199
training uh this is just an overview

00:00:56.399 --> 00:00:59.559
slide so we what we want to do is we

00:00:58.199 --> 00:01:00.760
want to maximize the likelihood of

00:00:59.559 --> 00:01:03.280
predicting the next word and the

00:01:00.760 --> 00:01:05.960
reference given the previous words uh

00:01:03.280 --> 00:01:08.119
which gives us the loss of the output

00:01:05.960 --> 00:01:09.799
given the input uh where you know the

00:01:08.119 --> 00:01:13.960
input can be the prompt the output can

00:01:09.799 --> 00:01:16.080
be the answer to uh the output but

00:01:13.960 --> 00:01:18.360
there's uh lots of problems with

00:01:16.080 --> 00:01:20.439
learning from Maximum likelihood and I'm

00:01:18.360 --> 00:01:22.079
going to give three examples here I

00:01:20.439 --> 00:01:24.159
think all of these are actually real

00:01:22.079 --> 00:01:26.880
problems uh that we need to be worried

00:01:24.159 --> 00:01:30.240
about so the first one is that some

00:01:26.880 --> 00:01:32.439
mistakes are worse than others so um in

00:01:30.240 --> 00:01:33.560
the end we want good outputs and some

00:01:32.439 --> 00:01:36.520
mistaken

00:01:33.560 --> 00:01:38.200
predictions uh can be a bigger problem

00:01:36.520 --> 00:01:42.680
for the output being

00:01:38.200 --> 00:01:46.000
good so to give an example uh let's say

00:01:42.680 --> 00:01:47.600
what we actually wanted from like a

00:01:46.000 --> 00:01:49.320
speech recognition system or a

00:01:47.600 --> 00:01:54.040
translation system or something like

00:01:49.320 --> 00:01:54.040
that is uh please send this package to

00:01:54.280 --> 00:01:58.920
Pittsburgh if I write please send a

00:01:56.880 --> 00:02:01.560
package to Pittsburgh then this is not a

00:01:58.920 --> 00:02:03.560
huge problem

00:02:01.560 --> 00:02:06.479
if I write uh please send this package

00:02:03.560 --> 00:02:07.719
to Tokyo then that might be a big

00:02:06.479 --> 00:02:09.640
problem because the package you wanted

00:02:07.719 --> 00:02:12.760
to come to Pittsburgh goes to Tokyo

00:02:09.640 --> 00:02:13.680
instead and uh you might not want that

00:02:12.760 --> 00:02:16.080
to

00:02:13.680 --> 00:02:18.000
happen you might also have it say

00:02:16.080 --> 00:02:20.400
bleeping send this package to Pittsburgh

00:02:18.000 --> 00:02:22.200
instead of pleas um and that would be a

00:02:20.400 --> 00:02:24.200
problem in a customer service system

00:02:22.200 --> 00:02:28.400
right because your customer would uh

00:02:24.200 --> 00:02:28.400
leave and never come back

00:02:28.840 --> 00:02:32.040
so

00:02:30.360 --> 00:02:33.720
determiner like this is not going to

00:02:32.040 --> 00:02:35.640
cause a huge issue U messing up other

00:02:33.720 --> 00:02:37.519
things is going to cause a larger

00:02:35.640 --> 00:02:39.519
issue but from the point of view of

00:02:37.519 --> 00:02:42.680
Maximum likelihood all of these are just

00:02:39.519 --> 00:02:44.560
tokens and messing up one token is the

00:02:42.680 --> 00:02:47.519
same as messing up another token so

00:02:44.560 --> 00:02:50.040
that's uh you know an

00:02:47.519 --> 00:02:52.080
issue another problem is that the gold

00:02:50.040 --> 00:02:54.640
standard and maximum likelihood

00:02:52.080 --> 00:02:57.480
estimation can be bad it can be like not

00:02:54.640 --> 00:02:59.239
what you want and uh corpa are full of

00:02:57.480 --> 00:03:02.400
outputs that we wouldn't want a language

00:02:59.239 --> 00:03:05.400
model producing so for example uh toxic

00:03:02.400 --> 00:03:07.799
comments on Reddit uh

00:03:05.400 --> 00:03:09.959
disinformation um another thing that a

00:03:07.799 --> 00:03:13.000
lot of people don't think about uh quite

00:03:09.959 --> 00:03:15.640
as much is a lot of the data online is

00:03:13.000 --> 00:03:17.680
uh from is automatically generated

00:03:15.640 --> 00:03:19.720
nowadays for example from machine

00:03:17.680 --> 00:03:24.080
translation a lot of the translations

00:03:19.720 --> 00:03:25.720
online are from uh 2016 Google translate

00:03:24.080 --> 00:03:27.560
uh when Google translate was a lot less

00:03:25.720 --> 00:03:29.120
good than it is now and so you have like

00:03:27.560 --> 00:03:31.760
poor quality translations that were

00:03:29.120 --> 00:03:31.760
automatically

00:03:33.040 --> 00:03:37.959
a final problem is uh something that's

00:03:35.280 --> 00:03:40.360
called exposure bias and exposure bias

00:03:37.959 --> 00:03:44.000
basically what it means is mle training

00:03:40.360 --> 00:03:46.000
doesn't consider um the necessarity the

00:03:44.000 --> 00:03:48.599
necessity for generation and it relies

00:03:46.000 --> 00:03:51.360
on gold standard context so if we go

00:03:48.599 --> 00:03:54.159
back to the mle equation when we're

00:03:51.360 --> 00:03:57.200
calculating mle this y less than T is

00:03:54.159 --> 00:03:59.200
always correct it's always a good output

00:03:57.200 --> 00:04:01.439
and so what the model does is it learns

00:03:59.200 --> 00:04:04.280
to over rely on good

00:04:01.439 --> 00:04:06.079
outputs and one example of a problem

00:04:04.280 --> 00:04:08.360
that this causes is models tend to

00:04:06.079 --> 00:04:10.560
repeat themselves over and over again

00:04:08.360 --> 00:04:12.319
for example um when you use some

00:04:10.560 --> 00:04:15.079
generation algorithms and the reason why

00:04:12.319 --> 00:04:18.519
this happens is because in a gold

00:04:15.079 --> 00:04:22.079
standard output if a word has appeared

00:04:18.519 --> 00:04:25.840
previously that word is more likely to

00:04:22.079 --> 00:04:28.560
happen next so like if you say um like I

00:04:25.840 --> 00:04:29.759
am going um I am going to Pittsburgh

00:04:28.560 --> 00:04:31.880
you're much more likely to say

00:04:29.759 --> 00:04:33.000
Pittsburgh again in the future because

00:04:31.880 --> 00:04:35.720
you're talking about Pittsburgh

00:04:33.000 --> 00:04:37.400
topically as coherent so what you get is

00:04:35.720 --> 00:04:38.639
you get mle trained models saying I'm

00:04:37.400 --> 00:04:40.160
going to Pittsburgh I am going to

00:04:38.639 --> 00:04:41.680
Pittsburgh I am going to Pittsburgh I

00:04:40.160 --> 00:04:45.280
going to Pittsburgh you've probably seen

00:04:41.680 --> 00:04:47.320
this before uh at some point and so um

00:04:45.280 --> 00:04:49.320
exposure bias is basically that the

00:04:47.320 --> 00:04:51.039
model has never been exposed to mistakes

00:04:49.320 --> 00:04:55.240
in the past and so it can't deal with

00:04:51.039 --> 00:04:56.840
them so what this does is um if you have

00:04:55.240 --> 00:04:58.560
an alternative training algorithm you

00:04:56.840 --> 00:05:02.120
can fix this by generating a whole bunch

00:04:58.560 --> 00:05:04.880
of outputs uh down like scoring some of

00:05:02.120 --> 00:05:06.880
them poorly and penalizing the model for

00:05:04.880 --> 00:05:09.960
uh generating po outputs and so that can

00:05:06.880 --> 00:05:09.960
fix these problems as

00:05:10.800 --> 00:05:18.440
well uh any questions about this all

00:05:15.199 --> 00:05:20.800
good Okay cool so now I'd like to get

00:05:18.440 --> 00:05:23.919
into how we measure how good an output

00:05:20.800 --> 00:05:26.360
is and there's different ways of doing

00:05:23.919 --> 00:05:30.319
this um the first one is objective

00:05:26.360 --> 00:05:32.680
assessment so for some uh tasks or for

00:05:30.319 --> 00:05:35.400
many tasks there's kind of objectively a

00:05:32.680 --> 00:05:37.280
correct answer there's also human

00:05:35.400 --> 00:05:40.360
subjective annotations so you can ask

00:05:37.280 --> 00:05:42.919
humans to do annotation for you there's

00:05:40.360 --> 00:05:45.400
machine prediction of human

00:05:42.919 --> 00:05:48.319
preferences and there's also use in

00:05:45.400 --> 00:05:50.840
another system in a downstream

00:05:48.319 --> 00:05:52.960
task so the way objective assessment

00:05:50.840 --> 00:05:54.919
works is you have an annotated correct

00:05:52.960 --> 00:05:57.080
answer in match against this so like if

00:05:54.919 --> 00:06:00.600
you're solving math problems uh

00:05:57.080 --> 00:06:02.560
answering objective questions and and

00:06:00.600 --> 00:06:04.280
you know you can pick any arbitrary

00:06:02.560 --> 00:06:06.840
example you can pick your classification

00:06:04.280 --> 00:06:09.800
example from uh like your text

00:06:06.840 --> 00:06:11.880
classification tasks an even clearer

00:06:09.800 --> 00:06:13.880
example is if you have math problems

00:06:11.880 --> 00:06:15.639
there's kind of objectively one answer

00:06:13.880 --> 00:06:18.080
to any math problem and there's no other

00:06:15.639 --> 00:06:19.680
answer that could be correct so this

00:06:18.080 --> 00:06:21.160
makes your life easy if you're handling

00:06:19.680 --> 00:06:22.560
this type of problem but of course

00:06:21.160 --> 00:06:24.120
there's many other types of problems we

00:06:22.560 --> 00:06:26.039
want to handle that don't have objective

00:06:24.120 --> 00:06:29.039
answers like

00:06:26.039 --> 00:06:31.440
this so let's say we're handling a gener

00:06:29.039 --> 00:06:34.680
a generation task where we don't have an

00:06:31.440 --> 00:06:36.360
objective answer um in this Cas kind of

00:06:34.680 --> 00:06:39.440
one of our gold standards is human

00:06:36.360 --> 00:06:42.360
evaluation so we might have a source

00:06:39.440 --> 00:06:44.919
input like a prompt or an input text for

00:06:42.360 --> 00:06:47.240
machine translation we have one or

00:06:44.919 --> 00:06:49.960
several hypotheses and we ask a human

00:06:47.240 --> 00:06:53.280
annotator to basically give uh a score

00:06:49.960 --> 00:06:55.759
for them or do some sort of other

00:06:53.280 --> 00:06:59.759
annotation and the different varieties

00:06:55.759 --> 00:07:03.080
of annotation that we can give are um

00:06:59.759 --> 00:07:04.599
something called direct assessment so uh

00:07:03.080 --> 00:07:06.599
direct assessment is a term that comes

00:07:04.599 --> 00:07:09.280
from machine translation uh so you might

00:07:06.599 --> 00:07:11.039
not see it used uh lots of other places

00:07:09.280 --> 00:07:13.120
but it's basically just give a score

00:07:11.039 --> 00:07:15.759
directly to how good the output is so

00:07:13.120 --> 00:07:17.199
you can say like if you say please send

00:07:15.759 --> 00:07:18.960
this translation is please send this

00:07:17.199 --> 00:07:21.759
package to Tokyo we give it a score of

00:07:18.960 --> 00:07:24.360
two out of 10 or something like

00:07:21.759 --> 00:07:28.000
this

00:07:24.360 --> 00:07:30.840
so the the question here is like what

00:07:28.000 --> 00:07:32.400
does like let's say I gave a score of

00:07:30.840 --> 00:07:34.520
two out of 10 for please send this

00:07:32.400 --> 00:07:37.680
package to Tokyo what score should I

00:07:34.520 --> 00:07:40.240
give for please send a package to Tokyo

00:07:37.680 --> 00:07:42.360
anyone have any ideas the the correct

00:07:40.240 --> 00:07:46.520
answer is please send this package to

00:07:42.360 --> 00:07:48.000
take out of eight out of 10 yeah but you

00:07:46.520 --> 00:07:50.440
might disagree on that right it's kind

00:07:48.000 --> 00:07:52.159
of like subjective um one of the

00:07:50.440 --> 00:07:54.039
difficulties of direct assessment is

00:07:52.159 --> 00:07:55.520
giving a number like this is pretty

00:07:54.039 --> 00:07:57.800
difficult if you don't have a very clear

00:07:55.520 --> 00:07:59.720
rubric and very skilled annotators and

00:07:57.800 --> 00:08:02.879
it's hard to get consistency between

00:07:59.720 --> 00:08:04.400
people when you do this so the advantage

00:08:02.879 --> 00:08:05.599
is it kind of gives you an idea of how

00:08:04.400 --> 00:08:07.520
good things are overall but the

00:08:05.599 --> 00:08:09.280
disadvantage is it's more difficult to

00:08:07.520 --> 00:08:11.319
annotate and get

00:08:09.280 --> 00:08:13.159
consistency um another thing that I

00:08:11.319 --> 00:08:15.319
should point out is often scores are

00:08:13.159 --> 00:08:18.680
assigned separately based on desirable

00:08:15.319 --> 00:08:20.960
traits so um we don't necessarily just

00:08:18.680 --> 00:08:23.479
say how good is it we say how fluent is

00:08:20.960 --> 00:08:26.120
it like is it fluent uh

00:08:23.479 --> 00:08:28.159
English in Translation there's a concept

00:08:26.120 --> 00:08:30.720
called adequacy which is how well does

00:08:28.159 --> 00:08:34.599
the output reflect the input

00:08:30.720 --> 00:08:36.519
semantics um and if you're assessing

00:08:34.599 --> 00:08:38.440
translation systems actually it's common

00:08:36.519 --> 00:08:40.519
to assess fluency without even looking

00:08:38.440 --> 00:08:43.200
at the input because then you can just

00:08:40.519 --> 00:08:44.880
say how fluent is it but for adequacy

00:08:43.200 --> 00:08:46.320
you definitely need to understand the

00:08:44.880 --> 00:08:49.600
input so you need to be a bilingual

00:08:46.320 --> 00:08:54.680
speaker to be able to assess

00:08:49.600 --> 00:08:57.560
that um factuality um and so factuality

00:08:54.680 --> 00:09:00.160
is tricky um it can either be factuality

00:08:57.560 --> 00:09:03.880
grounded in a particular input text in

00:09:00.160 --> 00:09:05.600
which case um the facts would have to be

00:09:03.880 --> 00:09:07.680
you know things that were said in the

00:09:05.600 --> 00:09:09.399
input or it can be just kind of is the

00:09:07.680 --> 00:09:11.120
statement factual in general in which

00:09:09.399 --> 00:09:13.720
case you need to go online you need to

00:09:11.120 --> 00:09:16.480
search for things and like uh check

00:09:13.720 --> 00:09:18.480
whether the statement is factual or not

00:09:16.480 --> 00:09:20.480
um other things are like coherence does

00:09:18.480 --> 00:09:21.480
the output fit coherently within the

00:09:20.480 --> 00:09:23.680
larger

00:09:21.480 --> 00:09:25.680
discs um and there's many many other

00:09:23.680 --> 00:09:28.120
ones of these this is also task

00:09:25.680 --> 00:09:29.760
dependent so like the things you will

00:09:28.120 --> 00:09:31.000
evaluate for machine transl are

00:09:29.760 --> 00:09:32.880
different than the ones you would do for

00:09:31.000 --> 00:09:35.760
dialog which are different than the ones

00:09:32.880 --> 00:09:38.200
you would do for a general purpose

00:09:35.760 --> 00:09:41.279
chatot uh which is different kind things

00:09:38.200 --> 00:09:44.120
you would do for um summarization for

00:09:41.279 --> 00:09:46.320
example so if you're interested in doing

00:09:44.120 --> 00:09:47.519
something like this uh then I definitely

00:09:46.320 --> 00:09:48.800
encourage you to look at what other

00:09:47.519 --> 00:09:51.399
people have done for the tasks you're

00:09:48.800 --> 00:09:53.079
interested in uh previously and uh find

00:09:51.399 --> 00:09:54.880
out the different types of traits that

00:09:53.079 --> 00:09:58.320
did

00:09:54.880 --> 00:10:00.760
last uh any any questions about this

00:09:58.320 --> 00:10:03.079
also

00:10:00.760 --> 00:10:06.920
okay the next type of feedback is

00:10:03.079 --> 00:10:09.839
preference ratings um and so this is uh

00:10:06.920 --> 00:10:12.600
basically what you do is you have two or

00:10:09.839 --> 00:10:14.240
more outputs from different models or

00:10:12.600 --> 00:10:16.440
different Generations from an individual

00:10:14.240 --> 00:10:18.839
model and you ask a human which one is

00:10:16.440 --> 00:10:22.320
better like is one better than the other

00:10:18.839 --> 00:10:23.839
or are they tied and so in this case um

00:10:22.320 --> 00:10:26.320
you might have please send this package

00:10:23.839 --> 00:10:28.880
to Tokyo please send a package to

00:10:26.320 --> 00:10:31.040
Tokyo we might disagree on how like good

00:10:28.880 --> 00:10:33.959
or bad each of them are but I think most

00:10:31.040 --> 00:10:35.959
people would agree that this one is like

00:10:33.959 --> 00:10:37.480
despite the fact that it got this wrong

00:10:35.959 --> 00:10:40.160
the second one is better than the first

00:10:37.480 --> 00:10:42.240
one so this is a little bit of an easier

00:10:40.160 --> 00:10:45.040
task it's easier to uh get people to

00:10:42.240 --> 00:10:46.839
annotate these things

00:10:45.040 --> 00:10:50.519
consistently however it has the

00:10:46.839 --> 00:10:52.839
disadvantage that you can't really tell

00:10:50.519 --> 00:10:55.360
uh whether systems are really good or

00:10:52.839 --> 00:10:57.200
really bad so let's say you have a bunch

00:10:55.360 --> 00:11:00.279
of really bad systems that you're

00:10:57.200 --> 00:11:01.839
comparing with each other um you might

00:11:00.279 --> 00:11:03.680
find that one is better than the other

00:11:01.839 --> 00:11:06.000
but that still doesn't mean it's ready

00:11:03.680 --> 00:11:07.399
to be deployed or if you have a bunch of

00:11:06.000 --> 00:11:11.040
really good systems they're all

00:11:07.399 --> 00:11:13.000
basically you know very very similar to

00:11:11.040 --> 00:11:14.399
another but one is like slightly more

00:11:13.000 --> 00:11:18.639
fluent than the other you might still

00:11:14.399 --> 00:11:20.680
get a similar result um and so that also

00:11:18.639 --> 00:11:22.760
makes it uh you know a little bit

00:11:20.680 --> 00:11:24.880
difficult to use practically in some

00:11:22.760 --> 00:11:27.040
ways I didn't put it on the slide but

00:11:24.880 --> 00:11:30.680
there's another way you can kind of get

00:11:27.040 --> 00:11:33.920
the best of both worlds um which is a

00:11:30.680 --> 00:11:35.560
side by side assessment and side by-side

00:11:33.920 --> 00:11:38.440
assessment basically what you would do

00:11:35.560 --> 00:11:40.560
is you would say um please send this

00:11:38.440 --> 00:11:43.399
package to Tokyo please send a package

00:11:40.560 --> 00:11:47.279
to Pittsburgh give each of them a direct

00:11:43.399 --> 00:11:48.839
score um but you can use decimal places

00:11:47.279 --> 00:11:51.120
and you can't use the same score for all

00:11:48.839 --> 00:11:55.920
of them and so it's

00:11:51.120 --> 00:11:57.480
like five 500 and 4.99 out of five or

00:11:55.920 --> 00:11:59.519
something like that like you like one

00:11:57.480 --> 00:12:02.639
slightly better than the other or or

00:11:59.519 --> 00:12:04.480
something like that um so there are ways

00:12:02.639 --> 00:12:07.240
to kind of get Best of Both Worlds if

00:12:04.480 --> 00:12:11.720
you're interested in doing

00:12:07.240 --> 00:12:11.720
that um

00:12:14.920 --> 00:12:20.519
so one problem one other problem with

00:12:18.279 --> 00:12:22.519
preference rankings is that there's a

00:12:20.519 --> 00:12:24.440
limited number of things that humans can

00:12:22.519 --> 00:12:28.160
compare before they get really

00:12:24.440 --> 00:12:32.360
overwhelmed so if you say I

00:12:28.160 --> 00:12:35.560
want like I want to

00:12:32.360 --> 00:12:36.920
rate 15 systems or 20 systems with

00:12:35.560 --> 00:12:39.120
respect to how good they are with

00:12:36.920 --> 00:12:40.639
respect to each other it's going to be

00:12:39.120 --> 00:12:43.680
impossible for humans to come up with a

00:12:40.639 --> 00:12:46.959
good preference ranking between them and

00:12:43.680 --> 00:12:49.480
so the typical way around this um which

00:12:46.959 --> 00:12:52.360
is also used in uh things like the

00:12:49.480 --> 00:12:55.440
chatbot Arena by lmis and other things

00:12:52.360 --> 00:12:58.720
like this is to use uh something like an

00:12:55.440 --> 00:13:00.959
ELO or true skill ranking and what these

00:12:58.720 --> 00:13:03.079
are is these are things that were

00:13:00.959 --> 00:13:05.760
created for the ranking of like chess

00:13:03.079 --> 00:13:09.160
players or video game players or other

00:13:05.760 --> 00:13:11.720
things where they like b battle against

00:13:09.160 --> 00:13:13.920
each other in multiple matches uh

00:13:11.720 --> 00:13:16.440
pair-wise and then you put all of the

00:13:13.920 --> 00:13:18.399
wins and losses into these ranking

00:13:16.440 --> 00:13:20.600
algorithms and they give you a score

00:13:18.399 --> 00:13:22.920
about how good like each of the each of

00:13:20.600 --> 00:13:27.079
the players are so if you do something

00:13:22.920 --> 00:13:29.480
like this you can um get basically a

00:13:27.079 --> 00:13:32.120
ranking of systems despite the that you

00:13:29.480 --> 00:13:35.240
only did pairwise assessments so these

00:13:32.120 --> 00:13:35.240
are also a good thing to know

00:13:37.399 --> 00:13:43.839
about a final variety of human feedback

00:13:40.600 --> 00:13:45.320
uh that we create is uh air annotation

00:13:43.839 --> 00:13:47.519
and this can be useful for a number of

00:13:45.320 --> 00:13:49.839
reasons um but basically the way it

00:13:47.519 --> 00:13:53.839
works is you annotate individual errors

00:13:49.839 --> 00:13:55.639
within the outputs and um oh one thing I

00:13:53.839 --> 00:13:58.120
should mention is that um I'm giving a

00:13:55.639 --> 00:14:00.880
lot of examples from machine translation

00:13:58.120 --> 00:14:02.800
um I feel like machine translation has

00:14:00.880 --> 00:14:04.519
been doing evaluation of generated

00:14:02.800 --> 00:14:07.600
outputs for a lot longer than a lot of

00:14:04.519 --> 00:14:09.000
other uh fields of NLP have and

00:14:07.600 --> 00:14:11.800
therefore their methodology is more

00:14:09.000 --> 00:14:13.480
developed than a lot of other fields um

00:14:11.800 --> 00:14:16.199
but a lot of these things can also be

00:14:13.480 --> 00:14:18.079
applied to uh other uh other tasks as

00:14:16.199 --> 00:14:19.079
well but anyway getting back to this

00:14:18.079 --> 00:14:20.680
there's something for machine

00:14:19.079 --> 00:14:23.639
translation called multi-dimensional

00:14:20.680 --> 00:14:26.240
quality metrics and the multidimensional

00:14:23.639 --> 00:14:29.160
quality metrics basically what they do

00:14:26.240 --> 00:14:32.199
is they annotate spans in the output

00:14:29.160 --> 00:14:34.800
where each Span in the output is given a

00:14:32.199 --> 00:14:38.079
severity ranking of the error and it's

00:14:34.800 --> 00:14:40.199
given a type of the error and there's

00:14:38.079 --> 00:14:42.600
about eight different types of Errors

00:14:40.199 --> 00:14:44.839
like this doesn't violate or this

00:14:42.600 --> 00:14:47.399
violates linguistic conventions of using

00:14:44.839 --> 00:14:49.880
the word this instead of uh here by

00:14:47.399 --> 00:14:51.639
using the word uh instead of this here

00:14:49.880 --> 00:14:55.079
and then this is an accuracy error

00:14:51.639 --> 00:14:57.839
because it's not accurately con uh uh

00:14:55.079 --> 00:15:01.720
conveying the output and then this error

00:14:57.839 --> 00:15:04.600
is minor uh this error is Major um and

00:15:01.720 --> 00:15:06.399
then there's also like severe severe

00:15:04.600 --> 00:15:07.440
versus major but minor and major is a

00:15:06.399 --> 00:15:09.680
more important

00:15:07.440 --> 00:15:11.839
distinction um so the advantage of this

00:15:09.680 --> 00:15:14.279
is a couple fold number one it gives you

00:15:11.839 --> 00:15:16.440
more fine grained feedback uh in that

00:15:14.279 --> 00:15:19.199
you can say okay this system has a lot

00:15:16.440 --> 00:15:22.199
of uh accuracy errors this system has a

00:15:19.199 --> 00:15:24.880
lot of linguistic conventions errors um

00:15:22.199 --> 00:15:28.600
it also can be more consistent because

00:15:24.880 --> 00:15:29.839
if you just say to people which output

00:15:28.600 --> 00:15:31.800
is better

00:15:29.839 --> 00:15:34.560
or what is the score of this output

00:15:31.800 --> 00:15:36.360
people have trouble deciding about that

00:15:34.560 --> 00:15:39.560
because it's a more subjective

00:15:36.360 --> 00:15:41.680
evaluation but if I say is this word

00:15:39.560 --> 00:15:43.000
correct it's a little bit easier for

00:15:41.680 --> 00:15:44.759
people to do so you can get more

00:15:43.000 --> 00:15:46.920
consistent annotations

00:15:44.759 --> 00:15:49.720
here the problem with this is this can

00:15:46.920 --> 00:15:50.839
be very time consuming so um you know

00:15:49.720 --> 00:15:52.480
obviously you need to go through and

00:15:50.839 --> 00:15:56.440
annotate every single error if it's for

00:15:52.480 --> 00:15:56.440
a long outputs or something your

00:15:56.959 --> 00:16:03.519
problem so anyway these are just three

00:15:59.800 --> 00:16:05.680
uh ways of collecting human feedback um

00:16:03.519 --> 00:16:08.639
and then there's an alternative which is

00:16:05.680 --> 00:16:10.079
automatic evaluation of outputs and um

00:16:08.639 --> 00:16:14.399
there's a bunch of different ways we can

00:16:10.079 --> 00:16:16.800
do this the basic idea here is we have a

00:16:14.399 --> 00:16:20.199
source um we have a couple

00:16:16.800 --> 00:16:22.800
hypotheses and uh we have an automatic

00:16:20.199 --> 00:16:26.000
system that generates outputs uh like

00:16:22.800 --> 00:16:28.279
scores and we optionally have a

00:16:26.000 --> 00:16:30.839
reference output so the reference output

00:16:28.279 --> 00:16:33.519
is a human created gold standard output

00:16:30.839 --> 00:16:35.120
with respect to how good that um uh with

00:16:33.519 --> 00:16:38.240
respect to like what the output should

00:16:35.120 --> 00:16:38.240
be in an ideal

00:16:38.279 --> 00:16:47.079
case and basically the goal of automatic

00:16:43.199 --> 00:16:50.199
evaluation is to

00:16:47.079 --> 00:16:52.839
predict human preferences or to predict

00:16:50.199 --> 00:16:56.240
what the human scores would be um

00:16:52.839 --> 00:16:58.600
because still at this point um we mostly

00:16:56.240 --> 00:16:59.480
view what humans think of the output to

00:16:58.600 --> 00:17:01.680
be

00:16:59.480 --> 00:17:03.280
uh kind of the

00:17:01.680 --> 00:17:06.199
standard

00:17:03.280 --> 00:17:08.439
and this is called a variety of things

00:17:06.199 --> 00:17:10.600
depending on what field you're in um in

00:17:08.439 --> 00:17:12.559
machine translation and summarization

00:17:10.600 --> 00:17:13.520
it's called automatic evaluation also a

00:17:12.559 --> 00:17:16.520
lot in

00:17:13.520 --> 00:17:18.400
dialogue um if you're talking about

00:17:16.520 --> 00:17:21.000
people from reinforcement learning or

00:17:18.400 --> 00:17:24.600
other things um or chat Bots or things

00:17:21.000 --> 00:17:28.240
like that uh a lot of people or uh like

00:17:24.600 --> 00:17:31.280
AGI or whatever um a lot of people call

00:17:28.240 --> 00:17:32.520
it uh word model um because that

00:17:31.280 --> 00:17:34.480
specifically comes from the point of

00:17:32.520 --> 00:17:36.440
view of like learning from this feedback

00:17:34.480 --> 00:17:37.960
but essentially they're the same thing

00:17:36.440 --> 00:17:41.080
uh from my point of view they're trying

00:17:37.960 --> 00:17:42.520
to predict how good an output is and how

00:17:41.080 --> 00:17:44.240
much you should reward the model for

00:17:42.520 --> 00:17:46.559
producing that

00:17:44.240 --> 00:17:48.679
output

00:17:46.559 --> 00:17:50.520
um so there's a bunch of different

00:17:48.679 --> 00:17:51.720
methods to do this I'm not going to

00:17:50.520 --> 00:17:53.799
cover all of them I'm just going to

00:17:51.720 --> 00:17:55.240
cover three paradigms for doing this so

00:17:53.799 --> 00:17:57.880
you know where to look further if you're

00:17:55.240 --> 00:18:00.039
interested in doing these things um the

00:17:57.880 --> 00:18:02.400
first one is embedding based

00:18:00.039 --> 00:18:04.679
evaluation and the way embedding based

00:18:02.400 --> 00:18:06.600
evaluation works is usually it's

00:18:04.679 --> 00:18:11.400
unsupervised calculation based on

00:18:06.600 --> 00:18:14.880
embeding similarity between um

00:18:11.400 --> 00:18:18.080
the output that the model generated and

00:18:14.880 --> 00:18:20.840
a reference output that uh you have

00:18:18.080 --> 00:18:23.400
created so sorry this is very small but

00:18:20.840 --> 00:18:25.559
we have a reference here that says the

00:18:23.400 --> 00:18:27.640
weather is cold today and we have a

00:18:25.559 --> 00:18:30.240
candidate that says it is freezing today

00:18:27.640 --> 00:18:33.000
so this is probably you know like a good

00:18:30.240 --> 00:18:35.480
um a reasonably good

00:18:33.000 --> 00:18:37.640
output and we run this through some

00:18:35.480 --> 00:18:39.120
embedding model uh it was called Bert

00:18:37.640 --> 00:18:40.679
score and so of course you can run it

00:18:39.120 --> 00:18:42.240
through Bert but basically it can be any

00:18:40.679 --> 00:18:43.799
embedding model that gives you embedding

00:18:42.240 --> 00:18:46.200
for each token in the

00:18:43.799 --> 00:18:47.640
sequence and so there are five tokens in

00:18:46.200 --> 00:18:49.720
this sequence four tokens in this

00:18:47.640 --> 00:18:51.960
sequence you get five tokens and then

00:18:49.720 --> 00:18:54.799
four sorry five embeddings and then four

00:18:51.960 --> 00:18:57.400
embeddings you calculate carewise cosine

00:18:54.799 --> 00:18:59.880
similarity between all of them and this

00:18:57.400 --> 00:19:03.480
gives you cosine

00:18:59.880 --> 00:19:06.480
similarity Matrix and then you take the

00:19:03.480 --> 00:19:09.120
ARG Max or you take the maximum

00:19:06.480 --> 00:19:11.280
similarity along either the

00:19:09.120 --> 00:19:15.799
rows or the

00:19:11.280 --> 00:19:19.559
columns and here the rows correspond

00:19:15.799 --> 00:19:22.400
to tokens in the reference and because

00:19:19.559 --> 00:19:24.039
the rows correspond to tokens in the

00:19:22.400 --> 00:19:26.960
reference

00:19:24.039 --> 00:19:28.320
the how well you find something that is

00:19:26.960 --> 00:19:31.679
similar to each of the tokens in the

00:19:28.320 --> 00:19:34.000
reference is like a recall based method

00:19:31.679 --> 00:19:35.919
because it's saying how many tokens in

00:19:34.000 --> 00:19:39.520
the reference have a good match in the

00:19:35.919 --> 00:19:41.120
output and then if you look at the

00:19:39.520 --> 00:19:42.799
columns if you look at the max and the

00:19:41.120 --> 00:19:44.960
columns this is like a precision based

00:19:42.799 --> 00:19:47.000
metric because it's saying how many of

00:19:44.960 --> 00:19:49.360
the things in the output are similar

00:19:47.000 --> 00:19:51.240
have a similar match in the reference so

00:19:49.360 --> 00:19:54.480
basically you can calculate recall and

00:19:51.240 --> 00:19:56.200
precision over all of the tokens and

00:19:54.480 --> 00:20:00.200
then feed this into something that looks

00:19:56.200 --> 00:20:02.400
like fmeasure and you can also use tfidf

00:20:00.200 --> 00:20:06.000
waiting um like what I talked about in

00:20:02.400 --> 00:20:07.799
the rag lecture uh to upweight low

00:20:06.000 --> 00:20:09.520
frequency words because low frequency

00:20:07.799 --> 00:20:11.440
words tend to be more content words and

00:20:09.520 --> 00:20:13.120
going back to my example you know if you

00:20:11.440 --> 00:20:14.280
make a mistake from Pittsburgh to Tokyo

00:20:13.120 --> 00:20:17.880
that's going to be more painful than

00:20:14.280 --> 00:20:21.000
making a mistake from this to um so

00:20:17.880 --> 00:20:22.520
actually if you'll uh if you were paying

00:20:21.000 --> 00:20:25.480
close attention to the rag lecture this

00:20:22.520 --> 00:20:27.360
looks really similar to the co bear um

00:20:25.480 --> 00:20:29.559
the co bear retrieval objective that I

00:20:27.360 --> 00:20:30.960
talked about in the r lecture um I don't

00:20:29.559 --> 00:20:32.840
think it's a coincidence they both came

00:20:30.960 --> 00:20:34.360
out around the same time uh so people

00:20:32.840 --> 00:20:36.360
were thinking about the same thing but

00:20:34.360 --> 00:20:37.600
um this is one method that's pretty

00:20:36.360 --> 00:20:40.200
widely

00:20:37.600 --> 00:20:43.480
use the bird Square code base is also

00:20:40.200 --> 00:20:45.440
really nice and easy to use so um if uh

00:20:43.480 --> 00:20:47.640
you want to try it out feel free to take

00:20:45.440 --> 00:20:47.640
a

00:20:48.159 --> 00:20:53.840
look cool um the next one I'd like to

00:20:51.600 --> 00:20:56.080
talk about is a regression based

00:20:53.840 --> 00:20:58.760
evaluation and the way this works is

00:20:56.080 --> 00:21:02.600
this is usually used in a supervised uh

00:20:58.760 --> 00:21:04.320
setting so uh the way what you have to

00:21:02.600 --> 00:21:07.600
do is you have to calculate a whole

00:21:04.320 --> 00:21:09.799
bunch of like actual human

00:21:07.600 --> 00:21:12.440
judgments and

00:21:09.799 --> 00:21:15.000
usually these judgments can either be

00:21:12.440 --> 00:21:16.960
direct assessment uh where you actually

00:21:15.000 --> 00:21:19.120
have a score or they can be pairwise

00:21:16.960 --> 00:21:20.840
judgments and then if you have direct

00:21:19.120 --> 00:21:23.640
assessment you use a regression based

00:21:20.840 --> 00:21:26.039
loss like uh minimum squared error if

00:21:23.640 --> 00:21:27.520
you have pairwise uh you use a ranking

00:21:26.039 --> 00:21:29.039
based loss that tries to upweight the

00:21:27.520 --> 00:21:31.360
ones that are higher scoring downward

00:21:29.039 --> 00:21:33.200
the ones that are lower scoring one

00:21:31.360 --> 00:21:35.720
typical example of this is Comet which

00:21:33.200 --> 00:21:37.200
is or has been at least for a very long

00:21:35.720 --> 00:21:39.880
time the state-of-the art and machine

00:21:37.200 --> 00:21:41.279
translation evaluation and the reason

00:21:39.880 --> 00:21:43.440
why it works so well is because we have

00:21:41.279 --> 00:21:44.720
a bunch of evaluations for machine

00:21:43.440 --> 00:21:46.080
translation they've been doing

00:21:44.720 --> 00:21:47.600
evaluation and machine translation

00:21:46.080 --> 00:21:50.480
systems for years and you can use that

00:21:47.600 --> 00:21:52.720
as lots of supervised training data so

00:21:50.480 --> 00:21:54.640
basically you just take um these

00:21:52.720 --> 00:21:56.440
evaluation data you have human

00:21:54.640 --> 00:21:59.080
annotations you have the output

00:21:56.440 --> 00:22:00.320
according to a model like comet um you

00:21:59.080 --> 00:22:02.679
calculate the difference between them

00:22:00.320 --> 00:22:05.640
and you update model

00:22:02.679 --> 00:22:07.080
parameters um the problem this is great

00:22:05.640 --> 00:22:08.520
if you have lots of training data the

00:22:07.080 --> 00:22:10.640
problem with this is for a lot of tasks

00:22:08.520 --> 00:22:12.360
we don't have lots of training data so

00:22:10.640 --> 00:22:14.720
um you know training these is a little

00:22:12.360 --> 00:22:14.720
bit less

00:22:15.400 --> 00:22:22.919
feasible and now recently uh what we

00:22:19.600 --> 00:22:25.279
have been moving into is is a QA based

00:22:22.919 --> 00:22:27.120
evaluation which is basically where we

00:22:25.279 --> 00:22:30.760
ask a language model how good the output

00:22:27.120 --> 00:22:32.279
is and so uh gmba is an example one of

00:22:30.760 --> 00:22:34.559
the early examples of this for machine

00:22:32.279 --> 00:22:37.320
translation evaluation uh where they

00:22:34.559 --> 00:22:39.840
basically just ask a g gp4 like score

00:22:37.320 --> 00:22:41.600
the following translation from Source

00:22:39.840 --> 00:22:44.000
language to target language with respect

00:22:41.600 --> 00:22:47.080
to the human reference um on a

00:22:44.000 --> 00:22:49.200
continuous scale from Z to 100 uh where

00:22:47.080 --> 00:22:51.320
the score of zero means no meaning

00:22:49.200 --> 00:22:54.039
preserved and the score of 100 means a

00:22:51.320 --> 00:22:56.880
perfect meaning in grammar uh you feed

00:22:54.039 --> 00:22:58.760
in the source um you feed in the T the

00:22:56.880 --> 00:23:01.000
human reference optionally if you have a

00:22:58.760 --> 00:23:03.320
human reference and then you feed in the

00:23:01.000 --> 00:23:06.760
Target um and you get a

00:23:03.320 --> 00:23:09.919
score and um so this this works pretty

00:23:06.760 --> 00:23:12.720
well this can give you uh better results

00:23:09.919 --> 00:23:15.159
um there's a especially if you have a

00:23:12.720 --> 00:23:16.960
strong language model the problem is

00:23:15.159 --> 00:23:18.279
it's very unpredictable whether this is

00:23:16.960 --> 00:23:20.120
going to work well and it's very

00:23:18.279 --> 00:23:23.039
dependent on the prompt that you're

00:23:20.120 --> 00:23:25.279
using so um right now A lot of people

00:23:23.039 --> 00:23:27.279
are using gp4 without actually

00:23:25.279 --> 00:23:29.039
validating whether it does a good job at

00:23:27.279 --> 00:23:33.080
evaluation and

00:23:29.039 --> 00:23:34.919
and my the results are all across the

00:23:33.080 --> 00:23:36.880
board it can be anywhere from very very

00:23:34.919 --> 00:23:38.640
good to very very bad at evaluating

00:23:36.880 --> 00:23:41.320
particular tasks so I would be at least

00:23:38.640 --> 00:23:43.559
a little bit suspicious of whether gp4

00:23:41.320 --> 00:23:45.679
is doing a good job evaluating for your

00:23:43.559 --> 00:23:49.320
task especially more complex

00:23:45.679 --> 00:23:51.960
tests um I would especially be

00:23:49.320 --> 00:23:54.000
suspicious if you're doing two uh any of

00:23:51.960 --> 00:23:56.760
the two following things number one if

00:23:54.000 --> 00:23:59.880
you're comparing gp4 or any model

00:23:56.760 --> 00:24:02.400
against itself in another model because

00:23:59.880 --> 00:24:05.200
gp4 really likes

00:24:02.400 --> 00:24:06.880
gp4 it really likes its own outputs and

00:24:05.200 --> 00:24:08.120
there are papers uh sorry I don't

00:24:06.880 --> 00:24:09.679
actually have the references here but I

00:24:08.120 --> 00:24:11.200
can follow up if people are interested

00:24:09.679 --> 00:24:13.080
but there are papers that demonstrate

00:24:11.200 --> 00:24:15.799
that gp4 likes it you know its own

00:24:13.080 --> 00:24:19.200
outputs more than others also if you're

00:24:15.799 --> 00:24:22.120
explicitly optimizing the outputs using

00:24:19.200 --> 00:24:24.640
rlf um there is something called good

00:24:22.120 --> 00:24:27.120
Hearts law which is basically anytime

00:24:24.640 --> 00:24:29.520
you uh start optimizing towards a metric

00:24:27.120 --> 00:24:32.559
it becomes a bad metric and that also

00:24:29.520 --> 00:24:35.000
happens for gp4 based evaluations so if

00:24:32.559 --> 00:24:37.200
you start optimizing for gp4 based

00:24:35.000 --> 00:24:38.960
evaluations especially for reference

00:24:37.200 --> 00:24:41.679
list metrics that don't use a reference

00:24:38.960 --> 00:24:44.840
output then um you start basically

00:24:41.679 --> 00:24:47.440
exploiting the metric

00:24:44.840 --> 00:24:49.840
um another thing that you can do with QA

00:24:47.440 --> 00:24:53.279
based evaluation is ask about fine grade

00:24:49.840 --> 00:24:54.919
mistakes and so this is a paper by um uh

00:24:53.279 --> 00:24:56.480
Patrick Fernandez who's a student who's

00:24:54.919 --> 00:25:02.080
working with me and basically what we

00:24:56.480 --> 00:25:05.240
did is we asked the model to um not give

00:25:02.080 --> 00:25:07.360
a particular score but actually identify

00:25:05.240 --> 00:25:08.880
the mistakes in the output and when we

00:25:07.360 --> 00:25:10.559
asked it to identify the mistakes in the

00:25:08.880 --> 00:25:13.720
output we found that this gave more

00:25:10.559 --> 00:25:17.320
consistent uh results so kind of

00:25:13.720 --> 00:25:18.840
interestingly we ask humans to identify

00:25:17.320 --> 00:25:21.120
individual mistakes and the output that

00:25:18.840 --> 00:25:24.240
gives humans more consistent results

00:25:21.120 --> 00:25:25.559
it's the same thing for gp4 so um that

00:25:24.240 --> 00:25:27.320
that's another paper you can look at if

00:25:25.559 --> 00:25:29.640
you're

00:25:27.320 --> 00:25:32.679
interested

00:25:29.640 --> 00:25:38.000
cool um so I I mentioned that you could

00:25:32.679 --> 00:25:38.000
or could not uh trust uh yeah sorry go

00:25:44.679 --> 00:25:51.279
ahead uh correct so yeah B basically

00:25:47.360 --> 00:25:53.279
just what you do is you have the source

00:25:51.279 --> 00:25:54.960
um ideally you'll also have a reference

00:25:53.279 --> 00:25:57.840
output that was created by skilled

00:25:54.960 --> 00:25:59.720
humans and then you put in the Target

00:25:57.840 --> 00:26:02.279
you know output basically you have the

00:25:59.720 --> 00:26:08.000
input ideally a reference output created

00:26:02.279 --> 00:26:08.000
by Good by skilled humans and uh like

00:26:15.159 --> 00:26:20.240
hypothesis yeah I

00:26:17.919 --> 00:26:24.559
mean it's a good question and I don't

00:26:20.240 --> 00:26:26.919
know if we actually have a a very clear

00:26:24.559 --> 00:26:31.399
empirical like evidence of why this is

00:26:26.919 --> 00:26:33.320
the case but my hypothesis about this is

00:26:31.399 --> 00:26:36.159
yes we kind of would expect models to be

00:26:33.320 --> 00:26:38.200
more biased towards their own outputs

00:26:36.159 --> 00:26:40.919
and the reason why is because

00:26:38.200 --> 00:26:43.080
essentially you know models

00:26:40.919 --> 00:26:44.279
are within their embeddings they're

00:26:43.080 --> 00:26:45.760
encoding when they're in a high

00:26:44.279 --> 00:26:47.600
probability part of the space and when

00:26:45.760 --> 00:26:50.200
they're in a low probability part of the

00:26:47.600 --> 00:26:51.120
space and like the high probability part

00:26:50.200 --> 00:26:54.600
of the

00:26:51.120 --> 00:26:56.200
space is going to be the high

00:26:54.600 --> 00:26:58.600
probability part of the space is going

00:26:56.200 --> 00:27:02.559
to be associated with good outputs

00:26:58.600 --> 00:27:07.000
because like when

00:27:02.559 --> 00:27:08.600
models are more sure of their outputs

00:27:07.000 --> 00:27:11.960
they're more likely to be

00:27:08.600 --> 00:27:13.520
good just because that indicates that

00:27:11.960 --> 00:27:15.240
like they're closer to the training data

00:27:13.520 --> 00:27:17.760
that it had and other things like that

00:27:15.240 --> 00:27:21.600
so model probabilities are associated

00:27:17.760 --> 00:27:23.760
with outputs uh with uh with good

00:27:21.600 --> 00:27:26.600
outputs but just

00:27:23.760 --> 00:27:29.440
correla separately from

00:27:26.600 --> 00:27:32.120
that I believe a model can identify when

00:27:29.440 --> 00:27:33.320
it's in a high probability segment of

00:27:32.120 --> 00:27:35.799
the space and when it's in a low

00:27:33.320 --> 00:27:39.399
probability segment of the space and

00:27:35.799 --> 00:27:39.399
because of that I expect

00:27:39.519 --> 00:27:45.519
that I like there are segments of the

00:27:43.240 --> 00:27:47.120
embedding space where it's more likely

00:27:45.519 --> 00:27:48.360
to answer yes about something being good

00:27:47.120 --> 00:27:50.960
or not and those are going to be

00:27:48.360 --> 00:27:54.760
associated with high uh like high

00:27:50.960 --> 00:27:56.159
probability outbreaks as well and also

00:27:54.760 --> 00:27:57.760
models are more likely to generate

00:27:56.159 --> 00:28:00.240
outputs that are high probability

00:27:57.760 --> 00:28:02.320
according into their model by definition

00:28:00.240 --> 00:28:03.880
so all three of those effects together

00:28:02.320 --> 00:28:05.640
would basically go into a model being

00:28:03.880 --> 00:28:09.120
bios supports its own outputs compared

00:28:05.640 --> 00:28:11.559
to that puts in another model but um

00:28:09.120 --> 00:28:13.279
yeah this is a very handwavy explanation

00:28:11.559 --> 00:28:15.519
but like putting the two the three

00:28:13.279 --> 00:28:18.600
together models output high probability

00:28:15.519 --> 00:28:20.880
things from their own probability Space

00:28:18.600 --> 00:28:23.440
by definition

00:28:20.880 --> 00:28:25.760
um things that are high probability are

00:28:23.440 --> 00:28:27.519
associated with being good uh just

00:28:25.760 --> 00:28:29.279
because otherwise a model would be

00:28:27.519 --> 00:28:31.840
outputting garbage

00:28:29.279 --> 00:28:33.840
and um the final thing which is more

00:28:31.840 --> 00:28:35.679
tenuous is if the model is in a high

00:28:33.840 --> 00:28:37.919
probability segment of the space it's

00:28:35.679 --> 00:28:39.760
more likely to Output yes according to a

00:28:37.919 --> 00:28:41.480
question of it being good and I I think

00:28:39.760 --> 00:28:44.360
that's probably true but I'm not 100%

00:28:41.480 --> 00:28:44.360
sure about the the

00:28:45.559 --> 00:28:51.039
fin um maybe maybe someone wants to

00:28:49.000 --> 00:28:52.840
examinate examine that as a final

00:28:51.039 --> 00:28:54.200
project it seems like a interesting

00:28:52.840 --> 00:28:57.080
interesting

00:28:54.200 --> 00:29:00.039
question um cool uh were there any other

00:28:57.080 --> 00:29:00.039
questions about these methods

00:29:00.159 --> 00:29:07.120
here um okay so when I say like an

00:29:03.960 --> 00:29:11.080
evaluation metric is good or not what do

00:29:07.120 --> 00:29:13.200
I mean by this being good or not um or a

00:29:11.080 --> 00:29:16.880
reward model or whatever else and

00:29:13.200 --> 00:29:18.440
basically the um the way we typically do

00:29:16.880 --> 00:29:19.840
this is by doing something called meta

00:29:18.440 --> 00:29:22.440
evaluation so it's called meta

00:29:19.840 --> 00:29:25.799
evaluation because it's evaluation of

00:29:22.440 --> 00:29:29.279
evaluation and uh the way we do this is

00:29:25.799 --> 00:29:32.519
we have human uh scores and we have

00:29:29.279 --> 00:29:34.760
automatic scores and we usually

00:29:32.519 --> 00:29:38.640
calculate some sort of correlation

00:29:34.760 --> 00:29:41.000
between the scores so um typical ones

00:29:38.640 --> 00:29:46.440
are rank correlations like Pearson's

00:29:41.000 --> 00:29:48.799
correlation or tendle uh Tow and uh so

00:29:46.440 --> 00:29:51.200
the more Associated the automatic scores

00:29:48.799 --> 00:29:53.960
are with the human scores the higher

00:29:51.200 --> 00:29:55.159
these correlations are going to be um

00:29:53.960 --> 00:29:57.559
there's other things that you can

00:29:55.159 --> 00:30:00.080
calculate so if you're trying to figure

00:29:57.559 --> 00:30:01.640
out whether a model um matches human

00:30:00.080 --> 00:30:04.279
pairwise preferences you can just

00:30:01.640 --> 00:30:06.440
calculate accuracy so I didn't put that

00:30:04.279 --> 00:30:08.080
on um I didn't put that on the slide

00:30:06.440 --> 00:30:10.880
here but you can just calculate accuracy

00:30:08.080 --> 00:30:13.120
of pairwise preferences um you can also

00:30:10.880 --> 00:30:15.360
calculate the absolute error between the

00:30:13.120 --> 00:30:19.320
the judgments if you want to know uh

00:30:15.360 --> 00:30:21.720
whether the absolute error matches so um

00:30:19.320 --> 00:30:24.159
the these are good things to do if you

00:30:21.720 --> 00:30:25.600
want to use an evaluation metric but you

00:30:24.159 --> 00:30:27.200
aren't sure whether it's good or not I

00:30:25.600 --> 00:30:29.640
would check to see whether the authors

00:30:27.200 --> 00:30:32.000
have done this sort of meta evaluation

00:30:29.640 --> 00:30:33.760
if they haven't be a little bit

00:30:32.000 --> 00:30:36.960
suspicious if they have be a little bit

00:30:33.760 --> 00:30:39.799
less suspicious but um

00:30:36.960 --> 00:30:42.960
yeah how do people do this typically uh

00:30:39.799 --> 00:30:45.640
usually they create uh data sets like

00:30:42.960 --> 00:30:49.440
the WM they use data sets like the WMT

00:30:45.640 --> 00:30:53.960
shared tasks um or

00:30:49.440 --> 00:30:57.679
uh uh like some evl um but there's also

00:30:53.960 --> 00:30:59.960
other ways to create um uh there's also

00:30:57.679 --> 00:31:01.639
Lots other data sets but in order to do

00:30:59.960 --> 00:31:05.639
this reliably you need a fairly large

00:31:01.639 --> 00:31:05.639
data set so it's one thing to be aware

00:31:07.080 --> 00:31:10.760
of

00:31:08.720 --> 00:31:14.200
cool

00:31:10.760 --> 00:31:16.360
um then the final thing um all of the

00:31:14.200 --> 00:31:17.919
automatic evaluation methods that I

00:31:16.360 --> 00:31:20.240
talked about now are trying to match

00:31:17.919 --> 00:31:22.679
human preferences but that's not the

00:31:20.240 --> 00:31:24.960
only thing that you necessarily want to

00:31:22.679 --> 00:31:28.440
do the final thing that you might want

00:31:24.960 --> 00:31:30.840
to do is uh use the model outputs in a

00:31:28.440 --> 00:31:34.200
downstream system and see whether they

00:31:30.840 --> 00:31:36.399
are effective for that so there's two

00:31:34.200 --> 00:31:39.080
concepts of intrinsic evaluation and

00:31:36.399 --> 00:31:41.720
extrinsic evaluation so intrinsic

00:31:39.080 --> 00:31:44.159
evaluation um evaluates the quality of

00:31:41.720 --> 00:31:45.720
the output itself and so that would be

00:31:44.159 --> 00:31:48.639
like asking a human directly about how

00:31:45.720 --> 00:31:50.720
good is this output extrinsic evaluation

00:31:48.639 --> 00:31:53.679
is evaluating output quality by its

00:31:50.720 --> 00:31:57.000
utility um and so just to give one

00:31:53.679 --> 00:31:58.360
example um if you can evaluate large

00:31:57.000 --> 00:32:00.200
language model summary

00:31:58.360 --> 00:32:04.200
through question answering

00:32:00.200 --> 00:32:05.880
accuracy um and so you can take the

00:32:04.200 --> 00:32:07.399
output of an llm and feed it through a

00:32:05.880 --> 00:32:09.600
question answering model and see whether

00:32:07.399 --> 00:32:12.399
you're able to answer questions based on

00:32:09.600 --> 00:32:15.799
this and that kind of gives you a better

00:32:12.399 --> 00:32:18.279
idea of whether the summary require uh

00:32:15.799 --> 00:32:20.120
incorporates requisite information but

00:32:18.279 --> 00:32:22.120
if you think about anything an llm can

00:32:20.120 --> 00:32:23.760
be used for usually it's part of a

00:32:22.120 --> 00:32:26.679
bigger system so you can evaluate it as

00:32:23.760 --> 00:32:28.399
a part of that bigger system um the

00:32:26.679 --> 00:32:30.639
problem with this is it's a very

00:32:28.399 --> 00:32:33.960
indirect way of assessing things so like

00:32:30.639 --> 00:32:36.080
let's say your QA model is just bad uh

00:32:33.960 --> 00:32:38.480
how can you disentangle the effect of

00:32:36.080 --> 00:32:41.679
the L summary versus the QA model that's

00:32:38.480 --> 00:32:44.120
not a trivial thing to do so ideally

00:32:41.679 --> 00:32:47.000
like a combination of these two is

00:32:44.120 --> 00:32:47.000
practically the best way

00:32:48.039 --> 00:32:52.200
go cool so

00:32:56.039 --> 00:32:59.960
yeah yeah it wouldn't necessar

00:32:58.360 --> 00:33:05.679
say it's harder to do it might even be

00:32:59.960 --> 00:33:05.679
easier to do um which is like let's

00:33:06.679 --> 00:33:11.720
say Let me let me see if I can come up

00:33:09.360 --> 00:33:11.720
with

00:33:12.639 --> 00:33:17.600
example what let's

00:33:15.000 --> 00:33:19.670
say you

00:33:17.600 --> 00:33:22.979
are trying

00:33:19.670 --> 00:33:22.979
[Music]

00:33:24.639 --> 00:33:29.760
to let's say you're trying to

00:33:30.559 --> 00:33:33.559
guess

00:33:39.000 --> 00:33:45.399
whether let's say you're trying to guess

00:33:42.399 --> 00:33:46.559
whether a someone will be hired at a

00:33:45.399 --> 00:33:52.039
company or

00:33:46.559 --> 00:33:53.880
not based on an llm generated summary of

00:33:52.039 --> 00:33:58.880
their qualifications for a position or

00:33:53.880 --> 00:34:01.799
something like that um and

00:33:58.880 --> 00:34:03.080
you what actually maybe this is not a

00:34:01.799 --> 00:34:04.720
great example because whether you should

00:34:03.080 --> 00:34:06.960
be doing this ethically is a little bit

00:34:04.720 --> 00:34:08.159
unclear but let's say you were doing

00:34:06.960 --> 00:34:09.560
let's say you were doing something like

00:34:08.159 --> 00:34:11.520
that just because it's one example I can

00:34:09.560 --> 00:34:14.320
think of right now whether they will get

00:34:11.520 --> 00:34:16.320
hired or not is um is clear because you

00:34:14.320 --> 00:34:19.399
have a objective answer right whether

00:34:16.320 --> 00:34:21.480
they were hired or not um or maybe maybe

00:34:19.399 --> 00:34:23.800
another example would be like let's say

00:34:21.480 --> 00:34:26.320
um let's say you want to predict the

00:34:23.800 --> 00:34:29.599
diagnosis in a medical application based

00:34:26.320 --> 00:34:32.960
on an llm generated some of somebody's

00:34:29.599 --> 00:34:35.919
uh you know LM generated summary of

00:34:32.960 --> 00:34:38.480
somebody's you know past medical history

00:34:35.919 --> 00:34:40.839
and all this stuff and here you want the

00:34:38.480 --> 00:34:43.440
llm generated summary you definitely

00:34:40.839 --> 00:34:44.879
want the summary because the summary is

00:34:43.440 --> 00:34:47.560
going to be viewed by a doctor who will

00:34:44.879 --> 00:34:49.359
make the final decision but you also

00:34:47.560 --> 00:34:50.760
have information about the diagnoses of

00:34:49.359 --> 00:34:52.399
all the people in your medical system

00:34:50.760 --> 00:34:54.560
later because you know they went through

00:34:52.399 --> 00:34:56.480
your medical system for years and you

00:34:54.560 --> 00:34:58.200
know later like through lots of tests

00:34:56.480 --> 00:35:00.800
and stuff uh whether how they were

00:34:58.200 --> 00:35:02.320
diagnosed so you generate an LM based

00:35:00.800 --> 00:35:05.000
summary and then you predict the

00:35:02.320 --> 00:35:06.599
diagnosis from the summary so there the

00:35:05.000 --> 00:35:08.040
evaluation of the diagnosis is very

00:35:06.599 --> 00:35:11.480
clear because you kind of have a gold

00:35:08.040 --> 00:35:12.599
standard answer um but the EV intrinsic

00:35:11.480 --> 00:35:14.839
evaluation of whether it's a good

00:35:12.599 --> 00:35:16.839
summary or not is not as clear because

00:35:14.839 --> 00:35:19.400
you'd have pass do whether it's good and

00:35:16.839 --> 00:35:21.079
understandable summary so the extrinsic

00:35:19.400 --> 00:35:24.920
evaluation might be easier because it's

00:35:21.079 --> 00:35:26.480
clearer um so there are cases like that

00:35:24.920 --> 00:35:30.720
um the problem is you would have to have

00:35:26.480 --> 00:35:33.800
that data in order to do that um yeah do

00:35:30.720 --> 00:35:38.240
like evaluation yeah I was just

00:35:33.800 --> 00:35:40.800
wondering typically the

00:35:38.240 --> 00:35:42.880
like like how do you accomodate the

00:35:40.800 --> 00:35:47.160
diversity oh yeah that's a great that's

00:35:42.880 --> 00:35:50.240
a great question um so how do you how do

00:35:47.160 --> 00:35:50.240
you get these scores

00:35:50.720 --> 00:35:55.800
here there's a number of different

00:35:53.200 --> 00:35:59.160
things in the WMT shared tasks what they

00:35:55.800 --> 00:36:00.280
did is they did

00:35:59.160 --> 00:36:03.200
the first thing they do is they

00:36:00.280 --> 00:36:06.319
normalize by annotator and what they do

00:36:03.200 --> 00:36:10.400
is they basically take the zcore or Z

00:36:06.319 --> 00:36:12.240
score of the um of the human annotator's

00:36:10.400 --> 00:36:14.880
actual scores because some people are

00:36:12.240 --> 00:36:16.400
more harsh than other people and so what

00:36:14.880 --> 00:36:20.680
that means is you basically normalize to

00:36:16.400 --> 00:36:22.119
have zero mean in unit variance um and

00:36:20.680 --> 00:36:24.119
then after they've normalized to zero

00:36:22.119 --> 00:36:29.560
mean and unit variance then I think they

00:36:24.119 --> 00:36:29.560
average together different humans so um

00:36:30.160 --> 00:36:36.520
then for how do you deal with the fact

00:36:33.680 --> 00:36:38.040
that humans disagree on things and I

00:36:36.520 --> 00:36:39.480
think it's pretty varied I don't know if

00:36:38.040 --> 00:36:42.160
there's any gold standard way of doing

00:36:39.480 --> 00:36:43.839
it but sometimes you just average

00:36:42.160 --> 00:36:46.359
sometimes you throw away examples where

00:36:43.839 --> 00:36:47.960
humans disagree a lot um because like

00:36:46.359 --> 00:36:50.200
you can't get the humans to agree how

00:36:47.960 --> 00:36:53.319
could you expect how could you expect a

00:36:50.200 --> 00:36:55.119
machine to do well um so I think it it's

00:36:53.319 --> 00:36:59.200
a little bit test

00:36:55.119 --> 00:37:01.560
defending yeah so for

00:36:59.200 --> 00:37:04.560
generation inin

00:37:01.560 --> 00:37:06.280
andin yeah so for code generation that's

00:37:04.560 --> 00:37:08.200
I I I love this example because I've

00:37:06.280 --> 00:37:09.960
worked on code generation a lot of

00:37:08.200 --> 00:37:12.680
people only think about extrinsic

00:37:09.960 --> 00:37:14.400
evaluation of code Generation Um or I

00:37:12.680 --> 00:37:16.160
don't know if it's extrinsic but only

00:37:14.400 --> 00:37:19.160
think about execution based evaluation

00:37:16.160 --> 00:37:20.520
of code generation which is like you

00:37:19.160 --> 00:37:22.400
execute the code you see whether it

00:37:20.520 --> 00:37:25.040
passs unit tests and other things like

00:37:22.400 --> 00:37:26.839
this but in reality actually there's a

00:37:25.040 --> 00:37:28.599
lot of other important things for code

00:37:26.839 --> 00:37:30.560
like readability and other stuff like

00:37:28.599 --> 00:37:32.160
that and you should be evaluating those

00:37:30.560 --> 00:37:34.920
things but I think a lot of people like

00:37:32.160 --> 00:37:36.520
kind of ignore that so um there there

00:37:34.920 --> 00:37:38.880
are a few Pap that do that but most of

00:37:36.520 --> 00:37:41.000
the time people just execute the Cod

00:37:38.880 --> 00:37:45.520
process

00:37:41.000 --> 00:37:47.760
un cool okay um so yeah moving on to the

00:37:45.520 --> 00:37:51.160
learning part so now I'd like to talk

00:37:47.760 --> 00:37:55.280
about uh learning and the first thing

00:37:51.160 --> 00:37:59.480
I'll cover is error and risk and so

00:37:55.280 --> 00:38:02.280
basically um the way we calculate air is

00:37:59.480 --> 00:38:03.119
we generate an output and we calculate

00:38:02.280 --> 00:38:07.680
its

00:38:03.119 --> 00:38:09.480
Badness um and so generating the output

00:38:07.680 --> 00:38:13.160
could be argmax it could be sampling it

00:38:09.480 --> 00:38:15.800
could be anything else like that um and

00:38:13.160 --> 00:38:18.640
we calculate its Badness uh which is one

00:38:15.800 --> 00:38:21.040
minus in which could be like how bad is

00:38:18.640 --> 00:38:22.720
the output uh if you're you have a

00:38:21.040 --> 00:38:24.760
Badness measure or it could be one minus

00:38:22.720 --> 00:38:28.400
the evaluation Square to calculate its

00:38:24.760 --> 00:38:30.160
Badness and this is defined as error

00:38:28.400 --> 00:38:31.440
and generally what you want to do is you

00:38:30.160 --> 00:38:33.520
want to minimize

00:38:31.440 --> 00:38:36.800
error

00:38:33.520 --> 00:38:39.400
um because in the end you're going to be

00:38:36.800 --> 00:38:42.359
deploying A system that just outputs you

00:38:39.400 --> 00:38:46.079
know one thing and uh you're going to

00:38:42.359 --> 00:38:49.800
want that to be as good a thing as

00:38:46.079 --> 00:38:53.000
possible um but the problem with this is

00:38:49.800 --> 00:38:56.400
there's no easy way to actually optimize

00:38:53.000 --> 00:38:59.079
this value in especially in a text

00:38:56.400 --> 00:39:01.800
generation sty setting but even in the

00:38:59.079 --> 00:39:06.839
classification setting we can't easily

00:39:01.800 --> 00:39:06.839
maximize err because um if you look at

00:39:09.040 --> 00:39:14.200
the if you look at the surface of air uh

00:39:12.760 --> 00:39:15.960
at some point you're going to have a

00:39:14.200 --> 00:39:18.319
non-differentiable part when you take

00:39:15.960 --> 00:39:21.119
the argmax and or when you do sampling

00:39:18.319 --> 00:39:23.319
or anything like that so um you're not

00:39:21.119 --> 00:39:27.119
going to be able to do gradient based

00:39:23.319 --> 00:39:29.200
optimization so what we do normally is

00:39:27.119 --> 00:39:33.400
um

00:39:29.200 --> 00:39:37.000
we instead calculate something uh called

00:39:33.400 --> 00:39:38.560
risk and what risk looks like is uh we

00:39:37.000 --> 00:39:40.599
talked a little bit about minimum based

00:39:38.560 --> 00:39:43.520
risk for decoding but this is for uh

00:39:40.599 --> 00:39:46.160
training time and what it looks like is

00:39:43.520 --> 00:39:49.040
it's essentially the expected err of the

00:39:46.160 --> 00:39:52.359
output and the expected err of the

00:39:49.040 --> 00:39:54.760
output um includes a probability in the

00:39:52.359 --> 00:39:58.240
objective function here and that

00:39:54.760 --> 00:40:01.079
probability uh is differential basically

00:39:58.240 --> 00:40:02.319
so we can um uh we can easily do

00:40:01.079 --> 00:40:05.720
gradient based

00:40:02.319 --> 00:40:09.119
optimization through it um the problem

00:40:05.720 --> 00:40:12.200
with this is It's differentiable but for

00:40:09.119 --> 00:40:17.160
text generation for example the sum is

00:40:12.200 --> 00:40:20.319
intractable because we have a combinator

00:40:17.160 --> 00:40:23.880
large number of potential outputs um

00:40:20.319 --> 00:40:25.520
because you know if this is we've talked

00:40:23.880 --> 00:40:28.720
about this before but if this is like

00:40:25.520 --> 00:40:30.680
link you know 50 and we have a 30,000

00:40:28.720 --> 00:40:32.839
vocabul that's 30,000 to the 50

00:40:30.680 --> 00:40:34.599
possibilities we can't take a su over

00:40:32.839 --> 00:40:36.359
that many

00:40:34.599 --> 00:40:38.400
possibilities

00:40:36.359 --> 00:40:42.680
um

00:40:38.400 --> 00:40:45.839
so minimum R risk training uh tries to

00:40:42.680 --> 00:40:48.440
minimize risk reinforcement learning

00:40:45.839 --> 00:40:50.040
also many of the models especially

00:40:48.440 --> 00:40:53.599
policy gradient models are trying to

00:40:50.040 --> 00:40:55.240
minimize risk as well so um but the

00:40:53.599 --> 00:40:58.040
reason why I wanted to talk about risk

00:40:55.240 --> 00:41:00.440
first is because this is very simple to

00:40:58.040 --> 00:41:01.640
get to from the uh the point of view of

00:41:00.440 --> 00:41:06.560
like all the things that we've studied

00:41:01.640 --> 00:41:06.560
so so I think it's talking about

00:41:06.760 --> 00:41:11.800
that

00:41:08.319 --> 00:41:15.520
um one other thing that I should mention

00:41:11.800 --> 00:41:18.400
about is

00:41:15.520 --> 00:41:23.079
um or no sorry I'll I'll talk about that

00:41:18.400 --> 00:41:26.880
later so when we want to optimize risk

00:41:23.079 --> 00:41:30.560
um what we do is we sample in order to

00:41:26.880 --> 00:41:35.520
make this trct so a very simple way to

00:41:30.560 --> 00:41:37.640
minimize risk is instead of um instead

00:41:35.520 --> 00:41:39.359
of summing over all of the possible

00:41:37.640 --> 00:41:42.760
outputs we sum over a small number of

00:41:39.359 --> 00:41:46.079
possible outputs and we upgrade uh and

00:41:42.760 --> 00:41:47.359
we uh sorry normalize uh to make this

00:41:46.079 --> 00:41:51.200
all add up to

00:41:47.359 --> 00:41:52.839
one and so this normalizer here is

00:41:51.200 --> 00:41:55.319
basically the sum over all of the

00:41:52.839 --> 00:41:58.599
probabilities that we have uh on the top

00:41:55.319 --> 00:42:02.119
part here and and these samples can be

00:41:58.599 --> 00:42:05.480
created either using sampling or n best

00:42:02.119 --> 00:42:07.040
search we don't need to have from the

00:42:05.480 --> 00:42:11.040
point of view of doing this sort of

00:42:07.040 --> 00:42:13.960
minimum risk training the kind of

00:42:11.040 --> 00:42:16.880
correct way of doing this is sampling

00:42:13.960 --> 00:42:19.880
using ancestral sampling uh like we

00:42:16.880 --> 00:42:23.079
talked about before and um in minimizing

00:42:19.880 --> 00:42:25.839
the output based on the the samples but

00:42:23.079 --> 00:42:28.480
the problem with that is um as many of

00:42:25.839 --> 00:42:31.440
you also might have seen when you were

00:42:28.480 --> 00:42:33.599
sampling from your language model uh

00:42:31.440 --> 00:42:35.160
from assignment one if you sample with

00:42:33.599 --> 00:42:38.040
temperature one it gives you a lot of

00:42:35.160 --> 00:42:40.720
like not very good outlets right and so

00:42:38.040 --> 00:42:43.400
if you're sampling with temperature one

00:42:40.720 --> 00:42:45.000
um you'll be exploring a a very large

00:42:43.400 --> 00:42:47.880
part of the space that actually isn't

00:42:45.000 --> 00:42:49.720
very good and so because of this uh some

00:42:47.880 --> 00:42:51.480
other Alternatives that you can use is

00:42:49.720 --> 00:42:53.400
you can just do endb search to find the

00:42:51.480 --> 00:42:55.280
best outputs or you can sample with a

00:42:53.400 --> 00:42:58.079
temperature that's not one or something

00:42:55.280 --> 00:43:00.240
like that and basically create uh you

00:42:58.079 --> 00:43:02.520
know a list of possible hypotheses and

00:43:00.240 --> 00:43:04.079
then normalize other B so that's another

00:43:02.520 --> 00:43:06.240
option and very often not using

00:43:04.079 --> 00:43:11.200
temperature one is a better

00:43:06.240 --> 00:43:15.280
way um if you're sampling with not

00:43:11.200 --> 00:43:18.640
temperature one and you are um

00:43:15.280 --> 00:43:20.920
potentially getting multiple outputs you

00:43:18.640 --> 00:43:23.400
should try to D duplicate or sample

00:43:20.920 --> 00:43:25.480
without replacement because if you get

00:43:23.400 --> 00:43:27.559
multiple outputs here it messes up your

00:43:25.480 --> 00:43:30.680
equations if you basically uh have the

00:43:27.559 --> 00:43:30.680
same one in there multiple

00:43:32.160 --> 00:43:37.800
times cool so so this is a really simple

00:43:35.880 --> 00:43:40.079
example of how you can do minimal risk

00:43:37.800 --> 00:43:42.119
training but now I want to get into uh

00:43:40.079 --> 00:43:44.640
like reinforcement learning which is the

00:43:42.119 --> 00:43:48.119
framing that most um

00:43:44.640 --> 00:43:50.760
modern Works about this Paulo uh one

00:43:48.119 --> 00:43:52.559
thing I should mention is there are

00:43:50.760 --> 00:43:55.240
actually other alternatives to learning

00:43:52.559 --> 00:43:57.359
from uh human feedback including like

00:43:55.240 --> 00:43:59.359
margin loss margin based losses and

00:43:57.359 --> 00:44:00.960
other stuff like that but most people

00:43:59.359 --> 00:44:03.440
nowadays use reinforcement learning so

00:44:00.960 --> 00:44:06.359
I'm only going to cover that

00:44:03.440 --> 00:44:08.440
here so what is reinforcement learning

00:44:06.359 --> 00:44:11.000
um learning reinforcement learning is

00:44:08.440 --> 00:44:14.559
learning where we have an environment uh

00:44:11.000 --> 00:44:16.079
x uh ability to make actions a and get a

00:44:14.559 --> 00:44:20.160
delayed reward

00:44:16.079 --> 00:44:21.880
R and um there's a really nice example

00:44:20.160 --> 00:44:24.400
uh if you're not familiar with the

00:44:21.880 --> 00:44:27.480
basics of policy gradient by Andre

00:44:24.400 --> 00:44:28.800
karpathy which I linked in the um in the

00:44:27.480 --> 00:44:29.680
recommended reading so you can take a

00:44:28.800 --> 00:44:34.680
look at

00:44:29.680 --> 00:44:37.240
that um but in that example gives an

00:44:34.680 --> 00:44:39.440
example of pong uh where you're playing

00:44:37.240 --> 00:44:42.640
the game pong where X is your observed

00:44:39.440 --> 00:44:45.640
image a is up or down and R is the wind

00:44:42.640 --> 00:44:47.480
loss at the end of the game uh does

00:44:45.640 --> 00:44:50.559
anyone have an idea about uh what this

00:44:47.480 --> 00:44:52.119
looks like for any arbitrary NLP task

00:44:50.559 --> 00:44:56.520
that we might want to do reinforcement

00:44:52.119 --> 00:44:59.040
learning for so what what is X what is a

00:44:56.520 --> 00:44:59.040
and what is

00:45:00.040 --> 00:45:04.680
are pick your favorite uh your favorite

00:45:06.920 --> 00:45:09.920
Trask

00:45:10.960 --> 00:45:18.400
anybody

00:45:12.520 --> 00:45:18.400
yeah be or what what's X first

00:45:19.680 --> 00:45:28.720
yeah you have generate okay is the

00:45:24.440 --> 00:45:29.720
next be like the Buton like whether or

00:45:28.720 --> 00:45:32.520
not

00:45:29.720 --> 00:45:35.240
you okay yeah I I think this is very

00:45:32.520 --> 00:45:37.119
close just to repeat it it's like X is

00:45:35.240 --> 00:45:39.599
what you've generated so far a is the

00:45:37.119 --> 00:45:41.559
next token and R is the button that the

00:45:39.599 --> 00:45:45.400
user clicks about whether it's good or

00:45:41.559 --> 00:45:46.920
not um I think that's reasonably good

00:45:45.400 --> 00:45:48.760
although I don't know if we'd expect

00:45:46.920 --> 00:45:52.960
them to click the button every token we

00:45:48.760 --> 00:45:54.880
generate right so um it might be that X

00:45:52.960 --> 00:45:57.880
is the conversational history up till

00:45:54.880 --> 00:46:02.319
this point um a

00:45:57.880 --> 00:46:04.280
a could be a next token generation and

00:46:02.319 --> 00:46:06.520
then R is a reward we get in an

00:46:04.280 --> 00:46:08.280
arbitrary time point it might not be

00:46:06.520 --> 00:46:09.960
like immediately after generating the

00:46:08.280 --> 00:46:12.040
next token but it might be later and

00:46:09.960 --> 00:46:13.480
that's actually really really important

00:46:12.040 --> 00:46:15.040
from the point of view of reinforcement

00:46:13.480 --> 00:46:19.599
learning and I'll I'll talk about that

00:46:15.040 --> 00:46:23.040
in a second um anyone have an idea from

00:46:19.599 --> 00:46:24.960
I don't know uh code generation or

00:46:23.040 --> 00:46:28.119
translation or some other

00:46:24.960 --> 00:46:31.160
things C generation maybe s is a

00:46:28.119 --> 00:46:33.040
compiler or like the gra scpt and then

00:46:31.160 --> 00:46:37.000
the

00:46:33.040 --> 00:46:42.520
is the actual code that right and reward

00:46:37.000 --> 00:46:44.839
is yep um so X could be the compiler

00:46:42.520 --> 00:46:47.559
it's probably the compiler and all of

00:46:44.839 --> 00:46:50.200
the surrounding code context like what

00:46:47.559 --> 00:46:52.520
what is the natural language output and

00:46:50.200 --> 00:46:53.960
it's also um you know what is the

00:46:52.520 --> 00:46:57.280
project that you're you're working on

00:46:53.960 --> 00:47:00.079
and stuff like that um a i think

00:46:57.280 --> 00:47:02.800
typically we would treat each token in

00:47:00.079 --> 00:47:04.160
the code to be an action um and then R

00:47:02.800 --> 00:47:06.599
would be the reward after a long

00:47:04.160 --> 00:47:08.640
sequence of actions um and it could be

00:47:06.599 --> 00:47:11.119
the reward from the compiler it could be

00:47:08.640 --> 00:47:13.160
the reward from a code readability model

00:47:11.119 --> 00:47:15.720
it could be the reward from a speed

00:47:13.160 --> 00:47:17.079
execution speed and stuff like that so

00:47:15.720 --> 00:47:18.839
like one of the interesting things about

00:47:17.079 --> 00:47:22.640
R is you can be really creative about

00:47:18.839 --> 00:47:25.400
how you form R um which is not easy to

00:47:22.640 --> 00:47:27.319
do uh if you're just doing maximum

00:47:25.400 --> 00:47:29.240
likelihood also so you can come up with

00:47:27.319 --> 00:47:32.920
a r that really matches with like what

00:47:29.240 --> 00:47:36.559
you want um what you want in an output

00:47:32.920 --> 00:47:40.079
so why reinforcement learning in NLP um

00:47:36.559 --> 00:47:42.599
and I think there's basically three um

00:47:40.079 --> 00:47:44.240
three answers the first one is you have

00:47:42.599 --> 00:47:49.000
a typical reinforcement learning

00:47:44.240 --> 00:47:51.119
scenario um where you have a dialogue

00:47:49.000 --> 00:47:52.720
where you get lots of responses and then

00:47:51.119 --> 00:47:54.559
you get a reward at the end so the

00:47:52.720 --> 00:47:57.359
thumbs up and thumbs down from humans is

00:47:54.559 --> 00:47:59.839
a very typical example of

00:47:57.359 --> 00:48:02.800
uh reinforcement learning because you

00:47:59.839 --> 00:48:05.000
get a delayed reward uh at some point in

00:48:02.800 --> 00:48:07.599
the dialogue when a human presses up or

00:48:05.000 --> 00:48:09.280
down um another like actually more

00:48:07.599 --> 00:48:11.680
technical scenario where reinforcement

00:48:09.280 --> 00:48:14.960
learning has been used um for a long

00:48:11.680 --> 00:48:17.400
time is call centers so we've had

00:48:14.960 --> 00:48:20.680
dialogue systems for call centers and

00:48:17.400 --> 00:48:23.160
then if you complete a ticket purchase

00:48:20.680 --> 00:48:24.839
um or you complete resolve a ticket

00:48:23.160 --> 00:48:27.480
without ever having to go to a human

00:48:24.839 --> 00:48:30.800
operator you get a really big reward

00:48:27.480 --> 00:48:33.640
if you have to go to the human operator

00:48:30.800 --> 00:48:36.400
you get maybe a smaller reward and if

00:48:33.640 --> 00:48:39.200
the person yells at you and hangs up

00:48:36.400 --> 00:48:41.640
then you get a really negative reward so

00:48:39.200 --> 00:48:43.040
um this is kind of the typical example

00:48:41.640 --> 00:48:45.599
reinforcement learning has been used for

00:48:43.040 --> 00:48:48.520
a long time there another example is if

00:48:45.599 --> 00:48:53.280
you have like latent variables uh chains

00:48:48.520 --> 00:48:55.799
of thought where um you decide the

00:48:53.280 --> 00:48:58.839
latent variable and then get a reward um

00:48:55.799 --> 00:49:02.799
you get a reward based Bas on how those

00:48:58.839 --> 00:49:03.920
latent variables affect the output so um

00:49:02.799 --> 00:49:07.200
this

00:49:03.920 --> 00:49:09.799
is uh this is another example

00:49:07.200 --> 00:49:12.599
because the Chain of Thought itself

00:49:09.799 --> 00:49:13.880
might not actually be good you might

00:49:12.599 --> 00:49:15.839
have a bad Chain of Thought and still

00:49:13.880 --> 00:49:17.760
get the correct answer so you don't

00:49:15.839 --> 00:49:19.640
actually know for sure that a chain of

00:49:17.760 --> 00:49:22.359
thought that was automatically generated

00:49:19.640 --> 00:49:24.799
is good or not but um that so that kind

00:49:22.359 --> 00:49:27.000
of makes it a reinforcement learning

00:49:24.799 --> 00:49:29.520
problem and another thing is you might

00:49:27.000 --> 00:49:32.520
have a sequence level evaluation metric

00:49:29.520 --> 00:49:34.240
um so that you can't optimize the

00:49:32.520 --> 00:49:36.839
evaluation metric without uh first

00:49:34.240 --> 00:49:38.480
generating the whole like sequence so

00:49:36.839 --> 00:49:40.880
that would be any of the evaluation

00:49:38.480 --> 00:49:42.400
metrics that I talked about before so um

00:49:40.880 --> 00:49:44.720
these are three scenarios where you can

00:49:42.400 --> 00:49:47.079
use reinforcement

00:49:44.720 --> 00:49:50.000
planning so

00:49:47.079 --> 00:49:51.400
um I'm going to make a few steps through

00:49:50.000 --> 00:49:54.640
but like let's start again with our

00:49:51.400 --> 00:49:57.359
supervised mle loss and uh that's just

00:49:54.640 --> 00:50:01.799
the log probability here um in the

00:49:57.359 --> 00:50:04.160
context of reinforcement learning this

00:50:01.799 --> 00:50:07.079
is also called imitation

00:50:04.160 --> 00:50:08.880
learning because um essentially you're

00:50:07.079 --> 00:50:12.680
learning how to perform actions by

00:50:08.880 --> 00:50:14.559
imitating a teacher um and imitation

00:50:12.680 --> 00:50:15.960
learning is not just supervised mle

00:50:14.559 --> 00:50:18.440
there's also other varieties of

00:50:15.960 --> 00:50:21.440
imitation learning but um this is one

00:50:18.440 --> 00:50:21.440
variety of imitation

00:50:22.520 --> 00:50:27.640
learning the next thing I'd like to talk

00:50:24.599 --> 00:50:30.079
about is self-training and basically

00:50:27.640 --> 00:50:31.760
self-training the idea is that you

00:50:30.079 --> 00:50:33.720
sample or argmax according to the

00:50:31.760 --> 00:50:36.119
current model so you have your current

00:50:33.720 --> 00:50:38.000
model and you get a sample from it and

00:50:36.119 --> 00:50:41.520
then you use the sample or samples to

00:50:38.000 --> 00:50:43.680
maximize likelihood so um basically

00:50:41.520 --> 00:50:47.520
instead of doing maximum likelihood with

00:50:43.680 --> 00:50:49.520
respect to the a gold standard output

00:50:47.520 --> 00:50:51.280
you're doing it with respect to your own

00:50:49.520 --> 00:50:55.280
output

00:50:51.280 --> 00:50:55.280
so does this seem like a good

00:50:55.640 --> 00:51:03.880
idea I see a few people shaking heads um

00:51:00.480 --> 00:51:03.880
any ideas why this is not a good

00:51:04.680 --> 00:51:07.680
idea

00:51:15.040 --> 00:51:20.599
yeah yeah exactly so if you don't have

00:51:17.720 --> 00:51:23.760
any access to any notion well it's good

00:51:20.599 --> 00:51:27.480
um this will be optimizing towards good

00:51:23.760 --> 00:51:28.839
outputs and bad outputs right so um your

00:51:27.480 --> 00:51:30.200
model might be outputting bad outputs

00:51:28.839 --> 00:51:32.839
and you're just reinforcing the errors

00:51:30.200 --> 00:51:35.160
set the model R already nonetheless like

00:51:32.839 --> 00:51:37.799
self trining actually improves your

00:51:35.160 --> 00:51:39.680
accuracy somewhat in some cases like for

00:51:37.799 --> 00:51:43.040
example if your accuracy is if your

00:51:39.680 --> 00:51:45.520
model is Right more often than not um

00:51:43.040 --> 00:51:49.119
basically optimizing towards the more

00:51:45.520 --> 00:51:51.720
often the not right outputs can actually

00:51:49.119 --> 00:51:53.640
um due to the implicit regularization

00:51:51.720 --> 00:51:55.000
that models have and early stopping and

00:51:53.640 --> 00:51:56.559
other things like that it can actually

00:51:55.000 --> 00:51:59.280
move you in the right direction and

00:51:56.559 --> 00:52:01.559
improve accuracy

00:51:59.280 --> 00:52:05.000
um

00:52:01.559 --> 00:52:06.640
so there are alternatives to this that

00:52:05.000 --> 00:52:09.520
further improve accuracy so like for

00:52:06.640 --> 00:52:12.720
example if you have multiple models and

00:52:09.520 --> 00:52:16.200
um you only generate sentences where the

00:52:12.720 --> 00:52:17.760
models agree then this can improve your

00:52:16.200 --> 00:52:20.000
uh overall accuracy

00:52:17.760 --> 00:52:24.240
further um this is called code training

00:52:20.000 --> 00:52:27.799
it was actually uh created by uh uh

00:52:24.240 --> 00:52:30.160
people at at CMU as well and another

00:52:27.799 --> 00:52:32.280
successful alternative uh is adding

00:52:30.160 --> 00:52:34.920
noise to the input to match the noise

00:52:32.280 --> 00:52:38.760
that you find in the output so if you uh

00:52:34.920 --> 00:52:40.720
add like word uh word-based Dropout or

00:52:38.760 --> 00:52:44.000
other things like that this can also

00:52:40.720 --> 00:52:47.400
help uh accommodate these things but

00:52:44.000 --> 00:52:48.920
anyway um so self trining is is useful

00:52:47.400 --> 00:52:50.480
but there are better Alternatives if you

00:52:48.920 --> 00:52:54.079
can get a reward

00:52:50.480 --> 00:52:55.559
function so um the simplest variety of

00:52:54.079 --> 00:52:56.960
this is something called policy gradient

00:52:55.559 --> 00:52:59.720
or reinforce

00:52:56.960 --> 00:53:02.319
um or more specifically reinforce and

00:52:59.720 --> 00:53:06.280
basically what this does is this adds a

00:53:02.319 --> 00:53:08.359
term that scales the loss by the reward

00:53:06.280 --> 00:53:12.400
so if you can get a reward for each

00:53:08.359 --> 00:53:15.680
output basically this

00:53:12.400 --> 00:53:18.119
um you uh instead of doing self trining

00:53:15.680 --> 00:53:21.760
entirely by itself you multiply it by a

00:53:18.119 --> 00:53:23.119
reward and this allows you to increase

00:53:21.760 --> 00:53:24.640
the likelihood of things that get a high

00:53:23.119 --> 00:53:28.440
reward decrease the likelihood of things

00:53:24.640 --> 00:53:28.440
that get a low reward

00:53:29.680 --> 00:53:34.960
so uh a brief quiz here under what

00:53:32.440 --> 00:53:37.599
conditions is this equal equivalent to

00:53:34.960 --> 00:53:41.480
ml or essentially equivalent to maximum

00:53:37.599 --> 00:53:43.079
leg uh estimation and so like in order

00:53:41.480 --> 00:53:45.480
to make this quiz easier I'll go back to

00:53:43.079 --> 00:53:47.720
maximum likelihood estimation so it

00:53:45.480 --> 00:53:50.359
looked a bit like this um you calculated

00:53:47.720 --> 00:53:53.440
the log probability of the true output

00:53:50.359 --> 00:53:55.440
and now let me go uh to

00:53:53.440 --> 00:53:56.960
here any

00:53:55.440 --> 00:54:00.119
ideas

00:53:56.960 --> 00:54:05.040
yeah when your reward equals to

00:54:00.119 --> 00:54:05.040
one some sometimes in zero other times

00:54:07.760 --> 00:54:10.960
what any

00:54:12.760 --> 00:54:17.520
ideas what when when does your reward

00:54:15.280 --> 00:54:19.640
need to be equal to one in order to make

00:54:17.520 --> 00:54:23.400
this

00:54:19.640 --> 00:54:23.400
equation equivalent this

00:54:24.960 --> 00:54:31.680
equation yeah when Y and Y hat are the

00:54:27.319 --> 00:54:36.119
same so um basically

00:54:31.680 --> 00:54:38.880
this objective is equivalent to the mle

00:54:36.119 --> 00:54:43.160
objective when you're using a zero1

00:54:38.880 --> 00:54:44.480
loss um where or you're using an

00:54:43.160 --> 00:54:46.359
evaluation function that gives you a

00:54:44.480 --> 00:54:50.920
score of one when it's exact match and

00:54:46.359 --> 00:54:51.720
zero when it's not exact match so um but

00:54:50.920 --> 00:54:54.480
that

00:54:51.720 --> 00:54:56.440
also demonstrates that this can be more

00:54:54.480 --> 00:54:58.400
flexible because you can have other

00:54:56.440 --> 00:55:00.160
rewards that are not just one and zero

00:54:58.400 --> 00:55:02.599
for exact match but you can use things

00:55:00.160 --> 00:55:05.359
that give you partial credit you can use

00:55:02.599 --> 00:55:06.880
things that uplate multiple potential uh

00:55:05.359 --> 00:55:08.880
potentially correct outputs and other

00:55:06.880 --> 00:55:13.400
things like

00:55:08.880 --> 00:55:17.160
that so one problem with these methods

00:55:13.400 --> 00:55:21.799
is um how do we know which action led to

00:55:17.160 --> 00:55:24.720
the reward so the best scenario is after

00:55:21.799 --> 00:55:26.359
each action you get a reward so after

00:55:24.720 --> 00:55:28.960
each token that you generated you get

00:55:26.359 --> 00:55:31.240
get a thumbs up or thumbs down uh from

00:55:28.960 --> 00:55:34.280
the user about whether they like that

00:55:31.240 --> 00:55:36.000
token or not um and how much happier

00:55:34.280 --> 00:55:37.720
they are after you generated that token

00:55:36.000 --> 00:55:42.400
than they were before you generated that

00:55:37.720 --> 00:55:44.200
token um the problem with this is that

00:55:42.400 --> 00:55:45.799
that's completely infeasible right like

00:55:44.200 --> 00:55:47.039
every time after you use chat GPD you're

00:55:45.799 --> 00:55:50.480
not going to press thumbs up and thumbs

00:55:47.039 --> 00:55:52.559
down after each token so um in reality

00:55:50.480 --> 00:55:55.559
what we get is usually we get it at the

00:55:52.559 --> 00:55:57.000
end of uh roll out of many many

00:55:55.559 --> 00:55:58.640
different actions and we're not sure

00:55:57.000 --> 00:55:59.720
which action is responsible for giving

00:55:58.640 --> 00:56:02.559
us the

00:55:59.720 --> 00:56:05.440
reward and

00:56:02.559 --> 00:56:08.000
so there's a few typical ways of dealing

00:56:05.440 --> 00:56:09.640
with this um the most typical way of

00:56:08.000 --> 00:56:13.359
dealing with this right now is just not

00:56:09.640 --> 00:56:15.440
dealing with it um and just hoping that

00:56:13.359 --> 00:56:17.200
your optimization algorithm internally

00:56:15.440 --> 00:56:21.480
will be able to do credit

00:56:17.200 --> 00:56:24.520
assignment um and so what that entails

00:56:21.480 --> 00:56:27.319
is essentially you um give an equal

00:56:24.520 --> 00:56:29.880
reward for each token in the output

00:56:27.319 --> 00:56:32.480
other ways that you can deal with it are

00:56:29.880 --> 00:56:35.640
um you can assign decaying rewards from

00:56:32.480 --> 00:56:37.559
future events so like let's say let's

00:56:35.640 --> 00:56:41.839
say you're talking about a chat bot for

00:56:37.559 --> 00:56:44.119
example maybe this is the the most uh

00:56:41.839 --> 00:56:46.599
kind of intuitive way of thinking about

00:56:44.119 --> 00:56:50.400
it but you you have a chat bot you have

00:56:46.599 --> 00:56:52.599
like 20 chat turns and you have the user

00:56:50.400 --> 00:56:55.640
give a thumbs up or a thumbs down on the

00:56:52.599 --> 00:56:58.920
20th chat turn there you would assign a

00:56:55.640 --> 00:57:01.440
reward of um like let's say it gave a

00:56:58.920 --> 00:57:03.640
thumbs up there you would re assign a

00:57:01.440 --> 00:57:06.559
reward of one for the previous chat turn

00:57:03.640 --> 00:57:09.839
a reward of like 0.5 for the second to

00:57:06.559 --> 00:57:11.720
previous chat term a reward of 0.25 for

00:57:09.839 --> 00:57:14.319
the third to previous chat term to

00:57:11.720 --> 00:57:16.160
basically say yeah like the user is

00:57:14.319 --> 00:57:18.240
feeling good at the moment they gave the

00:57:16.160 --> 00:57:20.359
thumbs up and that's probably more

00:57:18.240 --> 00:57:23.400
likely due to the things that happened

00:57:20.359 --> 00:57:23.400
recently so

00:57:23.559 --> 00:57:28.119
yeah we have a

00:57:26.680 --> 00:57:32.280
like not

00:57:28.119 --> 00:57:34.160
learning so the reward model can be any

00:57:32.280 --> 00:57:35.839
of the methods that I talked about

00:57:34.160 --> 00:57:37.480
before so it can be human feedback

00:57:35.839 --> 00:57:39.000
directly like a thumbs up or a thumbs

00:57:37.480 --> 00:57:42.200
down it could also be from a reward

00:57:39.000 --> 00:57:44.599
model uh that was pre-trained you could

00:57:42.200 --> 00:57:47.680
also theoretically learn the reward

00:57:44.599 --> 00:57:52.720
model simultaneously but you'd have to

00:57:47.680 --> 00:57:55.200
simultaneously with the model itself um

00:57:52.720 --> 00:57:57.280
so yeah I'm going to talk a little bit

00:57:55.200 --> 00:58:00.359
about DP which kind of does that a

00:57:57.280 --> 00:58:01.720
little bit but um I I would basically

00:58:00.359 --> 00:58:03.160
say that wherever you're getting your

00:58:01.720 --> 00:58:06.280
reward is probably from one of the

00:58:03.160 --> 00:58:06.280
things I talked about earlier

00:58:06.359 --> 00:58:14.960
today cool any other

00:58:09.319 --> 00:58:17.720
questions okay um so that's the basic

00:58:14.960 --> 00:58:20.640
the basic idea the very simplest thing

00:58:17.720 --> 00:58:23.359
that you can do is you can just sample

00:58:20.640 --> 00:58:26.079
um optimize the subjective function this

00:58:23.359 --> 00:58:28.359
is dead easy you it's not hard to imp

00:58:26.079 --> 00:58:30.799
imp it all as long as you have some

00:58:28.359 --> 00:58:32.760
source of reward signal um but the

00:58:30.799 --> 00:58:35.559
problem is uh reinforcement learning can

00:58:32.760 --> 00:58:38.599
be very unstable and it's hard to get it

00:58:35.559 --> 00:58:40.160
to uh you know work properly if you uh

00:58:38.599 --> 00:58:42.400
don't do some additional tricks so I'd

00:58:40.160 --> 00:58:45.720
like to talk about this

00:58:42.400 --> 00:58:45.720
next oh yeah

00:58:48.880 --> 00:58:51.880
sir

00:58:55.039 --> 00:58:58.039
yeah

00:59:03.280 --> 00:59:08.960
yeah the typical the typical way is you

00:59:05.440 --> 00:59:12.960
just have an exponential decay um so you

00:59:08.960 --> 00:59:16.200
you multiply each time by what 0.5 0. or

00:59:12.960 --> 00:59:19.400
something like that

00:59:16.200 --> 00:59:19.400
um from

00:59:20.319 --> 00:59:27.720
A6 um cool okay

00:59:25.039 --> 00:59:30.720
so

00:59:27.720 --> 00:59:33.319
and that's one option and sorry just to

00:59:30.720 --> 00:59:35.760
clarify the most common option nowadays

00:59:33.319 --> 00:59:37.920
um at least from the point of view of

00:59:35.760 --> 00:59:39.839
models is not to Decay it at all and

00:59:37.920 --> 00:59:43.880
just assign the same amount for each

00:59:39.839 --> 00:59:45.319
token um I'm not actually 100% sure what

00:59:43.880 --> 00:59:47.319
people are doing with respect to like

00:59:45.319 --> 00:59:49.280
long chat things I think probably

00:59:47.319 --> 00:59:51.720
they're only assigning it to the current

00:59:49.280 --> 00:59:54.240
like utterance and then not optimizing

00:59:51.720 --> 00:59:57.240
the previous utterances so like if they

00:59:54.240 --> 00:59:59.039
get a thumbs up or thumbs down signal um

00:59:57.240 --> 01:00:00.720
then they they would assign an

00:59:59.039 --> 01:00:02.440
equivalent reward for all of the tokens

01:00:00.720 --> 01:00:04.640
and the current utterance and zero

01:00:02.440 --> 01:00:06.119
reward for the previous ones but I'm not

01:00:04.640 --> 01:00:08.480
100% sure about that there might be

01:00:06.119 --> 01:00:11.200
other methods that people are

01:00:08.480 --> 01:00:13.960
using um

01:00:11.200 --> 01:00:16.680
cool so uh stabilizing reinforcement

01:00:13.960 --> 01:00:18.520
learning so um stabilizing reinforcement

01:00:16.680 --> 01:00:21.839
learning there's a lot of reasons why

01:00:18.520 --> 01:00:23.880
it's unstable um the first reason is

01:00:21.839 --> 01:00:27.200
you're sampling an individual output and

01:00:23.880 --> 01:00:30.160
calculating the um uh calculating based

01:00:27.200 --> 01:00:32.039
on the S individual sampled output and

01:00:30.160 --> 01:00:33.440
then there's an Infinity of other

01:00:32.039 --> 01:00:36.480
outputs that you could be optimizing

01:00:33.440 --> 01:00:39.119
over for mle this is not a problem

01:00:36.480 --> 01:00:41.319
because for mle you're always

01:00:39.119 --> 01:00:45.359
contrasting the gold standard output to

01:00:41.319 --> 01:00:46.599
all of the other outputs in the space um

01:00:45.359 --> 01:00:48.280
and you're saying I want to upweight the

01:00:46.599 --> 01:00:51.200
gold standard output and down we all of

01:00:48.280 --> 01:00:53.039
the other ones but for reinforcement

01:00:51.200 --> 01:00:54.760
learning you only have a single sampled

01:00:53.039 --> 01:00:57.520
output that output might be wrong and

01:00:54.760 --> 01:00:59.359
that's a source of inst ility this is

01:00:57.520 --> 01:01:02.079
particularly a problem when using bigger

01:00:59.359 --> 01:01:05.960
output spaces like all of the in the

01:01:02.079 --> 01:01:07.920
vocabul another problem is uh anytime

01:01:05.960 --> 01:01:11.599
you start using negative

01:01:07.920 --> 01:01:15.160
rewards um because if you start using

01:01:11.599 --> 01:01:17.559
negative rewards those rewards will be

01:01:15.160 --> 01:01:19.520
downweighting the probability of a

01:01:17.559 --> 01:01:20.680
particular output sequence and that

01:01:19.520 --> 01:01:22.440
might be a good idea maybe you're

01:01:20.680 --> 01:01:24.319
getting a toxic output or something like

01:01:22.440 --> 01:01:25.960
that and you want to down it but at the

01:01:24.319 --> 01:01:28.280
same time in addition to that toxic

01:01:25.960 --> 01:01:30.000
output there's like you know a

01:01:28.280 --> 01:01:31.599
combinatorial number of completely

01:01:30.000 --> 01:01:33.880
nonsense outputs that aren't even

01:01:31.599 --> 01:01:36.599
English and so basically you can start

01:01:33.880 --> 01:01:38.920
diverge from the N starting start to

01:01:36.599 --> 01:01:40.799
diverge from the natural like language

01:01:38.920 --> 01:01:44.720
modeling distribution that you have

01:01:40.799 --> 01:01:49.079
before so this is a big uh a big

01:01:44.720 --> 01:01:51.880
problem so a number of uh strategies can

01:01:49.079 --> 01:01:53.880
be used to stabilize the first one is

01:01:51.880 --> 01:01:55.480
this is completely obvious right now and

01:01:53.880 --> 01:01:57.240
nobody in their right mind would avoid

01:01:55.480 --> 01:02:00.119
doing this but the first one is

01:01:57.240 --> 01:02:02.839
pre-training with mle and so you start

01:02:00.119 --> 01:02:04.920
with a pre-trained model um and then

01:02:02.839 --> 01:02:09.359
switch over to RL after you finished

01:02:04.920 --> 01:02:11.520
pre-training the model um and so

01:02:09.359 --> 01:02:13.279
this makes a lot of sense if you're

01:02:11.520 --> 01:02:14.960
training a language model which I assume

01:02:13.279 --> 01:02:17.039
that almost everybody in this class is

01:02:14.960 --> 01:02:20.279
going to be doing but it does only work

01:02:17.039 --> 01:02:22.720
in scenarios where you can run mle and

01:02:20.279 --> 01:02:24.359
so it doesn't work if you're predicting

01:02:22.720 --> 01:02:27.240
like latent variables that aren't

01:02:24.359 --> 01:02:28.760
included in the original space

01:02:27.240 --> 01:02:31.960
um it

01:02:28.760 --> 01:02:34.279
also doesn't work in a setting where

01:02:31.960 --> 01:02:36.640
like you want to learn a

01:02:34.279 --> 01:02:40.799
chatbot you want to learn a chatbot for

01:02:36.640 --> 01:02:44.200
customer service for a

01:02:40.799 --> 01:02:48.039
company that

01:02:44.200 --> 01:02:49.960
has like for example a product catalog

01:02:48.039 --> 01:02:53.559
that the language model has never seen

01:02:49.960 --> 01:02:56.000
before and so if the language model has

01:02:53.559 --> 01:02:57.359
no information about the product catalog

01:02:56.000 --> 01:02:59.920
whatsoever you don't provide it through

01:02:57.359 --> 01:03:02.440
rag or something like that it's going to

01:02:59.920 --> 01:03:04.039
have to explore infinitely or not

01:03:02.440 --> 01:03:05.599
infinitely but it's going to have to

01:03:04.039 --> 01:03:08.359
explore too large of a space and you're

01:03:05.599 --> 01:03:10.000
never going to converge with um with

01:03:08.359 --> 01:03:12.359
your language modeling objectives so you

01:03:10.000 --> 01:03:15.000
need to basically be able to create at

01:03:12.359 --> 01:03:16.079
least some supervised training data to

01:03:15.000 --> 01:03:19.279
train with

01:03:16.079 --> 01:03:20.720
mle um but assuming you can do that I'm

01:03:19.279 --> 01:03:22.920
assuming that almost everybody is going

01:03:20.720 --> 01:03:26.400
to do some sort of pre-training with

01:03:22.920 --> 01:03:27.880
ML um The Next Step that people use uh

01:03:26.400 --> 01:03:30.520
in reinforcement learning that's really

01:03:27.880 --> 01:03:34.319
important to stabilize is regularization

01:03:30.520 --> 01:03:35.880
to an existing model and you have an

01:03:34.319 --> 01:03:39.039
existing model and you want to prevent

01:03:35.880 --> 01:03:40.559
it from getting too far away and the

01:03:39.039 --> 01:03:42.279
reason why you want to do this is like

01:03:40.559 --> 01:03:45.720
let's say you start assigning a negative

01:03:42.279 --> 01:03:47.440
reward to toxic utterances for example

01:03:45.720 --> 01:03:49.200
if your model stops being a language

01:03:47.440 --> 01:03:51.920
model whatsoever that's a bad idea so

01:03:49.200 --> 01:03:53.400
you want to keep it as a language model

01:03:51.920 --> 01:03:55.599
keep it close enough to still being a

01:03:53.400 --> 01:03:57.559
competent language model while you know

01:03:55.599 --> 01:03:59.599
like removing the toxic

01:03:57.559 --> 01:04:03.039
utterances so there's a number of

01:03:59.599 --> 01:04:05.680
methods that people use to do this um uh

01:04:03.039 --> 01:04:08.359
the most prominent ones are kale

01:04:05.680 --> 01:04:10.279
regularization uh well so the the first

01:04:08.359 --> 01:04:13.119
most prominent one is K regularization

01:04:10.279 --> 01:04:15.839
and the way this works is basically in

01:04:13.119 --> 01:04:19.400
addition you add you have two

01:04:15.839 --> 01:04:22.279
terms the first term is a term that

01:04:19.400 --> 01:04:25.760
improves your reward so you have your

01:04:22.279 --> 01:04:28.039
old model where your old model is

01:04:25.760 --> 01:04:31.279
creating a

01:04:28.039 --> 01:04:32.440
probability uh it has a probability here

01:04:31.279 --> 01:04:34.960
and then you have the probability

01:04:32.440 --> 01:04:38.160
assigned by your new model and then you

01:04:34.960 --> 01:04:41.200
have your reward signal here and so this

01:04:38.160 --> 01:04:43.599
is basically improving the log odds or

01:04:41.200 --> 01:04:46.960
improving the odds of getting a good

01:04:43.599 --> 01:04:49.720
reward for high reward

01:04:46.960 --> 01:04:52.920
sequences separately from this you have

01:04:49.720 --> 01:04:55.920
this K regularization term and this K

01:04:52.920 --> 01:04:58.119
regularization term is keeping the

01:04:55.920 --> 01:05:00.279
scores of or it's keeping the

01:04:58.119 --> 01:05:02.400
probability distribution of your new

01:05:00.279 --> 01:05:03.960
model similar to the probability

01:05:02.400 --> 01:05:09.200
distribution of your old

01:05:03.960 --> 01:05:11.359
model and this beta parameter basically

01:05:09.200 --> 01:05:15.240
you can increase it or decrease it based

01:05:11.359 --> 01:05:18.400
on how similar you want to keep the um

01:05:15.240 --> 01:05:18.400
how similar you want to keep the

01:05:20.720 --> 01:05:24.640
model another method that people use is

01:05:23.160 --> 01:05:29.279
something called proximal policy

01:05:24.640 --> 01:05:30.920
optimization or or Po and this is a

01:05:29.279 --> 01:05:33.920
method that is based on

01:05:30.920 --> 01:05:38.160
clipping uh the

01:05:33.920 --> 01:05:40.920
outputs and we Define uh this ratio

01:05:38.160 --> 01:05:43.880
here so this ratio is equivalent to this

01:05:40.920 --> 01:05:46.160
here so it's basically um kind of the

01:05:43.880 --> 01:05:47.839
amount that you're learning or the

01:05:46.160 --> 01:05:51.720
amount that the new model up weights

01:05:47.839 --> 01:05:54.039
High reward sequences and so here we

01:05:51.720 --> 01:05:58.200
have the same thing that we had

01:05:54.039 --> 01:06:01.200
above so it it looks like this but over

01:05:58.200 --> 01:06:03.720
here we have a clipped version of this

01:06:01.200 --> 01:06:07.000
where essentially what we do is we

01:06:03.720 --> 01:06:07.000
clip this

01:06:21.119 --> 01:06:27.880
ratio this ratio to be within uh a

01:06:24.720 --> 01:06:32.160
certain range of the original ratio and

01:06:27.880 --> 01:06:37.880
what this is doing is this is

01:06:32.160 --> 01:06:41.400
essentially forcing the model to um not

01:06:37.880 --> 01:06:44.000
reward large jumps in the space um

01:06:41.400 --> 01:06:47.559
because if you take the

01:06:44.000 --> 01:06:49.160
minimum and actually I'm I'm sorry I

01:06:47.559 --> 01:06:50.720
just realized I I might have done

01:06:49.160 --> 01:06:52.520
something confusing here because this is

01:06:50.720 --> 01:06:53.960
actually higher as better so this isn't

01:06:52.520 --> 01:06:56.079
really a loss function this is something

01:06:53.960 --> 01:06:57.680
you're attempting to maximize so

01:06:56.079 --> 01:06:59.839
in contrast to all of the other things I

01:06:57.680 --> 01:07:01.680
was talking about before um this is

01:06:59.839 --> 01:07:04.400
something where higher is better instead

01:07:01.680 --> 01:07:07.599
of lower is better but anyway basically

01:07:04.400 --> 01:07:09.599
by taking the minimum of this you're

01:07:07.599 --> 01:07:11.960
encouraging the model

01:07:09.599 --> 01:07:16.279
to

01:07:11.960 --> 01:07:18.559
uh keep examining the space where you

01:07:16.279 --> 01:07:20.799
don't diverge much from the original

01:07:18.559 --> 01:07:22.920
model and if the space where the

01:07:20.799 --> 01:07:25.240
original model was in is better than the

01:07:22.920 --> 01:07:27.440
new space that your model has moved into

01:07:25.240 --> 01:07:30.920
you move back towards the original model

01:07:27.440 --> 01:07:33.000
so basically like if you had um if you

01:07:30.920 --> 01:07:34.960
learned a model if you started learning

01:07:33.000 --> 01:07:37.960
a model that looked like it was

01:07:34.960 --> 01:07:40.279
optimizing uh your your reward but then

01:07:37.960 --> 01:07:43.119
suddenly the model went off the rails

01:07:40.279 --> 01:07:45.000
and um it starts generating completely

01:07:43.119 --> 01:07:47.319
nonsense outputs that get really bad

01:07:45.000 --> 01:07:49.119
reward this will push it back towards

01:07:47.319 --> 01:07:50.920
the original policy and that's the basic

01:07:49.119 --> 01:07:54.279
idea behind

01:07:50.920 --> 01:07:57.640
P um in terms of what I see people using

01:07:54.279 --> 01:07:59.799
um po was like really really popular for

01:07:57.640 --> 01:08:01.880
a while but I've started to see people

01:07:59.799 --> 01:08:04.799
use alternative strategies that use K

01:08:01.880 --> 01:08:06.880
regularization so I don't I don't think

01:08:04.799 --> 01:08:08.520
either one of them is like particularly

01:08:06.880 --> 01:08:10.039
more popular than any of the others and

01:08:08.520 --> 01:08:13.720
this one's a little bit simpler

01:08:10.039 --> 01:08:13.720
conceptually so I like the the

01:08:14.880 --> 01:08:19.279
one cool um any questions about

01:08:20.359 --> 01:08:26.759
this okay um and actually one thing I

01:08:24.640 --> 01:08:29.679
should mention is um all of these things

01:08:26.759 --> 01:08:32.120
are implemented uh in you know whatever

01:08:29.679 --> 01:08:33.759
libraries you use like hugging face TRL

01:08:32.120 --> 01:08:35.679
Transformer reinforcement learning as an

01:08:33.759 --> 01:08:37.040
example Library all of these methods are

01:08:35.679 --> 01:08:38.400
implemented there so if you actually

01:08:37.040 --> 01:08:40.600
want to use these in practice that's

01:08:38.400 --> 01:08:40.600
good

01:08:40.839 --> 01:08:46.359
place the next thing is adding a

01:08:42.920 --> 01:08:48.679
Baseline and so the basic idea is that

01:08:46.359 --> 01:08:52.199
you have ex expectations about your

01:08:48.679 --> 01:08:54.640
reward for a particular sentence and um

01:08:52.199 --> 01:08:56.560
like let's say we wanted to uh translate

01:08:54.640 --> 01:08:58.400
a sentence and we have uh something like

01:08:56.560 --> 01:09:01.279
this is an easy sentence and buffalo

01:08:58.400 --> 01:09:02.920
buffalo buffalo which is a harder

01:09:01.279 --> 01:09:07.799
sentence to

01:09:02.920 --> 01:09:09.679
translate and so we have a reward um if

01:09:07.799 --> 01:09:11.759
if you're not familiar with this example

01:09:09.679 --> 01:09:13.480
you can search on Wikipedia for buffalo

01:09:11.759 --> 01:09:16.759
buffalo buffalo and you'll you'll find

01:09:13.480 --> 01:09:19.520
out what I'm talking about um but uh

01:09:16.759 --> 01:09:21.440
there's a reward uh and let's say you

01:09:19.520 --> 01:09:24.359
got a reward of 0.8 for the first one

01:09:21.440 --> 01:09:29.679
and a reward of 0.3 for the second

01:09:24.359 --> 01:09:31.679
one but the problem is if um the first

01:09:29.679 --> 01:09:33.640
one actually is really easy and the

01:09:31.679 --> 01:09:36.120
second one is really hard getting a

01:09:33.640 --> 01:09:37.799
reward of 0.8 for the second one for

01:09:36.120 --> 01:09:40.080
like a translation or something is

01:09:37.799 --> 01:09:41.120
actually bad right and a reward of 0.3

01:09:40.080 --> 01:09:45.239
is good because you're moving in the

01:09:41.120 --> 01:09:49.359
right direction and so you basically um

01:09:45.239 --> 01:09:52.239
you have uh the Baseline uh minus reward

01:09:49.359 --> 01:09:54.960
or sorry reward minus Baseline and this

01:09:52.239 --> 01:09:56.520
would give you a negative value for this

01:09:54.960 --> 01:09:59.320
first one a positive value for the

01:09:56.520 --> 01:10:01.360
second one and so the basic idea is can

01:09:59.320 --> 01:10:04.400
we predict a priori how difficult this

01:10:01.360 --> 01:10:05.440
example is and then uh adjust our reward

01:10:04.400 --> 01:10:08.360
based on

01:10:05.440 --> 01:10:10.960
that and

01:10:08.360 --> 01:10:13.679
so that's the basic idea you just have

01:10:10.960 --> 01:10:15.560
kind of like a baseline model um you

01:10:13.679 --> 01:10:19.320
have a baseline model that predicts this

01:10:15.560 --> 01:10:19.320
and uh you adjust uh

01:10:19.760 --> 01:10:25.000
appropriately um there's two major ways

01:10:22.719 --> 01:10:27.600
you can do this the first one um the

01:10:25.000 --> 01:10:29.800
Baseline doesn't need to be anything um

01:10:27.600 --> 01:10:32.960
the only hope is that it decreases the

01:10:29.800 --> 01:10:35.960
variance in your reward uh and makes

01:10:32.960 --> 01:10:38.239
learning more stable um there's two

01:10:35.960 --> 01:10:40.159
options that I see done pretty widely

01:10:38.239 --> 01:10:43.000
the first one is predicting the final

01:10:40.159 --> 01:10:47.360
reward um predicting the final reward

01:10:43.000 --> 01:10:50.960
using a model that doesn't look at

01:10:47.360 --> 01:10:53.400
all at the answer that you provided it

01:10:50.960 --> 01:10:55.880
only looks at the input or it only looks

01:10:53.400 --> 01:10:58.840
at the intermediate States of uh you

01:10:55.880 --> 01:11:00.480
know a model or something and so at the

01:10:58.840 --> 01:11:03.280
sentence level you can have one Baseline

01:11:00.480 --> 01:11:04.719
per sentence um you can also do it at

01:11:03.280 --> 01:11:10.560
each decoder

01:11:04.719 --> 01:11:11.640
State and this is uh basically you can

01:11:10.560 --> 01:11:13.040
do this anytime you're doing

01:11:11.640 --> 01:11:15.199
reinforcement learning by just training

01:11:13.040 --> 01:11:18.199
a regression model that does this for

01:11:15.199 --> 01:11:19.679
you based on the rewards you get the

01:11:18.199 --> 01:11:21.040
important thing is the Baseline is not

01:11:19.679 --> 01:11:22.640
allowed to use any of your actual

01:11:21.040 --> 01:11:25.679
predictions because once you start using

01:11:22.640 --> 01:11:26.640
the predictions then um your uh it's not

01:11:25.679 --> 01:11:28.679
a

01:11:26.640 --> 01:11:30.840
baseline another option which is

01:11:28.679 --> 01:11:33.440
relatively easy to implement but can

01:11:30.840 --> 01:11:36.320
still be effective is you calculate the

01:11:33.440 --> 01:11:38.719
mean of the rewards in a batch and so if

01:11:36.320 --> 01:11:40.880
you have a big batch of data and your

01:11:38.719 --> 01:11:44.440
average reward in the batch is like

01:11:40.880 --> 01:11:46.480
0.4 uh then you just subtract that 0.4

01:11:44.440 --> 01:11:50.080
uh and calculate your reward based on

01:11:46.480 --> 01:11:50.080
that so that's another option that can

01:11:51.800 --> 01:11:57.800
use

01:11:53.639 --> 01:12:00.000
um a kind of extreme example of this uh

01:11:57.800 --> 01:12:01.199
of creating a baseline is contrasting

01:12:00.000 --> 01:12:03.639
pairwise

01:12:01.199 --> 01:12:05.880
examples um or

01:12:03.639 --> 01:12:08.280
contrasting different outputs for the

01:12:05.880 --> 01:12:12.040
same input

01:12:08.280 --> 01:12:13.920
and you can easily learn uh directly

01:12:12.040 --> 01:12:16.239
from pairwise Human

01:12:13.920 --> 01:12:18.199
preferences uh which can provide more

01:12:16.239 --> 01:12:20.760
stability because you know one is better

01:12:18.199 --> 01:12:23.880
than the other so you essentially can be

01:12:20.760 --> 01:12:26.199
sure that uh you're upweighting a better

01:12:23.880 --> 01:12:29.560
one and down weting a worse one

01:12:26.199 --> 01:12:31.400
um this is the idea behind DPO which is

01:12:29.560 --> 01:12:33.719
a recently pretty popular model but

01:12:31.400 --> 01:12:36.800
there's also other previous methods that

01:12:33.719 --> 01:12:40.199
did similar things and the way DPO works

01:12:36.800 --> 01:12:45.040
is it basically calculates this ratio of

01:12:40.199 --> 01:12:49.280
uh the probability of the new uh the new

01:12:45.040 --> 01:12:51.639
model to the old model but it UPS this

01:12:49.280 --> 01:12:53.639
probability for a good output and it

01:12:51.639 --> 01:12:56.280
downweights this probability for a bad

01:12:53.639 --> 01:12:57.679
output and so

01:12:56.280 --> 01:13:00.120
here we have our better outputs over

01:12:57.679 --> 01:13:02.040
here here we have our worse outputs and

01:13:00.120 --> 01:13:03.600
you just it's basically learning to

01:13:02.040 --> 01:13:05.639
upate the probability and downweight

01:13:03.600 --> 01:13:09.320
probability

01:13:05.639 --> 01:13:09.320
accordingly so

01:13:09.360 --> 01:13:15.040
um you can notice that DPO is very

01:13:12.280 --> 01:13:18.040
similar to PO um and that it's learning

01:13:15.040 --> 01:13:19.679
uh it's using these ratios but the

01:13:18.040 --> 01:13:21.520
disadvantage of this is you obviously

01:13:19.679 --> 01:13:23.120
require pairwise judgments and you can't

01:13:21.520 --> 01:13:26.120
learn a model if you don't have these

01:13:23.120 --> 01:13:28.080
pawise judgments so

01:13:26.120 --> 01:13:30.760
the

01:13:28.080 --> 01:13:33.159
beta yeah so the beta term is is

01:13:30.760 --> 01:13:35.840
basically a normalization term it's a

01:13:33.159 --> 01:13:39.960
hyper parameter um

01:13:35.840 --> 01:13:41.840
for DPO sorry I read the paper right

01:13:39.960 --> 01:13:43.639
when it came out and I don't remember if

01:13:41.840 --> 01:13:45.600
it's a direct derivation from the K

01:13:43.639 --> 01:13:47.960
Divergence term or not but I think it

01:13:45.600 --> 01:13:49.800
might be um I'd have to go back and look

01:13:47.960 --> 01:13:50.480
at the look at the paper but basically

01:13:49.800 --> 01:13:53.600
the

01:13:50.480 --> 01:13:56.760
more the larger this is the larger

01:13:53.600 --> 01:13:59.320
gradient steps you'll be

01:13:56.760 --> 01:14:00.639
it also um like you'll notice there

01:13:59.320 --> 01:14:03.400
sorry I didn't mention this but you'll

01:14:00.639 --> 01:14:06.120
notice there's a sigmoid term here so

01:14:03.400 --> 01:14:09.000
the the

01:14:06.120 --> 01:14:10.080
beta the larger you increase the beta

01:14:09.000 --> 01:14:13.239
the

01:14:10.080 --> 01:14:16.600
more small differences in these

01:14:13.239 --> 01:14:18.719
values like it basically like stretches

01:14:16.600 --> 01:14:22.280
or shrinks the sigmoid with respect to

01:14:18.719 --> 01:14:24.120
how beak the it is so it will um it will

01:14:22.280 --> 01:14:25.800
affect how much like small differences

01:14:24.120 --> 01:14:27.960
in this will affect

01:14:25.800 --> 01:14:30.120
but I I think this was derived from the

01:14:27.960 --> 01:14:31.760
K regularization term that we had

01:14:30.120 --> 01:14:34.400
previously in

01:14:31.760 --> 01:14:35.800
um in this slide here but I have to go

01:14:34.400 --> 01:14:40.520
back and double check unless somebody

01:14:35.800 --> 01:14:43.239
knows it is okay good yeah

01:14:40.520 --> 01:14:45.000
so I don't want to say wrong things but

01:14:43.239 --> 01:14:48.239
I also don't want

01:14:45.000 --> 01:14:50.920
to okay cool um and so then increasing

01:14:48.239 --> 01:14:55.080
batch size

01:14:50.920 --> 01:14:57.360
um because each uh another thing is um

01:14:55.080 --> 01:14:58.440
kind of NE necessarily reinforcement

01:14:57.360 --> 01:14:59.920
learning is going to have higher

01:14:58.440 --> 01:15:01.400
variance and maximum likelihood

01:14:59.920 --> 01:15:04.199
estimation just because we're doing samp

01:15:01.400 --> 01:15:07.840
playing and other things like this and

01:15:04.199 --> 01:15:09.440
um so one very simple thing you can do

01:15:07.840 --> 01:15:11.280
is just increase the number of examples

01:15:09.440 --> 01:15:13.679
or rollouts that you do before an update

01:15:11.280 --> 01:15:15.800
to stabilize and so I I would definitely

01:15:13.679 --> 01:15:17.480
suggest that if you're seeing any

01:15:15.800 --> 01:15:18.679
stability after doing all of the tricks

01:15:17.480 --> 01:15:20.400
that I mentioned before that you

01:15:18.679 --> 01:15:23.040
increase your batch size and often that

01:15:20.400 --> 01:15:25.480
can just resolve your problems

01:15:23.040 --> 01:15:28.760
um another uh

01:15:25.480 --> 01:15:30.560
thing that people often do is um save

01:15:28.760 --> 01:15:32.040
many many previous rollouts because

01:15:30.560 --> 01:15:34.199
generally doing rollouts is more

01:15:32.040 --> 01:15:37.840
expensive doing rollouts and collecting

01:15:34.199 --> 01:15:39.560
rewards is more expensive and so um you

01:15:37.840 --> 01:15:42.360
can save the roll outs that you have

01:15:39.560 --> 01:15:43.840
done before and uh keep them around so

01:15:42.360 --> 01:15:46.600
you can update parameters with larger

01:15:43.840 --> 01:15:50.800
batches in a more efficient

01:15:46.600 --> 01:15:53.120
way cool so that's all I have uh I just

01:15:50.800 --> 01:15:54.400
realized we're exactly at time so uh I

01:15:53.120 --> 01:15:56.440
should finish up here but I'll be happy

01:15:54.400 --> 01:15:59.440
to take any

01:15:56.440 --> 01:15:59.440
for

01:16:01.679 --> 01:16:04.679
thanks