ZHANGYUXUAN-zR commited on
Commit
e71561e
·
verified ·
1 Parent(s): 79f2ed4

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. parse/train/0WASBV4xkhy/0WASBV4xkhy_content_list.json +1490 -0
  2. parse/train/0WASBV4xkhy/0WASBV4xkhy_middle.json +0 -0
  3. parse/train/BJOFETxR-/BJOFETxR-.md +320 -0
  4. parse/train/BJOFETxR-/BJOFETxR-_content_list.json +1690 -0
  5. parse/train/BJOFETxR-/BJOFETxR-_middle.json +0 -0
  6. parse/train/BJOFETxR-/BJOFETxR-_model.json +0 -0
  7. parse/train/BJk7Gf-CZ/BJk7Gf-CZ_middle.json +0 -0
  8. parse/train/BJk7Gf-CZ/BJk7Gf-CZ_model.json +0 -0
  9. parse/train/BkgrBgSYDS/BkgrBgSYDS.md +0 -0
  10. parse/train/BkgrBgSYDS/BkgrBgSYDS_content_list.json +0 -0
  11. parse/train/BkgrBgSYDS/BkgrBgSYDS_middle.json +0 -0
  12. parse/train/BkgrBgSYDS/BkgrBgSYDS_model.json +0 -0
  13. parse/train/H1ersoRqtm/H1ersoRqtm.md +350 -0
  14. parse/train/H1ersoRqtm/H1ersoRqtm_content_list.json +1902 -0
  15. parse/train/H1ersoRqtm/H1ersoRqtm_middle.json +0 -0
  16. parse/train/H1ersoRqtm/H1ersoRqtm_model.json +0 -0
  17. parse/train/tL89RnzIiCd/images/042e1d5439f75f9511e496726e2b84d2054e738501fd36c673296c39964d9b81.jpg +3 -0
  18. parse/train/tL89RnzIiCd/images/07f61faf695e47c9e2536edaa51df49b54bebd95eb9227f935a655718c3b2186.jpg +3 -0
  19. parse/train/tL89RnzIiCd/images/0d47d9fb79658c8401ba9cd4ebfcb9e0e83a09b3a11e045f15995eb4918d659f.jpg +3 -0
  20. parse/train/tL89RnzIiCd/images/146d1dca6f4f5336a30d475798a577e48af58dd83735d21ab3a2758b241866b5.jpg +3 -0
  21. parse/train/tL89RnzIiCd/images/14c1b6836f4d1f321564480254bd0eb6aac7b5154801d2fb86b63ffce70e8914.jpg +3 -0
  22. parse/train/tL89RnzIiCd/images/2159cd7bb128f57cbb32cafecb86cd5ed257d950abf5cf41ada8a302e5f67250.jpg +3 -0
  23. parse/train/tL89RnzIiCd/images/29d91d86507c41379d4ae134b14c98b8c16bc9f2f9cb69e299fcfdb0320470d7.jpg +3 -0
  24. parse/train/tL89RnzIiCd/images/2bfbad340f78378ed4828c7ac3f1db498faf7e90ea37666efae75b8042efdc19.jpg +3 -0
  25. parse/train/tL89RnzIiCd/images/33e7e08ff8a133881d57ab2c3d98ba052c629914e7a6517ec2a268509dca806e.jpg +3 -0
  26. parse/train/tL89RnzIiCd/images/37ef8ac9a9c39eef0cf777b309bebdbee7778892b260e14d83ed671bbcad4020.jpg +3 -0
  27. parse/train/tL89RnzIiCd/images/384428ec4e24fd98f95e10f3c3a0be6bfa51603520e1b3b78913e0b5797accc3.jpg +3 -0
  28. parse/train/tL89RnzIiCd/images/3f73b79f6a79e73b9971f387a49a432bc6222afbe3f0dd518288ae7da148daaa.jpg +3 -0
  29. parse/train/tL89RnzIiCd/images/3f884bb1241f4eabdae24d4b77578a51680b98ee112beb142cba4083fe782460.jpg +3 -0
  30. parse/train/tL89RnzIiCd/images/461d7c77734d6e86a7b4d04b495ef0b9b7559a6729be63cceac4d1dc93ca5203.jpg +3 -0
  31. parse/train/tL89RnzIiCd/images/491cd1ca98150615a3effb7e3896c2d59263cf547c3a3fdc7d0920f78c1b5f37.jpg +3 -0
  32. parse/train/tL89RnzIiCd/images/4bb42082ff379fe5ed0acf322190ad00aca2a5babbddc33dbf032edaa30bd0d9.jpg +3 -0
  33. parse/train/tL89RnzIiCd/images/551e211393e896efbdd041343e4b08941cc17b6bc861d48da7d2b75da3eebf4c.jpg +3 -0
  34. parse/train/tL89RnzIiCd/images/56e69e27b335c3a9130734904fac724655aa508e6bdf0a4bf4228d9ed3678ac7.jpg +3 -0
  35. parse/train/tL89RnzIiCd/images/5805d3ea196ea1f81d84613500bae5a3b4be227d1511b59e7e07a48a36ae9dc3.jpg +3 -0
  36. parse/train/tL89RnzIiCd/images/5d286687868ac3253bf3a7dbb50478224bf709f6e7fdbd82d4f24dacd2e82cb6.jpg +3 -0
  37. parse/train/tL89RnzIiCd/images/610f7a476ef2204c1c8c7a2faa09e6c9c20839150eff9a0a83ac172fd7861e29.jpg +3 -0
  38. parse/train/tL89RnzIiCd/images/6341d7d4f484984ef43140dc286e5d2965d25130a6fb56a93c751b5b39d98091.jpg +3 -0
  39. parse/train/tL89RnzIiCd/images/69b95d4c9f39888ccc2c4d33bd73bd814e42d3f18278393bf491840673555a33.jpg +3 -0
  40. parse/train/tL89RnzIiCd/images/6d0557aba83450978b26fda2cccad77270dcc33a70953269636db1c63c650003.jpg +3 -0
  41. parse/train/tL89RnzIiCd/images/6e6e51933f308510130393a18066d569d4f8f3eae45bb686d4483465462d0e79.jpg +3 -0
  42. parse/train/tL89RnzIiCd/images/6fe37b2c3a938a045a1b4dbdd8960646ea02f35f03eebca6443838b062b7dd32.jpg +3 -0
  43. parse/train/tL89RnzIiCd/images/72675c81306017c80ae54fa81be15badb2d70c430c4f7d1c384a5cd09590e74a.jpg +3 -0
  44. parse/train/tL89RnzIiCd/images/7ca5211d93b96bf40d7582cbe9e30622314937f00dcdfd86febc90fe0b66ecdf.jpg +3 -0
  45. parse/train/tL89RnzIiCd/images/7ef3d588f304b9a5a76926f89d242f85f3f379954da705f4bbbf6965e7ae76a2.jpg +3 -0
  46. parse/train/tL89RnzIiCd/images/8316be427423ae3ed8854bd10242fe3668463998495795102138f8103cc836b6.jpg +3 -0
  47. parse/train/tL89RnzIiCd/images/8929985ebadaa5502bf136ece50ff17f0bd4cd5340a36ea9a7bbb6cf36231d45.jpg +3 -0
  48. parse/train/tL89RnzIiCd/images/8d132ace58ddbb52207795276ba9f810462d87d283961e92d23e325a4bbeae0b.jpg +3 -0
  49. parse/train/tL89RnzIiCd/images/90c6e58a3156bd7a7b5401fe44b99cd02b6f6ec8586f1984fc7886a615a595a4.jpg +3 -0
  50. parse/train/tL89RnzIiCd/images/95da2b92250fe2096a5fba8b13fbe39b323d13fe13f5905981688294fb892393.jpg +3 -0
parse/train/0WASBV4xkhy/0WASBV4xkhy_content_list.json ADDED
@@ -0,0 +1,1490 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Towards a Theoretical Framework of Out-of-Distribution Generalization ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 272,
8
+ 122,
9
+ 725,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Chuanlong XieHuawei Noah’s Ark Labxie.chuanlong@huawei.com",
17
+ "bbox": [
18
+ 377,
19
+ 215,
20
+ 584,
21
+ 257
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Haotian Ye \nPeking University \nPazhou Lab \nhaotianye@pku.edu.cn ",
28
+ "bbox": [
29
+ 184,
30
+ 215,
31
+ 359,
32
+ 271
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Tianle Cai Peking University caitianle1998@pku.edu.cn ",
39
+ "bbox": [
40
+ 604,
41
+ 215,
42
+ 812,
43
+ 257
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "Ruichen Li ",
50
+ "text_level": 1,
51
+ "bbox": [
52
+ 218,
53
+ 292,
54
+ 297,
55
+ 305
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "Zhenguo Li ",
62
+ "text_level": 1,
63
+ "bbox": [
64
+ 400,
65
+ 292,
66
+ 483,
67
+ 306
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Liwei Wang ",
74
+ "text_level": 1,
75
+ "bbox": [
76
+ 637,
77
+ 292,
78
+ 725,
79
+ 306
80
+ ],
81
+ "page_idx": 0
82
+ },
83
+ {
84
+ "type": "text",
85
+ "text": "Peking University xk-lrc@pku.edu.cn ",
86
+ "bbox": [
87
+ 184,
88
+ 306,
89
+ 331,
90
+ 333
91
+ ],
92
+ "page_idx": 0
93
+ },
94
+ {
95
+ "type": "text",
96
+ "text": "Huawei Noah’s Ark Lab Li.Zhenguo@huawei.com ",
97
+ "bbox": [
98
+ 352,
99
+ 306,
100
+ 532,
101
+ 333
102
+ ],
103
+ "page_idx": 0
104
+ },
105
+ {
106
+ "type": "text",
107
+ "text": "Key Laboratory of Machine Perception, MOE, School of EECS, Institute for Artificial Intelligence, Peking University wanglw@cis.pku.edu.cn ",
108
+ "bbox": [
109
+ 552,
110
+ 305,
111
+ 812,
112
+ 376
113
+ ],
114
+ "page_idx": 0
115
+ },
116
+ {
117
+ "type": "text",
118
+ "text": "Abstract ",
119
+ "text_level": 1,
120
+ "bbox": [
121
+ 462,
122
+ 411,
123
+ 535,
124
+ 426
125
+ ],
126
+ "page_idx": 0
127
+ },
128
+ {
129
+ "type": "text",
130
+ "text": "Generalization to out-of-distribution (OOD) data is one of the central problems in modern machine learning. Recently, there is a surge of attempts to propose algorithms that mainly build upon the idea of extracting invariant features. Although intuitively reasonable, theoretical understanding of what kind of invariance can guarantee OOD generalization is still limited, and generalization to arbitrary out-of-distribution is clearly impossible. In this work, we take the first step towards rigorous and quantitative definitions of 1) what is OOD; and 2) what does it mean by saying an OOD problem is learnable. We also introduce a new concept of expansion function, which characterizes to what extent the variance is amplified in the test domains over the training domains, and therefore give a quantitative meaning of invariant features. Based on these, we prove OOD generalization error bounds. It turns out that OOD generalization largely depends on the expansion function. As recently pointed out by [21], any OOD learning algorithm without a model selection module is incomplete. Our theory naturally induces a model selection criterion. Extensive experiments on benchmark OOD datasets demonstrate that our model selection criterion has a significant advantage over baselines. ",
131
+ "bbox": [
132
+ 233,
133
+ 441,
134
+ 766,
135
+ 662
136
+ ],
137
+ "page_idx": 0
138
+ },
139
+ {
140
+ "type": "text",
141
+ "text": "1 Introduction ",
142
+ "text_level": 1,
143
+ "bbox": [
144
+ 174,
145
+ 686,
146
+ 310,
147
+ 704
148
+ ],
149
+ "page_idx": 0
150
+ },
151
+ {
152
+ "type": "text",
153
+ "text": "One of the most fundamental assumptions of classic supervised learning is the “i.i.d. assumption”, which states that the training and the test data are independent and identically distributed. However, this assumption can be easily violated in a reality [8, 10, 11, 17, 38, 48, 56] where the test data usually have a different distribution than the training data. This motivates the research on the out-ofdistribution (OOD) generalization, or domain generalization problem, which assumes access only to data drawn from a set $\\mathcal { E } _ { a v a i l }$ of available domains during training, and the goal is to generalize to a larger domain set ${ \\mathcal { E } } _ { a l l }$ including unseen domains. ",
154
+ "bbox": [
155
+ 174,
156
+ 718,
157
+ 825,
158
+ 815
159
+ ],
160
+ "page_idx": 0
161
+ },
162
+ {
163
+ "type": "text",
164
+ "text": "To generalize to OOD data, most existing algorithms attempt to learn features that are invariant to a certain extent across training domains in the hope that such invariance also holds in unseen domains. For example, distributional matching-based methods [20, 35, 55] seek to learn features that have the same distribution across different domains; IRM [5] and its variants [1, 32, 33] learn feature representations such that the optimal linear classifier on top of the representation matches across domains. ",
165
+ "bbox": [
166
+ 174,
167
+ 821,
168
+ 825,
169
+ 904
170
+ ],
171
+ "page_idx": 0
172
+ },
173
+ {
174
+ "type": "text",
175
+ "text": "35th Conference on Neural Information Processing Systems (NeurIPS 2021). ",
176
+ "bbox": [
177
+ 174,
178
+ 922,
179
+ 629,
180
+ 936
181
+ ],
182
+ "page_idx": 0
183
+ },
184
+ {
185
+ "type": "text",
186
+ "text": "Though the idea of learning invariant features is intuitively reasonable, there is only limited theoretical understanding of what kind of invariance can guarantee OOD generalization. Clearly, generalization to an arbitrary out-of-distribution domain is impossible and in practice, the features can hardly be absolutely invariant from $\\mathcal { E } _ { a v a i l }$ to ${ \\mathcal { E } } _ { a l l }$ unless all the domains are identical. So it is necessary to first formulate what OOD data can be generalized to, or, what is the relation between the available training domain set $\\mathcal { E } _ { a v a i l }$ and the entire domain set ${ \\mathcal { E } } _ { a l l }$ . Meanwhile, to what extent the invariance of features on $\\mathcal { E } _ { a v a i l }$ can be preserved in ${ \\mathcal { E } } _ { a l l }$ should be rigorously characterized. ",
187
+ "bbox": [
188
+ 174,
189
+ 92,
190
+ 825,
191
+ 188
192
+ ],
193
+ "page_idx": 1
194
+ },
195
+ {
196
+ "type": "text",
197
+ "text": "In this paper, we take the first step towards a general OOD framework by quantitatively formalizing the relationship between $\\mathcal { E } _ { a v a i l }$ and ${ \\mathcal { E } } _ { a l l }$ in terms of the distributions of features and provide OOD generalization guarantees based on our quantification of the difficulty of OOD generalization problem. Specifically, we first rigorously formulate the intuition of invariant features used in previous works by introducing the “variation” and “informativeness” (Definition 3.1 and 3.2) of each feature. Our theoretical insight can then be informally stated as: for learnable OOD problems, if a feature is informative for the classification task as well as invariant over $\\mathcal { E } _ { a v a i l }$ , then it is still invariant over ${ \\mathcal { E } } _ { a l l }$ . In other words, invariance of informative features in $\\mathcal { E } _ { a v a i l }$ can be preserved in ${ \\mathcal { E } } _ { a l l }$ . We further introduce a class of functions, dubbed expansion function (Definition 3.3), to quantitatively characterize to what extent the variance of features on $\\mathcal { E } _ { a v a i l }$ is amplified on ${ \\mathcal { E } } _ { a l l }$ . ",
198
+ "bbox": [
199
+ 174,
200
+ 194,
201
+ 825,
202
+ 333
203
+ ],
204
+ "page_idx": 1
205
+ },
206
+ {
207
+ "type": "text",
208
+ "text": "Based on our formulation, we derive theoretical guarantees on the OOD generalization error, i.e., the gap of largest error between the domain in $\\mathcal { E } _ { a v a i l }$ and domain in ${ \\mathcal { E } } _ { a l l }$ . Specifically, we prove the upper and lower bound of OOD generalization error in terms of the expansion function and the variation of learned features over $\\mathcal { E } _ { a v a i l }$ . Our results theoretically confirm that 1) the expansion function can reflect the difficulty of OOD generalization problem, i.e., problems with more rapidly increasing expansion functions are harder and have worse generalization guarantees; 2) the generalization error gap can tend to zero when the variation of learned features tend to zero, so minimizing the variation in $\\mathcal { E } _ { a v a i l }$ can reduce the generalization error. ",
209
+ "bbox": [
210
+ 174,
211
+ 339,
212
+ 825,
213
+ 449
214
+ ],
215
+ "page_idx": 1
216
+ },
217
+ {
218
+ "type": "text",
219
+ "text": "As pointed out by Gulrajani and Lopez-Paz [21], any OOD algorithm without a specified model selection criterion is not complete. Since ${ \\mathcal { E } } _ { a l l }$ is unseen, hyper-parameters can only be chosen according to $\\mathcal { E } _ { a v a i l }$ . Previous selection methods mainly focus on validation accuracy over $\\mathcal { E } _ { a v a i l }$ which is only a biased metric of OOD performance. On the contrary, a promising model selection method should instead be predictive of OOD performance. Inspired by our bounds, we propose a model selection method to select models with high validation accuracy and low variation, which corresponds to the upper bound of OOD error. The introduction of a model’s variation relieves the problem of classic selection methods, in which models that overfit $\\mathcal { E } _ { a v a i l }$ tend to be selected. Experimental results show that our method can outperform baselines and select models with higher OOD accuracy. ",
220
+ "bbox": [
221
+ 174,
222
+ 457,
223
+ 825,
224
+ 594
225
+ ],
226
+ "page_idx": 1
227
+ },
228
+ {
229
+ "type": "text",
230
+ "text": "Contributions. We summarize our major contributions here: ",
231
+ "bbox": [
232
+ 174,
233
+ 622,
234
+ 583,
235
+ 636
236
+ ],
237
+ "page_idx": 1
238
+ },
239
+ {
240
+ "type": "text",
241
+ "text": "• We introduce a quantitative and rigorous formulation of OOD generalization problem that characterizes the relation of invariance over the training domain set $\\mathcal { E } _ { a v a i l }$ and test domain set ${ \\mathcal { E } } _ { a l l }$ . The core quantity in our characterization, the expansion function, determines the difficulty of an OOD generalization problem. ",
242
+ "bbox": [
243
+ 173,
244
+ 654,
245
+ 826,
246
+ 709
247
+ ],
248
+ "page_idx": 1
249
+ },
250
+ {
251
+ "type": "text",
252
+ "text": "• We prove novel OOD generalization error bounds based on our formulation. The upper and lower bounds together indicate that the expansion function well characterizes the OOD generalization ability of features with different levels of variation. ",
253
+ "bbox": [
254
+ 174,
255
+ 724,
256
+ 823,
257
+ 766
258
+ ],
259
+ "page_idx": 1
260
+ },
261
+ {
262
+ "type": "text",
263
+ "text": "• We design a model selection criterion that is inspired by our generalization bounds. Our criterion takes both the performance on training domains and the variation of models into consideration and is predictive of OOD performance according to our bounds. Experimental results demonstrate our selection criterion can choose models with higher OOD accuracy. ",
264
+ "bbox": [
265
+ 173,
266
+ 782,
267
+ 825,
268
+ 838
269
+ ],
270
+ "page_idx": 1
271
+ },
272
+ {
273
+ "type": "text",
274
+ "text": "The rest of the paper is organized as follows: Section 2 is our preliminary. In Section 3, we give our theoretical formulation. Section 4 gives our generalization bound. We propose our model selection method in Section 5. In Section 6 we conduct experiments on expansion function and model selection. We review more related works in Section 7 and conclude our work in Section 8. ",
275
+ "bbox": [
276
+ 176,
277
+ 856,
278
+ 825,
279
+ 911
280
+ ],
281
+ "page_idx": 1
282
+ },
283
+ {
284
+ "type": "text",
285
+ "text": "2 Preliminary ",
286
+ "text_level": 1,
287
+ "bbox": [
288
+ 173,
289
+ 88,
290
+ 305,
291
+ 107
292
+ ],
293
+ "page_idx": 2
294
+ },
295
+ {
296
+ "type": "text",
297
+ "text": "Throughout the paper, we consider a multi-class classification task $\\mathcal { X } \\to \\mathcal { Y } = \\{ 1 , . . . , K \\}$ .1 Let ${ \\mathcal { E } } _ { a l l }$ be the domain set we want to generalize to, and $\\mathcal { E } _ { a v a i l } \\subseteq \\mathcal { E } _ { a l l }$ be the available domain set, i.e., all domains we have during the training procedure. We denote $( X ^ { e } , Y ^ { e } )$ to be the input-label pair drawn from the data distribution of domain $e$ . The OOD generalization goal is to find a classifier $f ^ { * }$ that minimizes the worst-domain loss on ${ \\mathcal { E } } _ { a l l }$ : ",
298
+ "bbox": [
299
+ 174,
300
+ 119,
301
+ 825,
302
+ 190
303
+ ],
304
+ "page_idx": 2
305
+ },
306
+ {
307
+ "type": "equation",
308
+ "img_path": "images/92ece3d80a18d8b09d86d490b1aa6271dee39a3b130e884626dc355a67e41bdf.jpg",
309
+ "text": "$$\nf ^ { * } = \\underset { f \\in \\mathcal { F } } { \\mathrm { a r g m i n } } \\mathcal { L } ( \\mathcal { E } _ { a l l } , f ) , \\mathcal { L } ( \\mathcal { E } , f ) \\triangleq \\underset { e \\in \\mathcal { E } } { \\mathrm { m a x } } \\mathbb { E } \\big [ \\ell \\big ( f ( X ^ { e } ) , Y ^ { e } \\big ) \\big ]\n$$",
310
+ "text_format": "latex",
311
+ "bbox": [
312
+ 300,
313
+ 195,
314
+ 696,
315
+ 224
316
+ ],
317
+ "page_idx": 2
318
+ },
319
+ {
320
+ "type": "text",
321
+ "text": "where $\\mathcal { F } : \\mathcal { X } \\xrightarrow { } \\mathbb { R } ^ { K }$ is the the hypothetical space and $\\ell ( \\cdot , \\cdot )$ is a loss function. Similar to previous works [5, 16, 27, 33], we assume that $f$ can be decomposed into $g \\circ h$ , where $g \\in \\mathcal { G } : \\mathbb { R } ^ { d } \\mathbb { R } ^ { K }$ is the top classifier and $h : \\mathcal { X } \\mathbb { R } ^ { d }$ is a $d$ -dimensional feature extractor, i.e., ",
322
+ "bbox": [
323
+ 173,
324
+ 232,
325
+ 825,
326
+ 276
327
+ ],
328
+ "page_idx": 2
329
+ },
330
+ {
331
+ "type": "equation",
332
+ "img_path": "images/ee0a57e21bd4e230b25e434833fe9ced52367d0fd15ac040eda84f95a58b070d.jpg",
333
+ "text": "$$\nh ( x ) = ( \\phi _ { 1 } ( x ) , \\phi _ { 2 } ( x ) , \\ldots , \\phi _ { d } ( x ) ) ^ { \\top } , \\quad \\phi _ { i } \\in \\Phi .\n$$",
334
+ "text_format": "latex",
335
+ "bbox": [
336
+ 323,
337
+ 284,
338
+ 640,
339
+ 303
340
+ ],
341
+ "page_idx": 2
342
+ },
343
+ {
344
+ "type": "text",
345
+ "text": "Here $\\Phi$ is the set of scalar feature maps which map $\\mathcal { X }$ to $\\mathbb { R }$ and $d$ is fixed. We will call each $\\phi \\in \\Phi$ a feature for simplicity. Given a domain $e$ , we denote the $d$ -dimensional random vector $h ( X ^ { e } )$ as $h ^ { e }$ , one-dimensional feature $\\phi ( X ^ { e } )$ as $\\phi ^ { e }$ , and the conditional distribution of $h ^ { e } , \\phi ^ { e }$ given $Y ^ { e } = y$ as $\\mathbb { P } ( h ^ { e } | y ) , \\mathbb { P } ( \\phi ^ { e } | y )$ . For simplicity, we assume the data distribution is balanced in every domain, i.e., $P ( Y ^ { e } = y ) = \\frac { 1 } { K } , \\forall y \\in \\mathcal { Y } , e \\in \\mathcal { E } _ { a l l }$ . Our framework can be easily extended to the case where the balanced assumption is removed, with an additional term corresponding to the imbalance adding to the generalization bounds. ",
346
+ "bbox": [
347
+ 173,
348
+ 309,
349
+ 826,
350
+ 407
351
+ ],
352
+ "page_idx": 2
353
+ },
354
+ {
355
+ "type": "text",
356
+ "text": "3 Framework of OOD Generalization Problem ",
357
+ "text_level": 1,
358
+ "bbox": [
359
+ 173,
360
+ 426,
361
+ 580,
362
+ 444
363
+ ],
364
+ "page_idx": 2
365
+ },
366
+ {
367
+ "type": "text",
368
+ "text": "The main challenge of formalizing the OOD generalization problem is to mathematically describe the connection between $\\mathcal { E } _ { a v a i l }$ and ${ \\mathcal { E } } _ { a l l }$ and how generalization depends on this relation. Towards this goal, we introduce several quantities to characterize the relation of feature distributions over different domains and bridge $\\mathcal { E } _ { a v a i l }$ and ${ \\mathcal { E } } _ { a l l }$ by expansion function (Definition 3.3) over the quantities we have introduced. Our framework is motivated by the understanding that, in an OOD generalization task, certain “property” of “good” features in $\\mathcal { E } _ { a v a i l }$ should be “preserved” in ${ \\mathcal { E } } _ { a l l }$ (the reason is described in Section 1). In Section 3.1, we will go into details on what we mean by “property” (variation, Definition 3.1), “good” (informativeness, Definition 3.2), and “preserved” (measured by expansion function). In Section 6.2, we further illustrate the key concepts in our framework by a real-world OOD problem. ",
369
+ "bbox": [
370
+ 173,
371
+ 457,
372
+ 826,
373
+ 597
374
+ ],
375
+ "page_idx": 2
376
+ },
377
+ {
378
+ "type": "text",
379
+ "text": "3.1 Formalizing OOD Problem by Quantifying Feature Distribution ",
380
+ "text_level": 1,
381
+ "bbox": [
382
+ 174,
383
+ 612,
384
+ 658,
385
+ 628
386
+ ],
387
+ "page_idx": 2
388
+ },
389
+ {
390
+ "type": "text",
391
+ "text": "We first introduce the concepts “variation\" and “informativeness\" of a feature $\\phi$ . The first one is what we expect to be preserved in ${ \\mathcal { E } } _ { a l l }$ and the second one characterizes what features will be considered. Specifically, let $\\rho ( \\mathbb { P } , \\mathbb { Q } )$ be a symmetric “distance” of two distributions. Note that $\\rho$ can have many choices, like $L _ { 2 }$ Distance, Total Variation and symmetric KL-divergence, etc. The variation and informativeness are defined as follows: ",
392
+ "bbox": [
393
+ 173,
394
+ 638,
395
+ 825,
396
+ 708
397
+ ],
398
+ "page_idx": 2
399
+ },
400
+ {
401
+ "type": "text",
402
+ "text": "Definition 3.1 (Variation). The variation of feature $\\phi ( \\cdot )$ across a domain set $\\mathcal { E }$ is ",
403
+ "bbox": [
404
+ 173,
405
+ 712,
406
+ 705,
407
+ 728
408
+ ],
409
+ "page_idx": 2
410
+ },
411
+ {
412
+ "type": "equation",
413
+ "img_path": "images/b5e6d90d4f6e707f43d0a5fd09cd50b46b59f7364145ae7e58a3a5a8d9599fbf.jpg",
414
+ "text": "$$\n\\mathcal { V } _ { \\rho } ( \\phi , \\mathcal { E } ) = \\operatorname* { m a x } _ { y \\in \\mathcal { V } } \\operatorname* { s u p } _ { e , e ^ { \\prime } \\in \\mathcal { E } } \\rho \\big ( \\mathbb { P } ( \\phi ^ { e } | y ) , \\mathbb { P } ( \\phi ^ { e ^ { \\prime } } | y ) \\big ) .\n$$",
415
+ "text_format": "latex",
416
+ "bbox": [
417
+ 348,
418
+ 736,
419
+ 648,
420
+ 765
421
+ ],
422
+ "page_idx": 2
423
+ },
424
+ {
425
+ "type": "text",
426
+ "text": "A feature $\\phi ( \\cdot )$ is $\\varepsilon$ -invariant across $\\mathcal { E }$ , $i f \\varepsilon \\geq \\mathcal { V } ( \\phi , \\mathcal { E } )$ (We omit the subscript $\\rho$ in case of no ambiguity). Definition 3.2 (Informativeness). The informativeness of feature $\\phi ( \\cdot )$ across a domain set $\\mathcal { E }$ is ",
427
+ "bbox": [
428
+ 171,
429
+ 772,
430
+ 828,
431
+ 808
432
+ ],
433
+ "page_idx": 2
434
+ },
435
+ {
436
+ "type": "equation",
437
+ "img_path": "images/b5d2d9f29351ffd114b5530974aa3d8ba7d34f3c8275c029e6a978717a1c0731.jpg",
438
+ "text": "$$\n\\mathcal { T } _ { \\rho } ( \\phi , \\mathcal { E } ) = \\frac { 1 } { K ( K - 1 ) } \\sum _ { \\stackrel { y \\neq y ^ { \\prime } } { y , y ^ { \\prime } \\in y } } \\operatorname* { m i n } _ { e \\in \\mathcal { E } } \\rho \\big ( \\mathbb { P } ( \\phi ^ { e } | y ) , \\mathbb { P } ( \\phi ^ { e } | y ^ { \\prime } ) \\big ) .\n$$",
439
+ "text_format": "latex",
440
+ "bbox": [
441
+ 292,
442
+ 813,
443
+ 671,
444
+ 864
445
+ ],
446
+ "page_idx": 2
447
+ },
448
+ {
449
+ "type": "text",
450
+ "text": "A feature $\\phi ( \\cdot )$ is $\\delta$ -informative across $\\varepsilon$ , if $\\quad \\delta \\leq { \\mathcal { I } } ( \\phi , { \\mathcal { E } } )$ . ",
451
+ "bbox": [
452
+ 171,
453
+ 871,
454
+ 539,
455
+ 887
456
+ ],
457
+ "page_idx": 2
458
+ },
459
+ {
460
+ "type": "text",
461
+ "text": "The variation $\\mathcal { V } ( \\phi , \\mathcal { E } )$ measures the stability of $\\phi ( \\cdot )$ over the domains in $\\mathcal { E }$ and the informativeness ${ \\mathcal { T } } ( \\phi , { \\mathcal { E } } )$ captures the ability of $\\phi ( \\cdot )$ to distinguish different labels. We would like to highlight that the variation and informativeness are defined on each one-dimensional feature $\\phi ( \\cdot )$ . Unlike previous distance between distributions defined in $d$ -dimensional space, our definitions are more reasonable and practical, since it can be easily calculated and analyzed. ",
462
+ "bbox": [
463
+ 174,
464
+ 90,
465
+ 825,
466
+ 161
467
+ ],
468
+ "page_idx": 3
469
+ },
470
+ {
471
+ "type": "text",
472
+ "text": "We are now ready to introduce the core quantity for connecting $\\mathcal { E } _ { a v a i l }$ and ${ \\mathcal { E } } _ { a l l }$ . Our motivation, as elaborated in the introduction section, is that, if a feature is informative for the classification task and invariant over $\\mathcal { E } _ { a v a i l }$ , then to enable OOD generalization from $\\mathcal { E } _ { a v a i l }$ to ${ \\mathcal { E } } _ { a l l }$ , it should be still invariant over ${ \\mathcal { E } } _ { a l l }$ . So the relation between $\\mathcal { V } ( \\phi , \\mathcal { E } _ { a v a i l } )$ and $\\mathinner { \\gamma \\mathopen { \\left( \\phi , \\mathcal { E } _ { a l l } \\right) } }$ of an informative feature captures the feasibility and difficulty of OOD generalization. To quantitatively measure this relation, we define the following function class: ",
473
+ "bbox": [
474
+ 174,
475
+ 166,
476
+ 825,
477
+ 251
478
+ ],
479
+ "page_idx": 3
480
+ },
481
+ {
482
+ "type": "text",
483
+ "text": "Definition 3.3 (Expansion Function). We say a function $s : \\mathbb { R } ^ { + } \\cup \\{ 0 \\} \\mathbb { R } ^ { + } \\cup \\{ 0 , + \\infty \\}$ is an expansion function, iff the following properties hold: 1) $s ( \\cdot )$ is monotonically increasing and $s ( x ) \\geq x , \\forall x \\geq 0 ; 2 ,$ ) $\\begin{array} { r } { \\operatorname* { l i m } _ { x 0 ^ { + } } s ( x ) = s ( 0 ) = 0 } \\end{array}$ . ",
484
+ "bbox": [
485
+ 174,
486
+ 255,
487
+ 825,
488
+ 297
489
+ ],
490
+ "page_idx": 3
491
+ },
492
+ {
493
+ "type": "text",
494
+ "text": "This function class gives a full characterization of how the variation between $\\mathcal { E } _ { a v a i l }$ and ${ \\mathcal { E } } _ { a l l }$ is related. Based on this function class, we can introduce our formulation of the learnability of OOD generalization as follows: ",
495
+ "bbox": [
496
+ 174,
497
+ 309,
498
+ 825,
499
+ 351
500
+ ],
501
+ "page_idx": 3
502
+ },
503
+ {
504
+ "type": "text",
505
+ "text": "Definition 3.4 (Learnability). Let $\\Phi$ be the feature space and $\\rho$ be a distribution distance. We say an OOD generalization problem from $\\mathcal { E } _ { a v a i l }$ to ${ \\mathcal { E } } _ { a l l }$ is learnable if there exists an expansion function $s ( \\cdot )$ and $\\delta \\geq 0$ , such that: for all $\\phi \\in \\Phi$ satisfying ${ \\mathcal { T } } _ { \\rho } ( \\phi , { \\mathcal { E } } _ { a v a i l } ) \\geq \\delta$ , we have $s ( \\mathcal { V } _ { \\rho } ( \\phi , \\mathcal { E } _ { a v a i l } ) ) \\geq$ $\\mathcal { V } _ { \\rho } \\big ( \\phi , \\mathcal { E } _ { a l l } \\big )$ . If such $s ( \\cdot )$ and $\\delta$ exist, we further call this problem $( s ( \\cdot ) , \\delta )$ -learnable. If an $o o D$ generalization problem is not learnable, we call $i t$ unlearnable. ",
506
+ "bbox": [
507
+ 174,
508
+ 356,
509
+ 825,
510
+ 425
511
+ ],
512
+ "page_idx": 3
513
+ },
514
+ {
515
+ "type": "text",
516
+ "text": "To understand the intuition and rationality of our formulation, several discussions are in order. ",
517
+ "bbox": [
518
+ 171,
519
+ 436,
520
+ 787,
521
+ 452
522
+ ],
523
+ "page_idx": 3
524
+ },
525
+ {
526
+ "type": "text",
527
+ "text": "Properties of the expansion function. In Definition 3.3, we highlight two properties of the expansion function. The first property comes naturally from the monotonicity properties of variation: any $\\varepsilon _ { 1 }$ -invariant feature is also $\\varepsilon _ { 2 }$ -invariant for $\\varepsilon _ { 2 } \\geq \\varepsilon _ { 1 }$ ; and $\\mathcal { V } ( \\phi , \\mathcal { E } _ { 1 } ) \\leq \\mathcal { V } ( \\phi , \\mathcal { E } _ { 2 } )$ for any ${ \\mathcal { E } } _ { 1 } \\subseteq { \\mathcal { E } } _ { 2 }$ . The monotonicity also implies that larger ${ \\mathcal { E } } _ { a l l }$ will induce larger $s ( \\cdot ) ^ { 2 }$ and it is also harder to be generalized to. From this view, we can see that the scale of $s ( \\cdot )$ can reflect the difficulty of OOD generalization. The second property is more crucial since it formulates the intuition that if an informative feature is almost invariant in $\\mathcal { E } _ { a v a i l }$ , it should remain invariant in ${ \\mathcal { E } } _ { a l l }$ . Without this assumption, OOD generalization can never be guaranteed because we cannot predict whether an invariant and informative feature in $\\mathcal { E } _ { a v a i l }$ will vary severely in unseen ${ \\mathcal { E } } _ { a l l }$ . ",
528
+ "bbox": [
529
+ 173,
530
+ 467,
531
+ 826,
532
+ 592
533
+ ],
534
+ "page_idx": 3
535
+ },
536
+ {
537
+ "type": "text",
538
+ "text": "Necessity of informativeness. We include a seemingly redundant quantity informativeness in the definition of learnability. However, this term is necessary because only informative features are responsible for the performance of classification. Non-informative but invariant features over $\\mathcal { E } _ { a v a i l }$ may only capture some noise that is irrelevant to the classification problem, and we shall not expect the noise to be invariant over ${ \\mathcal { E } } _ { a l l }$ . Moreover, we show in Figure 1 that in practice, many invariant but useless features in $\\mathcal { E } _ { a v a i l }$ vary a lot in ${ \\mathcal { E } } _ { a l l }$ , and adding the constraint of informativeness makes the expansion function reasonable. In addition, there are multiple choices of $( s ( \\cdot ) , \\delta )$ to make an OOD generalization problem learnable: larger $\\delta$ will filter out more features, and so $\\dot { s } ( \\cdot )$ can be smaller (flatter). This multiplicity will result in a trade-off between $s ( \\cdot )$ and $\\delta$ , which will be discussed in Section 6.2. ",
539
+ "bbox": [
540
+ 174,
541
+ 607,
542
+ 825,
543
+ 746
544
+ ],
545
+ "page_idx": 3
546
+ },
547
+ {
548
+ "type": "text",
549
+ "text": "Two extreme cases: i.i.d. & unlearnable. To better understand the concept of learnability, we consider two extreme cases. (1) The first example is when all data from different $\\textit { e } \\in \\mathcal { E } _ { a l l }$ are identically distributed, i.e., the classic supervised learning setting. This problem is $( s ( \\cdot ) , 0 )$ -learnable with $s ( x ) = x$ , implying no extra difficulty in OOD generalization. (2) As an example of unlearnable, consider the following case (modified from Colored MNIST [5]): For $e \\in \\mathcal { E } _ { a v a i l }$ , images with label 0 always has a red background while images with label 1 has a blue background. For $e \\in \\mathcal { E } _ { a l l } \\ \\backslash \\ \\mathcal { E } _ { a v a i l }$ , this relationship is entirely inverse. Since data from different $e \\in \\mathcal { E } _ { a v a i l }$ are identically distributed but different from other $e \\in \\mathcal { E } _ { a l l }$ , no expansion function can make it learnable, i.e., it is OOD-unlearnable. ",
550
+ "bbox": [
551
+ 173,
552
+ 761,
553
+ 825,
554
+ 873
555
+ ],
556
+ "page_idx": 3
557
+ },
558
+ {
559
+ "type": "text",
560
+ "text": "The unlearnability of this case also coincides with our intuition: Without prior knowledge, it is not clear from merely the training data, whether the task is to distinguish digit 0 from 1, or to distinguish color red from blue. As a result, generalization to ${ \\mathcal { E } } _ { a l l }$ cannot be guaranteed. ",
561
+ "bbox": [
562
+ 173,
563
+ 90,
564
+ 825,
565
+ 133
566
+ ],
567
+ "page_idx": 4
568
+ },
569
+ {
570
+ "type": "text",
571
+ "text": "4 Generalization Bound ",
572
+ "text_level": 1,
573
+ "bbox": [
574
+ 174,
575
+ 151,
576
+ 390,
577
+ 170
578
+ ],
579
+ "page_idx": 4
580
+ },
581
+ {
582
+ "type": "text",
583
+ "text": "In this section, we consider an OOD generalization problem from $\\mathcal { E } _ { a v a i l }$ to ${ \\mathcal { E } } _ { a l l }$ , and our goal is to analyze the OOD generalization error of classifier $f = g \\circ h$ defined by ",
584
+ "bbox": [
585
+ 173,
586
+ 183,
587
+ 823,
588
+ 212
589
+ ],
590
+ "page_idx": 4
591
+ },
592
+ {
593
+ "type": "equation",
594
+ "img_path": "images/f61601e575911b7b38e2ff41bc91c80f1ca3bdfad17110177fbe71a235a390ce.jpg",
595
+ "text": "$$\n\\mathrm { e r r } ( f ) = \\mathcal { L } ( \\mathcal { E } _ { a l l } , f ) - \\mathcal { L } ( \\mathcal { E } _ { a v a i l } , f ) ,\n$$",
596
+ "text_format": "latex",
597
+ "bbox": [
598
+ 362,
599
+ 217,
600
+ 599,
601
+ 234
602
+ ],
603
+ "page_idx": 4
604
+ },
605
+ {
606
+ "type": "text",
607
+ "text": "where we assume the loss function $l ( \\cdot , \\cdot )$ is bounded by $[ 0 , C ]$ . We prove two upper bounds (4.1, 4.2) as well as a lower bound (4.3) for $\\operatorname { e r r } ( f )$ based on our formulation. Our bounds together provide a complete characterization of the difficulty of OOD generalization. Since we expect that an invariant classifier can generalize to unseen domains, we hope to bound $\\operatorname { e r r } ( f )$ in terms of the certain variation of $f$ . To this end, we define the variation and informativeness of $f$ in terms of its features, i.e., ",
608
+ "bbox": [
609
+ 173,
610
+ 238,
611
+ 825,
612
+ 309
613
+ ],
614
+ "page_idx": 4
615
+ },
616
+ {
617
+ "type": "equation",
618
+ "img_path": "images/37ed4f7a0dc7d2319bdc5086f2478da0e7cc992b3f71f92313ccf9703cd17289.jpg",
619
+ "text": "$$\n\\begin{array} { r l r } { \\mathcal { V } ^ { \\operatorname* { s u p } } ( h , \\mathcal { E } _ { a v a i l } ) } & { \\triangleq } & { \\underset { \\beta \\in S ^ { d - 1 } } { \\operatorname* { s u p } } \\mathcal { V } ( \\beta ^ { \\top } h , \\mathcal { E } _ { a v a i l } ) , } \\\\ { \\mathcal { T } ^ { \\operatorname* { i n f } } ( h , \\mathcal { E } _ { a v a i l } ) } & { \\triangleq } & { \\underset { \\beta \\in S ^ { d - 1 } } { \\operatorname* { i n f } } \\mathcal { T } ( \\beta ^ { \\top } h , \\mathcal { E } _ { a v a i l } ) , } \\end{array}\n$$",
620
+ "text_format": "latex",
621
+ "bbox": [
622
+ 348,
623
+ 313,
624
+ 647,
625
+ 372
626
+ ],
627
+ "page_idx": 4
628
+ },
629
+ {
630
+ "type": "text",
631
+ "text": "where $( \\beta ^ { \\top } h ) ( x ) = \\beta ^ { \\top } h ( x )$ is a feature and $S ^ { d - 1 } = \\{ \\beta \\in \\mathbb { R } ^ { d } : \\| \\beta \\| _ { 2 } = 1 \\}$ is the unit $( d - 1 )$ -sphere. ",
632
+ "bbox": [
633
+ 171,
634
+ 376,
635
+ 825,
636
+ 395
637
+ ],
638
+ "page_idx": 4
639
+ },
640
+ {
641
+ "type": "text",
642
+ "text": "Necessity of using supremum over linear combination. One seemingly plausible definition of the variation of a classifier $f$ can be the supremum over all $\\mathcal { V } ( \\phi _ { i } , \\mathcal { E } _ { a v a i l } ) , i \\in [ d ]$ . However, as is shown in Appendix 1, it is possible that two high-dimensional joint distributions have close marginal distribution in each dimension, while they do not overlap. In other words, there exist cases where $\\mathcal { V } ( \\phi _ { i } , \\mathcal { E } _ { a l l } ) = 0 , \\forall i \\in [ d ]$ but after applying the top model $g$ over $\\phi _ { i }$ ’s, the distribution varies a lot in $\\mathcal { E } _ { a v a i l }$ . Our definition comes from the simple idea that the class of top model $\\mathcal { G }$ is at least a linear space, so we should at least consider the variation of every (normalized) linear combination of $h ( \\cdot )$ With this, we can guarantee the joint distribution distance is still small. ",
643
+ "bbox": [
644
+ 173,
645
+ 406,
646
+ 825,
647
+ 518
648
+ ],
649
+ "page_idx": 4
650
+ },
651
+ {
652
+ "type": "text",
653
+ "text": "Theorem 4.1 (Main Theorem). Suppose we have learned a classifier $f ( x ) = g ( h ( x ) )$ such that $\\forall e \\in \\mathcal { E } _ { a l l }$ and $\\forall y \\in \\mathcal { V } ;$ $, p _ { h ^ { e } | Y ^ { e } } ( h | y ) \\in L ^ { 2 } ( \\mathbb R ^ { d } )$ . Denote the characteristic function of random variable $h ^ { e } | Y ^ { e }$ as $\\hat { p } _ { h ^ { e } | Y ^ { e } } ( t | y ) = \\mathbb { E } [ \\exp \\{ i \\langle t , h ^ { e } \\rangle \\} | Y ^ { e } = y ]$ . Assume the hypothetical space $\\mathcal { F }$ satisfies the following regularity conditions that $\\exists \\alpha , M _ { 1 } , M _ { 2 } > 0 , \\forall f \\in \\mathcal { F } , \\forall e \\in \\mathcal { E } _ { a l l } , y \\in \\mathcal { V }$ , ",
654
+ "bbox": [
655
+ 173,
656
+ 521,
657
+ 825,
658
+ 582
659
+ ],
660
+ "page_idx": 4
661
+ },
662
+ {
663
+ "type": "equation",
664
+ "img_path": "images/ee4b4c076d84f9c894a2e146552ae306c55f38d76c671d508d171889b7b12f9f.jpg",
665
+ "text": "$$\n\\int _ { h \\in \\mathbb { R } ^ { d } } p _ { h ^ { e } | Y ^ { e } } ( h | y ) | h | ^ { \\alpha } \\mathrm { d } h \\leq M _ { 1 } \\quad a n d \\quad \\int _ { t \\in \\mathbb { R } ^ { d } } | \\hat { p } _ { h ^ { e } | Y ^ { e } } ( t | y ) | | t | ^ { \\alpha } \\mathrm { d } t \\leq M _ { 2 } .\n$$",
666
+ "text_format": "latex",
667
+ "bbox": [
668
+ 251,
669
+ 585,
670
+ 745,
671
+ 619
672
+ ],
673
+ "page_idx": 4
674
+ },
675
+ {
676
+ "type": "text",
677
+ "text": "$I f ( \\mathcal { E } _ { a v a i l } , \\mathcal { E } _ { a l l } )$ is $\\left( s ( \\cdot ) , \\mathcal { T } ^ { i n f } ( h , \\mathcal { E } _ { a v a i l } ) \\right)$ -learnable under $\\Phi$ with Total Variation $\\rho ^ { 3 }$ , then we have ",
678
+ "bbox": [
679
+ 174,
680
+ 625,
681
+ 802,
682
+ 641
683
+ ],
684
+ "page_idx": 4
685
+ },
686
+ {
687
+ "type": "equation",
688
+ "img_path": "images/47d72154cd89cf0c6271de3f68baa90e658deea6245d64bec4f750c758b38256.jpg",
689
+ "text": "$$\n\\operatorname { e r r } ( f ) \\leq O \\left( s \\left( \\mathcal { V } _ { \\rho } ^ { s u p } ( h , \\mathcal { E } _ { a v a i l } ) \\right) ^ { \\frac { \\alpha ^ { 2 } } { ( \\alpha + d ) ^ { 2 } } } \\right) .\n$$",
690
+ "text_format": "latex",
691
+ "bbox": [
692
+ 349,
693
+ 647,
694
+ 616,
695
+ 676
696
+ ],
697
+ "page_idx": 4
698
+ },
699
+ {
700
+ "type": "text",
701
+ "text": "Here $\\rho$ is total variation distance, and $O ( \\cdot )$ depends on $d , C , \\alpha , M _ { 1 } , M _ { 2 }$ . ",
702
+ "bbox": [
703
+ 176,
704
+ 681,
705
+ 648,
706
+ 696
707
+ ],
708
+ "page_idx": 4
709
+ },
710
+ {
711
+ "type": "text",
712
+ "text": "The above theorem holds for a general classifier learned by any algorithms. Due to its generality, we need to introduce some technical regularity conditions on the density function. The assumption (4) assume the decay rate of density and its characteristic function, which is common in the literature, e.g. [14]. This theorem demonstrates that, the generalization error can be bounded by a function of the variation of $h$ , and it converges to 0 as the variation approaches to 0. Under some special but typical case where the top model $g$ is linear, we can further show that even without the regularity conditions in Theorem 4.1, we have a much better (linear) convergence rate. ",
713
+ "bbox": [
714
+ 173,
715
+ 705,
716
+ 826,
717
+ 804
718
+ ],
719
+ "page_idx": 4
720
+ },
721
+ {
722
+ "type": "text",
723
+ "text": "Theorem 4.2 (Linear Top Model). Consider any loss satisfying $\\begin{array} { r } { \\ell ( \\hat { y } , y ) = \\sum _ { k = 1 } ^ { K } \\ell _ { 0 } ( \\hat { y } _ { k } , y _ { k } ) } \\end{array}$ .4 For any classifier with linear top model $g$ , i.e., ",
724
+ "bbox": [
725
+ 173,
726
+ 809,
727
+ 823,
728
+ 839
729
+ ],
730
+ "page_idx": 4
731
+ },
732
+ {
733
+ "type": "equation",
734
+ "img_path": "images/fd483c8cfb69d41c51abea8bfcbef01bb15ff1bdd62fa9a0e20893ef0103bc4c.jpg",
735
+ "text": "$$\nf ( x ) = A h ( x ) + b w i t h A \\in \\mathbb { R } ^ { K \\times d } , b \\in \\mathbb { R } ^ { K } ,\n$$",
736
+ "text_format": "latex",
737
+ "bbox": [
738
+ 318,
739
+ 843,
740
+ 647,
741
+ 862
742
+ ],
743
+ "page_idx": 4
744
+ },
745
+ {
746
+ "type": "text",
747
+ "text": "$i f ( \\mathcal { E } _ { a v a i l } , \\mathcal { E } _ { a l l } )$ is $\\left( s ( \\cdot ) , \\mathcal { T } ^ { i n f } ( h , \\mathcal { E } _ { a v a i l } ) \\right)$ -learnable under $\\Phi$ with Total Variation $\\rho$ , then we have ",
748
+ "bbox": [
749
+ 171,
750
+ 90,
751
+ 797,
752
+ 108
753
+ ],
754
+ "page_idx": 5
755
+ },
756
+ {
757
+ "type": "equation",
758
+ "img_path": "images/bff65b7e956cd09791c5ed2c8933cda9684cbbae3c4dc554a897bdb02f4ed4da.jpg",
759
+ "text": "$$\n\\mathrm { e r r } ( f ) \\leq O \\Bigl ( s \\bigl ( \\mathcal { V } ^ { s u p } ( h , \\mathcal { E } _ { a v a i l } ) \\bigr ) \\Bigr ) .\n$$",
760
+ "text_format": "latex",
761
+ "bbox": [
762
+ 369,
763
+ 113,
764
+ 594,
765
+ 140
766
+ ],
767
+ "page_idx": 5
768
+ },
769
+ {
770
+ "type": "text",
771
+ "text": "Here $O ( \\cdot )$ depends only on d and $C$ . ",
772
+ "bbox": [
773
+ 174,
774
+ 145,
775
+ 413,
776
+ 160
777
+ ],
778
+ "page_idx": 5
779
+ },
780
+ {
781
+ "type": "text",
782
+ "text": "Discussion. Theorem 4.1 shows that, for any model, the generalization gap depends largely on the model’s variation captured by $\\mathcal { V } ^ { \\mathrm { s u p } } ( h , \\mathcal { E } _ { a v a i l } )$ . The result is irrelevant to the algorithm and provides a guarantee for the generalization gap from $\\mathcal { E } _ { a v a i l }$ to ${ \\mathcal { E } } _ { a l l }$ , so long as the learned model $f$ is invariant, i.e. $\\mathcal { V } ^ { \\mathrm { s u p } } ( h , \\mathcal { E } _ { a v a i l } )$ is small. When $s ( \\cdot )$ is fixed, a model with smaller $\\mathcal { V } ^ { \\mathrm { s u p } } ( h , \\mathcal { E } _ { a v a i l } )$ results in a smaller gap, which matches our understanding that invariant features in $\\mathcal { E } _ { a v a i l }$ are somehow invariant in ${ \\mathcal { E } } _ { a l l }$ . When $\\mathcal { V } ^ { \\mathrm { s u p } } ( h , \\mathcal { E } _ { a v a i l } )$ is fixed, more difficult generalization will generate a larger expansion function, which leads to a larger gap. For the Gaussian class with bounded mean and variance, $\\alpha \\gg d$ and the convergent rate is almost linear. ",
783
+ "bbox": [
784
+ 173,
785
+ 174,
786
+ 826,
787
+ 286
788
+ ],
789
+ "page_idx": 5
790
+ },
791
+ {
792
+ "type": "text",
793
+ "text": "However, without any constraint to $g$ , the convergent rate might be small. Theorem 4.2 then offers a generalization bound with a linear convergent rate under mild assumptions when $g$ is linear, which is common in reality. It relaxes the concentration assumption (Formula 4) and asks only for the integrability of the density. The convergent rate is identical to the convergent rate of the expansion function, showing that $s ( \\cdot )$ captures the generalization quite well. ",
794
+ "bbox": [
795
+ 173,
796
+ 291,
797
+ 825,
798
+ 362
799
+ ],
800
+ "page_idx": 5
801
+ },
802
+ {
803
+ "type": "text",
804
+ "text": "Proof Sketch of Theorem 4.1. The proof of the main result, Theorem 4.1, is decomposed into the following steps. First, we transform $\\operatorname { e r r } ( f )$ into the Total Variation of joint distributions of features in different domains (Step 1). To bound the Total Variation, it is sufficient to bound the distance of the corresponding Fourier transform, and further, it is equivalent to bound the Radon transform of joint distributions (Step 2). Eventually, we show that $\\mathcal { V } ^ { \\mathrm { s u p } } ( \\beta ^ { \\top } h , \\mathcal { E } _ { a v a i l } )$ can be used to bound the Radon transform, which finishes the proof (Step 3). ",
805
+ "bbox": [
806
+ 173,
807
+ 375,
808
+ 825,
809
+ 460
810
+ ],
811
+ "page_idx": 5
812
+ },
813
+ {
814
+ "type": "text",
815
+ "text": "Step 1. The OOD generalization error can be bounded as: ",
816
+ "bbox": [
817
+ 173,
818
+ 464,
819
+ 553,
820
+ 479
821
+ ],
822
+ "page_idx": 5
823
+ },
824
+ {
825
+ "type": "equation",
826
+ "img_path": "images/9c22961cf79642649ac7052d3371c49427c7a1ab896566ae2ddd688515f2d0dd.jpg",
827
+ "text": "$$\n\\mathrm { e r r } ( f ) \\le \\operatorname* { s u p } _ { ( e , e ^ { \\prime } ) \\in ( \\mathcal { E } _ { a v a i l } , \\mathcal { E } _ { a l l } ) } \\frac { C } { K } \\sum _ { y \\in \\mathcal { Y } } \\int _ { h \\in \\mathbb { R } ^ { d } } \\big | p _ { h ^ { e } | Y ^ { e } } ( h | y ) - p _ { h ^ { e ^ { \\prime } } | Y ^ { e ^ { \\prime } } } ( h | y ) ) \\big | \\mathrm { d } h .\n$$",
828
+ "text_format": "latex",
829
+ "bbox": [
830
+ 232,
831
+ 484,
832
+ 733,
833
+ 525
834
+ ],
835
+ "page_idx": 5
836
+ },
837
+ {
838
+ "type": "text",
839
+ "text": "Step 2. According to the assumption (4), the dominant term in (7) is ",
840
+ "bbox": [
841
+ 173,
842
+ 536,
843
+ 622,
844
+ 551
845
+ ],
846
+ "page_idx": 5
847
+ },
848
+ {
849
+ "type": "equation",
850
+ "img_path": "images/8d84abc42db5ac0bce20ba33a361ed49a07b3c2d298320a7da3642158de97201.jpg",
851
+ "text": "$$\n\\int _ { | h | \\leq r _ { 1 } } \\Big | \\int _ { | t | \\leq r _ { 2 } } e ^ { - i \\langle h , t \\rangle } \\big ( \\hat { p } _ { h ^ { e } | Y ^ { e } } ( t | y ) - \\hat { p } _ { h ^ { e ^ { \\prime } } | Y ^ { e ^ { \\prime } } } ( t | y ) \\big ) \\big ) \\mathrm { d } t \\Big | \\mathrm { d } t ,\n$$",
852
+ "text_format": "latex",
853
+ "bbox": [
854
+ 281,
855
+ 555,
856
+ 681,
857
+ 592
858
+ ],
859
+ "page_idx": 5
860
+ },
861
+ {
862
+ "type": "text",
863
+ "text": "where $r _ { 1 }$ and $r _ { 2 }$ are well-selected scalars that depend on $s \\big ( \\mathcal { V } _ { \\rho } ^ { \\mathrm { s u p } } ( h , \\mathcal { E } _ { a v a i l } ) \\big )$ . By the Projection Theorem [31, 42] and the Fourier Inversion Formula, (8) is bounded above by ",
864
+ "bbox": [
865
+ 173,
866
+ 597,
867
+ 826,
868
+ 627
869
+ ],
870
+ "page_idx": 5
871
+ },
872
+ {
873
+ "type": "equation",
874
+ "img_path": "images/49950396e3d8096d0baf981fde2f0be38a8c185cda445644133fe0a23d73c6a7.jpg",
875
+ "text": "$$\nO ( r _ { 1 } ^ { d } r _ { 2 } ^ { d } ) \\times \\int _ { u \\in \\mathbb { R } } \\big | \\mathscr { R } _ { e ^ { \\prime } } ( \\beta , u ) - \\mathscr { R } _ { e } ( \\beta , u ) \\big | \\mathrm { d } u ,\n$$",
876
+ "text_format": "latex",
877
+ "bbox": [
878
+ 333,
879
+ 632,
880
+ 630,
881
+ 666
882
+ ],
883
+ "page_idx": 5
884
+ },
885
+ {
886
+ "type": "text",
887
+ "text": "where $\\mathcal { R } _ { e } ( \\beta , u )$ is the Radon transform of $p _ { h ^ { e } | Y ^ { e } } ( t | y )$ . ",
888
+ "bbox": [
889
+ 174,
890
+ 671,
891
+ 534,
892
+ 688
893
+ ],
894
+ "page_idx": 5
895
+ },
896
+ {
897
+ "type": "text",
898
+ "text": "Step 3. The right-hand side of Formula 8 can be bounded by $O \\big ( r _ { 1 } ^ { d } r _ { 2 } ^ { d } s \\big ( \\mathcal { V } _ { \\rho } ^ { \\mathrm { s u p } } ( h , \\mathcal { E } _ { a v a i l } ) \\big ) \\big )$ . We finish the proof by selecting appropriate $r _ { 1 }$ and $r _ { 2 }$ to balance the rate of the dominant term and other minor terms. For more details, please see Appendix 2 for the complete proofs. ",
899
+ "bbox": [
900
+ 173,
901
+ 694,
902
+ 825,
903
+ 737
904
+ ],
905
+ "page_idx": 5
906
+ },
907
+ {
908
+ "type": "text",
909
+ "text": "Now we turn to the lower bound of $\\operatorname { e r r } ( f )$ ",
910
+ "bbox": [
911
+ 174,
912
+ 742,
913
+ 452,
914
+ 757
915
+ ],
916
+ "page_idx": 5
917
+ },
918
+ {
919
+ "type": "text",
920
+ "text": "Theorem 4.3 (Lower Bound). Consider 0-1 loss: $\\ell ( \\hat { y } , y ) = \\mathbb { I } ( \\hat { y } \\neq y )$ . For any $\\delta > 0$ and any exps.t. $k x \\leq s ( x ) < + \\infty , x \\in [ 0 , t ]$ $\\begin{array} { r } { s _ { + } ^ { \\prime } ( 0 ) \\triangleq \\operatorname* { l i m } _ { x \\to 0 ^ { + } } \\frac { s ( x ) - s ( 0 ) } { x } \\in ( 1 , + \\infty ) } \\end{array}$ s(x)−s(0) ∈ (1, +∞); 2) exists k > 1, t > 0, $C _ { 0 }$ $O O D$ generaliz $( \\mathcal { E } _ { a v a i l } , \\mathcal { E } _ { a l l } )$ that is $( s ( \\cdot ) , \\delta )$ -learnable under linear feature space $\\Phi$ w.r.t symmetric $K L$ -divergence $\\rho$ , s.t. $\\forall \\varepsilon \\ \\in \\ [ 0 , \\frac { t } { 2 } ] .$ , the optimal classifier $f$ satisfying $\\mathcal { V } ^ { s u p } ( h , \\mathcal { E } _ { a v a i l } ) = \\varepsilon$ will have the OOD generalization error lower bounded by ",
921
+ "bbox": [
922
+ 173,
923
+ 761,
924
+ 825,
925
+ 848
926
+ ],
927
+ "page_idx": 5
928
+ },
929
+ {
930
+ "type": "equation",
931
+ "img_path": "images/b71427ee15ff225ca02625e3250ad817c12b27937efe9a03a49e7ec1eee529f3.jpg",
932
+ "text": "$$\n\\mathrm { e r r } ( f ) \\geq C _ { 0 } \\cdot s ( \\mathcal { V } ^ { s u p } ( h , \\mathcal { E } _ { a v a i l } ) ) .\n$$",
933
+ "text_format": "latex",
934
+ "bbox": [
935
+ 372,
936
+ 853,
937
+ 593,
938
+ 871
939
+ ],
940
+ "page_idx": 5
941
+ },
942
+ {
943
+ "type": "text",
944
+ "text": "Theorem 4.3 shows that $\\operatorname { e r r } ( f )$ of optimal classifier $f$ is lower bounded by its variation. Here “optimal” means the classifier that minimize $\\mathcal { L } ( f , \\mathcal { E } _ { a v a i l } )$ . Altogether, the above three theorems offer a bidirectional control of OOD generalization error, showing that our formulation can offer a fine-grained description of most OOD generalization problem in a theoretical way. To pursue a good OOD performance, OOD algorithm should focus on improving predictive performance on $\\mathcal { E } _ { a v a i l }$ and controlling the variation $\\mathcal { V } ^ { \\mathrm { s u p } } ( h , \\mathcal { E } _ { a v a i l } )$ simultaneously. Note that this bound starts from population error, and we call for future works to combine our generalization bound and traditional bound from data samples to population error, giving a more complete characterization of the problem. ",
945
+ "bbox": [
946
+ 171,
947
+ 882,
948
+ 823,
949
+ 912
950
+ ],
951
+ "page_idx": 5
952
+ },
953
+ {
954
+ "type": "text",
955
+ "text": "",
956
+ "bbox": [
957
+ 173,
958
+ 90,
959
+ 825,
960
+ 175
961
+ ],
962
+ "page_idx": 6
963
+ },
964
+ {
965
+ "type": "text",
966
+ "text": "5 Variation as a Factor of Model Selection Criterion ",
967
+ "text_level": 1,
968
+ "bbox": [
969
+ 173,
970
+ 194,
971
+ 622,
972
+ 212
973
+ ],
974
+ "page_idx": 6
975
+ },
976
+ {
977
+ "type": "text",
978
+ "text": "As is pointed out in [21], model selection has a significant effect on domain generalization, and any OOD algorithm without a model selection criterion is not complete. [21] trained more than 45,900 models with different algorithms, and results show that when traditional selection methods are applied, none of OOD algorithms can outperform ERM [58] by a significant margin. This result is not strange, since traditional selection methods focus mainly on (validation) accuracy, which is biased in OOD generalization [21, 63]. A very typical example is Colored MNIST [5], where the image is colored according to the label, but the relationship varies across domains. As explained in [5], ERM principle will only capture this spurious feature (color) and performs badly in ${ \\mathcal { E } } _ { a l l }$ . Since ERM is exactly minimizing loss in $\\mathcal { E } _ { a v a i l }$ , any model selection method using validation accuracy alone is likely to choose ERM rather than any other OOD algorithm [63]. Thus no algorithm will have a significant improvement compared to ERM. ",
979
+ "bbox": [
980
+ 173,
981
+ 227,
982
+ 825,
983
+ 380
984
+ ],
985
+ "page_idx": 6
986
+ },
987
+ {
988
+ "type": "text",
989
+ "text": "A natural question arises: what else can we use, in addition to accuracy? Theorem 4.1 points out that, learning feature with small variation across $\\mathcal { E } _ { a v a i l }$ is important for decreasing OOD generalization error. Once a model $f$ achieves a small $\\mathcal { V } ^ { \\mathrm { s u p } } ( h , \\mathcal { E } _ { a v a i l } )$ , then $\\operatorname { e r r } ( f )$ will be small. If the validation accuracy is also high, we shall know that the OOD accuracy will remain high. To this end, we propose our heuristic selection criterion (Algorithm 1). Instead of considering validation accuracy alone, we combine it with feature variation and select the model with high validation accuracy as well as low variation. ",
990
+ "bbox": [
991
+ 173,
992
+ 386,
993
+ 825,
994
+ 482
995
+ ],
996
+ "page_idx": 6
997
+ },
998
+ {
999
+ "type": "text",
1000
+ "text": "Algorithm 1: Model Selection ",
1001
+ "text_level": 1,
1002
+ "bbox": [
1003
+ 174,
1004
+ 501,
1005
+ 377,
1006
+ 515
1007
+ ],
1008
+ "page_idx": 6
1009
+ },
1010
+ {
1011
+ "type": "text",
1012
+ "text": "Input: available dataset $\\mathcal { X } _ { a v a i l } = ( \\mathcal { X } _ { t r a i n } , \\mathcal { X } _ { v a l } )$ , candidate models set $\\mathcal { M }$ , var_acc_rate $r _ { 0 }$ . \nfor $f = g \\circ h$ in $\\mathcal { M }$ do for $i$ in $[ d ]$ do $\\hat { \\mathcal { V } } _ { i } \\gets \\operatorname* { m a x } _ { y \\in \\mathcal { V } , \\mathcal { X } ^ { e } \\neq \\mathcal { X } ^ { e ^ { \\prime } } \\in \\mathcal { X } _ { a v a i l } }$ Total Variation $( \\mathbb { P } ( \\phi _ { i } ^ { e } | y ) , \\mathbb { P } ( \\phi _ { i } ^ { e ^ { \\prime } } | y ) )$ ; .Use GPU KDE end $\\mathcal { V } _ { f } \\gets \\mathrm { m e a n } _ { i \\in [ d ] } \\hat { \\mathcal { V } } _ { i }$ $\\operatorname { A c c } _ { f } $ compute validation accuracy of $f$ using $\\mathcal { X } _ { v a l }$ \nend \nRetur ${ \\mathfrak { n } } \\operatorname { a r g m a x } _ { f \\in { \\mathcal { M } } } ( \\operatorname { A c c } _ { f } - r _ { 0 } \\mathcal { V } _ { f } )$ ",
1013
+ "bbox": [
1014
+ 173,
1015
+ 517,
1016
+ 810,
1017
+ 657
1018
+ ],
1019
+ "page_idx": 6
1020
+ },
1021
+ {
1022
+ "type": "text",
1023
+ "text": "We briefly explain Algorithm 1 here. For each candidate model, we calculate its variation using the average of each feature’s variation, i.e., $\\begin{array} { r } { \\frac { 1 } { d } \\sum _ { i \\in [ d ] } \\mathcal { V } ( \\phi _ { i } , \\mathcal { X } _ { a v a i l } ) } \\end{array}$ . When deriving the bounds, we use $\\mathcal { V } ^ { \\mathrm { s u p } }$ instead of their average because we need to consider the worst case, i.e., the worst top model. In practice, we find out that the average of $\\mathcal { V } ( \\phi _ { i } , \\mathcal { X } _ { a v a i l } )$ is enough to improve selection. ",
1024
+ "bbox": [
1025
+ 174,
1026
+ 679,
1027
+ 825,
1028
+ 738
1029
+ ],
1030
+ "page_idx": 6
1031
+ },
1032
+ {
1033
+ "type": "text",
1034
+ "text": "Our criterion of model selection is ",
1035
+ "bbox": [
1036
+ 174,
1037
+ 744,
1038
+ 400,
1039
+ 758
1040
+ ],
1041
+ "page_idx": 6
1042
+ },
1043
+ {
1044
+ "type": "equation",
1045
+ "img_path": "images/f4a8d3348d12ad167259139dedde77e64f96549c3f99a91438c1b14e5a3f0957.jpg",
1046
+ "text": "$$\n\\operatorname { A c c } _ { f } { - r _ { 0 } \\gamma _ { f } } ,\n$$",
1047
+ "text_format": "latex",
1048
+ "bbox": [
1049
+ 434,
1050
+ 767,
1051
+ 531,
1052
+ 784
1053
+ ],
1054
+ "page_idx": 6
1055
+ },
1056
+ {
1057
+ "type": "text",
1058
+ "text": "i.e., we select a model with high validation accuracy and low variation simultaneously. Here $r _ { 0 }$ is a hyper-parameter representing the concrete relationship between $\\operatorname { e r r } ( f )$ and $\\mathcal { V } _ { f }$ . Although we have already used one hyper-parameter to help select multiple hyper-parameter combinations, it is natural to ask whether we can further get rid of the selection of $r _ { 0 }$ . Since $r _ { 0 }$ represents the relationship between variation and accuracy, which is actually determined by the unknown expansion function, explicitly calculating $r _ { 0 }$ is not possible. However, we can empirically estimate $r _ { 0 }$ using $\\begin{array} { r } { r _ { 0 } = \\frac { \\mathrm { S t d } _ { f \\in \\hat { \\mathcal { M } } } \\mathrm { A c c } _ { f } } { \\mathrm { S t d } _ { f \\in \\hat { \\mathcal { M } } } \\mathcal { V } _ { f } } } \\end{array}$ where $\\hat { \\mathcal { M } } \\subset \\mathcal { M }$ is the model with not bad validation accuracy. We do not use the whole set $\\mathcal { M }$ because some OOD algorithms will perform extremely bad when the penalty is huge, and these models will influence our estimation of the ratio. Since high validation means large informativeness in learned features, the use of $\\hat { \\mathcal { M } }$ is an implicit application of informative assumption. ",
1059
+ "bbox": [
1060
+ 173,
1061
+ 791,
1062
+ 825,
1063
+ 912
1064
+ ],
1065
+ "page_idx": 6
1066
+ },
1067
+ {
1068
+ "type": "text",
1069
+ "text": "",
1070
+ "bbox": [
1071
+ 171,
1072
+ 90,
1073
+ 825,
1074
+ 122
1075
+ ],
1076
+ "page_idx": 7
1077
+ },
1078
+ {
1079
+ "type": "text",
1080
+ "text": "As shown in Section 6.1, our method can select models with higher OOD accuracy in various OOD datasets. We also explain in Appendix 3 why our method can outperform the traditional method in Color MNIST, where the dataset is hand-make and simple enough to calculate the expansion function. ",
1081
+ "bbox": [
1082
+ 174,
1083
+ 127,
1084
+ 825,
1085
+ 170
1086
+ ],
1087
+ "page_idx": 7
1088
+ },
1089
+ {
1090
+ "type": "text",
1091
+ "text": "6 Experiments ",
1092
+ "text_level": 1,
1093
+ "bbox": [
1094
+ 174,
1095
+ 188,
1096
+ 312,
1097
+ 205
1098
+ ],
1099
+ "page_idx": 7
1100
+ },
1101
+ {
1102
+ "type": "text",
1103
+ "text": "In this section, we conduct experiments to compare our model selection criterion (Section 5) with the baseline method5 [21]. Since both the variation and informativeness in Definition 3.1 are based on one-dimensional features, we can directly estimate these quantities feature-by-feature and design model selection method based on them. To verify the existence of the expansion function and to see what it’s like in a real-world dataset, we plot nearly 2 million features trained in a common-used OOD dataset and compute their variation and informativeness. We then draw the expansion function for this problem. ",
1104
+ "bbox": [
1105
+ 174,
1106
+ 218,
1107
+ 825,
1108
+ 315
1109
+ ],
1110
+ "page_idx": 7
1111
+ },
1112
+ {
1113
+ "type": "text",
1114
+ "text": "6.1 Experiments on Model Selection ",
1115
+ "text_level": 1,
1116
+ "bbox": [
1117
+ 174,
1118
+ 330,
1119
+ 437,
1120
+ 345
1121
+ ],
1122
+ "page_idx": 7
1123
+ },
1124
+ {
1125
+ "type": "text",
1126
+ "text": "In this section, we conduct experiments to compare the performance of models selected by our method and by validation accuracy. We train models on different datasets, different $\\mathcal { E } _ { a v a i l }$ , and select models according to a different selection criteria. We then compare the OOD accuracy of selected models. ",
1127
+ "bbox": [
1128
+ 174,
1129
+ 356,
1130
+ 825,
1131
+ 411
1132
+ ],
1133
+ "page_idx": 7
1134
+ },
1135
+ {
1136
+ "type": "text",
1137
+ "text": "Settings We train our model on three benchmark OOD datasets (PACS [34], OfficeHome [59], VLCS [57]) and consider all possible selections of $( \\mathcal { E } _ { a v a i l } , \\mathcal { E } _ { a l l } )$ . We choose ResNet–50 as our network architecture. We use ERM [58] and four common-used OOD algorithms (CORAL [55], Inter-domain Mixup [62], Group DRO [51], and IRM [5]). For each environment setup, we train 200 models using different algorithms, penalties, learning rates, and epoch. After training, we employ different selection methods and compare the OOD accuracy of the selected models. As stated in Section 5, we use the standard deviation of $\\nu$ and validation accuracy in $\\hat { \\mathcal { M } }$ to estimate $r _ { 0 }$ , where ${ \\hat { \\mathcal { M } } } = \\{ f \\in { \\mathcal { M } } : \\operatorname { A c c } _ { f } \\geq \\operatorname* { m a x } _ { \\hat { f } } \\operatorname { A c c } _ { \\hat { f } } - 0 . 1 \\}$ . Note that calculating $\\mathcal { V } ( \\phi _ { i } , \\mathcal { X } _ { a v a i l } )$ takes calculus many times, so we design a parallel GPU kernel density estimation to speed up the whole process a hundred times and manage to finish one model in seconds. For more details about the experiments, see Appendix 4. ",
1138
+ "bbox": [
1139
+ 173,
1140
+ 425,
1141
+ 826,
1142
+ 584
1143
+ ],
1144
+ "page_idx": 7
1145
+ },
1146
+ {
1147
+ "type": "table",
1148
+ "img_path": "images/cb2470f47e4fb512f2684a9e17c4e49890f16f65e01308e130f28a69279cde8a.jpg",
1149
+ "table_caption": [
1150
+ "Table 1: Model Selection Result. “Env” denotes the unseen domain during training. “Val” denotes the OOD accuracy of model selected by validation accuracy. "
1151
+ ],
1152
+ "table_footnote": [],
1153
+ "table_body": "<table><tr><td rowspan=\"3\">PACS</td><td>Env</td><td>A</td><td>C</td><td>P</td><td>S</td><td>avg</td><td>acc inc</td></tr><tr><td>Val</td><td>85.20%</td><td>80.42%</td><td>96.17%</td><td>77.86%</td><td>84.91%</td><td>1</td></tr><tr><td>Ours</td><td>88.72%</td><td>81.74%</td><td>96.83%</td><td>79.00%</td><td>86.57%</td><td>1.66%↑</td></tr><tr><td rowspan=\"3\">OfficeHome</td><td>Env</td><td>A</td><td>C</td><td>P</td><td>R</td><td>avg</td><td>acc inc</td></tr><tr><td>Val</td><td>61.85%</td><td>55.56%</td><td>74.72%</td><td>76.25%</td><td>67.09%</td><td>-</td></tr><tr><td>Ours</td><td>65.76%</td><td>55.07%</td><td>75.20%</td><td>76.31%</td><td>68.09%</td><td>1.00%↑</td></tr><tr><td rowspan=\"3\">VLCS</td><td>Env</td><td>C</td><td>L</td><td>S</td><td>V</td><td>avg</td><td>acc inc</td></tr><tr><td>Val</td><td>97.46%</td><td>64.83%</td><td>69.50%6</td><td>70.97%</td><td>75.69%</td><td>1</td></tr><tr><td>Ours</td><td>97.81%</td><td>66.98%</td><td>69.50%</td><td>70.97%</td><td>76.32%</td><td>0.63%↑</td></tr></table>",
1154
+ "bbox": [
1155
+ 200,
1156
+ 643,
1157
+ 797,
1158
+ 775
1159
+ ],
1160
+ "page_idx": 7
1161
+ },
1162
+ {
1163
+ "type": "text",
1164
+ "text": "Result We summarize our experimental results in Table 1. For each environment setup, we select the best model according to Algorithm 1 and validation accuracy. The results show that on all datasets, our selection criterion significantly outperforms the validation accuracy in average OOD accuracy. For a more detailed comparison, our method improves the OOD accuracy in most of the 12 setups. Our experiments demonstrate that our criterion can help select models with higher OOD accuracy. ",
1165
+ "bbox": [
1166
+ 173,
1167
+ 792,
1168
+ 826,
1169
+ 863
1170
+ ],
1171
+ "page_idx": 7
1172
+ },
1173
+ {
1174
+ "type": "image",
1175
+ "img_path": "images/c514b7d4698237506faccba2638407d1bd68cc2a61ac79a424f03d7abc31b464.jpg",
1176
+ "image_caption": [
1177
+ "Figure 1: The expansion function of the OOD generalization problem on Office-Home. The $\\mathbf { X } ^ { } -$ -axis stands for $\\mathcal { V } ( \\phi , \\mathcal { E } _ { a v a i l } )$ and the y-axis for $\\mathcal { V } ( \\phi , \\mathcal { E } _ { a l l } )$ . There are approximately 2 million points in each image, with each point representing a feature, and its color represents its informativeness. The solid red line stands for the expansion function under the corresponding $\\delta$ . When $\\delta$ increases, the expansion function decreases. When $\\delta = 0$ , no expansion function can make it learnable. "
1178
+ ],
1179
+ "image_footnote": [],
1180
+ "bbox": [
1181
+ 191,
1182
+ 121,
1183
+ 810,
1184
+ 234
1185
+ ],
1186
+ "page_idx": 8
1187
+ },
1188
+ {
1189
+ "type": "text",
1190
+ "text": "One may wonder if the expansion function really exists and what it will look like for a real-world OOD generalization task. In this section, we consider the OOD dataset Office-Home [59]. We explicitly plot millions of features’ $\\mathcal { V } _ { \\rho } \\big ( \\phi , \\mathcal { E } _ { a v a i l } \\big )$ and $\\mathcal { V } _ { \\rho } \\big ( \\phi , \\mathcal { E } _ { a l l } \\big )$ with Total Variation $\\rho$ to see what the expansion function is like in this task. We take the architecture as ResNet-50 [23], and we trained thousands of models with more than five algorithms, obtaining about 2 million features. The results are in Figure 1. ",
1191
+ "bbox": [
1192
+ 174,
1193
+ 327,
1194
+ 825,
1195
+ 411
1196
+ ],
1197
+ "page_idx": 8
1198
+ },
1199
+ {
1200
+ "type": "text",
1201
+ "text": "Existence of $s ( \\cdot )$ . When $\\delta = 0$ , some non-informative features are nearly 0-invariant across $\\mathcal { E } _ { a v a i l }$ but are varying across ${ \\mathcal { E } } _ { a l l }$ , so no expansion function can make this task learnable, i.e., this task is NOT $( s ( \\cdot ) , 0 )$ for any expansion function. But as $\\delta$ increases, only informative features are left, and now we can find appropriate $s ( \\cdot )$ to make it learnable. We can clearly realize from the figure that $s ( \\cdot )$ do exist when $\\delta \\geq 0 . 1 5$ . ",
1202
+ "bbox": [
1203
+ 174,
1204
+ 424,
1205
+ 825,
1206
+ 494
1207
+ ],
1208
+ "page_idx": 8
1209
+ },
1210
+ {
1211
+ "type": "text",
1212
+ "text": "Trade-off between $s ( \\cdot )$ and $\\delta$ . The second phenomenon is that the slope of $s ( \\cdot )$ decreases as $\\delta$ increases, showing a trade-off between $s ( \\cdot )$ and $\\delta$ . Although this trade-off comes naturally from the definition of learnability, it has a deep meaning. As is shown in Section 4, $\\operatorname { e r r } ( f )$ is bounded by $O ( s ( \\varepsilon ) )$ where $\\varepsilon$ is the variation of the model. To make the bound tighter, a natural idea is to choose a flatter $s ( \\cdot )$ . However, a flatter $s ( \\cdot )$ corresponds to a larger $\\delta$ . Typically, learning a model to meet this higher informativeness requirement is more difficult, and it is possible that the algorithm achieves this by capturing more domain-specific features, which will therefore increase the variation of the model, $\\varepsilon$ . As a result, we are not sure whether $s ( \\varepsilon )$ will increase or decrease. We believe this is also the essence of model selection: i.e., to trade-off between the variation and informativeness of a model, which is done in Formula 11. ",
1213
+ "bbox": [
1214
+ 173,
1215
+ 508,
1216
+ 825,
1217
+ 647
1218
+ ],
1219
+ "page_idx": 8
1220
+ },
1221
+ {
1222
+ "type": "text",
1223
+ "text": "7 More Related Works ",
1224
+ "text_level": 1,
1225
+ "bbox": [
1226
+ 174,
1227
+ 665,
1228
+ 379,
1229
+ 683
1230
+ ],
1231
+ "page_idx": 8
1232
+ },
1233
+ {
1234
+ "type": "text",
1235
+ "text": "Domain generalization [12, 39], or OOD generalization, has drawn much attention recently [21, 30]. The goal is to learn a model from several training domains and expect good performance on unseen test domains. [60, 64] offer a comprehensive survey. A popular solution is to extract domain-invariant feature representation. [45] and [49] proved that when the model is linear, the invariance under training domains can help discover invariant features on test domains. [5] introduces the invariant prediction into neural networks and proposes a practical objective function. After that, a lot of works arise from the view of causal discovery, distributional robustness and conditional independence [1, 7, 16, 15, 26, 32, 33, 43, 51, 61]. On the other hand, some works point out the weakness of existing methods from the theoretical and experimental perspectives [2, 21, 29, 41, 50]. ",
1236
+ "bbox": [
1237
+ 173,
1238
+ 696,
1239
+ 825,
1240
+ 821
1241
+ ],
1242
+ "page_idx": 8
1243
+ },
1244
+ {
1245
+ "type": "text",
1246
+ "text": "The OOD generalization requires restrictions on how the target domains may differ. A straightforward approach is to define a set of test domains around the training domain using some distribution distance measure [6, 13, 19, 25, 51, 53, 54, 61]. Another feasible route is the causal framework which is robust to the test distributions caused by interventions[44, 46] on variables, e.g., [5, 24, 36, 37, 40, 47, 49, 52]. The principle of these methods is that a causal model is invariant and can achieve the minimal worstcase risk [4, 22, 44, 49]. Since the test distribution is unknown, additional assumptions are required for generalization analysis. [12, 18, 39] assume that the domains are generated from a hyper-distribution and measures the average risk estimation error bound. [3] derives a risk bound for any linear combination of training domains. For more related results in domain adaptation, a closed field where the test domains can be seen but are unlabeled, please see [9, 10, 28]. ",
1247
+ "bbox": [
1248
+ 174,
1249
+ 828,
1250
+ 825,
1251
+ 911
1252
+ ],
1253
+ "page_idx": 8
1254
+ },
1255
+ {
1256
+ "type": "text",
1257
+ "text": "",
1258
+ "bbox": [
1259
+ 174,
1260
+ 92,
1261
+ 825,
1262
+ 147
1263
+ ],
1264
+ "page_idx": 9
1265
+ },
1266
+ {
1267
+ "type": "text",
1268
+ "text": "8 Conclusion ",
1269
+ "text_level": 1,
1270
+ "bbox": [
1271
+ 174,
1272
+ 166,
1273
+ 299,
1274
+ 184
1275
+ ],
1276
+ "page_idx": 9
1277
+ },
1278
+ {
1279
+ "type": "text",
1280
+ "text": "In this paper, we take the first step towards a rigorous theoretical framework of OOD generalization. We propose a mathematical formulation to characterize the learnability of OOD generalization problem. Based on our framework, we prove generalization bounds and give guarantees for OOD generalization error. Inspired by our bound, we design a model selection criterion to check the model’s variation and validation accuracy simultaneously. Experiments show that our metric has a significant advantage over the traditional selection method. ",
1281
+ "bbox": [
1282
+ 174,
1283
+ 198,
1284
+ 825,
1285
+ 280
1286
+ ],
1287
+ "page_idx": 9
1288
+ },
1289
+ {
1290
+ "type": "text",
1291
+ "text": "Acknowledgments and Disclosure of Funding ",
1292
+ "text_level": 1,
1293
+ "bbox": [
1294
+ 174,
1295
+ 299,
1296
+ 553,
1297
+ 318
1298
+ ],
1299
+ "page_idx": 9
1300
+ },
1301
+ {
1302
+ "type": "text",
1303
+ "text": "Authors are thankful to the anonymous reviewers for their helpful and constructive feedback. ",
1304
+ "bbox": [
1305
+ 171,
1306
+ 332,
1307
+ 779,
1308
+ 347
1309
+ ],
1310
+ "page_idx": 9
1311
+ },
1312
+ {
1313
+ "type": "text",
1314
+ "text": "References ",
1315
+ "text_level": 1,
1316
+ "bbox": [
1317
+ 174,
1318
+ 364,
1319
+ 266,
1320
+ 381
1321
+ ],
1322
+ "page_idx": 9
1323
+ },
1324
+ {
1325
+ "type": "text",
1326
+ "text": "[1] Kartik Ahuja, Karthikeyan Shanmugam, Kush Varshney, and Amit Dhurandhar. Invariant risk minimization games. arXiv preprint arXiv:2002.04692, 2020. \n[2] Kartik Ahuja, Jun Wang, Amit Dhurandhar, Karthikeyan Shanmugam, and Kush R Varshney. Empirical or invariant risk minimization? a sample complexity perspective. arXiv preprint arXiv:2010.16412, 2020. \n[3] Isabela Albuquerque, João Monteiro, Tiago H Falk, and Ioannis Mitliagkas. Adversarial target-invariant representation learning for domain generalization. arXiv preprint arXiv:1911.00804, 2019. \n[4] John Aldrich. Autonomy. Oxford Economic Papers, 41(1):15–34, 1989. \n[5] Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. arXiv preprint arXiv:1907.02893, 2019. \n[6] J Andrew Bagnell. Robust supervised learning. In Proceedings of the national conference on artificial intelligence, volume 20, page 714. Menlo Park, CA; Cambridge, MA; London; AAAI Press; MIT Press; 1999, 2005. \n[7] Haoyue Bai, Rui Sun, Lanqing Hong, Fengwei Zhou, Nanyang Ye, Han-Jia Ye, S-H Gary Chan, and Zhenguo Li. Decaug: Out-of-distribution generalization via decomposed feature representation and semantic augmentation. arXiv preprint arXiv:2012.09382, 2020. \n[8] Sara Beery, Grant Van Horn, and Pietro Perona. Recognition in terra incognita. In Proceedings of the European Conference on Computer Vision (ECCV), September 2018. \n[9] Shai Ben-David, John Blitzer, Koby Crammer, Fernando Pereira, et al. Analysis of representations for domain adaptation. Advances in neural information processing systems, 19:137, 2007. \n[10] Shai Ben-David, John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Wortman Vaughan. A theory of learning from different domains. Machine learning, 79(1):151–175, 2010. \n[11] Yoshua Bengio, Tristan Deleu, Nasim Rahaman, Nan Rosemary Ke, Sebastien Lachapelle, Olexa Bilaniuk, Anirudh Goyal, and Christopher Pal. A meta-transfer objective for learning to disentangle causal mechanisms. In International Conference on Learning Representations, 2019. \n[12] Gilles Blanchard, Gyemin Lee, and Clayton Scott. Generalizing from several related classification tasks to a new unlabeled sample. Advances in neural information processing systems, 24:2178–2186, 2011. \n[13] Jose Blanchet, Yang Kang, Karthyek Murthy, and Fan Zhang. Data-driven optimal transport cost selection for distributionally robust optimization. In 2019 Winter Simulation Conference (WSC), pages 3740–3751. IEEE, 2019. \n[14] Laurent Cavalier. Efficient estimation of a density in a problem of tomography. Annals of Statistics, pages 630–647, 2000. \n[15] Shiyu Chang, Yang Zhang, Mo Yu, and Tommi Jaakkola. Invariant rationalization. In International Conference on Machine Learning, pages 1448–1458. PMLR, 2020. \n[16] Elliot Creager, Joern-Henrik Jacobsen, and Richard Zemel. Exchanging lessons between algorithmic fairness and domain generalization, 2021. URL https://openreview.net/forum?id=DC1Im3MkGG. \n[17] Alex J DeGrave, Joseph D Janizek, and Su-In Lee. Ai for radiographic covid-19 detection selects shortcuts over signal. medRxiv, 2020. \n[18] Aniket Anand Deshmukh, Yunwen Lei, Srinagesh Sharma, Urun Dogan, James W Cutler, and Clayton Scott. A generalization error bound for multi-class domain generalization. arXiv preprint arXiv:1905.10392, 2019. \n[19] Peyman Mohajerin Esfahani and Daniel Kuhn. Data-driven distributionally robust optimization using the wasserstein metric: Performance guarantees and tractable reformulations. Mathematical Programming, 171(1-2):115–166, 2018. \n[20] Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The journal of machine learning research, 17(1):2096–2030, 2016. \n[21] Ishaan Gulrajani and David Lopez-Paz. In search of lost domain generalization. arXiv preprint arXiv:2007.01434, 2020. \n[22] Trygve Haavelmo. The probability approach in econometrics. Econometrica: Journal of the Econometric Society, pages iii–115, 1944. \n[23] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016. \n[24] Christina Heinze-Deml and Nicolai Meinshausen. Conditional variance penalties and domain shift robustness. Machine Learning, 110(2):303–348, 2021. \n[25] Zhaolin Hu and L Jeff Hong. Kullback-leibler divergence constrained distributionally robust optimization. Available at Optimization Online, 2013. \n[26] Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Domain extrapolation via regret minimization. arXiv preprint arXiv:2006.03908, 2020. \n[27] Wengong Jin, Regina Barzilay, and Tommi S. Jaakkola. Enforcing predictive invariance across structured biomedical domains, 2021. URL https://openreview.net/forum?id $=$ JywMsiz_NtO. \n[28] Fredrik D Johansson, David Sontag, and Rajesh Ranganath. Support and invertibility in domain-invariant representations. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 527–536. PMLR, 2019. \n[29] Pritish Kamath, Akilesh Tangella, Danica J Sutherland, and Nathan Srebro. Does invariant risk minimization capture invariance? arXiv preprint arXiv:2101.01134, 2021. \n[30] Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Sara Beery, et al. Wilds: A benchmark of in-the-wild distribution shifts. arXiv preprint arXiv:2012.07421, 2020. \n[31] Aleksandr Petrovich Korostelev and Alexandre B Tsybakov. Minimax theory of image reconstruction, volume 82. Springer Science & Business Media, 2012. \n[32] Masanori Koyama and Shoichiro Yamaguchi. Out-of-distribution generalization with maximal invariant predictor. arXiv preprint arXiv:2008.01883, 2020. \n[33] David Krueger, Ethan Caballero, Joern-Henrik Jacobsen, Amy Zhang, Jonathan Binas, Remi Le Priol, and Aaron Courville. Out-of-distribution generalization via risk extrapolation (rex). arXiv preprint arXiv:2003.00688, 2020. \n[34] Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Deeper, broader and artier domain generalization. In Proceedings of the IEEE international conference on computer vision, pages 5542–5550, 2017. \n[35] Haoliang Li, Sinno Jialin Pan, Shiqi Wang, and Alex C Kot. Domain generalization with adversarial feature learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5400–5409, 2018. \n[36] Sara Magliacane, Thijs van Ommen, Tom Claassen, Stephan Bongers, Philip Versteeg, and Joris M Mooij. Domain adaptation by using causal inference to predict invariant conditional distributions. arXiv preprint arXiv:1707.06422, 2017. \n[37] Nicolai Meinshausen. Causality from a distributional robustness point of view. In 2018 IEEE Data Science Workshop (DSW), pages 6–10. IEEE, 2018. \n[38] Jose G Moreno-Torres, Troy Raeder, Rocío Alaiz-Rodríguez, Nitesh V Chawla, and Francisco Herrera. A unifying view on dataset shift in classification. Pattern recognition, 45(1):521–530, 2012. \n[39] Krikamol Muandet, David Balduzzi, and Bernhard Schölkopf. Domain generalization via invariant feature representation. In International Conference on Machine Learning, pages 10–18, 2013. \n[40] Jens Müller, Robert Schmier, Lynton Ardizzone, Carsten Rother, and Ullrich Köthe. Learning robust models using the principle of independent causal mechanisms. arXiv preprint arXiv:2010.07167, 2020. \n[41] Vaishnavh Nagarajan, Anders Andreassen, and Behnam Neyshabur. Understanding the failure modes of out-of-distribution generalization. arXiv preprint arXiv:2010.15775, 2020. \n[42] Frank Natterer. The mathematics of computerized tomography. SIAM, 2001. \n[43] Giambattista Parascandolo, Alexander Neitz, Antonio Orvieto, Luigi Gresele, and Bernhard Schölkopf. Learning explanations that are hard to vary. arXiv preprint arXiv:2009.00329, 2020. \n[44] Judea Pearl. Causality. Cambridge university press, 2009. \n[45] Jonas Peters, Peter Bühlmann, and Nicolai Meinshausen. Causal inference by using invariant prediction: identification and confidence intervals. Journal of the Royal Statistical Society. Series B (Statistical Methodology), pages 947–1012, 2016. \n[46] Jonas Peters, Dominik Janzing, and Bernhard Schölkopf. Elements of causal inference: foundations and learning algorithms. The MIT Press, 2017. \n[47] Niklas Pfister, Evan G Williams, Jonas Peters, Ruedi Aebersold, and Peter Bühlmann. Stabilizing variable selection and regression. arXiv preprint arXiv:1911.01850, 2019. \n[48] Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do imagenet classifiers generalize to imagenet? In International Conference on Machine Learning, pages 5389–5400. PMLR, 2019. \n[49] Mateo Rojas-Carulla, Bernhard Schölkopf, Richard Turner, and Jonas Peters. Invariant models for causal transfer learning. The Journal of Machine Learning Research, 19(1):1309–1342, 2018. \n[50] Elan Rosenfeld, Pradeep Ravikumar, and Andrej Risteski. The risks of invariant risk minimization. arXiv preprint arXiv:2010.05761, 2020. \n[51] Shiori Sagawa, Pang Wei Koh, Tatsunori B Hashimoto, and Percy Liang. Distributionally robust neural networks. In International Conference on Learning Representations, 2019. \n[52] Bernhard Schölkopf, Dominik Janzing, Jonas Peters, Eleni Sgouritsa, Kun Zhang, and Joris Mooij. On causal and anticausal learning. arXiv preprint arXiv:1206.6471, 2012. \n[53] Soroosh Shafieezadeh Abadeh, Peyman M Mohajerin Esfahani, and Daniel Kuhn. Distributionally robust logistic regression. Advances in Neural Information Processing Systems, 28:1576–1584, 2015. \n[54] Aman Sinha, Hongseok Namkoong, and John Duchi. Certifying some distributional robustness with principled adversarial training. In International Conference on Learning Representations, 2018. \n[55] Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. In European conference on computer vision, pages 443–450. Springer, 2016. \n[56] Rohan Taori, Achal Dave, Vaishaal Shankar, Nicholas Carlini, Benjamin Recht, and Ludwig Schmidt. Measuring robustness to natural distribution shifts in image classification. Advances in Neural Information Processing Systems, 33, 2020. \n[57] Antonio Torralba and Alexei A Efros. Unbiased look at dataset bias. In CVPR 2011, pages 1521–1528. IEEE, 2011. \n[58] Vladimir Vapnik. Principles of risk minimization for learning theory. In Advances in neural information processing systems, pages 831–838, 1992. \n[59] Hemanth Venkateswara, Jose Eusebio, Shayok Chakraborty, and Sethuraman Panchanathan. Deep hashing network for unsupervised domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5018–5027, 2017. \n[60] Jindong Wang, Cuiling Lan, Chang Liu, Yidong Ouyang, Wenjun Zeng, and Tao Qin. Generalizing to unseen domains: A survey on domain generalization. arXiv preprint arXiv:2103.03097, 2021. \n[61] Chuanlong Xie, Fei Chen, Yue Liu, and Zhenguo Li. Risk variance penalization. arXiv preprint arXiv:2006.07544, 2020. \n[62] Shen Yan, Huan Song, Nanxiang Li, Lincan Zou, and Liu Ren. Improve unsupervised domain adaptation with mixup training. arXiv preprint arXiv:2001.00677, 2020. \n[63] Haotian Ye, Chuanlong Xie, Yue Liu, and Zhenguo Li. Out-of-distribution generalization analysis via influence function. arXiv preprint arXiv:2101.08521, 2021. \n[64] Kaiyang Zhou, Ziwei Liu, Yu Qiao, Tao Xiang, and Chen Change Loy. Domain generalization: A survey. arXiv preprint arXiv:2103.02503, 2021. ",
1327
+ "bbox": [
1328
+ 174,
1329
+ 380,
1330
+ 826,
1331
+ 912
1332
+ ],
1333
+ "page_idx": 9
1334
+ },
1335
+ {
1336
+ "type": "text",
1337
+ "text": "",
1338
+ "bbox": [
1339
+ 171,
1340
+ 50,
1341
+ 828,
1342
+ 920
1343
+ ],
1344
+ "page_idx": 10
1345
+ },
1346
+ {
1347
+ "type": "text",
1348
+ "text": "",
1349
+ "bbox": [
1350
+ 171,
1351
+ 61,
1352
+ 828,
1353
+ 922
1354
+ ],
1355
+ "page_idx": 11
1356
+ },
1357
+ {
1358
+ "type": "text",
1359
+ "text": "",
1360
+ "bbox": [
1361
+ 171,
1362
+ 92,
1363
+ 828,
1364
+ 308
1365
+ ],
1366
+ "page_idx": 12
1367
+ },
1368
+ {
1369
+ "type": "text",
1370
+ "text": "Checklist ",
1371
+ "text_level": 1,
1372
+ "bbox": [
1373
+ 173,
1374
+ 332,
1375
+ 254,
1376
+ 348
1377
+ ],
1378
+ "page_idx": 12
1379
+ },
1380
+ {
1381
+ "type": "text",
1382
+ "text": "1. For all authors... ",
1383
+ "bbox": [
1384
+ 169,
1385
+ 359,
1386
+ 295,
1387
+ 373
1388
+ ],
1389
+ "page_idx": 12
1390
+ },
1391
+ {
1392
+ "type": "text",
1393
+ "text": "(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] \n(b) Did you describe the limitations of your work? [Yes] See Section 5. \n(c) Did you discuss any potential negative societal impacts of your work? [N/A] \n(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] ",
1394
+ "bbox": [
1395
+ 174,
1396
+ 377,
1397
+ 825,
1398
+ 455
1399
+ ],
1400
+ "page_idx": 12
1401
+ },
1402
+ {
1403
+ "type": "text",
1404
+ "text": "2. If you are including theoretical results... ",
1405
+ "bbox": [
1406
+ 168,
1407
+ 459,
1408
+ 449,
1409
+ 473
1410
+ ],
1411
+ "page_idx": 12
1412
+ },
1413
+ {
1414
+ "type": "text",
1415
+ "text": "(a) Did you state the full set of assumptions of all theoretical results? [Yes] (b) Did you include complete proofs of all theoretical results? [Yes] ",
1416
+ "bbox": [
1417
+ 174,
1418
+ 478,
1419
+ 669,
1420
+ 508
1421
+ ],
1422
+ "page_idx": 12
1423
+ },
1424
+ {
1425
+ "type": "text",
1426
+ "text": "3. If you ran experiments... ",
1427
+ "bbox": [
1428
+ 168,
1429
+ 513,
1430
+ 348,
1431
+ 527
1432
+ ],
1433
+ "page_idx": 12
1434
+ },
1435
+ {
1436
+ "type": "text",
1437
+ "text": "(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] \n(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] In the appendix. \n(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A] \n(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] ",
1438
+ "bbox": [
1439
+ 174,
1440
+ 531,
1441
+ 826,
1442
+ 650
1443
+ ],
1444
+ "page_idx": 12
1445
+ },
1446
+ {
1447
+ "type": "text",
1448
+ "text": "4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... ",
1449
+ "bbox": [
1450
+ 166,
1451
+ 655,
1452
+ 782,
1453
+ 669
1454
+ ],
1455
+ "page_idx": 12
1456
+ },
1457
+ {
1458
+ "type": "text",
1459
+ "text": "(a) If your work uses existing assets, did you cite the creators? [Yes] We use [21] and we cite it in Section 6. \n(b) Did you mention the license of the assets? [N/A] \n(c) Did you include any new assets either in the supplemental material or as a URL? [No] \n(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes] \n(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] ",
1460
+ "bbox": [
1461
+ 173,
1462
+ 672,
1463
+ 826,
1464
+ 794
1465
+ ],
1466
+ "page_idx": 12
1467
+ },
1468
+ {
1469
+ "type": "text",
1470
+ "text": "5. If you used crowdsourcing or conducted research with human subjects... ",
1471
+ "bbox": [
1472
+ 169,
1473
+ 797,
1474
+ 661,
1475
+ 813
1476
+ ],
1477
+ "page_idx": 12
1478
+ },
1479
+ {
1480
+ "type": "text",
1481
+ "text": "(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] \n(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] \n(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] ",
1482
+ "bbox": [
1483
+ 173,
1484
+ 816,
1485
+ 826,
1486
+ 906
1487
+ ],
1488
+ "page_idx": 12
1489
+ }
1490
+ ]
parse/train/0WASBV4xkhy/0WASBV4xkhy_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/BJOFETxR-/BJOFETxR-.md ADDED
@@ -0,0 +1,320 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LEARNING TO REPRESENT PROGRAMS WITH GRAPHS
2
+
3
+ Miltiadis Allamanis
4
+ Microsoft Research
5
+ Cambridge, UK
6
+ miallama@microsoft.com
7
+ Marc Brockschmidt
8
+ Microsoft Research
9
+ Cambridge, UK
10
+ mabrocks@microsoft.com
11
+
12
+ Mahmoud Khademi∗ Simon Fraser University Burnaby, BC, Canada mkhademi@sfu.ca
13
+
14
+ # ABSTRACT
15
+
16
+ Learning tasks on source code (i.e., formal languages) have been considered recently, but most work has tried to transfer natural language methods and does not capitalize on the unique opportunities offered by code’s known sematics. For example, long-range dependencies induced by using the same variable or function in distant locations are often not considered. We propose to use graphs to represent both the syntactic and semantic structure of code and use graph-based deep learning methods to learn to reason over program structures.
17
+
18
+ In this work, we present how to construct graphs from source code and how to scale Gated Graph Neural Networks training to such large graphs. We evaluate our method on two tasks: VARNAMING, in which a network attempts to predict the name of a variable given its usage, and VARMISUSE, in which the network learns to reason about selecting the correct variable that should be used at a given program location. Our comparison to methods that use less structured program representations shows the advantages of modeling known structure, and suggests that our models learn to infer meaningful names and to solve the VARMISUSE task in many cases. Additionally, our testing showed that VARMISUSE identifies a number of bugs in mature open-source projects.
19
+
20
+ # 1 INTRODUCTION
21
+
22
+ The advent of large repositories of source code as well as scalable machine learning methods naturally leads to the idea of “big code”, i.e., largely unsupervised methods that support software engineers by generalizing from existing source code (Allamanis et al., 2017). Currently, existing deep learning models of source code capture its shallow, textual structure, e.g. as a sequence of tokens (Hindle et al., 2012; Raychev et al., 2014; Allamanis et al., 2016), as parse trees (Maddison & Tarlow, 2014; Bielik et al., 2016), or as a flat dependency networks of variables (Raychev et al., 2015). Such models miss out on the opportunity to capitalize on the rich and well-defined semantics of source code. In this work, we take a step to alleviate this by including two additional signal sources in source code: data flow and type hierarchies. We do this by encoding programs as graphs, in which edges represent syntactic relationships (e.g. “token before/after”) as well as semantic relationships (“variable last used/written here”, “formal parameter for argument is called stream”, etc.). Our key insight is that exposing these semantics explicitly as structured input to a machine learning model lessens the requirements on amounts of training data, model capacity and training regime and allows us to solve tasks that are beyond the current state of the art.
23
+
24
+ We explore two tasks to illustrate the advantages of exposing more semantic structure of programs. First, we consider the VARNAMING task (Allamanis et al., 2014; Raychev et al., 2015), in which given some source code, the “correct” variable name is inferred as a sequence of subtokens. This requires some understanding of how a variable is used, i.e., requires reasoning about lines of code far apart in the source file. Secondly, we introduce the variable misuse prediction task (VARMISUSE), in which the network aims to infer which variable should be used in a program location. To illustrate the task, Figure 1 shows a slightly simplified snippet of a bug our model detected in a popular open-source project. Specifically, instead of the variable clazz, variable first should have been used in the yellow highlighted slot. Existing static analysis methods cannot detect such issues, even though a software engineer would easily identify this as an error from experience.
25
+
26
+ ![](images/1bc113e2a4c0fb9e0e51adeae6b01b6e7ddf6b162f6335e7e776d43b92e616d2.jpg)
27
+ Figure 1: A snippet of a detected bug in RavenDB an open-source C# project. The code has been slightly simplified. Our model detects correctly that the variable used in the highlighted (yellow) slot is incorrect. Instead, first should have been placed at the slot. We reported this problem which was fixed in PR 4138.
28
+
29
+ To achieve high accuracy on these tasks, we need to learn representations of program semantics. For both tasks, we need to learn the semantic role of a variable (e.g., “is it a counter?”, “is it a filename?”). Additionally, for VARMISUSE, learning variable usage semantics (e.g., “a filename is needed here”) is required. This “fill the blank element” task is related to methods for learning distributed representations of natural language words, such as Word2Vec (Mikolov et al., 2013) and GLoVe (Pennington et al., 2014). However, we can learn from a much richer structure such as data flow information. This work is a step towards learning program representations, and we expect them to be valuable in a wide range of other tasks, such as code completion (“this is the variable you are looking for”) and more advanced bug finding (“you should lock before using this object”).
30
+
31
+ To summarize, our contributions are: (i) We define the VARMISUSE task as a challenge for machine learning modeling of source code, that requires to learn (some) semantics of programs (cf. section 3). (ii) We present deep learning models for solving the VARNAMING and VARMISUSE tasks by modeling the code’s graph structure and learning program representations over those graphs (cf. section 4). (iii) We evaluate our models on a large dataset of 2.9 million lines of real-world source code, showing that our best model achieves $3 2 . 9 \%$ accuracy on the VARNAMING task and $8 5 . 5 \%$ accuracy on the VARMISUSE task, beating simpler baselines (cf. section 5). (iv) We document practical relevance of VARMISUSE by summarizing some bugs that we found in mature open-source software projects $( c f .$ subsection 5.3). Our implementation of graph neural networks (on a simpler task) can be found at https://github.com/Microsoft/gated-graph-neural-network-samples and the dataset can be found at https://aka.ms/iclr18-prog-graphs-dataset.
32
+
33
+ # 2 RELATED WORK
34
+
35
+ Our work builds upon the recent field of using machine learning for source code artifacts (Allamanis et al., 2017). For example, Hindle et al. (2012); Bhoopchand et al. (2016) model the code as a sequence of tokens, while Maddison & Tarlow (2014); Raychev et al. (2016) model the syntax tree structure of code. All works on language models of code find that predicting variable and method identifiers is one of biggest challenges in the task.
36
+
37
+ Closest to our work is the work of Allamanis et al. (2015) who learn distributed representations of variables using all their usages to predict their names. However, they do not use data flow information and we are not aware of any model that does so. Raychev et al. (2015) and Bichsel et al. (2016) use conditional random fields to model a variety of relationships between variables, AST elements and types to predict variable names and types (resp. to deobfuscate Android apps), but without considering the flow of data explicitly. In these works, all variable usages are deterministically known beforehand (as the code is complete and remains unmodified), as in Allamanis et al. (2014; 2015).
38
+
39
+ Our work is remotely related to work on program synthesis using sketches (Solar-Lezama, 2008) and automated code transplantation (Barr et al., 2015). However, these approaches require a set of specifications (e.g. input-output examples, test suites) to complete the gaps, rather than statistics learned from big code. These approaches can be thought as complementary to ours, since we learn to statistically complete the gaps without any need for specifications, by learning common variable usage patterns from code.
40
+
41
+ Neural networks on graphs (Gori et al., 2005; Li et al., 2015; Defferrard et al., 2016; Kipf & Welling, 2016; Gilmer et al., 2017) adapt a variety of deep learning methods to graph-structured input. They have been used in a series of applications, such as link prediction and classification (Grover & Leskovec, 2016) and semantic role labeling in NLP (Marcheggiani & Titov, 2017). Somewhat related to source code is the work of Wang et al. (2017) who learn graph-based representations of mathematical formulas for premise selection in theorem proving.
42
+
43
+ # 3 THE VARMISUSE TASK
44
+
45
+ Detecting variable misuses in code is a task that requires understanding and reasoning about program semantics. To successfully tackle the task one needs to infer the role and function of the program elements and understand how they relate. For example, given a program such as Fig. 1, the task is to automatically detect that the marked use of $\mathtt { C 1 a z z }$ is a mistake and that first should be used instead. While this task resembles standard code completion, it differs significantly in its scope and purpose, by considering only variable identifiers and a mostly complete program.
46
+
47
+ Task Description We view a source code file as a sequence of tokens $t _ { 0 } \ldots t _ { N } = \mathcal { T }$ , in which some tokens $t _ { \lambda _ { 0 } } , t _ { \lambda _ { 1 } } \ldots$ are variables. Furthermore, let $\mathbb { V } _ { t } \subset \mathbb { V }$ refer to the set of all type-correct variables in scope at the location of $t$ , i.e., those variables that can be used at $t$ without raising a compiler error. We call a token $t o k _ { \lambda }$ where we want to predict the correct variable usage a slot. We define a separate task for each slot $t _ { \lambda }$ : Given $t _ { 0 } \ldots t _ { \lambda - 1 }$ and $t _ { \lambda + 1 } , \dots , t _ { N }$ , correctly select $t _ { \lambda }$ from $\mathbb { V } _ { t _ { \lambda } }$ . For training and evaluation purposes, a correct solution is one that simply matches the ground truth, but note that in practice, several possible assignments could be considered correct (i.e., when several variables refer to the same value in memory).
48
+
49
+ # 4 MODEL: PROGRAMS AS GRAPHS
50
+
51
+ In this section, we discuss how to transform program source code into program graphs and learn representations over them. These program graphs not only encode the program text but also the semantic information that can be obtained using standard compiler tools.
52
+
53
+ Gated Graph Neural Networks Our work builds on Gated Graph Neural Networks (Li et al., 2015) (GGNN) and we summarize them here. A graph $\mathcal { G } = ( \nu , \pmb { \varepsilon } , \pmb { X } )$ is composed of a set of nodes $\nu$ , node features $\boldsymbol { X }$ , and a list of directed edge sets $\pmb { \mathcal { E } } = ( \mathcal { E } _ { 1 } , \ldots , \mathcal { E } _ { K } )$ where $K$ is the number of edge types. We annotate each $v \in \mathcal V$ with a real-valued vector $\pmb { x } ^ { ( v ) } \in \mathbb { R } ^ { D }$ representing the features of the node (e.g., the embedding of a string label of that node).
54
+
55
+ We associate every node $v$ with a state vector $\mathbf { \Omega } _ { h } ( v )$ , initialized from the node label $\pmb { x } ^ { ( v ) }$ . The sizes of the state vector and feature vector are typically the same, but we can use larger state vectors through padding of node features. To propagate information throughout the graph, “messages” of type $k$ are sent from each $v$ to its neighbors, where each message is computed from its current state vector as m(vk $m _ { k } ^ { ( v ) } = f _ { k } ( { \pmb h } ^ { ( v ) } )$ . Here, $f _ { k }$ can be an arbitrary function; we choose a linear layer in our case. By computing messages for all graph edges at the same time, all states can be updated at the same time. In particular, a new state for a node $v$ is computed by aggregating all incoming messages as $\tilde { m } ^ { ( v ) } = g ( \{ m _ { k } ^ { ( u ) } \ |$ there is an edge of type $k$ from $u$ to $v \}$ ). $g$ is an aggregation function, which we implement as elementwise summation. Given the aggregated message $\tilde { m } ^ { ( v ) }$ and the current state vector $\mathbf { \Omega } _ { h } ( v )$ of node $v$ , the state of the next time step $\boldsymbol { h ^ { \prime } } ^ { ( v ) }$ is computed as $\pmb { h } ^ { \prime ( v ) } = \mathbf { G } \mathbf { R } \mathbf { U } ( \tilde { \pmb { m } } ^ { ( v ) } , \pmb { h } ^ { ( v ) } )$ , where GRU is the recurrent cell function of gated recurrent unit (GRU) (Cho et al., 2014). The
56
+
57
+ (a) Simplified syntax graph for line 2 of Fig. 1, where blue rounded boxes are syntax nodes, black rectangular boxes syntax tokens, blue edges Child edges and double black edges NextToken edges.
58
+
59
+ ![](images/f0957bde3bf55bfd9fc41e58429404103dadf9736f4a693bec1cc3c471bc40e7.jpg)
60
+ Figure 2: Examples of graph edges used in program representation.
61
+
62
+ ![](images/83a96cffbd0f2a1c8368982c7c4bae4e01f2122dfee415273de350b2c11528e5.jpg)
63
+
64
+ (b) Data flow edges for $\begin{array} { r l r } { ( \overline { { \bf x } } ) ^ { 1 } , \overline { { \boldsymbol { \mathbf { y } } } } } & { { } = } & { \bf F o o ( \begin{array} { l } { ) } \ ; } \end{array} \end{array}$ while $\left. \overline { { \mathbf { x } } } \right. ^ { 3 } \ > \ \mathsf { 0 } .$ ) $\underline { { \nabla } } \mathbf { \Sigma } ^ { 4 } \mathbf { \Sigma } = \underline { { \nabla } } \mathbf { \bar { x } } \mathbf { \Sigma } ^ { 5 } \mathbf { \Sigma } ^ { \subset } \mathbf { \Sigma } \boxed { \nabla } \mathbf { \bar { y } } \mathbf { \Sigma } ^ { 6 }$ (indices added for clarity), with red dotted LastUse edges, green dashed LastWrite edges and dashdotted purple ComputedFrom edges.
65
+
66
+ dynamics defined by the above equations are repeated for a fixed number of time steps. Then, we use the state vectors from the last time step as the node representations.1
67
+
68
+ Program Graphs We represent program source code as graphs and use different edge types to model syntactic and semantic relationships between different tokens. The backbone of a program graph is the program’s abstract syntax tree (AST), consisting of syntax nodes (corresponding to nonterminals in the programming language’s grammar) and syntax tokens (corresponding to terminals). We label syntax nodes with the name of the nonterminal from the program’s grammar, whereas syntax tokens are labeled with the string that they represent. We use Child edges to connect nodes according to the AST. As this does not induce an order on children of a syntax node, we additionally add NextToken edges connecting each syntax token to its successor. An example of this is shown in Fig. 2a.
69
+
70
+ To capture the flow of control and data through a program, we add additional edges connecting different uses and updates of syntax tokens corresponding to variables. For such a token $v$ , let $\mathcal { D } ^ { R } ( v )$ be the set of syntax tokens at which the variable could have been used last. This set may contain several nodes (for example, when using a variable after a conditional in which it was used in both branches), and even syntax tokens that follow in the program code (in the case of loops). Similarly, let $\mathcal { D } ^ { W } ( v )$ be the set of syntax tokens at which the variable was last written to. Using these, we add LastRead (resp. LastWrite) edges connecting $v$ to all elements of $\mathcal { D } ^ { R } ( v )$ (resp. $\tilde { \mathcal { D } } ^ { W } ( v ) )$ . Additionally, whenever we observe an assignment $v = e x p r$ , we connect $v$ to all variable tokens occurring in expr using ComputedFrom edges. An example of such semantic edges is shown in Fig. 2b.
71
+
72
+ We extend the graph to chain all uses of the same variable using LastLexicalUse edges (independent of data flow, i.e., in if (...) { ... v ...} else { ... v ...}, we link the two occurrences of $v$ ). We also connect return tokens to the method declaration using ReturnsTo edges (this creates a “shortcut” to its name and type). Inspired by Rice et al. (2017), we connect arguments in method calls to the formal parameters that they are matched to with FormalArgName edges, i.e., if we observe a call Foo(bar) and a method declaration Foo(InputStream stream), we connect the bar token to the stream token. Finally, we connect every token corresponding to a variable to enclosing guard expressions that use the variable with GuardedBy and GuardedByNegation edges. For example, in if ( $\mathrm { ~ \bf ~ \cdot ~ x ~ } > \mathrm { ~ \bf ~ y ~ }$ ) { ... x ...} else $\{ \ \begin{array} { r l } { \mathrm { ~ \texttt ~ { ~ . ~ . ~ } ~ } \underline { { \mathrm { ~ y ~ } } } \mathrm { ~ . ~ . ~ . ~ } \} } \end{array}$ , we add a GuardedBy edge from $\underline { { \boldsymbol { \mathrm { X } } } }$ (resp. a GuardedByNegation edge from y) to the AST node corresponding to $\mathrm { ~ ~ { ~ x ~ } ~ } > \mathrm { ~ ~ { ~ y ~ } ~ }$ .
73
+
74
+ Finally, for all types of edges we introduce their respective backwards edges (transposing the adjacency matrix), doubling the number of edges and edge types. Backwards edges help with propagating information faster across the GGNN and make the model more expressive.
75
+
76
+ Leveraging Variable Type Information We assume a statically typed language and that the source code can be compiled, and thus each variable has a (known) type $\tau ( v )$ . To use it, we define a learnable embedding function $\mathbf { r } ( \tau )$ for known types and additionally define an “UNKTYPE” for all unknown/unrepresented types. We also leverage the rich type hierarchy that is available in many object-oriented languages. For this, we map a variable’s type $\tau ( v )$ to the set of its supertypes, i.e. $\tau ^ { * } \bar { ( } v ) = \{ \tau : \tau ( v ) \quad$ implements type $\tau \} \cup \{ \bar { \tau } ( v ) \}$ . We then compute the type representation $\mathbf { r } ^ { * } ( v )$ of a variable $v$ as the element-wise maximum of $\{ \mathbf { r } ( \tau ) : \tau \in \tau ^ { * } ( v ) \}$ . We chose the maximum here, as it is a natural pooling operation for representing partial ordering relations (such as type lattices). Using all types in $\tau ^ { * } ( v )$ allows us to generalize to unseen types that implement common supertypes or interfaces. For example, List ${ \tt < K > }$ has multiple concrete types (e.g. List<int>, List<string>). Nevertheless, these types implement a common interface (IList) and share common characteristics. During training, we randomly select a non-empty subset of $\tau ^ { * } ( v )$ which ensures training of all known types in the lattice. This acts both like a dropout mechanism and allows us to learn a good representation for all types in the type lattice.
77
+
78
+ Initial Node Representation To compute the initial node state, we combine information from the textual representation of the token and its type. Concretely, we split the name of a node representing a token into subtokens (e.g. classTypes will be split into two subtokens class and types) on camelCase and pascal_case. We then average the embeddings of all subtokens to retrieve an embedding for the node name. Finally, we concatenate the learned type representation $\mathbf { r } ^ { * } ( v )$ , computed as discussed earlier, with the node name representation, and pass it through a linear layer to obtain the initial representations for each node in the graph.
79
+
80
+ Programs Graphs for VARNAMING Given a program and an existing variable $v$ , we build a program graph as discussed above and then replace the variable name in all corresponding variable tokens by a special ${ < } S \mathrm { L O T } >$ token. To predict a name, we use the initial node labels computed as the concatenation of learnable token embeddings and type embeddings as discussed above, run GGNN propagation for 8 time steps2 and then compute a variable usage representation by averaging the representations for all ${ < } S \mathrm { L O T } >$ tokens. This representation is then used as the initial state of a one-layer GRU, which predicts the target name as a sequence of subtokens (e.g., the name inputStreamBuffer is treated as the sequence [input, stream, buffer]). We train this graph2seq architecture using a maximum likelihood objective. In section 5, we report the accuracy for predicting the exact name and the F1 score for predicting its subtokens.
81
+
82
+ Program Graphs for VARMISUSE To model VARMISUSE with program graphs we need to modify the graph. First, to compute a context representation $\mathbf { } c ( t )$ for a slot $t$ where we want to predict the used variable, we insert a new node $v _ { < S \tt L O T > }$ at the position of $t$ , corresponding to a “hole” at this point, and connect it to the remaining graph using all applicable edges that do not depend on the chosen variable at the slot (i.e., everything but LastUse, LastWrite, LastLexicalUse, and GuardedBy edges). Then, to compute the usage representation $\mathbf { u } ( t , v )$ of each candidate variable $v$ at the target slot, we insert a “candidate” node $v _ { t , v }$ for all $v$ in $\mathbb { V } _ { t }$ , and connect it to the graph by inserting the LastUse, LastWrite and LastLexicalUse edges that would be used if the variable were to be used at this slot. Each of these candidate nodes represents the speculative placement of the variable within the scope.
83
+
84
+ Using the initial node representations, concatenated with an extra bit that is set to one for the candidate nodes $v _ { t , v }$ , we run GGNN propagation for 8 time steps.2 The context and usage representation are then the final node states of the nodes, i.e., $\pmb { c } ( t ) = \pmb { h } ^ { ( v _ { < \mathrm { S L O T } > } ) }$ and $\mathbf { u } ( t , v ) = h ^ { ( v _ { t , v } ) }$ . Finally, the correct variable usage at the location is computed as arg $\textstyle \operatorname* { m a x } _ { v } W [ c ( t ) , \mathbf { u } ( t , v ) ]$ where $W$ is a linear layer that uses the concatenation of $\mathbf { } c ( t )$ and $\mathbf { u } ( t , v )$ . We train using a max-margin objective.
85
+
86
+ # 4.1 IMPLEMENTATION
87
+
88
+ Using GGNNs for sets of large, diverse graphs requires some engineering effort, as efficient batching is hard in the presence of diverse shapes. An important observation is that large graphs are normally very sparse, and thus a representation of edges as an adjacency list would usually be advantageous to reduce memory consumption. In our case, this can be easily implemented using a sparse tensor representation, allowing large batch sizes that exploit the parallelism of modern GPUs efficiently. A second key insight is to represent a batch of graphs as one large graph with many disconnected components. This just requires appropriate pre-processing to make node identities unique. As this makes batch construction somewhat CPU-intensive, we found it useful to prepare minibatches on a separate thread. Our TensorFlow (Abadi et al., 2016) implementation scales to 55 graphs per second during training and 219 graphs per second during test-time using a single NVidia GeForce GTX Titan X with graphs having on average 2,228 (median 936) nodes and 8,350 (median 3,274) edges and 8 GGNN unrolling iterations, all 20 edge types (forward and backward edges for 10 original edge types) and the size of the hidden layer set to 64. The number of types of edges in the GGNN contributes proportionally to the running time. For example, a GGNN run for our ablation study using only the two most common edge types (NextToken, Child) achieves 105 graphs/second during training and 419 graphs/second at test time with the same hyperparameters. Our (generic) implementation of GGNNs is available at https://github.com/Microsoft/ gated-graph-neural-network-samples, using a simpler demonstration task.
89
+
90
+ # 5 EVALUATION
91
+
92
+ Dataset We collected a dataset for the VARMISUSE task from open source $C ^ { \# }$ projects on GitHub. To select projects, we picked the top-starred (non-fork) projects in GitHub. We then filtered out projects that we could not (easily) compile in full using Roslyn3, as we require a compilation to extract precise type information for the code (including those types present in external libraries). Our final dataset contains 29 projects from a diverse set of domains (compilers, databases, . . . ) with about 2.9 million non-empty lines of code. A full table is shown in Appendix D.
93
+
94
+ For the task of detecting variable misuses, we collect data from all projects by selecting all variable usage locations, filtering out variable declarations, where at least one other type-compatible replacement variable is in scope. The task is then to infer the correct variable that originally existed in that location. Thus, by construction there is at least one type-correct replacement variable, i.e. picking it would not raise an error during type checking. In our test datasets, at each slot there are on average 3.8 type-correct alternative variables (median 3, $\sigma = 2 . 6$ ).
95
+
96
+ From our dataset, we selected two projects as our development set. From the rest of the projects, we selected three projects for UNSEENPROJTEST to allow testing on projects with completely unknown structure and types. We split the remaining 23 projects into train/validation/test sets in the proportion 60-10-30, splitting along files (i.e., all examples from one source file are in the same set). We call the test set obtained like this SEENPROJTEST.
97
+
98
+ Baselines For VARMISUSE, we consider two bidirectional RNN-based baselines. The local model (LOC) is a simple two-layer bidirectional GRU run over the tokens before and after the target location. For this baseline, $\mathbf { } c ( t )$ is set to the slot representation computed by the RNN, and the usage context of each variable $\mathbf { u } ( t , v )$ is the embedding of the name and type of the variable, computed in the same way as the initial node labels in the GGNN. This baseline allows us to evaluate how important the usage context information is for this task. The flat dataflow model (AVGBIRNN) is an extension to LOC, where the usage representation $\mathbf { u } ( t , v )$ is computed using another two-layer bidirectional RNN run over the tokens before/after each usage, and then averaging over the computed representations at the variable token $v$ . The local context, $\mathbf { } c ( t )$ , is identical to LOC. AVGBIRNN is a significantly stronger baseline that already takes some structural information into account, as the averaging over all variables usages helps with long-range dependencies. Both models pick the variable that maximizes $\boldsymbol { c } ( t ) ^ { T } \mathbf { u } ( t , v )$ .
99
+
100
+ For VARNAMING, we replace LOC by AVGLBL, which uses a log-bilinear model for 4 left and 4 right context tokens of each variable usage, and then averages over these context representations (this corresponds to the model in Allamanis et al. (2015)). We also test AVGBIRNN on VARNAMING, which essentially replaces the log-bilinear context model by a bidirectional RNN.
101
+
102
+ Table 1: Evaluation of models. SEENPROJTEST refers to the test set containing projects that have files in the training set, UNSEENPROJTEST refers to projects that have no files in the training data. Results averaged over two runs.
103
+
104
+ <table><tr><td></td><td colspan="4">SEENPROJTEST</td><td colspan="4">UNSEENPROJTEST</td></tr><tr><td></td><td>Loc</td><td>AVGLBL</td><td>AVGBIRNN</td><td>GGNN</td><td>Loc</td><td>AVGLBL</td><td>AVGBIRNN</td><td>GGNN</td></tr><tr><td>VARMISUSE</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Accuracy (%)</td><td>50.0</td><td>二</td><td>73.7</td><td>85.5</td><td>28.9</td><td></td><td>60.2</td><td>78.2</td></tr><tr><td>PR AUC</td><td>0.788</td><td></td><td>0.941</td><td>0.980</td><td>0.611</td><td></td><td>0.895</td><td>0.958</td></tr><tr><td>VARNAMING Accuracy (%)</td><td></td><td>36.1</td><td>42.9</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td>53.6</td><td></td><td>22.7</td><td>23.4</td><td>44.0</td></tr><tr><td>F1 (%)</td><td></td><td>44.0</td><td>50.1</td><td>65.8</td><td></td><td>30.6</td><td>32.0</td><td>62.0</td></tr></table>
105
+
106
+ Table 2: Ablation study for the GGNN model on SEENPROJTEST for the two tasks.
107
+
108
+ <table><tr><td>Ablation Description</td><td colspan="2">Accuracy (%) VARMISUSE</td></tr><tr><td></td><td></td><td>VARNAMING</td></tr><tr><td>Standard Model (reported in Table 1)</td><td>85.5</td><td>53.6</td></tr><tr><td>Only NextToken, Child, LastUse_LastWrite edges</td><td>80.6</td><td>31.2</td></tr><tr><td>Only semantic edges (all but NextToken, Child) Only syntax edges (NextToken, Child)</td><td>78.4 55.3</td><td>52.9 34.3</td></tr><tr><td>Node Labels: Tokens instead of subtokens</td><td></td><td></td></tr><tr><td>Node Labels:Disabled</td><td>85.6 84.3</td><td>34.5</td></tr><tr><td></td><td></td><td>31.8</td></tr></table>
109
+
110
+ # 5.1 QUANTITATIVE EVALUATION
111
+
112
+ Table 1 shows the evaluation results of the models for both tasks.4 As LOC captures very little information, it performs relatively badly. AVGLBL and AVGBIRNN, which capture information from many variable usage sites, but do not explicitly encode the rich structure of the problem, still lag behind the GGNN by a wide margin. The performance difference is larger for VARMISUSE, since the structure and the semantics of code are far more important within this setting.
113
+
114
+ Generalization to new projects Generalizing across a diverse set of source code projects with different domains is an important challenge in machine learning. We repeat the evaluation using the UNSEENPROJTEST set stemming from projects that have no files in the training set. The right side of Table 1 shows that our models still achieve good performance, although it is slightly lower compared to SEENPROJTEST. This is expected since the type lattice is mostly unknown in UNSEENPROJTEST.
115
+
116
+ We believe that the dominant problem in applying a trained model to an unknown project (i.e., domain) is the fact that its type hierarchy is unknown and the used vocabulary (e.g. in variables, method and class names, etc.) can differ substantially.
117
+
118
+ Ablation Study To study the effect of some of the design choices for our models, we have run some additional experiments and show their results in Table 2. First, we varied the edges used in the program graph. We find that restricting the model to syntactic information has a large impact on performance on both tasks, whereas restricting it to semantic edges seems to mostly impact performance on VARMISUSE. Similarly, the ComputedFrom, FormalArgName and ReturnsTo edges give a small boost on VARMISUSE, but greatly improve performance on VARNAMING. As evidenced by the experiments with the node label representation, syntax node and token names seem to matter little for VARMISUSE, but naturally have a great impact on VARNAMING.
119
+
120
+ # 5.2 QUALITATIVE EVALUATION
121
+
122
+ Figure 3 illustrates the predictions that GGNN makes on a sample test snippet. The snippet recursively searches for the global directives file by gradually descending into the root folder. Reasoning about the correct variable usages is hard, even for humans, but the GGNN correctly predicts the variable usages at all locations except two (slot 1 and 8). As a software engineer is writing the code, it is imaginable that she may make a mistake misusing one variable in the place of another. Since all variables are string variables, no type errors will be raised. As the probabilities in Fig. 3 suggest most potential variable misuses can be flagged by the model yielding valuable warnings to software engineers. Additional samples with comments can be found in Appendix B.
123
+
124
+ ![](images/cd8c9c73a863608276a7923a4347ae44724d33325aed2f76dd26669048968bd2.jpg)
125
+ Figure 3: VARMISUSE predictions on slots within a snippet of the SEENPROJTEST set for the ServiceStack project. Additional visualizations are available in Appendix B. The underlined tokens are the correct tokens. The model has to select among a number of string variables at each slot, where all of them represent some kind of path. The GGNN accurately predicts the correct variable usage in 11 out of the 13 slots reasoning about the complex ways the variables interact among them.
126
+
127
+ ![](images/1a46d813f5e2a8d4ca1585320818302c03d99347f9237a6ad178e6da4a0a1573.jpg)
128
+ Figure 4: A bug found (yellow) in RavenDB open-source project. The code unnecessarily ensures that the buffer is of size length rather than size (which our model predicts as the correct variable here).
129
+
130
+ Furthermore, Appendix C shows samples of pairs of code snippets that share similar representations as computed by the cosine similarity of the usage representation $\mathbf { u } ( t , v )$ of GGNN. The reader can notice that the network learns to group variable usages that share semantic similarities together. For example, checking for null before the use of a variable yields similar distributed representations across code segments (Sample 1 in Appendix C).
131
+
132
+ # 5.3 DISCOVERED VARIABLE MISUSE BUGS
133
+
134
+ We have used our VARMISUSE model to identify likely locations of bugs in RavenDB (a document database) and Roslyn (Microsoft’s $C ^ { \# }$ compiler framework). For this, we manually reviewed a sample of the top 500 locations in both projects where our model was most confident about a choosing a variable differing from the ground truth, and found three bugs in each of the projects.
135
+
136
+ Figs. 1,4,5 show the issues discovered in RavenDB. The bug in Fig. 1 was possibly caused by copy-pasting, and cannot be easily caught by traditional methods. A compiler will not warn about unused variables (since first is used) and virtually nobody would write a test testing another test. Fig. 4 shows an issue that, although not critical, can lead to increased memory consumption. Fig. 5 shows another issue arising from a non-informative error message. We privately reported three additional bugs to the Roslyn developers, who have fixed the issues in the meantime (cf. https://github.com/dotnet/roslyn/pull/23437). One of the reported bugs could cause a crash in Visual Studio when using certain Roslyn features.
137
+
138
+ ![](images/336e106c897c8cfa8eb64fc3ca64fbd06fdd03a060af8c210b6cbadf7e1fcc42.jpg)
139
+ Figure 5: A bug found (yellow) in the RavenDB open-source project. Although backupFilename is found to be invalid by IsValidBackup, the user is notified that backupLocation is invalid instead.
140
+
141
+ Finding these issues in widely released and tested code suggests that our model can be useful during the software development process, complementing classic program analysis tools. For example, one usage scenario would be to guide the code reviewing process to locations a VARMISUSE model has identified as unusual, or use it as a prior to focus testing or expensive code analysis efforts.
142
+
143
+ # 6 DISCUSSION & CONCLUSIONS
144
+
145
+ Although source code is well understood and studied within other disciplines such as programming language research, it is a relatively new domain for deep learning. It presents novel opportunities compared to textual or perceptual data, as its (local) semantics are well-defined and rich additional information can be extracted using well-known, efficient program analyses. On the other hand, integrating this wealth of structured information poses an interesting challenge. Our VARMISUSE task exposes these opportunities, going beyond simpler tasks such as code completion. We consider it as a first proxy for the core challenge of learning the meaning of source code, as it requires to probabilistically refine standard information included in type systems.
146
+
147
+ # REFERENCES
148
+
149
+ Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016.
150
+ Miltiadis Allamanis, Earl T Barr, Christian Bird, and Charles Sutton. Learning natural coding conventions. In Foundations of Software Engineering (FSE), 2014.
151
+ Miltiadis Allamanis, Earl T Barr, Christian Bird, and Charles Sutton. Suggesting accurate method and class names. In Foundations of Software Engineering (FSE), 2015.
152
+ Miltiadis Allamanis, Hao Peng, and Charles Sutton. A convolutional attention network for extreme summarization of source code. In International Conference on Machine Learning (ICML), pp. 2091–2100, 2016.
153
+ Miltiadis Allamanis, Earl T Barr, Premkumar Devanbu, and Charles Sutton. A survey of machine learning for big code and naturalness. arXiv preprint arXiv:1709.06182, 2017.
154
+ Earl T Barr, Mark Harman, Yue Jia, Alexandru Marginean, and Justyna Petke. Automated software transplantation. In International Symposium on Software Testing and Analysis (ISSTA), 2015.
155
+ Al Bessey, Ken Block, Ben Chelf, Andy Chou, Bryan Fulton, Seth Hallem, Charles Henri-Gros, Asya Kamsky, Scott McPeak, and Dawson Engler. A few billion lines of code later: using static analysis to find bugs in the real world. Communications of the ACM, 53(2):66–75, 2010.
156
+ Avishkar Bhoopchand, Tim Rocktäschel, Earl Barr, and Sebastian Riedel. Learning Python code suggestion with a sparse pointer network. arXiv preprint arXiv:1611.08307, 2016.
157
+
158
+ Benjamin Bichsel, Veselin Raychev, Petar Tsankov, and Martin Vechev. Statistical deobfuscation of android applications. In Conference on Computer and Communications Security (CCS), 2016.
159
+
160
+ Pavol Bielik, Veselin Raychev, and Martin Vechev. PHOG: probabilistic model for code. In International Conference on Machine Learning (ICML), 2016.
161
+
162
+ Kyunghyun Cho, Bart van Merriënboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties of neural machine translation: Encoder–decoder approaches. Syntax, Semantics and Structure in Statistical Translation, 2014.
163
+
164
+ Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Neural Information Processing Systems (NIPS), pp. 3844–3852, 2016.
165
+
166
+ Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. arXiv preprint arXiv:1704.01212, 2017.
167
+
168
+ Marco Gori, Gabriele Monfardini, and Franco Scarselli. A new model for learning in graph domains. In IEEE International Joint Conference Neural Networks (IJCNN). IEEE, 2005.
169
+
170
+ Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In International Conference on Knowledge Discovery and Data Mining (SIGKDD), pp. 855–864. ACM, 2016.
171
+
172
+ Abram Hindle, Earl T Barr, Zhendong Su, Mark Gabel, and Premkumar Devanbu. On the naturalness of software. In International Conference on Software Engineering (ICSE), 2012.
173
+
174
+ Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
175
+
176
+ Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. In International Conference on Learning Representations (ICLR), 2015.
177
+
178
+ Chris J Maddison and Daniel Tarlow. Structured generative models of natural source code. In International Conference on Machine Learning (ICML), 2014.
179
+
180
+ Diego Marcheggiani and Ivan Titov. Encoding sentences with graph convolutional networks for semantic role labeling. In ACL, 2017.
181
+
182
+ Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Neural Information Processing Systems (NIPS), 2013.
183
+
184
+ Jeffrey Pennington, Richard Socher, and Christopher D Manning. GloVe: Global vectors for word representation. In EMNLP, 2014.
185
+
186
+ Veselin Raychev, Martin Vechev, and Eran Yahav. Code completion with statistical language models. In Programming Languages Design and Implementation (PLDI), pp. 419–428, 2014.
187
+
188
+ Veselin Raychev, Martin Vechev, and Andreas Krause. Predicting program properties from Big Code. In Principles of Programming Languages (POPL), 2015.
189
+
190
+ Veselin Raychev, Pavol Bielik, and Martin Vechev. Probabilistic model for code with decision trees. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2016.
191
+
192
+ Andrew Rice, Edward Aftandilian, Ciera Jaspan, Emily Johnston, Michael Pradel, and Yulissa Arroyo-Paredes. Detecting argument selection defects. Proceedings of the ACM on Programming Languages, 1(OOPSLA):104, 2017.
193
+
194
+ Michael Schlichtkrull, Thomas N. Kipf, Peter Bloem, Rianne van den Berg, Ivan Titov, and Max Welling. Modeling relational data with graph convolutional network. arXiv preprint arXiv:1703.06103, 2017.
195
+
196
+ Armando Solar-Lezama. Program synthesis by sketching. University of California, Berkeley, 2008.
197
+
198
+ Mingzhe Wang, Yihe Tang, Jian Wang, and Jia Deng. Premise selection for theorem proving by deep graph embedding. In Advances in Neural Information Processing Systems, pp. 2783–2793, 2017.
199
+
200
+ ![](images/8d4734049cdf665102b0203edbfe7d102c214d1ca0e59c1e940ccf68db6434c3.jpg)
201
+ Figure 6: Precision-Recall and ROC curves for the GGNN model on VARMISUSE. Note that the $y$ axis starts from $50 \%$ .
202
+
203
+ Table 3: Performance of GGNN model on VARMISUSE per number of type-correct, in-scope candidate variables. Here we compute the performance of the full GGNN model that uses subtokens.
204
+
205
+ <table><tr><td># of candidates</td><td>2</td><td>3</td><td>4</td><td></td><td>6or7</td><td>8+</td></tr><tr><td>Accuracy On SEENPROJTEST (%)</td><td>91.6</td><td>84.5</td><td>81.8</td><td>78.6</td><td>75.1</td><td>77.5</td></tr><tr><td>Accuracy On UNSEENPROJTEST (%)</td><td>85.7</td><td>77.1</td><td>75.7</td><td>69.0</td><td>71.5</td><td>62.4</td></tr></table>
206
+
207
+ # A PERFORMANCE CURVES
208
+
209
+ Figure 6 shows the ROC and precision-recall curves for the GGNN model. As the reader may observe, setting a false positive rate to $10 \%$ we get a true positive rate5 of $73 \%$ for the SEENPROJTEST and $69 \%$ for the unseen test. This suggests that this model can be practically used at a high precision setting with acceptable performance.
210
+
211
+ # B VARMISUSE PREDICTION SAMPLES
212
+
213
+ Below we list a set of samples from our SEENPROJTEST projects with comments about the model performance. Code comments and formatting may have been altered for typesetting reasons. The ground truth choice is underlined.
214
+
215
+ # Sample 1
216
+
217
+ ![](images/abfe6409dabc3b628a3cb9baa2fdc14d3f39bb8b79f6efc499c55f175cb161d8.jpg)
218
+
219
+ . The model correctly predicts all variables in the loop.
220
+
221
+ # Sample 2
222
+
223
+ ![](images/67d1357095f3d80bff9433916647f24a7195c8a63c4dcc5ead0f08be17f5bdaf.jpg)
224
+
225
+ #1 name: $86 \%$ , DIR_PATH: $14 \%$ #2 path: $90 \%$ , name: $8 \%$ , DIR_PATH: $2 \%$ #3 path: $76 \%$ , name: $16 \%$ , DIR_PATH: $8 \%$
226
+
227
+ $\triangleright$ String variables are not confused their semantic role is inferred correctly.
228
+
229
+ # Sample 3
230
+
231
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
232
+ public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag $=$ input.ReadTag()) $\ ! = ~ 0$ ) { switch(tag) { default: input.SkipLastField(); break; case 10: { #1 .AddEntriesFrom(input, _repeated_payload_codec); break; } }
233
+ }
234
+
235
+ #1 Payload: $66 \%$ , payload_: $44 \%$
236
+
237
+ $\triangleright$ The model is commonly confused by aliases, i.e. variables that point to the same location in memory.
238
+ In this sample, either choice would have yielded identical behavior.
239
+
240
+ # Sample 4
241
+
242
+ ![](images/a45880cd7de37c697125e92c3c541033a38ec7e20081fe1d6ce9b55998761b1c.jpg)
243
+
244
+ #1 gate: $9 9 \%$ , _observers: $1 \%$ #2 _isDisposed: $90 \%$ , _isStopped: $8 \%$ , HasObservers: $2 \%$
245
+
246
+ . The ReturnsTo edge can help predict variables that otherwise would have been impossible.
247
+
248
+ # Sample 5
249
+
250
+ ![](images/382d0a5b3bd9d9fd228858bebcaa0e6dfce97d4d8f24faa63d9010e590be558b.jpg)
251
+
252
+ #1 error: $93 \%$ , _exception: $7 \%$
253
+ #2 error: $98 \%$ , _exception: $2 \%$
254
+ #3 _gate: $100 \%$ , _observers: $0 \%$
255
+ #4 isStopped: $86 \%$ , _isDisposed: $13 \%$ , HasObservers: $1 \%$
256
+ #5 isStopped: $91 \%$ , _isDisposed: $9 \%$ , HasObservers: $0 \%$
257
+ #6 _exception: $100 \%$ , error: $0 \%$
258
+ #7 error: $98 \%$ , _exception: $2 \%$
259
+ #8 _exception: $9 9 \%$ , error: $1 \%$
260
+
261
+ $\triangleright$ The model predicts the correct variables from all slots apart from the last. Reasoning about the last one, requires interprocedural understanding of the code across the class file.
262
+
263
+ # Sample 6
264
+
265
+ private bool BecomingCommand(object message) if (ReceiveCommand #1 return true; if #2 .ToString() $= =$ #3 #4 .Tell #5 else return false; return true;
266
+ }
267
+
268
+ #1 message: $100 \%$ , Response: $0 \%$ , Message: $0 \%$ #2 message: $100 \%$ , Response: $0 \%$ , Message: $0 \%$ #3 Response: $91 \%$ , Message: $9 \%$ #4 Probe: $98 \%$ , AskedForDelete: $2 \%$ #5 Response: $98 \%$ , Message: $2 \%$
269
+
270
+ . The model predicts correctly all usages except from the one in slot #3. Reasoning about this snippet requires additional semantic information about the intent of the code.
271
+
272
+ # Sample 7
273
+
274
+ var response $=$ ResultsFilter(typeof(TResponse), #1 #2 , request);
275
+
276
+ #1 httpMethod: $9 9 \%$ , absoluteUrl: $1 \%$ , UserName: $0 \%$ , UserAgent: $0 \%$ #2 absoluteUrl: $9 9 \%$ , httpMethod: $1 \%$ , UserName: $0 \%$ , UserAgent: $0 \%$
277
+
278
+ $\triangleright$ The model knows about selecting the correct string parameters because it matches them to the formal parameter names.
279
+
280
+ # Sample 8
281
+
282
+ if #1 $> =$ #2 ) throw new InvalidOperationException(Strings_Core.FAILED_CLOCK_MONITORING)
283
+
284
+ #1 n: $100 \%$ , MAXERROR: $0 \%$ , SYNC_MAXRETRIES: $0 \%$ #2 MAXERROR: $62 \%$ , SYNC_MAXRETRIES: $22 \%$ , n: $16 \%$
285
+
286
+ $\triangleright$ It is hard for the model to reason about conditionals, especially with rare constants as in slot #2.
287
+
288
+ # C NEAREST NEIGHBOR OF GGNN USAGE REPRESENTATIONS
289
+
290
+ Here we show pairs of nearest neighbors based on the cosine similarity of the learned representations $\mathbf { u } ( t , v )$ . Each slot $t$ is marked in dark blue and all usages of $v$ are marked in yellow (i.e. variableName ). This is a set of hand-picked examples showing good and bad examples. A brief description follows after each pair.
291
+
292
+ # Sample 1
293
+
294
+ ![](images/3af9a60fadeb14347e4f874e0c1dc803122c0a76e9fdc856fd08d2c98658db62.jpg)
295
+
296
+ $\triangleright$ Slots that are checked for null-ness have similar representations.
297
+
298
+ # Sample 2
299
+
300
+ ![](images/d1ada4fdbb0e1a6e130ce0b48d0b02926d9a7f74e9bd9bde7dc55ae52c59ef8f.jpg)
301
+
302
+ $\triangleright$ Slots that follow similar API protocols have similar representations. Note that the function HasAddress is a local function, seen only in the testset.
303
+
304
+ # Sample 3
305
+
306
+ ![](images/2138340e86ff73ed6c4633db684eb824cdcf8b0c1f5f5434c9e65b177116c2f6.jpg)
307
+
308
+ $\triangleright$ Adding elements to a collection-like object yields similar representations.
309
+
310
+ # D DATASET
311
+
312
+ The collected dataset and its characteristics are listed in Table 4. The full dataset as a set of projects and its parsed JSON will become available online.
313
+
314
+ Table 4: Projects in our dataset. Ordered alphabetically. kLOC measures the number of non-empty lines of C# code. Projects marked with Devwere used as a development set. Projects marked with †were in the test-only dataset. The rest of the projects were split into train-validation-test. The dataset contains in total about 2.9MLOC.
315
+
316
+ <table><tr><td>Name</td><td>Git SHA</td><td>kLOCs</td><td>Slots</td><td>Vars</td><td>Description</td></tr><tr><td>Akka.NET</td><td>719335a1</td><td>240</td><td>51.3k</td><td>51.2k</td><td>Actor-based Concurrent &amp;Distributed Framework</td></tr><tr><td>AutoMapper</td><td>2ca7c2b5</td><td>46</td><td>3.7k</td><td>10.7k</td><td>Object-to-Object Mapping Library</td></tr><tr><td>BenchmarkDotNet</td><td>1670ca34</td><td>28</td><td>5.1k</td><td>6.1k</td><td>Benchmarking Library</td></tr><tr><td>BotBuilder</td><td>190117c3</td><td>44</td><td>6.4k</td><td>8.7k</td><td>SDK for Building Bots</td></tr><tr><td>choco</td><td>93985688</td><td>36</td><td>3.8k</td><td>5.2k</td><td>Windows Package Manager</td></tr><tr><td>commandline†</td><td>09677b16</td><td>11</td><td>1.1k</td><td>2.3k</td><td>Command Line Parser</td></tr><tr><td>CommonMark.NETDev</td><td>f3d54530</td><td>14</td><td>2.6k</td><td>1.4k</td><td>Markdown Parser</td></tr><tr><td>Dapper</td><td>931c700d</td><td>18</td><td>3.3k</td><td>4.7k</td><td>Object Mapper Library</td></tr><tr><td>EntityFramework</td><td>fa0b7ec8</td><td>263</td><td>33.4k</td><td>39.3k</td><td>Object-Relational Mapper</td></tr><tr><td>Hangfire</td><td>ffc4912f</td><td>33</td><td>3.6k</td><td>6.1k</td><td>Background Job Processing Library</td></tr><tr><td>Humanizert</td><td>cclla77e</td><td>27</td><td>2.4k</td><td>4.4k</td><td>String Manipulation and Formatting</td></tr><tr><td>Lean†</td><td>f574bfd7</td><td>190</td><td>26.4k</td><td>28.3k</td><td>Algorithmic Trading Engine</td></tr><tr><td>Nancy</td><td>72elf614</td><td>70</td><td>7.5k</td><td>15.7</td><td>HTTP Service Framework</td></tr><tr><td>Newtonsoft.Json</td><td>6057d9b8</td><td>123</td><td>14.9k</td><td>16.1k</td><td> JSON Library</td></tr><tr><td>Ninject</td><td>7006297f</td><td>13</td><td>0.7k</td><td>2.1k</td><td>Code Injection Library</td></tr><tr><td>NLog</td><td>643e326a</td><td>75</td><td>8.3k</td><td>11.0k</td><td>Logging Library</td></tr><tr><td>Opserver</td><td>51b032e7</td><td>24</td><td>3.7k</td><td>4.5k</td><td>Monitoring System</td></tr><tr><td>OptiKey</td><td>7d35c718</td><td>34</td><td>6.1k</td><td>3.9k</td><td>Assistive On-Screen Keyboard</td></tr><tr><td>orleans Polly</td><td>e0d6a150 0afdbc32</td><td>300 32</td><td>30.7k 3.8k</td><td>35.6k 9.1k</td><td>Distributed Virtual Actor Model</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>Resilience &amp; Transient Fault Handling Library</td></tr><tr><td>quartznet</td><td>b33e6f86</td><td>49</td><td>9.6k</td><td>9.8k</td><td>Scheduler</td></tr><tr><td>ravendbDev</td><td>55230922</td><td>647</td><td>78.0k</td><td>82.7k</td><td>Document Database</td></tr><tr><td>RestSharp</td><td>70de357b</td><td>20</td><td>4.0k</td><td>4.5k</td><td>REST and HTTP API Client Library</td></tr><tr><td>Rx.NET</td><td>2d146fe5</td><td>180</td><td>14.0k</td><td>21.9k</td><td>Reactive Language Extensions</td></tr><tr><td>scriptcs</td><td>f3cc8bcb</td><td>18</td><td>2.7k</td><td>4.3k</td><td>C# Text Editor</td></tr><tr><td>ServiceStack</td><td>6d59da75</td><td>231</td><td>38.0k</td><td>46.2k</td><td>Web Framework</td></tr><tr><td>ShareX</td><td>718dd711</td><td>125</td><td>22.3k</td><td>18.1k</td><td>Sharing Application</td></tr><tr><td>SignalR</td><td>fa88089e</td><td>53</td><td>6.5k</td><td>10.5k</td><td>Push Notification Framework</td></tr><tr><td>Wox</td><td>cdaf6272</td><td>13</td><td>2.0k</td><td>2.1k</td><td>Application Launcher</td></tr></table>
317
+
318
+ For this work, we released a large portion of the data, with the exception of projects with a GPL license. The data can be found at https://aka.ms/iclr18-prog-graphs-dataset. Since we are excluding some projects from the data, below we report the results, averaged over three runs, on the published dataset:
319
+
320
+ <table><tr><td></td><td>Accuracy (%)</td><td>PR AUC</td></tr><tr><td>SEENPROJTEST</td><td>84.0</td><td>0.976</td></tr><tr><td>UNSEENPROJTEST</td><td>74.1</td><td>0.934</td></tr></table>
parse/train/BJOFETxR-/BJOFETxR-_content_list.json ADDED
@@ -0,0 +1,1690 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "LEARNING TO REPRESENT PROGRAMS WITH GRAPHS ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 173,
8
+ 98,
9
+ 816,
10
+ 121
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Miltiadis Allamanis \nMicrosoft Research \nCambridge, UK \nmiallama@microsoft.com \nMarc Brockschmidt \nMicrosoft Research \nCambridge, UK \nmabrocks@microsoft.com ",
17
+ "bbox": [
18
+ 183,
19
+ 145,
20
+ 401,
21
+ 200
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "",
28
+ "bbox": [
29
+ 596,
30
+ 145,
31
+ 813,
32
+ 200
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Mahmoud Khademi∗ Simon Fraser University Burnaby, BC, Canada mkhademi@sfu.ca ",
39
+ "bbox": [
40
+ 183,
41
+ 222,
42
+ 344,
43
+ 277
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "ABSTRACT ",
50
+ "text_level": 1,
51
+ "bbox": [
52
+ 454,
53
+ 314,
54
+ 544,
55
+ 329
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "Learning tasks on source code (i.e., formal languages) have been considered recently, but most work has tried to transfer natural language methods and does not capitalize on the unique opportunities offered by code’s known sematics. For example, long-range dependencies induced by using the same variable or function in distant locations are often not considered. We propose to use graphs to represent both the syntactic and semantic structure of code and use graph-based deep learning methods to learn to reason over program structures. ",
62
+ "bbox": [
63
+ 233,
64
+ 347,
65
+ 764,
66
+ 443
67
+ ],
68
+ "page_idx": 0
69
+ },
70
+ {
71
+ "type": "text",
72
+ "text": "In this work, we present how to construct graphs from source code and how to scale Gated Graph Neural Networks training to such large graphs. We evaluate our method on two tasks: VARNAMING, in which a network attempts to predict the name of a variable given its usage, and VARMISUSE, in which the network learns to reason about selecting the correct variable that should be used at a given program location. Our comparison to methods that use less structured program representations shows the advantages of modeling known structure, and suggests that our models learn to infer meaningful names and to solve the VARMISUSE task in many cases. Additionally, our testing showed that VARMISUSE identifies a number of bugs in mature open-source projects. ",
73
+ "bbox": [
74
+ 233,
75
+ 446,
76
+ 764,
77
+ 584
78
+ ],
79
+ "page_idx": 0
80
+ },
81
+ {
82
+ "type": "text",
83
+ "text": "1 INTRODUCTION ",
84
+ "text_level": 1,
85
+ "bbox": [
86
+ 176,
87
+ 612,
88
+ 334,
89
+ 627
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "The advent of large repositories of source code as well as scalable machine learning methods naturally leads to the idea of “big code”, i.e., largely unsupervised methods that support software engineers by generalizing from existing source code (Allamanis et al., 2017). Currently, existing deep learning models of source code capture its shallow, textual structure, e.g. as a sequence of tokens (Hindle et al., 2012; Raychev et al., 2014; Allamanis et al., 2016), as parse trees (Maddison & Tarlow, 2014; Bielik et al., 2016), or as a flat dependency networks of variables (Raychev et al., 2015). Such models miss out on the opportunity to capitalize on the rich and well-defined semantics of source code. In this work, we take a step to alleviate this by including two additional signal sources in source code: data flow and type hierarchies. We do this by encoding programs as graphs, in which edges represent syntactic relationships (e.g. “token before/after”) as well as semantic relationships (“variable last used/written here”, “formal parameter for argument is called stream”, etc.). Our key insight is that exposing these semantics explicitly as structured input to a machine learning model lessens the requirements on amounts of training data, model capacity and training regime and allows us to solve tasks that are beyond the current state of the art. ",
96
+ "bbox": [
97
+ 174,
98
+ 643,
99
+ 825,
100
+ 838
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "We explore two tasks to illustrate the advantages of exposing more semantic structure of programs. First, we consider the VARNAMING task (Allamanis et al., 2014; Raychev et al., 2015), in which given some source code, the “correct” variable name is inferred as a sequence of subtokens. This requires some understanding of how a variable is used, i.e., requires reasoning about lines of code far apart in the source file. Secondly, we introduce the variable misuse prediction task (VARMISUSE), in which the network aims to infer which variable should be used in a program location. To illustrate the task, Figure 1 shows a slightly simplified snippet of a bug our model detected in a popular open-source project. Specifically, instead of the variable clazz, variable first should have been used in the yellow highlighted slot. Existing static analysis methods cannot detect such issues, even though a software engineer would easily identify this as an error from experience. ",
107
+ "bbox": [
108
+ 174,
109
+ 845,
110
+ 825,
111
+ 901
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "image",
117
+ "img_path": "images/1bc113e2a4c0fb9e0e51adeae6b01b6e7ddf6b162f6335e7e776d43b92e616d2.jpg",
118
+ "image_caption": [
119
+ "Figure 1: A snippet of a detected bug in RavenDB an open-source C# project. The code has been slightly simplified. Our model detects correctly that the variable used in the highlighted (yellow) slot is incorrect. Instead, first should have been placed at the slot. We reported this problem which was fixed in PR 4138. "
120
+ ],
121
+ "image_footnote": [],
122
+ "bbox": [
123
+ 169,
124
+ 102,
125
+ 825,
126
+ 214
127
+ ],
128
+ "page_idx": 1
129
+ },
130
+ {
131
+ "type": "text",
132
+ "text": "",
133
+ "bbox": [
134
+ 174,
135
+ 304,
136
+ 825,
137
+ 388
138
+ ],
139
+ "page_idx": 1
140
+ },
141
+ {
142
+ "type": "text",
143
+ "text": "To achieve high accuracy on these tasks, we need to learn representations of program semantics. For both tasks, we need to learn the semantic role of a variable (e.g., “is it a counter?”, “is it a filename?”). Additionally, for VARMISUSE, learning variable usage semantics (e.g., “a filename is needed here”) is required. This “fill the blank element” task is related to methods for learning distributed representations of natural language words, such as Word2Vec (Mikolov et al., 2013) and GLoVe (Pennington et al., 2014). However, we can learn from a much richer structure such as data flow information. This work is a step towards learning program representations, and we expect them to be valuable in a wide range of other tasks, such as code completion (“this is the variable you are looking for”) and more advanced bug finding (“you should lock before using this object”). ",
144
+ "bbox": [
145
+ 174,
146
+ 395,
147
+ 825,
148
+ 521
149
+ ],
150
+ "page_idx": 1
151
+ },
152
+ {
153
+ "type": "text",
154
+ "text": "To summarize, our contributions are: (i) We define the VARMISUSE task as a challenge for machine learning modeling of source code, that requires to learn (some) semantics of programs (cf. section 3). (ii) We present deep learning models for solving the VARNAMING and VARMISUSE tasks by modeling the code’s graph structure and learning program representations over those graphs (cf. section 4). (iii) We evaluate our models on a large dataset of 2.9 million lines of real-world source code, showing that our best model achieves $3 2 . 9 \\%$ accuracy on the VARNAMING task and $8 5 . 5 \\%$ accuracy on the VARMISUSE task, beating simpler baselines (cf. section 5). (iv) We document practical relevance of VARMISUSE by summarizing some bugs that we found in mature open-source software projects $( c f .$ subsection 5.3). Our implementation of graph neural networks (on a simpler task) can be found at https://github.com/Microsoft/gated-graph-neural-network-samples and the dataset can be found at https://aka.ms/iclr18-prog-graphs-dataset. ",
155
+ "bbox": [
156
+ 173,
157
+ 526,
158
+ 826,
159
+ 680
160
+ ],
161
+ "page_idx": 1
162
+ },
163
+ {
164
+ "type": "text",
165
+ "text": "2 RELATED WORK ",
166
+ "text_level": 1,
167
+ "bbox": [
168
+ 176,
169
+ 710,
170
+ 344,
171
+ 728
172
+ ],
173
+ "page_idx": 1
174
+ },
175
+ {
176
+ "type": "text",
177
+ "text": "Our work builds upon the recent field of using machine learning for source code artifacts (Allamanis et al., 2017). For example, Hindle et al. (2012); Bhoopchand et al. (2016) model the code as a sequence of tokens, while Maddison & Tarlow (2014); Raychev et al. (2016) model the syntax tree structure of code. All works on language models of code find that predicting variable and method identifiers is one of biggest challenges in the task. ",
178
+ "bbox": [
179
+ 174,
180
+ 750,
181
+ 825,
182
+ 819
183
+ ],
184
+ "page_idx": 1
185
+ },
186
+ {
187
+ "type": "text",
188
+ "text": "Closest to our work is the work of Allamanis et al. (2015) who learn distributed representations of variables using all their usages to predict their names. However, they do not use data flow information and we are not aware of any model that does so. Raychev et al. (2015) and Bichsel et al. (2016) use conditional random fields to model a variety of relationships between variables, AST elements and types to predict variable names and types (resp. to deobfuscate Android apps), but without considering the flow of data explicitly. In these works, all variable usages are deterministically known beforehand (as the code is complete and remains unmodified), as in Allamanis et al. (2014; 2015). ",
189
+ "bbox": [
190
+ 174,
191
+ 825,
192
+ 825,
193
+ 924
194
+ ],
195
+ "page_idx": 1
196
+ },
197
+ {
198
+ "type": "text",
199
+ "text": "Our work is remotely related to work on program synthesis using sketches (Solar-Lezama, 2008) and automated code transplantation (Barr et al., 2015). However, these approaches require a set of specifications (e.g. input-output examples, test suites) to complete the gaps, rather than statistics learned from big code. These approaches can be thought as complementary to ours, since we learn to statistically complete the gaps without any need for specifications, by learning common variable usage patterns from code. ",
200
+ "bbox": [
201
+ 174,
202
+ 103,
203
+ 825,
204
+ 186
205
+ ],
206
+ "page_idx": 2
207
+ },
208
+ {
209
+ "type": "text",
210
+ "text": "Neural networks on graphs (Gori et al., 2005; Li et al., 2015; Defferrard et al., 2016; Kipf & Welling, 2016; Gilmer et al., 2017) adapt a variety of deep learning methods to graph-structured input. They have been used in a series of applications, such as link prediction and classification (Grover & Leskovec, 2016) and semantic role labeling in NLP (Marcheggiani & Titov, 2017). Somewhat related to source code is the work of Wang et al. (2017) who learn graph-based representations of mathematical formulas for premise selection in theorem proving. ",
211
+ "bbox": [
212
+ 174,
213
+ 194,
214
+ 825,
215
+ 279
216
+ ],
217
+ "page_idx": 2
218
+ },
219
+ {
220
+ "type": "text",
221
+ "text": "3 THE VARMISUSE TASK ",
222
+ "text_level": 1,
223
+ "bbox": [
224
+ 176,
225
+ 304,
226
+ 400,
227
+ 320
228
+ ],
229
+ "page_idx": 2
230
+ },
231
+ {
232
+ "type": "text",
233
+ "text": "Detecting variable misuses in code is a task that requires understanding and reasoning about program semantics. To successfully tackle the task one needs to infer the role and function of the program elements and understand how they relate. For example, given a program such as Fig. 1, the task is to automatically detect that the marked use of $\\mathtt { C 1 a z z }$ is a mistake and that first should be used instead. While this task resembles standard code completion, it differs significantly in its scope and purpose, by considering only variable identifiers and a mostly complete program. ",
234
+ "bbox": [
235
+ 174,
236
+ 339,
237
+ 825,
238
+ 422
239
+ ],
240
+ "page_idx": 2
241
+ },
242
+ {
243
+ "type": "text",
244
+ "text": "Task Description We view a source code file as a sequence of tokens $t _ { 0 } \\ldots t _ { N } = \\mathcal { T }$ , in which some tokens $t _ { \\lambda _ { 0 } } , t _ { \\lambda _ { 1 } } \\ldots$ are variables. Furthermore, let $\\mathbb { V } _ { t } \\subset \\mathbb { V }$ refer to the set of all type-correct variables in scope at the location of $t$ , i.e., those variables that can be used at $t$ without raising a compiler error. We call a token $t o k _ { \\lambda }$ where we want to predict the correct variable usage a slot. We define a separate task for each slot $t _ { \\lambda }$ : Given $t _ { 0 } \\ldots t _ { \\lambda - 1 }$ and $t _ { \\lambda + 1 } , \\dots , t _ { N }$ , correctly select $t _ { \\lambda }$ from $\\mathbb { V } _ { t _ { \\lambda } }$ . For training and evaluation purposes, a correct solution is one that simply matches the ground truth, but note that in practice, several possible assignments could be considered correct (i.e., when several variables refer to the same value in memory). ",
245
+ "bbox": [
246
+ 174,
247
+ 444,
248
+ 825,
249
+ 556
250
+ ],
251
+ "page_idx": 2
252
+ },
253
+ {
254
+ "type": "text",
255
+ "text": "4 MODEL: PROGRAMS AS GRAPHS ",
256
+ "text_level": 1,
257
+ "bbox": [
258
+ 174,
259
+ 582,
260
+ 478,
261
+ 598
262
+ ],
263
+ "page_idx": 2
264
+ },
265
+ {
266
+ "type": "text",
267
+ "text": "In this section, we discuss how to transform program source code into program graphs and learn representations over them. These program graphs not only encode the program text but also the semantic information that can be obtained using standard compiler tools. ",
268
+ "bbox": [
269
+ 174,
270
+ 617,
271
+ 823,
272
+ 659
273
+ ],
274
+ "page_idx": 2
275
+ },
276
+ {
277
+ "type": "text",
278
+ "text": "Gated Graph Neural Networks Our work builds on Gated Graph Neural Networks (Li et al., 2015) (GGNN) and we summarize them here. A graph $\\mathcal { G } = ( \\nu , \\pmb { \\varepsilon } , \\pmb { X } )$ is composed of a set of nodes $\\nu$ , node features $\\boldsymbol { X }$ , and a list of directed edge sets $\\pmb { \\mathcal { E } } = ( \\mathcal { E } _ { 1 } , \\ldots , \\mathcal { E } _ { K } )$ where $K$ is the number of edge types. We annotate each $v \\in \\mathcal V$ with a real-valued vector $\\pmb { x } ^ { ( v ) } \\in \\mathbb { R } ^ { D }$ representing the features of the node (e.g., the embedding of a string label of that node). ",
279
+ "bbox": [
280
+ 174,
281
+ 680,
282
+ 825,
283
+ 752
284
+ ],
285
+ "page_idx": 2
286
+ },
287
+ {
288
+ "type": "text",
289
+ "text": "We associate every node $v$ with a state vector $\\mathbf { \\Omega } _ { h } ( v )$ , initialized from the node label $\\pmb { x } ^ { ( v ) }$ . The sizes of the state vector and feature vector are typically the same, but we can use larger state vectors through padding of node features. To propagate information throughout the graph, “messages” of type $k$ are sent from each $v$ to its neighbors, where each message is computed from its current state vector as m(vk $m _ { k } ^ { ( v ) } = f _ { k } ( { \\pmb h } ^ { ( v ) } )$ . Here, $f _ { k }$ can be an arbitrary function; we choose a linear layer in our case. By computing messages for all graph edges at the same time, all states can be updated at the same time. In particular, a new state for a node $v$ is computed by aggregating all incoming messages as $\\tilde { m } ^ { ( v ) } = g ( \\{ m _ { k } ^ { ( u ) } \\ |$ there is an edge of type $k$ from $u$ to $v \\}$ ). $g$ is an aggregation function, which we implement as elementwise summation. Given the aggregated message $\\tilde { m } ^ { ( v ) }$ and the current state vector $\\mathbf { \\Omega } _ { h } ( v )$ of node $v$ , the state of the next time step $\\boldsymbol { h ^ { \\prime } } ^ { ( v ) }$ is computed as $\\pmb { h } ^ { \\prime ( v ) } = \\mathbf { G } \\mathbf { R } \\mathbf { U } ( \\tilde { \\pmb { m } } ^ { ( v ) } , \\pmb { h } ^ { ( v ) } )$ , where GRU is the recurrent cell function of gated recurrent unit (GRU) (Cho et al., 2014). The ",
290
+ "bbox": [
291
+ 174,
292
+ 758,
293
+ 825,
294
+ 924
295
+ ],
296
+ "page_idx": 2
297
+ },
298
+ {
299
+ "type": "text",
300
+ "text": "(a) Simplified syntax graph for line 2 of Fig. 1, where blue rounded boxes are syntax nodes, black rectangular boxes syntax tokens, blue edges Child edges and double black edges NextToken edges. ",
301
+ "bbox": [
302
+ 173,
303
+ 219,
304
+ 482,
305
+ 270
306
+ ],
307
+ "page_idx": 3
308
+ },
309
+ {
310
+ "type": "image",
311
+ "img_path": "images/f0957bde3bf55bfd9fc41e58429404103dadf9736f4a693bec1cc3c471bc40e7.jpg",
312
+ "image_caption": [
313
+ "Figure 2: Examples of graph edges used in program representation. "
314
+ ],
315
+ "image_footnote": [],
316
+ "bbox": [
317
+ 196,
318
+ 114,
319
+ 459,
320
+ 215
321
+ ],
322
+ "page_idx": 3
323
+ },
324
+ {
325
+ "type": "image",
326
+ "img_path": "images/83a96cffbd0f2a1c8368982c7c4bae4e01f2122dfee415273de350b2c11528e5.jpg",
327
+ "image_caption": [],
328
+ "image_footnote": [],
329
+ "bbox": [
330
+ 522,
331
+ 102,
332
+ 771,
333
+ 198
334
+ ],
335
+ "page_idx": 3
336
+ },
337
+ {
338
+ "type": "text",
339
+ "text": "(b) Data flow edges for $\\begin{array} { r l r } { ( \\overline { { \\bf x } } ) ^ { 1 } , \\overline { { \\boldsymbol { \\mathbf { y } } } } } & { { } = } & { \\bf F o o ( \\begin{array} { l } { ) } \\ ; } \\end{array} \\end{array}$ while $\\left. \\overline { { \\mathbf { x } } } \\right. ^ { 3 } \\ > \\ \\mathsf { 0 } .$ ) $\\underline { { \\nabla } } \\mathbf { \\Sigma } ^ { 4 } \\mathbf { \\Sigma } = \\underline { { \\nabla } } \\mathbf { \\bar { x } } \\mathbf { \\Sigma } ^ { 5 } \\mathbf { \\Sigma } ^ { \\subset } \\mathbf { \\Sigma } \\boxed { \\nabla } \\mathbf { \\bar { y } } \\mathbf { \\Sigma } ^ { 6 }$ (indices added for clarity), with red dotted LastUse edges, green dashed LastWrite edges and dashdotted purple ComputedFrom edges. ",
340
+ "bbox": [
341
+ 516,
342
+ 205,
343
+ 825,
344
+ 270
345
+ ],
346
+ "page_idx": 3
347
+ },
348
+ {
349
+ "type": "text",
350
+ "text": "dynamics defined by the above equations are repeated for a fixed number of time steps. Then, we use the state vectors from the last time step as the node representations.1 ",
351
+ "bbox": [
352
+ 173,
353
+ 314,
354
+ 821,
355
+ 342
356
+ ],
357
+ "page_idx": 3
358
+ },
359
+ {
360
+ "type": "text",
361
+ "text": "Program Graphs We represent program source code as graphs and use different edge types to model syntactic and semantic relationships between different tokens. The backbone of a program graph is the program’s abstract syntax tree (AST), consisting of syntax nodes (corresponding to nonterminals in the programming language’s grammar) and syntax tokens (corresponding to terminals). We label syntax nodes with the name of the nonterminal from the program’s grammar, whereas syntax tokens are labeled with the string that they represent. We use Child edges to connect nodes according to the AST. As this does not induce an order on children of a syntax node, we additionally add NextToken edges connecting each syntax token to its successor. An example of this is shown in Fig. 2a. ",
362
+ "bbox": [
363
+ 173,
364
+ 366,
365
+ 825,
366
+ 492
367
+ ],
368
+ "page_idx": 3
369
+ },
370
+ {
371
+ "type": "text",
372
+ "text": "To capture the flow of control and data through a program, we add additional edges connecting different uses and updates of syntax tokens corresponding to variables. For such a token $v$ , let $\\mathcal { D } ^ { R } ( v )$ be the set of syntax tokens at which the variable could have been used last. This set may contain several nodes (for example, when using a variable after a conditional in which it was used in both branches), and even syntax tokens that follow in the program code (in the case of loops). Similarly, let $\\mathcal { D } ^ { W } ( v )$ be the set of syntax tokens at which the variable was last written to. Using these, we add LastRead (resp. LastWrite) edges connecting $v$ to all elements of $\\mathcal { D } ^ { R } ( v )$ (resp. $\\tilde { \\mathcal { D } } ^ { W } ( v ) )$ . Additionally, whenever we observe an assignment $v = e x p r$ , we connect $v$ to all variable tokens occurring in expr using ComputedFrom edges. An example of such semantic edges is shown in Fig. 2b. ",
373
+ "bbox": [
374
+ 173,
375
+ 498,
376
+ 825,
377
+ 637
378
+ ],
379
+ "page_idx": 3
380
+ },
381
+ {
382
+ "type": "text",
383
+ "text": "We extend the graph to chain all uses of the same variable using LastLexicalUse edges (independent of data flow, i.e., in if (...) { ... v ...} else { ... v ...}, we link the two occurrences of $v$ ). We also connect return tokens to the method declaration using ReturnsTo edges (this creates a “shortcut” to its name and type). Inspired by Rice et al. (2017), we connect arguments in method calls to the formal parameters that they are matched to with FormalArgName edges, i.e., if we observe a call Foo(bar) and a method declaration Foo(InputStream stream), we connect the bar token to the stream token. Finally, we connect every token corresponding to a variable to enclosing guard expressions that use the variable with GuardedBy and GuardedByNegation edges. For example, in if ( $\\mathrm { ~ \\bf ~ \\cdot ~ x ~ } > \\mathrm { ~ \\bf ~ y ~ }$ ) { ... x ...} else $\\{ \\ \\begin{array} { r l } { \\mathrm { ~ \\texttt ~ { ~ . ~ . ~ } ~ } \\underline { { \\mathrm { ~ y ~ } } } \\mathrm { ~ . ~ . ~ . ~ } \\} } \\end{array}$ , we add a GuardedBy edge from $\\underline { { \\boldsymbol { \\mathrm { X } } } }$ (resp. a GuardedByNegation edge from y) to the AST node corresponding to $\\mathrm { ~ ~ { ~ x ~ } ~ } > \\mathrm { ~ ~ { ~ y ~ } ~ }$ . ",
384
+ "bbox": [
385
+ 173,
386
+ 643,
387
+ 826,
388
+ 797
389
+ ],
390
+ "page_idx": 3
391
+ },
392
+ {
393
+ "type": "text",
394
+ "text": "Finally, for all types of edges we introduce their respective backwards edges (transposing the adjacency matrix), doubling the number of edges and edge types. Backwards edges help with propagating information faster across the GGNN and make the model more expressive. ",
395
+ "bbox": [
396
+ 176,
397
+ 804,
398
+ 823,
399
+ 847
400
+ ],
401
+ "page_idx": 3
402
+ },
403
+ {
404
+ "type": "text",
405
+ "text": "Leveraging Variable Type Information We assume a statically typed language and that the source code can be compiled, and thus each variable has a (known) type $\\tau ( v )$ . To use it, we define a learnable embedding function $\\mathbf { r } ( \\tau )$ for known types and additionally define an “UNKTYPE” for all unknown/unrepresented types. We also leverage the rich type hierarchy that is available in many object-oriented languages. For this, we map a variable’s type $\\tau ( v )$ to the set of its supertypes, i.e. $\\tau ^ { * } \\bar { ( } v ) = \\{ \\tau : \\tau ( v ) \\quad$ implements type $\\tau \\} \\cup \\{ \\bar { \\tau } ( v ) \\}$ . We then compute the type representation $\\mathbf { r } ^ { * } ( v )$ of a variable $v$ as the element-wise maximum of $\\{ \\mathbf { r } ( \\tau ) : \\tau \\in \\tau ^ { * } ( v ) \\}$ . We chose the maximum here, as it is a natural pooling operation for representing partial ordering relations (such as type lattices). Using all types in $\\tau ^ { * } ( v )$ allows us to generalize to unseen types that implement common supertypes or interfaces. For example, List ${ \\tt < K > }$ has multiple concrete types (e.g. List<int>, List<string>). Nevertheless, these types implement a common interface (IList) and share common characteristics. During training, we randomly select a non-empty subset of $\\tau ^ { * } ( v )$ which ensures training of all known types in the lattice. This acts both like a dropout mechanism and allows us to learn a good representation for all types in the type lattice. ",
406
+ "bbox": [
407
+ 174,
408
+ 103,
409
+ 825,
410
+ 297
411
+ ],
412
+ "page_idx": 4
413
+ },
414
+ {
415
+ "type": "text",
416
+ "text": "Initial Node Representation To compute the initial node state, we combine information from the textual representation of the token and its type. Concretely, we split the name of a node representing a token into subtokens (e.g. classTypes will be split into two subtokens class and types) on camelCase and pascal_case. We then average the embeddings of all subtokens to retrieve an embedding for the node name. Finally, we concatenate the learned type representation $\\mathbf { r } ^ { * } ( v )$ , computed as discussed earlier, with the node name representation, and pass it through a linear layer to obtain the initial representations for each node in the graph. ",
417
+ "bbox": [
418
+ 174,
419
+ 314,
420
+ 825,
421
+ 411
422
+ ],
423
+ "page_idx": 4
424
+ },
425
+ {
426
+ "type": "text",
427
+ "text": "Programs Graphs for VARNAMING Given a program and an existing variable $v$ , we build a program graph as discussed above and then replace the variable name in all corresponding variable tokens by a special ${ < } S \\mathrm { L O T } >$ token. To predict a name, we use the initial node labels computed as the concatenation of learnable token embeddings and type embeddings as discussed above, run GGNN propagation for 8 time steps2 and then compute a variable usage representation by averaging the representations for all ${ < } S \\mathrm { L O T } >$ tokens. This representation is then used as the initial state of a one-layer GRU, which predicts the target name as a sequence of subtokens (e.g., the name inputStreamBuffer is treated as the sequence [input, stream, buffer]). We train this graph2seq architecture using a maximum likelihood objective. In section 5, we report the accuracy for predicting the exact name and the F1 score for predicting its subtokens. ",
428
+ "bbox": [
429
+ 174,
430
+ 426,
431
+ 825,
432
+ 565
433
+ ],
434
+ "page_idx": 4
435
+ },
436
+ {
437
+ "type": "text",
438
+ "text": "Program Graphs for VARMISUSE To model VARMISUSE with program graphs we need to modify the graph. First, to compute a context representation $\\mathbf { } c ( t )$ for a slot $t$ where we want to predict the used variable, we insert a new node $v _ { < S \\tt L O T > }$ at the position of $t$ , corresponding to a “hole” at this point, and connect it to the remaining graph using all applicable edges that do not depend on the chosen variable at the slot (i.e., everything but LastUse, LastWrite, LastLexicalUse, and GuardedBy edges). Then, to compute the usage representation $\\mathbf { u } ( t , v )$ of each candidate variable $v$ at the target slot, we insert a “candidate” node $v _ { t , v }$ for all $v$ in $\\mathbb { V } _ { t }$ , and connect it to the graph by inserting the LastUse, LastWrite and LastLexicalUse edges that would be used if the variable were to be used at this slot. Each of these candidate nodes represents the speculative placement of the variable within the scope. ",
439
+ "bbox": [
440
+ 174,
441
+ 582,
442
+ 825,
443
+ 720
444
+ ],
445
+ "page_idx": 4
446
+ },
447
+ {
448
+ "type": "text",
449
+ "text": "Using the initial node representations, concatenated with an extra bit that is set to one for the candidate nodes $v _ { t , v }$ , we run GGNN propagation for 8 time steps.2 The context and usage representation are then the final node states of the nodes, i.e., $\\pmb { c } ( t ) = \\pmb { h } ^ { ( v _ { < \\mathrm { S L O T } > } ) }$ and $\\mathbf { u } ( t , v ) = h ^ { ( v _ { t , v } ) }$ . Finally, the correct variable usage at the location is computed as arg $\\textstyle \\operatorname* { m a x } _ { v } W [ c ( t ) , \\mathbf { u } ( t , v ) ]$ where $W$ is a linear layer that uses the concatenation of $\\mathbf { } c ( t )$ and $\\mathbf { u } ( t , v )$ . We train using a max-margin objective. ",
450
+ "bbox": [
451
+ 174,
452
+ 728,
453
+ 825,
454
+ 800
455
+ ],
456
+ "page_idx": 4
457
+ },
458
+ {
459
+ "type": "text",
460
+ "text": "4.1 IMPLEMENTATION ",
461
+ "text_level": 1,
462
+ "bbox": [
463
+ 174,
464
+ 818,
465
+ 341,
466
+ 832
467
+ ],
468
+ "page_idx": 4
469
+ },
470
+ {
471
+ "type": "text",
472
+ "text": "Using GGNNs for sets of large, diverse graphs requires some engineering effort, as efficient batching is hard in the presence of diverse shapes. An important observation is that large graphs are normally very sparse, and thus a representation of edges as an adjacency list would usually be advantageous to reduce memory consumption. In our case, this can be easily implemented using a sparse tensor representation, allowing large batch sizes that exploit the parallelism of modern GPUs efficiently. A second key insight is to represent a batch of graphs as one large graph with many disconnected components. This just requires appropriate pre-processing to make node identities unique. As this makes batch construction somewhat CPU-intensive, we found it useful to prepare minibatches on a separate thread. Our TensorFlow (Abadi et al., 2016) implementation scales to 55 graphs per second during training and 219 graphs per second during test-time using a single NVidia GeForce GTX Titan X with graphs having on average 2,228 (median 936) nodes and 8,350 (median 3,274) edges and 8 GGNN unrolling iterations, all 20 edge types (forward and backward edges for 10 original edge types) and the size of the hidden layer set to 64. The number of types of edges in the GGNN contributes proportionally to the running time. For example, a GGNN run for our ablation study using only the two most common edge types (NextToken, Child) achieves 105 graphs/second during training and 419 graphs/second at test time with the same hyperparameters. Our (generic) implementation of GGNNs is available at https://github.com/Microsoft/ gated-graph-neural-network-samples, using a simpler demonstration task. ",
473
+ "bbox": [
474
+ 176,
475
+ 843,
476
+ 825,
477
+ 900
478
+ ],
479
+ "page_idx": 4
480
+ },
481
+ {
482
+ "type": "text",
483
+ "text": "",
484
+ "bbox": [
485
+ 174,
486
+ 103,
487
+ 825,
488
+ 299
489
+ ],
490
+ "page_idx": 5
491
+ },
492
+ {
493
+ "type": "text",
494
+ "text": "5 EVALUATION ",
495
+ "text_level": 1,
496
+ "bbox": [
497
+ 176,
498
+ 348,
499
+ 313,
500
+ 364
501
+ ],
502
+ "page_idx": 5
503
+ },
504
+ {
505
+ "type": "text",
506
+ "text": "Dataset We collected a dataset for the VARMISUSE task from open source $C ^ { \\# }$ projects on GitHub. To select projects, we picked the top-starred (non-fork) projects in GitHub. We then filtered out projects that we could not (easily) compile in full using Roslyn3, as we require a compilation to extract precise type information for the code (including those types present in external libraries). Our final dataset contains 29 projects from a diverse set of domains (compilers, databases, . . . ) with about 2.9 million non-empty lines of code. A full table is shown in Appendix D. ",
507
+ "bbox": [
508
+ 174,
509
+ 397,
510
+ 825,
511
+ 481
512
+ ],
513
+ "page_idx": 5
514
+ },
515
+ {
516
+ "type": "text",
517
+ "text": "For the task of detecting variable misuses, we collect data from all projects by selecting all variable usage locations, filtering out variable declarations, where at least one other type-compatible replacement variable is in scope. The task is then to infer the correct variable that originally existed in that location. Thus, by construction there is at least one type-correct replacement variable, i.e. picking it would not raise an error during type checking. In our test datasets, at each slot there are on average 3.8 type-correct alternative variables (median 3, $\\sigma = 2 . 6$ ). ",
518
+ "bbox": [
519
+ 174,
520
+ 488,
521
+ 825,
522
+ 571
523
+ ],
524
+ "page_idx": 5
525
+ },
526
+ {
527
+ "type": "text",
528
+ "text": "From our dataset, we selected two projects as our development set. From the rest of the projects, we selected three projects for UNSEENPROJTEST to allow testing on projects with completely unknown structure and types. We split the remaining 23 projects into train/validation/test sets in the proportion 60-10-30, splitting along files (i.e., all examples from one source file are in the same set). We call the test set obtained like this SEENPROJTEST. ",
529
+ "bbox": [
530
+ 174,
531
+ 579,
532
+ 825,
533
+ 648
534
+ ],
535
+ "page_idx": 5
536
+ },
537
+ {
538
+ "type": "text",
539
+ "text": "Baselines For VARMISUSE, we consider two bidirectional RNN-based baselines. The local model (LOC) is a simple two-layer bidirectional GRU run over the tokens before and after the target location. For this baseline, $\\mathbf { } c ( t )$ is set to the slot representation computed by the RNN, and the usage context of each variable $\\mathbf { u } ( t , v )$ is the embedding of the name and type of the variable, computed in the same way as the initial node labels in the GGNN. This baseline allows us to evaluate how important the usage context information is for this task. The flat dataflow model (AVGBIRNN) is an extension to LOC, where the usage representation $\\mathbf { u } ( t , v )$ is computed using another two-layer bidirectional RNN run over the tokens before/after each usage, and then averaging over the computed representations at the variable token $v$ . The local context, $\\mathbf { } c ( t )$ , is identical to LOC. AVGBIRNN is a significantly stronger baseline that already takes some structural information into account, as the averaging over all variables usages helps with long-range dependencies. Both models pick the variable that maximizes $\\boldsymbol { c } ( t ) ^ { T } \\mathbf { u } ( t , v )$ . ",
540
+ "bbox": [
541
+ 173,
542
+ 694,
543
+ 825,
544
+ 861
545
+ ],
546
+ "page_idx": 5
547
+ },
548
+ {
549
+ "type": "text",
550
+ "text": "For VARNAMING, we replace LOC by AVGLBL, which uses a log-bilinear model for 4 left and 4 right context tokens of each variable usage, and then averages over these context representations (this corresponds to the model in Allamanis et al. (2015)). We also test AVGBIRNN on VARNAMING, which essentially replaces the log-bilinear context model by a bidirectional RNN. ",
551
+ "bbox": [
552
+ 174,
553
+ 867,
554
+ 825,
555
+ 924
556
+ ],
557
+ "page_idx": 5
558
+ },
559
+ {
560
+ "type": "table",
561
+ "img_path": "images/b50ee87c697642af7c15b71b6fc64db9212a957b4661dfb2395c47f5be19c8b6.jpg",
562
+ "table_caption": [
563
+ "Table 1: Evaluation of models. SEENPROJTEST refers to the test set containing projects that have files in the training set, UNSEENPROJTEST refers to projects that have no files in the training data. Results averaged over two runs. "
564
+ ],
565
+ "table_footnote": [],
566
+ "table_body": "<table><tr><td></td><td colspan=\"4\">SEENPROJTEST</td><td colspan=\"4\">UNSEENPROJTEST</td></tr><tr><td></td><td>Loc</td><td>AVGLBL</td><td>AVGBIRNN</td><td>GGNN</td><td>Loc</td><td>AVGLBL</td><td>AVGBIRNN</td><td>GGNN</td></tr><tr><td>VARMISUSE</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Accuracy (%)</td><td>50.0</td><td>二</td><td>73.7</td><td>85.5</td><td>28.9</td><td></td><td>60.2</td><td>78.2</td></tr><tr><td>PR AUC</td><td>0.788</td><td></td><td>0.941</td><td>0.980</td><td>0.611</td><td></td><td>0.895</td><td>0.958</td></tr><tr><td>VARNAMING Accuracy (%)</td><td></td><td>36.1</td><td>42.9</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td>53.6</td><td></td><td>22.7</td><td>23.4</td><td>44.0</td></tr><tr><td>F1 (%)</td><td></td><td>44.0</td><td>50.1</td><td>65.8</td><td></td><td>30.6</td><td>32.0</td><td>62.0</td></tr></table>",
567
+ "bbox": [
568
+ 173,
569
+ 143,
570
+ 823,
571
+ 252
572
+ ],
573
+ "page_idx": 6
574
+ },
575
+ {
576
+ "type": "table",
577
+ "img_path": "images/0af154e3d64763ffe10fe3cdcde26c9644db9e9a108844942ce96db280c1e44b.jpg",
578
+ "table_caption": [
579
+ "Table 2: Ablation study for the GGNN model on SEENPROJTEST for the two tasks. "
580
+ ],
581
+ "table_footnote": [],
582
+ "table_body": "<table><tr><td>Ablation Description</td><td colspan=\"2\">Accuracy (%) VARMISUSE</td></tr><tr><td></td><td></td><td>VARNAMING</td></tr><tr><td>Standard Model (reported in Table 1)</td><td>85.5</td><td>53.6</td></tr><tr><td>Only NextToken, Child, LastUse_LastWrite edges</td><td>80.6</td><td>31.2</td></tr><tr><td>Only semantic edges (all but NextToken, Child) Only syntax edges (NextToken, Child)</td><td>78.4 55.3</td><td>52.9 34.3</td></tr><tr><td>Node Labels: Tokens instead of subtokens</td><td></td><td></td></tr><tr><td>Node Labels:Disabled</td><td>85.6 84.3</td><td>34.5</td></tr><tr><td></td><td></td><td>31.8</td></tr></table>",
583
+ "bbox": [
584
+ 241,
585
+ 282,
586
+ 756,
587
+ 412
588
+ ],
589
+ "page_idx": 6
590
+ },
591
+ {
592
+ "type": "text",
593
+ "text": "5.1 QUANTITATIVE EVALUATION ",
594
+ "text_level": 1,
595
+ "bbox": [
596
+ 176,
597
+ 438,
598
+ 416,
599
+ 453
600
+ ],
601
+ "page_idx": 6
602
+ },
603
+ {
604
+ "type": "text",
605
+ "text": "Table 1 shows the evaluation results of the models for both tasks.4 As LOC captures very little information, it performs relatively badly. AVGLBL and AVGBIRNN, which capture information from many variable usage sites, but do not explicitly encode the rich structure of the problem, still lag behind the GGNN by a wide margin. The performance difference is larger for VARMISUSE, since the structure and the semantics of code are far more important within this setting. ",
606
+ "bbox": [
607
+ 174,
608
+ 464,
609
+ 825,
610
+ 535
611
+ ],
612
+ "page_idx": 6
613
+ },
614
+ {
615
+ "type": "text",
616
+ "text": "Generalization to new projects Generalizing across a diverse set of source code projects with different domains is an important challenge in machine learning. We repeat the evaluation using the UNSEENPROJTEST set stemming from projects that have no files in the training set. The right side of Table 1 shows that our models still achieve good performance, although it is slightly lower compared to SEENPROJTEST. This is expected since the type lattice is mostly unknown in UNSEENPROJTEST. ",
617
+ "bbox": [
618
+ 174,
619
+ 551,
620
+ 825,
621
+ 621
622
+ ],
623
+ "page_idx": 6
624
+ },
625
+ {
626
+ "type": "text",
627
+ "text": "We believe that the dominant problem in applying a trained model to an unknown project (i.e., domain) is the fact that its type hierarchy is unknown and the used vocabulary (e.g. in variables, method and class names, etc.) can differ substantially. ",
628
+ "bbox": [
629
+ 176,
630
+ 627,
631
+ 823,
632
+ 670
633
+ ],
634
+ "page_idx": 6
635
+ },
636
+ {
637
+ "type": "text",
638
+ "text": "Ablation Study To study the effect of some of the design choices for our models, we have run some additional experiments and show their results in Table 2. First, we varied the edges used in the program graph. We find that restricting the model to syntactic information has a large impact on performance on both tasks, whereas restricting it to semantic edges seems to mostly impact performance on VARMISUSE. Similarly, the ComputedFrom, FormalArgName and ReturnsTo edges give a small boost on VARMISUSE, but greatly improve performance on VARNAMING. As evidenced by the experiments with the node label representation, syntax node and token names seem to matter little for VARMISUSE, but naturally have a great impact on VARNAMING. ",
639
+ "bbox": [
640
+ 174,
641
+ 685,
642
+ 825,
643
+ 797
644
+ ],
645
+ "page_idx": 6
646
+ },
647
+ {
648
+ "type": "text",
649
+ "text": "5.2 QUALITATIVE EVALUATION ",
650
+ "text_level": 1,
651
+ "bbox": [
652
+ 176,
653
+ 815,
654
+ 405,
655
+ 830
656
+ ],
657
+ "page_idx": 6
658
+ },
659
+ {
660
+ "type": "text",
661
+ "text": "Figure 3 illustrates the predictions that GGNN makes on a sample test snippet. The snippet recursively searches for the global directives file by gradually descending into the root folder. Reasoning about the correct variable usages is hard, even for humans, but the GGNN correctly predicts the variable usages at all locations except two (slot 1 and 8). As a software engineer is writing the code, it is imaginable that she may make a mistake misusing one variable in the place of another. Since all variables are string variables, no type errors will be raised. As the probabilities in Fig. 3 suggest most potential variable misuses can be flagged by the model yielding valuable warnings to software engineers. Additional samples with comments can be found in Appendix B. ",
662
+ "bbox": [
663
+ 176,
664
+ 842,
665
+ 823,
666
+ 885
667
+ ],
668
+ "page_idx": 6
669
+ },
670
+ {
671
+ "type": "image",
672
+ "img_path": "images/cd8c9c73a863608276a7923a4347ae44724d33325aed2f76dd26669048968bd2.jpg",
673
+ "image_caption": [
674
+ "Figure 3: VARMISUSE predictions on slots within a snippet of the SEENPROJTEST set for the ServiceStack project. Additional visualizations are available in Appendix B. The underlined tokens are the correct tokens. The model has to select among a number of string variables at each slot, where all of them represent some kind of path. The GGNN accurately predicts the correct variable usage in 11 out of the 13 slots reasoning about the complex ways the variables interact among them. "
675
+ ],
676
+ "image_footnote": [],
677
+ "bbox": [
678
+ 169,
679
+ 106,
680
+ 828,
681
+ 392
682
+ ],
683
+ "page_idx": 7
684
+ },
685
+ {
686
+ "type": "image",
687
+ "img_path": "images/1a46d813f5e2a8d4ca1585320818302c03d99347f9237a6ad178e6da4a0a1573.jpg",
688
+ "image_caption": [
689
+ "Figure 4: A bug found (yellow) in RavenDB open-source project. The code unnecessarily ensures that the buffer is of size length rather than size (which our model predicts as the correct variable here). "
690
+ ],
691
+ "image_footnote": [],
692
+ "bbox": [
693
+ 169,
694
+ 497,
695
+ 818,
696
+ 560
697
+ ],
698
+ "page_idx": 7
699
+ },
700
+ {
701
+ "type": "text",
702
+ "text": "",
703
+ "bbox": [
704
+ 174,
705
+ 637,
706
+ 825,
707
+ 708
708
+ ],
709
+ "page_idx": 7
710
+ },
711
+ {
712
+ "type": "text",
713
+ "text": "Furthermore, Appendix C shows samples of pairs of code snippets that share similar representations as computed by the cosine similarity of the usage representation $\\mathbf { u } ( t , v )$ of GGNN. The reader can notice that the network learns to group variable usages that share semantic similarities together. For example, checking for null before the use of a variable yields similar distributed representations across code segments (Sample 1 in Appendix C). ",
714
+ "bbox": [
715
+ 174,
716
+ 715,
717
+ 825,
718
+ 785
719
+ ],
720
+ "page_idx": 7
721
+ },
722
+ {
723
+ "type": "text",
724
+ "text": "5.3 DISCOVERED VARIABLE MISUSE BUGS ",
725
+ "text_level": 1,
726
+ "bbox": [
727
+ 176,
728
+ 804,
729
+ 486,
730
+ 819
731
+ ],
732
+ "page_idx": 7
733
+ },
734
+ {
735
+ "type": "text",
736
+ "text": "We have used our VARMISUSE model to identify likely locations of bugs in RavenDB (a document database) and Roslyn (Microsoft’s $C ^ { \\# }$ compiler framework). For this, we manually reviewed a sample of the top 500 locations in both projects where our model was most confident about a choosing a variable differing from the ground truth, and found three bugs in each of the projects. ",
737
+ "bbox": [
738
+ 174,
739
+ 830,
740
+ 825,
741
+ 888
742
+ ],
743
+ "page_idx": 7
744
+ },
745
+ {
746
+ "type": "text",
747
+ "text": "Figs. 1,4,5 show the issues discovered in RavenDB. The bug in Fig. 1 was possibly caused by copy-pasting, and cannot be easily caught by traditional methods. A compiler will not warn about unused variables (since first is used) and virtually nobody would write a test testing another test. Fig. 4 shows an issue that, although not critical, can lead to increased memory consumption. Fig. 5 shows another issue arising from a non-informative error message. We privately reported three additional bugs to the Roslyn developers, who have fixed the issues in the meantime (cf. https://github.com/dotnet/roslyn/pull/23437). One of the reported bugs could cause a crash in Visual Studio when using certain Roslyn features. ",
748
+ "bbox": [
749
+ 174,
750
+ 895,
751
+ 823,
752
+ 924
753
+ ],
754
+ "page_idx": 7
755
+ },
756
+ {
757
+ "type": "image",
758
+ "img_path": "images/336e106c897c8cfa8eb64fc3ca64fbd06fdd03a060af8c210b6cbadf7e1fcc42.jpg",
759
+ "image_caption": [
760
+ "Figure 5: A bug found (yellow) in the RavenDB open-source project. Although backupFilename is found to be invalid by IsValidBackup, the user is notified that backupLocation is invalid instead. "
761
+ ],
762
+ "image_footnote": [],
763
+ "bbox": [
764
+ 171,
765
+ 102,
766
+ 826,
767
+ 170
768
+ ],
769
+ "page_idx": 8
770
+ },
771
+ {
772
+ "type": "text",
773
+ "text": "",
774
+ "bbox": [
775
+ 173,
776
+ 242,
777
+ 826,
778
+ 327
779
+ ],
780
+ "page_idx": 8
781
+ },
782
+ {
783
+ "type": "text",
784
+ "text": "Finding these issues in widely released and tested code suggests that our model can be useful during the software development process, complementing classic program analysis tools. For example, one usage scenario would be to guide the code reviewing process to locations a VARMISUSE model has identified as unusual, or use it as a prior to focus testing or expensive code analysis efforts. ",
785
+ "bbox": [
786
+ 174,
787
+ 334,
788
+ 825,
789
+ 390
790
+ ],
791
+ "page_idx": 8
792
+ },
793
+ {
794
+ "type": "text",
795
+ "text": "6 DISCUSSION & CONCLUSIONS ",
796
+ "text_level": 1,
797
+ "bbox": [
798
+ 176,
799
+ 409,
800
+ 459,
801
+ 425
802
+ ],
803
+ "page_idx": 8
804
+ },
805
+ {
806
+ "type": "text",
807
+ "text": "Although source code is well understood and studied within other disciplines such as programming language research, it is a relatively new domain for deep learning. It presents novel opportunities compared to textual or perceptual data, as its (local) semantics are well-defined and rich additional information can be extracted using well-known, efficient program analyses. On the other hand, integrating this wealth of structured information poses an interesting challenge. Our VARMISUSE task exposes these opportunities, going beyond simpler tasks such as code completion. We consider it as a first proxy for the core challenge of learning the meaning of source code, as it requires to probabilistically refine standard information included in type systems. ",
808
+ "bbox": [
809
+ 174,
810
+ 440,
811
+ 825,
812
+ 553
813
+ ],
814
+ "page_idx": 8
815
+ },
816
+ {
817
+ "type": "text",
818
+ "text": "REFERENCES ",
819
+ "text_level": 1,
820
+ "bbox": [
821
+ 174,
822
+ 574,
823
+ 285,
824
+ 588
825
+ ],
826
+ "page_idx": 8
827
+ },
828
+ {
829
+ "type": "text",
830
+ "text": "Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016. \nMiltiadis Allamanis, Earl T Barr, Christian Bird, and Charles Sutton. Learning natural coding conventions. In Foundations of Software Engineering (FSE), 2014. \nMiltiadis Allamanis, Earl T Barr, Christian Bird, and Charles Sutton. Suggesting accurate method and class names. In Foundations of Software Engineering (FSE), 2015. \nMiltiadis Allamanis, Hao Peng, and Charles Sutton. A convolutional attention network for extreme summarization of source code. In International Conference on Machine Learning (ICML), pp. 2091–2100, 2016. \nMiltiadis Allamanis, Earl T Barr, Premkumar Devanbu, and Charles Sutton. A survey of machine learning for big code and naturalness. arXiv preprint arXiv:1709.06182, 2017. \nEarl T Barr, Mark Harman, Yue Jia, Alexandru Marginean, and Justyna Petke. Automated software transplantation. In International Symposium on Software Testing and Analysis (ISSTA), 2015. \nAl Bessey, Ken Block, Ben Chelf, Andy Chou, Bryan Fulton, Seth Hallem, Charles Henri-Gros, Asya Kamsky, Scott McPeak, and Dawson Engler. A few billion lines of code later: using static analysis to find bugs in the real world. Communications of the ACM, 53(2):66–75, 2010. \nAvishkar Bhoopchand, Tim Rocktäschel, Earl Barr, and Sebastian Riedel. Learning Python code suggestion with a sparse pointer network. arXiv preprint arXiv:1611.08307, 2016. ",
831
+ "bbox": [
832
+ 171,
833
+ 594,
834
+ 826,
835
+ 926
836
+ ],
837
+ "page_idx": 8
838
+ },
839
+ {
840
+ "type": "text",
841
+ "text": "Benjamin Bichsel, Veselin Raychev, Petar Tsankov, and Martin Vechev. Statistical deobfuscation of android applications. In Conference on Computer and Communications Security (CCS), 2016. ",
842
+ "bbox": [
843
+ 171,
844
+ 103,
845
+ 825,
846
+ 132
847
+ ],
848
+ "page_idx": 9
849
+ },
850
+ {
851
+ "type": "text",
852
+ "text": "Pavol Bielik, Veselin Raychev, and Martin Vechev. PHOG: probabilistic model for code. In International Conference on Machine Learning (ICML), 2016. ",
853
+ "bbox": [
854
+ 173,
855
+ 140,
856
+ 823,
857
+ 170
858
+ ],
859
+ "page_idx": 9
860
+ },
861
+ {
862
+ "type": "text",
863
+ "text": "Kyunghyun Cho, Bart van Merriënboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties of neural machine translation: Encoder–decoder approaches. Syntax, Semantics and Structure in Statistical Translation, 2014. ",
864
+ "bbox": [
865
+ 174,
866
+ 176,
867
+ 823,
868
+ 219
869
+ ],
870
+ "page_idx": 9
871
+ },
872
+ {
873
+ "type": "text",
874
+ "text": "Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Neural Information Processing Systems (NIPS), pp. 3844–3852, 2016. ",
875
+ "bbox": [
876
+ 174,
877
+ 227,
878
+ 823,
879
+ 270
880
+ ],
881
+ "page_idx": 9
882
+ },
883
+ {
884
+ "type": "text",
885
+ "text": "Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. arXiv preprint arXiv:1704.01212, 2017. ",
886
+ "bbox": [
887
+ 171,
888
+ 276,
889
+ 823,
890
+ 308
891
+ ],
892
+ "page_idx": 9
893
+ },
894
+ {
895
+ "type": "text",
896
+ "text": "Marco Gori, Gabriele Monfardini, and Franco Scarselli. A new model for learning in graph domains. In IEEE International Joint Conference Neural Networks (IJCNN). IEEE, 2005. ",
897
+ "bbox": [
898
+ 171,
899
+ 314,
900
+ 823,
901
+ 344
902
+ ],
903
+ "page_idx": 9
904
+ },
905
+ {
906
+ "type": "text",
907
+ "text": "Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In International Conference on Knowledge Discovery and Data Mining (SIGKDD), pp. 855–864. ACM, 2016. ",
908
+ "bbox": [
909
+ 174,
910
+ 351,
911
+ 825,
912
+ 381
913
+ ],
914
+ "page_idx": 9
915
+ },
916
+ {
917
+ "type": "text",
918
+ "text": "Abram Hindle, Earl T Barr, Zhendong Su, Mark Gabel, and Premkumar Devanbu. On the naturalness of software. In International Conference on Software Engineering (ICSE), 2012. ",
919
+ "bbox": [
920
+ 174,
921
+ 387,
922
+ 823,
923
+ 417
924
+ ],
925
+ "page_idx": 9
926
+ },
927
+ {
928
+ "type": "text",
929
+ "text": "Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016. ",
930
+ "bbox": [
931
+ 174,
932
+ 424,
933
+ 825,
934
+ 454
935
+ ],
936
+ "page_idx": 9
937
+ },
938
+ {
939
+ "type": "text",
940
+ "text": "Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. In International Conference on Learning Representations (ICLR), 2015. ",
941
+ "bbox": [
942
+ 174,
943
+ 460,
944
+ 823,
945
+ 491
946
+ ],
947
+ "page_idx": 9
948
+ },
949
+ {
950
+ "type": "text",
951
+ "text": "Chris J Maddison and Daniel Tarlow. Structured generative models of natural source code. In International Conference on Machine Learning (ICML), 2014. ",
952
+ "bbox": [
953
+ 176,
954
+ 497,
955
+ 823,
956
+ 526
957
+ ],
958
+ "page_idx": 9
959
+ },
960
+ {
961
+ "type": "text",
962
+ "text": "Diego Marcheggiani and Ivan Titov. Encoding sentences with graph convolutional networks for semantic role labeling. In ACL, 2017. ",
963
+ "bbox": [
964
+ 174,
965
+ 534,
966
+ 823,
967
+ 564
968
+ ],
969
+ "page_idx": 9
970
+ },
971
+ {
972
+ "type": "text",
973
+ "text": "Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Neural Information Processing Systems (NIPS), 2013. ",
974
+ "bbox": [
975
+ 173,
976
+ 570,
977
+ 823,
978
+ 613
979
+ ],
980
+ "page_idx": 9
981
+ },
982
+ {
983
+ "type": "text",
984
+ "text": "Jeffrey Pennington, Richard Socher, and Christopher D Manning. GloVe: Global vectors for word representation. In EMNLP, 2014. ",
985
+ "bbox": [
986
+ 173,
987
+ 621,
988
+ 823,
989
+ 651
990
+ ],
991
+ "page_idx": 9
992
+ },
993
+ {
994
+ "type": "text",
995
+ "text": "Veselin Raychev, Martin Vechev, and Eran Yahav. Code completion with statistical language models. In Programming Languages Design and Implementation (PLDI), pp. 419–428, 2014. ",
996
+ "bbox": [
997
+ 173,
998
+ 657,
999
+ 825,
1000
+ 688
1001
+ ],
1002
+ "page_idx": 9
1003
+ },
1004
+ {
1005
+ "type": "text",
1006
+ "text": "Veselin Raychev, Martin Vechev, and Andreas Krause. Predicting program properties from Big Code. In Principles of Programming Languages (POPL), 2015. ",
1007
+ "bbox": [
1008
+ 173,
1009
+ 694,
1010
+ 823,
1011
+ 724
1012
+ ],
1013
+ "page_idx": 9
1014
+ },
1015
+ {
1016
+ "type": "text",
1017
+ "text": "Veselin Raychev, Pavol Bielik, and Martin Vechev. Probabilistic model for code with decision trees. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2016. ",
1018
+ "bbox": [
1019
+ 173,
1020
+ 731,
1021
+ 823,
1022
+ 761
1023
+ ],
1024
+ "page_idx": 9
1025
+ },
1026
+ {
1027
+ "type": "text",
1028
+ "text": "Andrew Rice, Edward Aftandilian, Ciera Jaspan, Emily Johnston, Michael Pradel, and Yulissa Arroyo-Paredes. Detecting argument selection defects. Proceedings of the ACM on Programming Languages, 1(OOPSLA):104, 2017. ",
1029
+ "bbox": [
1030
+ 174,
1031
+ 767,
1032
+ 823,
1033
+ 811
1034
+ ],
1035
+ "page_idx": 9
1036
+ },
1037
+ {
1038
+ "type": "text",
1039
+ "text": "Michael Schlichtkrull, Thomas N. Kipf, Peter Bloem, Rianne van den Berg, Ivan Titov, and Max Welling. Modeling relational data with graph convolutional network. arXiv preprint arXiv:1703.06103, 2017. ",
1040
+ "bbox": [
1041
+ 173,
1042
+ 819,
1043
+ 821,
1044
+ 862
1045
+ ],
1046
+ "page_idx": 9
1047
+ },
1048
+ {
1049
+ "type": "text",
1050
+ "text": "Armando Solar-Lezama. Program synthesis by sketching. University of California, Berkeley, 2008. ",
1051
+ "bbox": [
1052
+ 171,
1053
+ 869,
1054
+ 823,
1055
+ 886
1056
+ ],
1057
+ "page_idx": 9
1058
+ },
1059
+ {
1060
+ "type": "text",
1061
+ "text": "Mingzhe Wang, Yihe Tang, Jian Wang, and Jia Deng. Premise selection for theorem proving by deep graph embedding. In Advances in Neural Information Processing Systems, pp. 2783–2793, 2017. ",
1062
+ "bbox": [
1063
+ 171,
1064
+ 892,
1065
+ 823,
1066
+ 921
1067
+ ],
1068
+ "page_idx": 9
1069
+ },
1070
+ {
1071
+ "type": "image",
1072
+ "img_path": "images/8d4734049cdf665102b0203edbfe7d102c214d1ca0e59c1e940ccf68db6434c3.jpg",
1073
+ "image_caption": [
1074
+ "Figure 6: Precision-Recall and ROC curves for the GGNN model on VARMISUSE. Note that the $y$ axis starts from $50 \\%$ . "
1075
+ ],
1076
+ "image_footnote": [],
1077
+ "bbox": [
1078
+ 171,
1079
+ 99,
1080
+ 823,
1081
+ 270
1082
+ ],
1083
+ "page_idx": 10
1084
+ },
1085
+ {
1086
+ "type": "table",
1087
+ "img_path": "images/dd6c7d57e2baa84336760f0c78a1b6a4a7c222370ffeb1c9b7940bd6dc5e4789.jpg",
1088
+ "table_caption": [
1089
+ "Table 3: Performance of GGNN model on VARMISUSE per number of type-correct, in-scope candidate variables. Here we compute the performance of the full GGNN model that uses subtokens. "
1090
+ ],
1091
+ "table_footnote": [],
1092
+ "table_body": "<table><tr><td># of candidates</td><td>2</td><td>3</td><td>4</td><td></td><td>6or7</td><td>8+</td></tr><tr><td>Accuracy On SEENPROJTEST (%)</td><td>91.6</td><td>84.5</td><td>81.8</td><td>78.6</td><td>75.1</td><td>77.5</td></tr><tr><td>Accuracy On UNSEENPROJTEST (%)</td><td>85.7</td><td>77.1</td><td>75.7</td><td>69.0</td><td>71.5</td><td>62.4</td></tr></table>",
1093
+ "bbox": [
1094
+ 218,
1095
+ 366,
1096
+ 779,
1097
+ 425
1098
+ ],
1099
+ "page_idx": 10
1100
+ },
1101
+ {
1102
+ "type": "text",
1103
+ "text": "A PERFORMANCE CURVES ",
1104
+ "text_level": 1,
1105
+ "bbox": [
1106
+ 178,
1107
+ 450,
1108
+ 413,
1109
+ 467
1110
+ ],
1111
+ "page_idx": 10
1112
+ },
1113
+ {
1114
+ "type": "text",
1115
+ "text": "Figure 6 shows the ROC and precision-recall curves for the GGNN model. As the reader may observe, setting a false positive rate to $10 \\%$ we get a true positive rate5 of $73 \\%$ for the SEENPROJTEST and $69 \\%$ for the unseen test. This suggests that this model can be practically used at a high precision setting with acceptable performance. ",
1116
+ "bbox": [
1117
+ 173,
1118
+ 483,
1119
+ 826,
1120
+ 540
1121
+ ],
1122
+ "page_idx": 10
1123
+ },
1124
+ {
1125
+ "type": "text",
1126
+ "text": "B VARMISUSE PREDICTION SAMPLES",
1127
+ "text_level": 1,
1128
+ "bbox": [
1129
+ 174,
1130
+ 563,
1131
+ 506,
1132
+ 579
1133
+ ],
1134
+ "page_idx": 10
1135
+ },
1136
+ {
1137
+ "type": "text",
1138
+ "text": "Below we list a set of samples from our SEENPROJTEST projects with comments about the model performance. Code comments and formatting may have been altered for typesetting reasons. The ground truth choice is underlined. ",
1139
+ "bbox": [
1140
+ 173,
1141
+ 595,
1142
+ 826,
1143
+ 638
1144
+ ],
1145
+ "page_idx": 10
1146
+ },
1147
+ {
1148
+ "type": "text",
1149
+ "text": "Sample 1 ",
1150
+ "text_level": 1,
1151
+ "bbox": [
1152
+ 173,
1153
+ 643,
1154
+ 240,
1155
+ 659
1156
+ ],
1157
+ "page_idx": 10
1158
+ },
1159
+ {
1160
+ "type": "image",
1161
+ "img_path": "images/abfe6409dabc3b628a3cb9baa2fdc14d3f39bb8b79f6efc499c55f175cb161d8.jpg",
1162
+ "image_caption": [],
1163
+ "image_footnote": [],
1164
+ "bbox": [
1165
+ 171,
1166
+ 664,
1167
+ 831,
1168
+ 858
1169
+ ],
1170
+ "page_idx": 10
1171
+ },
1172
+ {
1173
+ "type": "text",
1174
+ "text": ". The model correctly predicts all variables in the loop. ",
1175
+ "bbox": [
1176
+ 173,
1177
+ 868,
1178
+ 537,
1179
+ 883
1180
+ ],
1181
+ "page_idx": 10
1182
+ },
1183
+ {
1184
+ "type": "text",
1185
+ "text": "Sample 2 ",
1186
+ "text_level": 1,
1187
+ "bbox": [
1188
+ 173,
1189
+ 99,
1190
+ 241,
1191
+ 114
1192
+ ],
1193
+ "page_idx": 11
1194
+ },
1195
+ {
1196
+ "type": "image",
1197
+ "img_path": "images/67d1357095f3d80bff9433916647f24a7195c8a63c4dcc5ead0f08be17f5bdaf.jpg",
1198
+ "image_caption": [],
1199
+ "image_footnote": [],
1200
+ "bbox": [
1201
+ 171,
1202
+ 121,
1203
+ 830,
1204
+ 174
1205
+ ],
1206
+ "page_idx": 11
1207
+ },
1208
+ {
1209
+ "type": "text",
1210
+ "text": "#1 name: $86 \\%$ , DIR_PATH: $14 \\%$ #2 path: $90 \\%$ , name: $8 \\%$ , DIR_PATH: $2 \\%$ #3 path: $76 \\%$ , name: $16 \\%$ , DIR_PATH: $8 \\%$ ",
1211
+ "bbox": [
1212
+ 174,
1213
+ 183,
1214
+ 513,
1215
+ 234
1216
+ ],
1217
+ "page_idx": 11
1218
+ },
1219
+ {
1220
+ "type": "text",
1221
+ "text": "$\\triangleright$ String variables are not confused their semantic role is inferred correctly. ",
1222
+ "bbox": [
1223
+ 173,
1224
+ 246,
1225
+ 663,
1226
+ 261
1227
+ ],
1228
+ "page_idx": 11
1229
+ },
1230
+ {
1231
+ "type": "text",
1232
+ "text": "Sample 3 ",
1233
+ "text_level": 1,
1234
+ "bbox": [
1235
+ 173,
1236
+ 266,
1237
+ 240,
1238
+ 280
1239
+ ],
1240
+ "page_idx": 11
1241
+ },
1242
+ {
1243
+ "type": "text",
1244
+ "text": "[global::System.Diagnostics.DebuggerNonUserCodeAttribute] \npublic void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag $=$ input.ReadTag()) $\\ ! = ~ 0$ ) { switch(tag) { default: input.SkipLastField(); break; case 10: { #1 .AddEntriesFrom(input, _repeated_payload_codec); break; } } \n} ",
1245
+ "bbox": [
1246
+ 171,
1247
+ 289,
1248
+ 707,
1249
+ 484
1250
+ ],
1251
+ "page_idx": 11
1252
+ },
1253
+ {
1254
+ "type": "text",
1255
+ "text": "#1 Payload: $66 \\%$ , payload_: $44 \\%$ ",
1256
+ "bbox": [
1257
+ 186,
1258
+ 493,
1259
+ 464,
1260
+ 511
1261
+ ],
1262
+ "page_idx": 11
1263
+ },
1264
+ {
1265
+ "type": "text",
1266
+ "text": "$\\triangleright$ The model is commonly confused by aliases, i.e. variables that point to the same location in memory. \nIn this sample, either choice would have yielded identical behavior. ",
1267
+ "bbox": [
1268
+ 173,
1269
+ 522,
1270
+ 825,
1271
+ 551
1272
+ ],
1273
+ "page_idx": 11
1274
+ },
1275
+ {
1276
+ "type": "text",
1277
+ "text": "Sample 4 ",
1278
+ "text_level": 1,
1279
+ "bbox": [
1280
+ 173,
1281
+ 556,
1282
+ 241,
1283
+ 571
1284
+ ],
1285
+ "page_idx": 11
1286
+ },
1287
+ {
1288
+ "type": "image",
1289
+ "img_path": "images/a45880cd7de37c697125e92c3c541033a38ec7e20081fe1d6ce9b55998761b1c.jpg",
1290
+ "image_caption": [],
1291
+ "image_footnote": [],
1292
+ "bbox": [
1293
+ 169,
1294
+ 578,
1295
+ 828,
1296
+ 715
1297
+ ],
1298
+ "page_idx": 11
1299
+ },
1300
+ {
1301
+ "type": "text",
1302
+ "text": "#1 gate: $9 9 \\%$ , _observers: $1 \\%$ #2 _isDisposed: $90 \\%$ , _isStopped: $8 \\%$ , HasObservers: $2 \\%$ ",
1303
+ "bbox": [
1304
+ 173,
1305
+ 726,
1306
+ 671,
1307
+ 758
1308
+ ],
1309
+ "page_idx": 11
1310
+ },
1311
+ {
1312
+ "type": "text",
1313
+ "text": ". The ReturnsTo edge can help predict variables that otherwise would have been impossible. ",
1314
+ "bbox": [
1315
+ 166,
1316
+ 770,
1317
+ 785,
1318
+ 786
1319
+ ],
1320
+ "page_idx": 11
1321
+ },
1322
+ {
1323
+ "type": "text",
1324
+ "text": "Sample 5 ",
1325
+ "text_level": 1,
1326
+ "bbox": [
1327
+ 173,
1328
+ 99,
1329
+ 240,
1330
+ 114
1331
+ ],
1332
+ "page_idx": 12
1333
+ },
1334
+ {
1335
+ "type": "image",
1336
+ "img_path": "images/382d0a5b3bd9d9fd228858bebcaa0e6dfce97d4d8f24faa63d9010e590be558b.jpg",
1337
+ "image_caption": [],
1338
+ "image_footnote": [],
1339
+ "bbox": [
1340
+ 166,
1341
+ 121,
1342
+ 828,
1343
+ 534
1344
+ ],
1345
+ "page_idx": 12
1346
+ },
1347
+ {
1348
+ "type": "text",
1349
+ "text": "#1 error: $93 \\%$ , _exception: $7 \\%$ \n#2 error: $98 \\%$ , _exception: $2 \\%$ \n#3 _gate: $100 \\%$ , _observers: $0 \\%$ \n#4 isStopped: $86 \\%$ , _isDisposed: $13 \\%$ , HasObservers: $1 \\%$ \n#5 isStopped: $91 \\%$ , _isDisposed: $9 \\%$ , HasObservers: $0 \\%$ \n#6 _exception: $100 \\%$ , error: $0 \\%$ \n#7 error: $98 \\%$ , _exception: $2 \\%$ \n#8 _exception: $9 9 \\%$ , error: $1 \\%$ ",
1350
+ "bbox": [
1351
+ 174,
1352
+ 545,
1353
+ 679,
1354
+ 684
1355
+ ],
1356
+ "page_idx": 12
1357
+ },
1358
+ {
1359
+ "type": "text",
1360
+ "text": "$\\triangleright$ The model predicts the correct variables from all slots apart from the last. Reasoning about the last one, requires interprocedural understanding of the code across the class file. ",
1361
+ "bbox": [
1362
+ 171,
1363
+ 695,
1364
+ 825,
1365
+ 724
1366
+ ],
1367
+ "page_idx": 12
1368
+ },
1369
+ {
1370
+ "type": "text",
1371
+ "text": "Sample 6 ",
1372
+ "text_level": 1,
1373
+ "bbox": [
1374
+ 173,
1375
+ 99,
1376
+ 241,
1377
+ 114
1378
+ ],
1379
+ "page_idx": 13
1380
+ },
1381
+ {
1382
+ "type": "text",
1383
+ "text": "private bool BecomingCommand(object message) if (ReceiveCommand #1 return true; if #2 .ToString() $= =$ #3 #4 .Tell #5 else return false; return true; \n} ",
1384
+ "bbox": [
1385
+ 169,
1386
+ 122,
1387
+ 633,
1388
+ 219
1389
+ ],
1390
+ "page_idx": 13
1391
+ },
1392
+ {
1393
+ "type": "text",
1394
+ "text": "#1 message: $100 \\%$ , Response: $0 \\%$ , Message: $0 \\%$ #2 message: $100 \\%$ , Response: $0 \\%$ , Message: $0 \\%$ #3 Response: $91 \\%$ , Message: $9 \\%$ #4 Probe: $98 \\%$ , AskedForDelete: $2 \\%$ #5 Response: $98 \\%$ , Message: $2 \\%$ ",
1395
+ "bbox": [
1396
+ 174,
1397
+ 229,
1398
+ 571,
1399
+ 318
1400
+ ],
1401
+ "page_idx": 13
1402
+ },
1403
+ {
1404
+ "type": "text",
1405
+ "text": ". The model predicts correctly all usages except from the one in slot #3. Reasoning about this snippet requires additional semantic information about the intent of the code. ",
1406
+ "bbox": [
1407
+ 168,
1408
+ 329,
1409
+ 825,
1410
+ 357
1411
+ ],
1412
+ "page_idx": 13
1413
+ },
1414
+ {
1415
+ "type": "text",
1416
+ "text": "Sample 7 ",
1417
+ "text_level": 1,
1418
+ "bbox": [
1419
+ 173,
1420
+ 362,
1421
+ 240,
1422
+ 377
1423
+ ],
1424
+ "page_idx": 13
1425
+ },
1426
+ {
1427
+ "type": "text",
1428
+ "text": "var response $=$ ResultsFilter(typeof(TResponse), #1 #2 , request); ",
1429
+ "bbox": [
1430
+ 166,
1431
+ 385,
1432
+ 815,
1433
+ 404
1434
+ ],
1435
+ "page_idx": 13
1436
+ },
1437
+ {
1438
+ "type": "text",
1439
+ "text": "#1 httpMethod: $9 9 \\%$ , absoluteUrl: $1 \\%$ , UserName: $0 \\%$ , UserAgent: $0 \\%$ #2 absoluteUrl: $9 9 \\%$ , httpMethod: $1 \\%$ , UserName: $0 \\%$ , UserAgent: $0 \\%$ ",
1440
+ "bbox": [
1441
+ 194,
1442
+ 415,
1443
+ 758,
1444
+ 449
1445
+ ],
1446
+ "page_idx": 13
1447
+ },
1448
+ {
1449
+ "type": "text",
1450
+ "text": "$\\triangleright$ The model knows about selecting the correct string parameters because it matches them to the formal parameter names. ",
1451
+ "bbox": [
1452
+ 173,
1453
+ 460,
1454
+ 825,
1455
+ 489
1456
+ ],
1457
+ "page_idx": 13
1458
+ },
1459
+ {
1460
+ "type": "text",
1461
+ "text": "Sample 8 ",
1462
+ "text_level": 1,
1463
+ "bbox": [
1464
+ 173,
1465
+ 496,
1466
+ 241,
1467
+ 510
1468
+ ],
1469
+ "page_idx": 13
1470
+ },
1471
+ {
1472
+ "type": "text",
1473
+ "text": "if #1 $> =$ #2 ) throw new InvalidOperationException(Strings_Core.FAILED_CLOCK_MONITORING) ",
1474
+ "bbox": [
1475
+ 187,
1476
+ 517,
1477
+ 843,
1478
+ 547
1479
+ ],
1480
+ "page_idx": 13
1481
+ },
1482
+ {
1483
+ "type": "text",
1484
+ "text": "#1 n: $100 \\%$ , MAXERROR: $0 \\%$ , SYNC_MAXRETRIES: $0 \\%$ #2 MAXERROR: $62 \\%$ , SYNC_MAXRETRIES: $22 \\%$ , n: $16 \\%$ ",
1485
+ "bbox": [
1486
+ 174,
1487
+ 559,
1488
+ 596,
1489
+ 593
1490
+ ],
1491
+ "page_idx": 13
1492
+ },
1493
+ {
1494
+ "type": "text",
1495
+ "text": "$\\triangleright$ It is hard for the model to reason about conditionals, especially with rare constants as in slot #2. ",
1496
+ "bbox": [
1497
+ 163,
1498
+ 604,
1499
+ 812,
1500
+ 621
1501
+ ],
1502
+ "page_idx": 13
1503
+ },
1504
+ {
1505
+ "type": "text",
1506
+ "text": "C NEAREST NEIGHBOR OF GGNN USAGE REPRESENTATIONS ",
1507
+ "text_level": 1,
1508
+ "bbox": [
1509
+ 171,
1510
+ 101,
1511
+ 705,
1512
+ 118
1513
+ ],
1514
+ "page_idx": 14
1515
+ },
1516
+ {
1517
+ "type": "text",
1518
+ "text": "Here we show pairs of nearest neighbors based on the cosine similarity of the learned representations $\\mathbf { u } ( t , v )$ . Each slot $t$ is marked in dark blue and all usages of $v$ are marked in yellow (i.e. variableName ). This is a set of hand-picked examples showing good and bad examples. A brief description follows after each pair. ",
1519
+ "bbox": [
1520
+ 173,
1521
+ 217,
1522
+ 828,
1523
+ 276
1524
+ ],
1525
+ "page_idx": 14
1526
+ },
1527
+ {
1528
+ "type": "text",
1529
+ "text": "Sample 1 ",
1530
+ "text_level": 1,
1531
+ "bbox": [
1532
+ 173,
1533
+ 281,
1534
+ 240,
1535
+ 296
1536
+ ],
1537
+ "page_idx": 14
1538
+ },
1539
+ {
1540
+ "type": "image",
1541
+ "img_path": "images/3af9a60fadeb14347e4f874e0c1dc803122c0a76e9fdc856fd08d2c98658db62.jpg",
1542
+ "image_caption": [],
1543
+ "image_footnote": [],
1544
+ "bbox": [
1545
+ 165,
1546
+ 299,
1547
+ 831,
1548
+ 590
1549
+ ],
1550
+ "page_idx": 14
1551
+ },
1552
+ {
1553
+ "type": "text",
1554
+ "text": "$\\triangleright$ Slots that are checked for null-ness have similar representations. ",
1555
+ "bbox": [
1556
+ 171,
1557
+ 595,
1558
+ 606,
1559
+ 611
1560
+ ],
1561
+ "page_idx": 14
1562
+ },
1563
+ {
1564
+ "type": "text",
1565
+ "text": "Sample 2 ",
1566
+ "text_level": 1,
1567
+ "bbox": [
1568
+ 173,
1569
+ 616,
1570
+ 240,
1571
+ 631
1572
+ ],
1573
+ "page_idx": 14
1574
+ },
1575
+ {
1576
+ "type": "image",
1577
+ "img_path": "images/d1ada4fdbb0e1a6e130ce0b48d0b02926d9a7f74e9bd9bde7dc55ae52c59ef8f.jpg",
1578
+ "image_caption": [],
1579
+ "image_footnote": [],
1580
+ "bbox": [
1581
+ 166,
1582
+ 635,
1583
+ 833,
1584
+ 895
1585
+ ],
1586
+ "page_idx": 14
1587
+ },
1588
+ {
1589
+ "type": "text",
1590
+ "text": "$\\triangleright$ Slots that follow similar API protocols have similar representations. Note that the function HasAddress is a local function, seen only in the testset. ",
1591
+ "bbox": [
1592
+ 171,
1593
+ 898,
1594
+ 826,
1595
+ 928
1596
+ ],
1597
+ "page_idx": 14
1598
+ },
1599
+ {
1600
+ "type": "text",
1601
+ "text": "Sample 3 ",
1602
+ "text_level": 1,
1603
+ "bbox": [
1604
+ 173,
1605
+ 99,
1606
+ 240,
1607
+ 114
1608
+ ],
1609
+ "page_idx": 15
1610
+ },
1611
+ {
1612
+ "type": "image",
1613
+ "img_path": "images/2138340e86ff73ed6c4633db684eb824cdcf8b0c1f5f5434c9e65b177116c2f6.jpg",
1614
+ "image_caption": [],
1615
+ "image_footnote": [],
1616
+ "bbox": [
1617
+ 169,
1618
+ 117,
1619
+ 831,
1620
+ 296
1621
+ ],
1622
+ "page_idx": 15
1623
+ },
1624
+ {
1625
+ "type": "text",
1626
+ "text": "$\\triangleright$ Adding elements to a collection-like object yields similar representations. ",
1627
+ "bbox": [
1628
+ 173,
1629
+ 301,
1630
+ 668,
1631
+ 316
1632
+ ],
1633
+ "page_idx": 15
1634
+ },
1635
+ {
1636
+ "type": "text",
1637
+ "text": "D DATASET ",
1638
+ "text_level": 1,
1639
+ "bbox": [
1640
+ 174,
1641
+ 351,
1642
+ 287,
1643
+ 367
1644
+ ],
1645
+ "page_idx": 15
1646
+ },
1647
+ {
1648
+ "type": "text",
1649
+ "text": "The collected dataset and its characteristics are listed in Table 4. The full dataset as a set of projects and its parsed JSON will become available online. ",
1650
+ "bbox": [
1651
+ 173,
1652
+ 388,
1653
+ 825,
1654
+ 417
1655
+ ],
1656
+ "page_idx": 15
1657
+ },
1658
+ {
1659
+ "type": "table",
1660
+ "img_path": "images/cbc14fa71ce2f75da12cf724042a0e7a75e4183c82fc6295ea8172f5e72f36df.jpg",
1661
+ "table_caption": [
1662
+ "Table 4: Projects in our dataset. Ordered alphabetically. kLOC measures the number of non-empty lines of C# code. Projects marked with Devwere used as a development set. Projects marked with †were in the test-only dataset. The rest of the projects were split into train-validation-test. The dataset contains in total about 2.9MLOC. "
1663
+ ],
1664
+ "table_footnote": [],
1665
+ "table_body": "<table><tr><td>Name</td><td>Git SHA</td><td>kLOCs</td><td>Slots</td><td>Vars</td><td>Description</td></tr><tr><td>Akka.NET</td><td>719335a1</td><td>240</td><td>51.3k</td><td>51.2k</td><td>Actor-based Concurrent &amp;Distributed Framework</td></tr><tr><td>AutoMapper</td><td>2ca7c2b5</td><td>46</td><td>3.7k</td><td>10.7k</td><td>Object-to-Object Mapping Library</td></tr><tr><td>BenchmarkDotNet</td><td>1670ca34</td><td>28</td><td>5.1k</td><td>6.1k</td><td>Benchmarking Library</td></tr><tr><td>BotBuilder</td><td>190117c3</td><td>44</td><td>6.4k</td><td>8.7k</td><td>SDK for Building Bots</td></tr><tr><td>choco</td><td>93985688</td><td>36</td><td>3.8k</td><td>5.2k</td><td>Windows Package Manager</td></tr><tr><td>commandline†</td><td>09677b16</td><td>11</td><td>1.1k</td><td>2.3k</td><td>Command Line Parser</td></tr><tr><td>CommonMark.NETDev</td><td>f3d54530</td><td>14</td><td>2.6k</td><td>1.4k</td><td>Markdown Parser</td></tr><tr><td>Dapper</td><td>931c700d</td><td>18</td><td>3.3k</td><td>4.7k</td><td>Object Mapper Library</td></tr><tr><td>EntityFramework</td><td>fa0b7ec8</td><td>263</td><td>33.4k</td><td>39.3k</td><td>Object-Relational Mapper</td></tr><tr><td>Hangfire</td><td>ffc4912f</td><td>33</td><td>3.6k</td><td>6.1k</td><td>Background Job Processing Library</td></tr><tr><td>Humanizert</td><td>cclla77e</td><td>27</td><td>2.4k</td><td>4.4k</td><td>String Manipulation and Formatting</td></tr><tr><td>Lean†</td><td>f574bfd7</td><td>190</td><td>26.4k</td><td>28.3k</td><td>Algorithmic Trading Engine</td></tr><tr><td>Nancy</td><td>72elf614</td><td>70</td><td>7.5k</td><td>15.7</td><td>HTTP Service Framework</td></tr><tr><td>Newtonsoft.Json</td><td>6057d9b8</td><td>123</td><td>14.9k</td><td>16.1k</td><td> JSON Library</td></tr><tr><td>Ninject</td><td>7006297f</td><td>13</td><td>0.7k</td><td>2.1k</td><td>Code Injection Library</td></tr><tr><td>NLog</td><td>643e326a</td><td>75</td><td>8.3k</td><td>11.0k</td><td>Logging Library</td></tr><tr><td>Opserver</td><td>51b032e7</td><td>24</td><td>3.7k</td><td>4.5k</td><td>Monitoring System</td></tr><tr><td>OptiKey</td><td>7d35c718</td><td>34</td><td>6.1k</td><td>3.9k</td><td>Assistive On-Screen Keyboard</td></tr><tr><td>orleans Polly</td><td>e0d6a150 0afdbc32</td><td>300 32</td><td>30.7k 3.8k</td><td>35.6k 9.1k</td><td>Distributed Virtual Actor Model</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>Resilience &amp; Transient Fault Handling Library</td></tr><tr><td>quartznet</td><td>b33e6f86</td><td>49</td><td>9.6k</td><td>9.8k</td><td>Scheduler</td></tr><tr><td>ravendbDev</td><td>55230922</td><td>647</td><td>78.0k</td><td>82.7k</td><td>Document Database</td></tr><tr><td>RestSharp</td><td>70de357b</td><td>20</td><td>4.0k</td><td>4.5k</td><td>REST and HTTP API Client Library</td></tr><tr><td>Rx.NET</td><td>2d146fe5</td><td>180</td><td>14.0k</td><td>21.9k</td><td>Reactive Language Extensions</td></tr><tr><td>scriptcs</td><td>f3cc8bcb</td><td>18</td><td>2.7k</td><td>4.3k</td><td>C# Text Editor</td></tr><tr><td>ServiceStack</td><td>6d59da75</td><td>231</td><td>38.0k</td><td>46.2k</td><td>Web Framework</td></tr><tr><td>ShareX</td><td>718dd711</td><td>125</td><td>22.3k</td><td>18.1k</td><td>Sharing Application</td></tr><tr><td>SignalR</td><td>fa88089e</td><td>53</td><td>6.5k</td><td>10.5k</td><td>Push Notification Framework</td></tr><tr><td>Wox</td><td>cdaf6272</td><td>13</td><td>2.0k</td><td>2.1k</td><td>Application Launcher</td></tr></table>",
1666
+ "bbox": [
1667
+ 178,
1668
+ 507,
1669
+ 820,
1670
+ 921
1671
+ ],
1672
+ "page_idx": 15
1673
+ },
1674
+ {
1675
+ "type": "table",
1676
+ "img_path": "images/72b636af8dc21676160a77f576e621c898d29fb40316b34c6acb8fc9ae0dc020.jpg",
1677
+ "table_caption": [
1678
+ "For this work, we released a large portion of the data, with the exception of projects with a GPL license. The data can be found at https://aka.ms/iclr18-prog-graphs-dataset. Since we are excluding some projects from the data, below we report the results, averaged over three runs, on the published dataset: "
1679
+ ],
1680
+ "table_footnote": [],
1681
+ "table_body": "<table><tr><td></td><td>Accuracy (%)</td><td>PR AUC</td></tr><tr><td>SEENPROJTEST</td><td>84.0</td><td>0.976</td></tr><tr><td>UNSEENPROJTEST</td><td>74.1</td><td>0.934</td></tr></table>",
1682
+ "bbox": [
1683
+ 173,
1684
+ 166,
1685
+ 514,
1686
+ 224
1687
+ ],
1688
+ "page_idx": 16
1689
+ }
1690
+ ]
parse/train/BJOFETxR-/BJOFETxR-_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/BJOFETxR-/BJOFETxR-_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/BJk7Gf-CZ/BJk7Gf-CZ_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/BJk7Gf-CZ/BJk7Gf-CZ_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/BkgrBgSYDS/BkgrBgSYDS.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/BkgrBgSYDS/BkgrBgSYDS_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/BkgrBgSYDS/BkgrBgSYDS_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/BkgrBgSYDS/BkgrBgSYDS_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1ersoRqtm/H1ersoRqtm.md ADDED
@@ -0,0 +1,350 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # STRUCTURED NEURAL SUMMARIZATION
2
+
3
+ Patrick Fernandes, Miltiadis Allamanis & Marc Brockschmidt
4
+
5
+ Microsoft Research
6
+ Cambridge, United Kingdom
7
+ {t-pafern,miallama,mabrocks}@microsoft.com
8
+
9
+ # ABSTRACT
10
+
11
+ Summarization of long sequences into a concise statement is a core problem in natural language processing, requiring non-trivial understanding of the input. Based on the promising results of graph neural networks on highly structured data, we develop a framework to extend existing sequence encoders with a graph component that can reason about long-distance relationships in weakly structured data such as text. In an extensive evaluation, we show that the resulting hybrid sequence-graph models outperform both pure sequence models as well as pure graph models on a range of summarization tasks.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ Summarization, the task of condensing a large and complex input into a smaller representation that retains the core semantics of the input, is a classical task for natural language processing systems. Automatic summarization requires a machine learning component to identify important entities and relationships between them, while ignoring redundancies and common concepts.
16
+
17
+ Current approaches to summarization are based on the sequence-to-sequence paradigm over the words of some text, with a sequence encoder — typically a recurrent neural network, but sometimes a 1D-CNN (Narayan et al., 2018) or using self-attention (McCann et al., 2018) — processing the input and a sequence decoder generating the output. Recent successful implementations of this paradigm have substantially improved performance by focusing on the decoder, extending it with an attention mechanism over the input sequence and copying facilities (See et al., 2017; McCann et al., 2018). However, while standard encoders (e.g. bidirectional LSTMs) theoretically have the ability to handle arbitrary long-distance relationships, in practice they often fail to correctly handle long texts and are easily distracted by simple noise (Jia & Liang, 2017).
18
+
19
+ In this work, we focus on an improvement of sequence encoders that is compatible with a wide range of decoder choices. To mitigate the long-distance relationship problem, we draw inspiration from recent work on highly-structured objects (Li et al., 2015; Kipf & Welling, 2017; Gilmer et al., 2017; Allamanis et al., 2018; Cvitkovic et al., 2018). In this line of work, highly-structured data such as entity relationships, molecules and programs is modelled using graphs. Graph neural networks are then successfully applied to directly learn from these graph representations. Here, we propose to extend this idea to weakly-structured data such as natural language. Using existing tools, we can annotate (accepting some noise) such data with additional relationships (e.g. co-references) to obtain a graph. However, the sequential aspect of the input data is still rich in meaning, and thus we propose a hybrid model in which a standard sequence encoder generates rich input for a graph neural network. In our experiments, the resulting combination outperforms baselines that use pure sequence or pure graph-based representations.
20
+
21
+ Briefly, the contributions of our work are: 1. A framework that extends standard sequence encoder models with a graph component that leverages additional structure in sequence data. 2. Application of this extension to a range of existing sequence models and an extensive evaluation on three summarization tasks from the literature. 3. We release all used code and data at https://github.com/CoderPat/structured-neural-summarization.
22
+
23
+ public void Add(string name, object value $=$ null, DbType? dbType $=$ null, ParameterDirection? direction $=$ null, int? size $=$ null, byte? precision $=$ null, byte? scale $=$ null) { parameters[Clean(name) $] =$ new ParamInfo{ Name $=$ name, Value $=$ value, ParameterDirection $=$ direction ?? ParameterDirection.Input, DbType $=$ dbType, Size $=$ size, Precision $=$ precision, Scale $=$ scale };}
24
+
25
+ Ground truth: BILSTM LSTM: $\mathbf { B I L S T M + G N N } \to \mathbf { L S T M } .$ : $\mathbf { B I L S T M + G N N } \to \mathbf { L S T M + P O I N T E R }$ :
26
+
27
+ add a parameter to this dynamic parameter list adds a new parameter to the specified parameter creates a new instance of the dynamic type specified add a parameter to a list of parameters
28
+
29
+ Figure 1: An example from the dataset for the METHODDOC source code summarization task along with the outputs of a baseline and our models. In the METHODNAMING dataset, this method appears as a sample requiring to predict the name Add as a subtoken sequence of length 1.
30
+
31
+ # 2 STRUCTURED SUMMARIZATION TASKS
32
+
33
+ In this work, we consider three summarization tasks with different properties. All tasks follow the common pattern of translating a long (structured) sequence into a shorter sequence while trying to preserve as much meaning as possible. The first two tasks are related to the summarization of source code (Figure 1), which is highly structured and thus can profit most from models that can take advantage of this structure; the final task is a classical natural language task illustrating that hybrid sequence-graph models are applicable for less structured inputs as well.
34
+
35
+ METHODNAMING The aim of this task is to infer the name of a function (or method in objectoriented languages, such as Java, Python and C#) given its source code (Allamanis et al., 2016). Although method names are a single token, they are usually composed of one or more subtokens (split using snake case or camelCase) and thus, the method naming task can be cast as predicting a sequence of subtokens. Consequently, method names represent an “extreme” summary of the functionality of a given function (on average, the names in the Java dataset have only 2.9 subtokens). Notably, the vocabulary of tokens used in names is very large (due to abbreviations and domainspecific jargon), but this is mitigated by the fact that $33 \%$ of subtokens in names can be copied directly from subtokens in the method’s source code. Finally, source code is highly structured input data with known semantics, which can be exploited to support name prediction.
36
+
37
+ METHODDOC Similar to the first task, the aim of this task is to predict a succinct description of the functionality of a method given its source code (Barone & Sennrich, 2017). Such descriptions usually appear as documentation of methods (e.g. “docstrings” in Python or “JavaDocs” in Java). While the task shares many characteristics with the METHODNAMING task, the target sequence is substantially longer (on average 19.1 tokens in our C# dataset) and only $1 9 . 4 \%$ of tokens in the documentation can be copied from the code. While method documentation is nearer to standard natural language than method names, it mixes project-specific jargon, code segments and often describes non-functional aspects of the code, such as performance characteristics and design considerations.
38
+
39
+ NLSUMMARIZATION Finally, we consider the classic summarization of natural language as widely studied in NLP research. Specifically, we are interested in abstractive summarization, where given some text input (e.g. a news article) a machine learning model produces a novel natural language summary. Traditionally, NLP summarization methods treat text as a sequence of sentences and each one of them as a sequence of words (tokens). The input data has less explicitly defined structure than our first two tasks. However, we recast the task as a structured summarization problem by considering additional linguistic structure, including named entities and entity coreferences as inferred by existing NLP tools.
40
+
41
+ # 3 MODEL
42
+
43
+ As discussed above, standard neural approaches to summarization follow the sequence-to-sequence framework. In this setting, most decoders only require a representation $^ { h }$ of the complete input sequence (e.g. the final state of an RNN) and per-token representations $h _ { t _ { i } }$ for each input token $t _ { i }$ These token representations are then used as the “memories” of an attention mechanism (Bahdanau et al., 2014; Luong et al., 2015) or a pointer network (Vinyals et al., 2015a).
44
+
45
+ In this work, we propose an extension of sequence encoders that allows us to leverage known (or inferred) relationships among elements in the input data. To achieve that, we combine sequence encoders with graph neural networks (GNNs) (Li et al., 2015; Gilmer et al., 2017; Kipf & Welling, 2017). For this, we first use a standard sequential encoder (e.g. bidirectional RNNs) to obtain a pertoken representation $h _ { t _ { i } }$ , which we then feed into a GNN as the initial node representations. The resulting per-node (i.e. per-token) representations $\boldsymbol { h } _ { t _ { i } } ^ { \prime }$ can then be used by an unmodified decoder. Experimentally, we found this to surpass models that use either only the sequential structure or only the graph structure (see Sect. 4). We now discuss the different parts of our model in detail.
46
+
47
+ Gated Graph Neural Networks To process graphs, we follow Li et al. (2015) and briefly summarize the core concepts of GGNNs here. A graph $\mathcal { G } = ( \nu , \pmb { \varepsilon } , \pmb { X } )$ is composed of a set of nodes $\nu$ , node features $\boldsymbol { X }$ , and a list of directed edge sets ${ \pmb { \mathcal { E } } } = ( { \mathcal { E } } _ { 1 } , \dots , { \mathcal { E } } _ { K } )$ where $K$ is the number of edge types. Each $v \in \nu$ is associated with a real-valued vector $\scriptstyle { \mathbf { { \mathit { x } } } } _ { \mathit { v } }$ representing the features of the node (e.g., the embedding of a string label of that node), which is used for the initial state ${ h } _ { v } ^ { ( 0 ) }$ of a node.
48
+
49
+ Information is propagated through the graph using neural message passing (Gilmer et al., 2017). For this, every node $v$ sends messages to its neighbors by transforming its current representation $\boldsymbol { h } _ { v } ^ { ( i ) }$ using an edge-type dependent function $f _ { k }$ . Here, $f _ { k }$ can be an arbitrary function; we use a simple linear layer. By computing all messages at the same time, all states can be updated simultaneously. In particular, a new state for a node $v$ is computed by aggregating all incoming messages as $m _ { v } ^ { ( i ) } = \bar { g } ( \{ f _ { k } ( h _ { u } ^ { ( i ) } ) \} )$ there is an edge of type $k$ from $u$ to $v \}$ ). $g$ is an aggregation function; we use elementwise summation for $g$ . Given the aggregated message $\mathbf { \it { m } } _ { v } ^ { ( i ) }$ and the current state vector $\boldsymbol { h } _ { v } ^ { ( i ) }$ of node $v$ , we can compute the new state 1) = GRU(m(i)v , h(i)v ), where GRU is the recurrent cell function of a gated recurrent unit. These dynamics are rolled out for a fixed number of timesteps $T$ , and the state vectors resulting from the final step are used as output node representations, i.e., $\mathrm { G N N } ( ( \mathcal { V } , \pmb { \mathcal { E } } , X ) ) = \{ \pmb { h } _ { v } ^ { ( T ) } \} _ { v \in \mathcal { V } }$ .
50
+
51
+ Sequence GNNs We now explain our novel combination of GGNNs and standard sequence encoders. As input, we take a sequence $\boldsymbol { S } = \left[ s _ { 1 } \ldots s _ { N } \right]$ and $K$ binary relationships $R _ { 1 } \ldots R _ { K } \in S \times S$ between elements of the sequence. For example, $R _ { = }$ could be the equality relationship $\left\{ \left( s _ { i } , s _ { j } \right) \right. \mid$ $s _ { i } = s _ { j } \}$ . The choice and construction of relationships is dataset-dependent, and will be discussed in detail in Sect. 4. Given any sequence encoder $\mathcal { S E }$ that maps $S$ to per-element representations $\left[ \mathbf { e } _ { 1 } \ldots \mathbf { e } _ { N } \right]$ and a sequence representation e (e.g. a bidirectional RNN), we can construct the sequence GNN $\mathcal { S } \mathcal { E } _ { G N N }$ by simply computing $\mathbf { \bar { e } } _ { 1 } ^ { \prime } \cdot \cdot \cdot \mathbf { e } _ { N } ^ { \prime } ] = \mathbf { G N N } ( ( S , [ R _ { 1 } \dots R _ { K } ] , [ \mathbf { e } _ { 1 } \dots \mathbf { e } _ { N } ] ) )$ . To obtain a graph-level representation, we use the weighted averaging mechanism from Gilmer et al. (2017). Concretely, for each node $v$ in the graph, we compute a weight $\sigma ( w ( \pmb { h } _ { v } ^ { ( T ) } ) ) \in [ 0 , 1 ]$ using a learnable function $w$ and the logistic sigmoid $\sigma$ and compute a graph-level representation as $\begin{array} { r } { \hat { \mathbf { e } } \equiv \sum _ { 1 \leq i \leq N } \sigma ( w ( \mathbf { e } _ { i } ^ { \prime } ) ) \cdot \mathbb { N } ( \mathbf { e } _ { i } ^ { \prime } ) } \end{array}$ , where $\aleph$ is another learnable projection function. We found that best results were achieved by computing the final $\mathbf { e ^ { \prime } }$ as $W \cdot ( \mathbf { e } \hat { \mathbf { e } } )$ for some learnable matrix $W$ .
52
+
53
+ This method can easily be extended to support additional nodes not present in the original sequence $S$ after running $\mathcal { S E }$ (e.g., to accommodate meta-nodes representing sentences, or non-terminal nodes from a syntax tree). The initial node representation for these additional nodes can come from other sources, such as a simple embedding of their label.
54
+
55
+ Implementation Details. Processing large graphs of different shapes efficiently requires to overcome some engineering challenges. For example, the CNN/DM corpus has (on average) about 900 nodes per graph. To allow efficient computation, we use the trick of Allamanis et al. (2018) where all graphs in a minibatch are “flattened” into a single graph with multiple disconnected components. The varying graph sizes also represent a problem for the attention and copying mechanisms in the decoder, as they require to compute a softmax over a variable-sized list of memories. To handle this efficiently without padding, we associate each node in the (flattened) “batch” graph with the index of the sample in the minibatch from which the node originated. Then, using TensorFlow’s unsorted segment $\mathbf { \nabla } _ { \cdot } \star$ operations, we can perform an efficient and numerically stable softmax over the variable number of representations of the nodes of each graph.
56
+
57
+ # 4 EVALUATION
58
+
59
+ # 4.1 QUANTITATIVE EVALUATION
60
+
61
+ We evaluate Sequence GNNs on our three tasks by comparing them to models that use only sequence or graph information, as well as by comparing them to task-specific baselines. We discuss the three tasks, their respective baselines and how we present the data to the models (including the relationships considered in the graph component) next before analyzing the results.
62
+
63
+ # 4.1.1 SETUP FOR METHODNAMING
64
+
65
+ Datasets, Metrics, and Models. We consider two datasets for the METHODNAMING task. First, we consider the “Java (small)” dataset of Alon et al. (2018a), re-using the train-validation-test splits they have picked. We additionally generated a new dataset from 23 open-source C# projects mined from GitHub (see below for the reasons for this second dataset), removing any duplicates. More information about these datasets can be found in Appendix C. We follow earlier work on METHODNAMING (Allamanis et al., 2016; Alon et al., 2018a) and measure performance using the F1 score over the generated subtokens. However, since the task can be viewed as a form of (extreme) summarization, we also report ROUGE-2 and ROUGE-L scores (Lin, 2004), which we believe to be additional useful indicators for the quality of results. ROUGE-1 is omitted since it is equivalent to F1 score. We note that there is no widely accepted metric for this task and further work identifying the most appropriate metric is required.
66
+
67
+ We compare to the current state of the art (Alon et al., 2018a), as well as a sequence-to-sequence implementation from the OpenNMT project (Klein et al.). Concretely, we combine two encoders (a bidirectional LSTM encoder with 1 layer and 256 hidden units, and its sequence GNN extension with 128 hidden units unrolled over 8 timesteps) with two decoders (an LSTM decoder with 1 layer and 256 hidden units with attention over the input sequence, and an extension using a pointer network-style copying mechanism (Vinyals et al., 2015a)). Additionally, we consider self-attention as an alternative to RNN-based sequence encoding architectures. For this, we use the Transformer (Vaswani et al., 2017) implementation in OpenNMT (i.e., using self-attention both for the decoder and the encoder) as a baseline and compare it to a version whose encoder is extended with a GNN component.
68
+
69
+ Data Representation Following the work of Allamanis et al. (2016); Alon et al. (2018a), we break up all identifier tokens (i.e. variables, methods, classes, etc.) in the source code into subtokens by splitting them according to camelCase and pascal case heuristics. This allows the models to extract information from the information-rich subtoken structure, and ensures that a copying mechanism in the decoder can directly copy relevant subtokens, something that we found to be very effective for this task. All models are provided with all (sub)tokens belonging to the source code of a method, including its declaration, with the actual method name replaced by a placeholder symbol.
70
+
71
+ To construct a graph from the (sub)tokens, we implement a simplified form of the work of Allamanis et al. (2018). First, we introduce additional nodes for each (full) identifier token, and connect the constituent subtokens appearing in the input sequence using a INTOKEN edge; we additionally connect these nodes using a NEXTTOKEN edge. We also add nodes for the parse tree and use edges to indicate that one node is a CHILD of another. Finally, we add LASTLEXICALUSE edges to connect identifiers to their most (lexically) recent use in the source code.
72
+
73
+ # 4.1.2 SETUP FOR METHODDOC
74
+
75
+ Datasets, Metrics, and Models. We tried to evaluate on the Python dataset of Barone & Sennrich (2017) that contains pairs of method declarations and their documentation (“docstring”). However, following the work of Lopes et al. (2017), we found extensive duplication between different folds of the dataset and were only able to reach comparable results by substantially overfitting to the training data that overlapped with the test set. We have documented details in subsection C.3 and in Allamanis (2018), and decided to instead evaluate on our new dataset of 23 open-source C# projects from above, again removing duplicates and methods without documentation. Following Barone & Sennrich (2017), we measure the BLEU score for all models. However, we also report F1, ROUGE-2 and ROUGE-L scores, which should better reflect the summarization aspect of the task. We consider the same models as for the METHODNAMING task, using the same configuration, and use the same data representation.
76
+
77
+ ![](images/0f24ece1ecd933d082df2284a4d3190ac4a48d4c10138fc5c01fc0d240b7a43f.jpg)
78
+ Figure 2: (Partial) graph of an example input from the CNN/DM corpus.
79
+
80
+ # 4.1.3 SETUP FOR NLSUMMARIZATION
81
+
82
+ Datasets, Metrics, and Models. We use the CNN/DM dataset (Hermann et al., 2015) using the exact data and split provided by See et al. (2017). The data is constructed from CNN and Daily Mail news articles along with a few sentences that summarize each article. To measure performance, we use the standard ROUGE metrics. We compare our model with the near-to-state-of-the-art work of See et al. (2017), who use a sequence-to-sequence model with attention and copying as basis, but have additionally substantially improved the decoder component. As our contribution is entirely on the encoder side and our model uses a standard sequence decoder, we are not expecting to outperform more recent models that introduce substantial novelty in the structure or training objective of the decoder (Chen & Bansal, 2018; Narayan et al., 2018). Again, we evaluate our contribution using an OpenNMT-based encoder/decoder combination. Concretely, we use a bidirectional LSTM encoder with 1 layer and 256 hidden units, and its sequence GNN extension with 128 hidden units unrolled over 8 timesteps. As decoder, we use an LSTM with 1 layer and 256 hidden units with attention over the input sequence, and an extension using a pointer network-style copying mechanism.
83
+
84
+ Data Representation We use Stanford CoreNLP (Manning et al., 2014) (version 3.9.1) to tokenize the text and provide the resulting tokens to the encoder. For the graph construction (Figure 2), we extract the named entities and run coreference resolution using CoreNLP. We connect tokens using a NEXT edge and introduce additional super-nodes for each sentence, connecting each token to the corresponding sentence-node using a IN edge. We also connect subsequent sentence-nodes using a NEXT edge. Then, for each multi-token named entity we create a new node, labeling it with the type of the entity and connecting it with all tokens referring to that entity using an IN edge. Finally, coreferences of entities are connected with a special REF edge. Figure 2 shows a partial graph for an article in the CNN/DM dataset. The goal of this graph construction process is to explicitly annotate important relationships that can be useful for summarization. We note that (a) in early efforts we experimented with adding dependency parse edges, but found that they do not provide significant benefits and (b) that since we retrieve the annotations from CoreNLP, they can contain errors and thus, the performance of the our method is influenced by the accuracy of the upstream annotators of named entities and coreferences.
85
+
86
+ Table 1: Evaluation results for all models and tasks.
87
+
88
+ <table><tr><td>METHODNAMING</td><td>F1</td><td>ROUGE-2</td><td>ROUGE-L</td></tr><tr><td>Java</td><td></td><td></td><td></td></tr><tr><td>Alon et al. (2018a)</td><td>43.0</td><td>一</td><td>1</td></tr><tr><td>SELFATT →SELFATT</td><td>24.9</td><td>8.3</td><td>27.4</td></tr><tr><td>SELFATT+GNN →SELFATT</td><td>44.5</td><td>20.9</td><td>43.4</td></tr><tr><td>BILSTM →LSTM</td><td>35.8</td><td>17.9</td><td>39.7</td></tr><tr><td>BILSTM+GNN →LSTM</td><td>44.7</td><td>21.1</td><td>43.1</td></tr><tr><td>BILSTM →LSTM+POINTER</td><td>42.5</td><td>22.4</td><td>45.6</td></tr><tr><td>GNN →LSTM+POINTER</td><td>50.5</td><td>24.8</td><td>48.9</td></tr><tr><td>BILSTM+GNN→LSTM+POINTER</td><td>51.4</td><td>25.0</td><td>50.0</td></tr><tr><td>C#</td><td></td><td></td><td></td></tr><tr><td>SELFATT →SELFATT</td><td>41.3</td><td>25.2</td><td>43.2</td></tr><tr><td>SELFATT+GNN→→SELFATT</td><td>62.1</td><td>31.0</td><td>61.1</td></tr><tr><td>BILSTM →LSTM</td><td>48.8</td><td>32.8</td><td>51.8</td></tr><tr><td>BILSTM+GNN →LSTM</td><td>62.6</td><td>31.0</td><td>61.3</td></tr><tr><td>BILSTM →LSTM+POINTER</td><td>57.2</td><td>29.7</td><td>60.4</td></tr><tr><td>GNN→LSTM+POINTER</td><td>63.0</td><td>31.5</td><td>61.3</td></tr><tr><td>BILSTM+GNN→LSTM+POINTER</td><td>63.4</td><td>31.9</td><td>62.4</td></tr><tr><td>METHODDOC</td><td>F1</td><td>ROUGE-2</td><td>ROUGE-L</td><td>BLEU</td></tr><tr><td>C#</td><td></td><td></td><td></td><td></td></tr><tr><td>SELFATT →SELFATT</td><td>40.0</td><td>27.8</td><td>41.1</td><td>13.9</td></tr><tr><td>SELFATT+GNN→SELFATT</td><td>37.6</td><td>25.6</td><td>37.9</td><td>21.4</td></tr><tr><td>BILSTM →LSTM</td><td>35.2</td><td>15.3</td><td>30.8</td><td>10.0</td></tr><tr><td>BILSTM+GNN →LSTM</td><td>41.1</td><td>28.9</td><td>41.0</td><td>22.5</td></tr><tr><td>BILSTM →LSTM+POINTER</td><td>35.2</td><td>20.8</td><td>36.7</td><td>14.7</td></tr><tr><td>GNN →LSTM+POINTER</td><td>38.9</td><td>25.6</td><td>37.1</td><td>17.7</td></tr><tr><td>BILSTM+GNN →→LSTM+POINTER (average pooling)</td><td>43.2</td><td>29.0</td><td>41.0</td><td>21.3</td></tr><tr><td>BILSTM+GNN→LSTM+POINTER</td><td>45.4</td><td>28.3</td><td>41.1</td><td>22.2</td></tr><tr><td>NLSUMMARIZATION</td><td>ROUGE-1</td><td>ROUGE-2</td><td>ROUGE-L</td><td></td></tr><tr><td>CNN/DM</td><td></td><td></td><td></td><td></td></tr><tr><td>BILSTM →LSTM</td><td>33.6</td><td>11.4</td><td>27.9</td><td></td></tr><tr><td>BILSTM+GNN→LSTM</td><td>33.0</td><td>13.3</td><td>28.3</td><td></td></tr><tr><td>See et al. (2017) (+ Pointer)</td><td>36.4</td><td>15.7</td><td>33.4</td><td></td></tr><tr><td>BILSTM →LSTM+POINTER</td><td>35.9</td><td>13.9</td><td>30.3</td><td></td></tr><tr><td>BILSTM+GNN →LSTM+POINTER</td><td>38.1</td><td>16.1</td><td>33.2</td><td></td></tr><tr><td>See et al. (2017) (+ Pointer + Coverage)</td><td>39.5</td><td>17.3</td><td>36.4</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr></table>
89
+
90
+ # 4.1.4 RESULTS & ANALYSIS
91
+
92
+ We show all results in Tab. 1. Results for models from the literature are taken from the respective papers and repeated here. Across all tasks, the results show the advantage of our hybrid sequence GNN encoders over pure sequence encoders.
93
+
94
+ On METHODNAMING, we can see that all GNN-augmented models are able to outperform the current specialized state of the art, requiring only simple graph structure that can easily be obtained using existing parsers for a programming language. The results in performance between the different encoder and decoder configurations nicely show that their effects are largely orthogonal.
95
+
96
+ On METHODDOC, the unmodified SELFATT $ s$ ELFATT model already performs quite well, and the augmentation with graph data only improves the BLEU score and worsens the results on ROUGE. Inspection of the results shows that this is due to the length of predictions. Whereas the ground truth data has on average 19 tokens in each result, SELFATT $ s$ ELFATT predicts on average 11 tokens, and SELFATT+GNN SELFATT 16 tokens. Additionally, we experimented with an ablation in which a model is only using graph information, e.g., a setting comparable to a simplification of the architecture of Allamanis et al. (2018). For this, we configured the GNN to use 128-dimensional representations and unrolled it for 10 timesteps, keeping the decoder configuration as for the other models. The results indicate that this configuration performs less well than a pure sequenced model. We speculate that this is mainly due to the fact that 10 timesteps are insufficient to propagate inforpublic static bool TryFormat(float value, Span<byte> destination, out int bytesWritten, StandardFormat format $=$ default) { return TryFormatFloatingPoint<float>(value, destination, out bytesWritten, format); }
97
+
98
+ Table 2: Ablations on CNN/DM Corpus
99
+
100
+ <table><tr><td>NLSUMMARIZATION (CNN/DM)</td><td>ROUGE-1</td><td>ROUGE-2</td><td>ROUGE-L</td></tr><tr><td>See et al.(2017) (base)</td><td>31.3</td><td>11.8</td><td>28.8</td></tr><tr><td>See et al. (2017) (+ Pointer)</td><td>36.4</td><td>15.7</td><td>33.4</td></tr><tr><td>See et al.(2017) (+ Pointer + Coverage)</td><td>39.5</td><td>17.3</td><td>36.4</td></tr><tr><td>BILSTM →LSTM</td><td>33.6</td><td>11.4</td><td>27.9</td></tr><tr><td>BILSTM →LSTM+POINTER</td><td>35.9</td><td>13.9</td><td>30.3</td></tr><tr><td>BILSTM →LSTM+PoINTER (+ coref/entity annotations)</td><td>36.2</td><td>14.2</td><td>30.5</td></tr><tr><td>BILSTM+GNN →LSTM</td><td>33.0</td><td>13.3</td><td>28.3</td></tr><tr><td>BILSTM+GNN→LSTM+POINTER (only sentence nodes)</td><td>36.0</td><td>15.2</td><td>29.6</td></tr><tr><td>BILSTM+GNN →LSTM+POINTER (sentence nodes + eq edges)</td><td>36.1</td><td>15.4</td><td>30.3</td></tr><tr><td>BILSTM+GNN→LSTM+POINTER</td><td>38.1</td><td>16.1</td><td>33.2</td></tr></table>
101
+
102
+ Ground truth BILSTM LSTM BILST $\mathbf { M } \mathbf { + } \mathbf { G N N } \to \mathbf { L S T M }$ B $\mathbf { \mathbf { \mathbf { I L S T M + G N N } } } \mathbf { \mathbf { \Phi } } \to \mathbf { \mathbf { \mathbf { L S T M + P O I N T E R } } }$ formats a single as a utf8 string formats a number of bytes in a utf8 string formats a timespan as a utf8 string formats a float as a utf8 string
103
+
104
+ Figure 3: An example from the dataset for the METHODDOC source code summarization task along with the outputs of a baseline and our models.
105
+
106
+ mation across the whole graph, especially in combination with summation as aggregation function for messages in graph information propagation.
107
+
108
+ Finally, on NLSUMMARIZATION, our experiments show that the same model suitable for tasks on highly structured code is competitive with specialized models for natural language tasks. While there is still a gap to the best configuration of See et al. (2017) (and an even larger one to more recent work in the area), we believe that this is entirely due to our simplistic decoder and training objective, and that our contribution can be combined with these advances.
109
+
110
+ In Table 2 we show some ablations for NLSUMMARIZATION. As we use the same hyperparameters across all datasets and tasks, we additionally perform an experiment with the model of See et al. (2017) (as implemented in OpenNMT) but using our settings. The results achieved by these baselines trend to be a bit worse than the results reported in the original paper, which we believe is due to a lack of hyperparameter optimization for this task. We then evaluated how much the additional linguistic structure provided by CoreNLP helps. First, we add the coreference and entity annotations to the baseline $\mathrm { B I L S T M } \to \mathrm { L S T M } + \mathrm { P O I N T E R }$ model (by extending the embedding of tokens with an embedding of the entity information, and inserting fresh $\mathrm { ~ \omega ~ } _ { \mathrm { i R E F 1 } } \mathrm { ~ \omega ~ }$ ”, . . . tokens at the sources/targets of co-references) and observe only minimal improvements. This suggests that our graph-based encoder is better-suited to exploit additional structured information compared to a biLSTM encoder. We then drop all linguistic structure information from our model, keeping only the sentence edges/nodes. This still improves on the baseline $\mathrm { B I L S T M } \to \mathrm { L S T M } + \mathrm { P O I I }$ NTER model (in the ROUGE-2 score), suggesting that the GNN still yields improvements in the absence of linguistic structure. Finally, we add long-range dependency edges by connecting tokens with equivalent string representations of their stems and observe further minor improvements, indicating that even using only purely syntactical information, without a semantic parse, can already provide gains.
111
+
112
+ # 4.2 QUALITATIVE EVALUATION
113
+
114
+ We look at a few sample suggestions in our dataset across the tasks. Here we highlight some observations we make that point out interesting aspects and failure cases of our model.
115
+
116
+ Figure 4: Sample natural language translations from the CNN-DM dataset.
117
+
118
+ <table><tr><td rowspan=1 colspan=1>Input: Arsenal,Newcastle United and Southampton have checked on Caen midfelder N&#x27;golo Kante .Paris-born Kante is a defensive minded player who has impressed for Caen this season and they are wiling to sellfor around f 5milion.Marseille have been in constant contact with Caen over signing the 24-year-old who has similarities with Lassna Diarra and Claude Makelele in terms of stature and style .N&#x27;Golo Kante is attractinginterest froma host of PremierLeague clubs including Arsenal.Caen would be wiling to sellKante for aroundf5million.</td></tr><tr><td rowspan=1 colspan=1>Reference:n&#x27;golo kante is wanted by arsenal,newcastle and southampton.marseille are also keen on thef5mrated midfielder.kante has been compared to lassana diarra and claude makelele.click here for the latestpremier league news .</td></tr><tr><td rowspan=1 colspan=1>See et al.(2O17) (+ Pointer): arsenal,newcastle united and southampton have checked on caen midfieldern&#x27;golo kante .paris-born kante is attracting interest from a host of premier league clubs including arsenal .paris-born kante is attracting interest from a host of premier league clubs including arsenal</td></tr><tr><td rowspan=1 colspan=1>See et al. (2O17)(+ Pointer + Coverage): arsenal, newcastle united and southampton have checked on caenmidfielder n&#x27;golo kante.paris-born kante is a defensive minded player who has impressed for caen this season.marseille have been in constant contact with caen over signing the 24-year-old .</td></tr><tr><td rowspan=1 colspan=1>BILSTM+GNN →LSTM: marseille have been linked with caen midfielder %UNK% %UNK% . marseillehave been interested from a host of premier league clubs including arsenal .caen have been interested from ahost of premier league clubs including arsenal .</td></tr><tr><td rowspan=1 colspan=1>BILSTM+GNN →LSTM+PoINTER n&#x27;golo kante is attracting interest from a host of premier league clubs .marseilehave been in constant contact with caen over signing the24-year-old.the 24-year-old has similaritieswith lassana diarra and claude makelele in terms of stature .</td></tr></table>
119
+
120
+ METHODDOC Figures 1 and 3 illustrate typical results of baselines and our model on the METHODDOC task (see Appendix A for more examples). The hardness of the task stems from the large number of distractors and the need to identify the most relevant parts of the input. In Figure 1, the token “parameter” and variations appears many times, and identifying the correct relationship is non-trivial, but is evidently eased by graph edges explicitly denoting these relationships. Similarly, in Figure 3, many variables are passed around, and the semantics of the method require understanding how information flows between them.
121
+
122
+ NLSUMMARIZATION Figure 4 shows one sample summarization. More samples for this task can be found in Appendix B. First, we notice that the model produces natural-looking summaries with no noticeable negative impact on the fluency of the language over existing methods. Furthermore, the GNN-based model seems to capture the central named entity in the article and creates a summary centered around that entity. We hypothesize that the GNN component that links long-distance relationships helps capture and maintain a better “global” view of the article, allowing for better identification of central entities. Our model still suffers from repetition of information (see Appendix B), and so we believe that our model would also profit from advances such as taking coverage into account (See et al., 2017) or optimizing for ROUGE-L scores directly via reinforcement learning (Chen & Bansal, 2018; Narayan et al., 2018).
123
+
124
+ # 5 RELATED WORK
125
+
126
+ Natural language processing research has studied summarization for a long time. Most related is work on abstractive summarization, in which the core content of a given text (usually a news article) is summarized in a novel and concise sentence. Chopra et al. (2016) and Nallapati et al. (2016) use deep learning models with attention on the input text to guide a decoder that generates a summary. See et al. (2017) and McCann et al. (2018) extend this idea with pointer networks (Vinyals et al., 2015a) to allow for copying tokens from the input text to the output summary. These approaches treat text as a simple token sequences, not explicitly exposing additional structure. In principle, deep sequence networks are known to be able to learn the inherent structure of natural language (e.g. in parsing (Vinyals et al., 2015b) and entity recognition (Lample et al., 2016)), but our experiments indicate that explicitly exposing this structure by separating concerns improves performance.
127
+
128
+ Recent work in summarization has proposed improved training objectives for summarization, such as tracking coverage of the input document (See et al., 2017) or using reinforcement learning to directly identify actions in the decoder that improve target measures such as ROUGE-L (Chen & Bansal, 2018; Narayan et al., 2018). These objectives are orthogonal to the graph-augmented encoder discussed in this work, and we are interested in combining these efforts in future work.
129
+
130
+ Exposing more language structure explicitly has been studied over the last years, with a focus on tree-based models (Tai et al., 2015). Very recently, first uses of graphs in natural language processing have been explored. Marcheggiani & Titov (2017) use graph convolutional networks to encode single sentences and assist machine translation. De Cao et al. (2018) create a graph over named entities over a set of documents to assist question answering. Closer to our work is the work of Liu et al. (2018), who use abstract meaning representation (AMR), in which the source document is first parsed into AMR graphs, before a summary graph is created, which is finally rendered in natural language. In contrast to that work we do not use AMRs but directly encode relatively simple relationships directly on the tokenized text, and do not treat summarization as a graph rewrite problem. Combining our encoder with AMRs to use richer graph structures may be a promising future direction.
131
+
132
+ Finally, summarization in source code has also been studied in the forms of method naming, comment and documentation prediction. Method naming has been tackled with a series of models. For example, Allamanis et al. (2015) use a log-bilinear network to predict method names from features, and later extend this idea to use a convolutional attention network over the tokens of a method to predict the subtokens of names (Allamanis et al., 2016). Raychev et al. (2015) and Bichsel et al. (2016) use CRFs for a range of tasks on source code, including the inference of names for variables and methods. Recently, Alon et al. (2018b;a) extract and encode paths from the syntax tree of a program, setting the state of the art in accuracy on method naming.
133
+
134
+ Linking text to code can have useful applications, such as code search (Gu et al., 2018), traceability (Guo et al., 2017), and detection of redundant method comments (Louis et al., 2018). Most approaches on source code either treat it as natural language (i.e., a token sequence), or use a language parser to explicitly expose its tree structure. For example, Barone & Sennrich (2017) use a simple sequenceto-sequence baseline, whereas Hu et al. (2017) summarize source code by linearizing the abstract syntax tree of the code and using a sequence-to-sequence model. Wan et al. (2018) instead directly operate on the tree structure using tree recurrent neural networks (Tai et al., 2015). The use of additional structure on related tasks on source code has been studied recently, for example in models that are conditioned on learned traversals of the syntax tree (Bielik et al., 2016) and in graph-based approaches (Allamanis et al., 2018; Cvitkovic et al., 2018). However, as noted by Liao et al. (2018), GNN-based approaches suffer from a tension between the ability to propagate information across large distances in a graph and the computational expense of the propagation function, which is linear in the number of graph edges per propagation step.
135
+
136
+ # 6 DISCUSSION & CONCLUSIONS
137
+
138
+ We presented a framework for extending sequence encoders with a graph component that can leverage rich additional structure. In an evaluation on three different summarization tasks, we have shown that this augmentation improves the performance of a range of different sequence models across all tasks. We are excited about this initial progress and look forward to deeper integration of mixed sequence-graph modeling in a wide range of tasks across both formal and natural languages. The key insight, which we believe to be widely applicable, is that inductive biases induced by explicit relationship modeling are a simple way to boost the practical performance of existing deep learning systems.
139
+
140
+ # REFERENCES
141
+
142
+ Miltiadis Allamanis. The adverse effects of code duplication in machine learning models of code. arXiv preprint arXiv:1812.06469, 2018.
143
+
144
+ Miltiadis Allamanis, Earl T Barr, Christian Bird, and Charles Sutton. Suggesting accurate method and class names. In Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering, pp. 38–49. ACM, 2015.
145
+
146
+ Miltiadis Allamanis, Hao Peng, and Charles Sutton. A convolutional attention network for extreme summarization of source code. In International Conference on Machine Learning, pp. 2091–2100, 2016.
147
+
148
+ Miltiadis Allamanis, Marc Brockschmidt, and Mahmoud Khademi. Learning to represent programs with graphs. In International Conference on Learning Representations, 2018.
149
+
150
+ Uri Alon, Omer Levy, and Eran Yahav. code2seq: Generating sequences from structured representations of code. arXiv preprint arXiv:1808.01400, 2018a.
151
+
152
+ Uri Alon, Meital Zilberstein, Omer Levy, and Eran Yahav. A general path-based representation for predicting program properties. In Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 404–419. ACM, 2018b.
153
+
154
+ Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
155
+
156
+ Antonio Valerio Miceli Barone and Rico Sennrich. A parallel corpus of Python functions and documentation strings for automated code documentation and code generation. In Proceedings of the Eighth International Joint Conference on Natural Language Processing (Volume 2: Short Papers), volume 2, pp. 314–319, 2017.
157
+
158
+ Benjamin Bichsel, Veselin Raychev, Petar Tsankov, and Martin Vechev. Statistical deobfuscation of android applications. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, pp. 343–355. ACM, 2016.
159
+
160
+ Pavol Bielik, Veselin Raychev, and Martin Vechev. PHOG: probabilistic model for code. In International Conference on Machine Learning (ICML), 2016.
161
+
162
+ Yen-Chun Chen and Mohit Bansal. Fast abstractive summarization with reinforce-selected sentence rewriting. arXiv preprint arXiv:1805.11080, 2018.
163
+
164
+ Sumit Chopra, Michael Auli, and Alexander M Rush. Abstractive sentence summarization with attentive recurrent neural networks. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 93–98, 2016.
165
+
166
+ Milan Cvitkovic, Badal Singh, and Anima Anandkumar. Deep learning on code with an unbounded vocabulary. In Machine Learning 4 Programming, 2018.
167
+
168
+ Nicola De Cao, Wilker Aziz, and Ivan Titov. Question answering by reasoning across documents with graph convolutional networks. arXiv preprint arXiv:1808.09920, 2018.
169
+
170
+ Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In International Conference on Machine Learning, pp. 1263–1272, 2017.
171
+
172
+ Xiaodong Gu, Hongyu Zhang, and Sunghun Kim. Deep code search. In Proceedings of the 40th International Conference on Software Engineering, pp. 933–944. ACM, 2018.
173
+
174
+ Jin Guo, Jinghui Cheng, and Jane Cleland-Huang. Semantically enhanced software traceability using deep learning techniques. In Software Engineering (ICSE), 2017 IEEE/ACM 39th International Conference on, pp. 3–14. IEEE, 2017.
175
+
176
+ Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. Teaching machines to read and comprehend. In Advances in Neural Information Processing Systems, pp. 1693–1701, 2015.
177
+
178
+ Xing Hu, Yuhan Wei, Ge Li, and Zhi Jin. Codesum: Translate program language to natural language. arXiv preprint arXiv:1708.01837, 2017.
179
+
180
+ Robin Jia and Percy Liang. Adversarial examples for evaluating reading comprehension systems. In Empirical Methods in Natural Language Processing (EMNLP), 2017.
181
+
182
+ Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations, 2017.
183
+
184
+ G. Klein, Y. Kim, Y. Deng, J. Senellart, and A. M. Rush. OpenNMT: Open-Source Toolkit for Neural Machine Translation. ArXiv e-prints.
185
+
186
+ Guillaume Lample, Miguel Ballesteros, Sandeep Subramanian, Kazuya Kawakami, and Chris Dyer. Neural architectures for named entity recognition. In Proceedings the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 2016.
187
+
188
+ Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493, 2015.
189
+
190
+ Renjie Liao, Marc Brockschmidt, Daniel Tarlow, Alexander Gaunt, Raquel Urtasun, and Richard S. Zemel. Graph partition neural networks for semi-supervised classification. In International Conference on Learning Representations (ICLR) [Workshop Track], 2018.
191
+
192
+ Chin-Yew Lin. ROUGE: A package for automatic evaluation of summaries. Text Summarization Branches Out, 2004.
193
+
194
+ Fei Liu, Jeffrey Flanigan, Sam Thomson, Norman Sadeh, and Noah A Smith. Toward abstractive summarization using semantic representations. arXiv preprint arXiv:1805.10399, 2018.
195
+
196
+ Cristina V Lopes, Petr Maj, Pedro Martins, Vaibhav Saini, Di Yang, Jakub Zitny, Hitesh Sajnani, and Jan Vitek. Dej´ avu: a map of code duplicates on github. \` Proceedings of the ACM on Programming Languages, 1(OOPSLA):84, 2017.
197
+
198
+ Annie Louis, Santanu Kumar Dash, Earl T Barr, and Charles Sutton. Deep learning to detect redundant method comments. arXiv preprint arXiv:1806.04616, 2018.
199
+
200
+ Minh-Thang Luong, Hieu Pham, and Christopher D Manning. Effective approaches to attentionbased neural machine translation. arXiv preprint arXiv:1508.04025, 2015.
201
+
202
+ Christopher Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven Bethard, and David McClosky. The stanford corenlp natural language processing toolkit. In Proceedings of 52nd annual meeting of the association for computational linguistics: system demonstrations, pp. 55–60, 2014.
203
+
204
+ Diego Marcheggiani and Ivan Titov. Encoding sentences with graph convolutional networks for semantic role labeling. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 1506–1515, 2017.
205
+
206
+ Bryan McCann, Nitish Shirish Keskar, Caiming Xiong, and Richard Socher. The natural language decathlon: Multitask learning as question answering. arXiv preprint arXiv:1806.08730, 2018.
207
+
208
+ Ramesh Nallapati, Bowen Zhou, Cicero dos Santos, Caglar Gulcehre, and Bing Xiang. Abstractive text summarization using sequence-to-sequence rnns and beyond. In Proceedings of The 20th SIGNLL Conference on Computational Natural Language Learning, pp. 280–290, 2016.
209
+
210
+ Shashi Narayan, Shay B Cohen, and Mirella Lapata. Ranking sentences for extractive summarization with reinforcement learning. arXiv preprint arXiv:1802.08636, 2018.
211
+
212
+ Veselin Raychev, Martin Vechev, and Andreas Krause. Predicting program properties from Big Code. In Principles of Programming Languages (POPL), 2015.
213
+
214
+ Abigail See, Peter J Liu, and Christopher D Manning. Get to the point: Summarization with pointergenerator networks. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pp. 1073–1083, 2017.
215
+
216
+ Kai Sheng Tai, Richard Socher, and Christopher D Manning. Improved semantic representations from tree-structured long short-term memory networks. 2015.
217
+
218
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pp. 5998–6008, 2017.
219
+
220
+ Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In Advances in Neural Information Processing Systems, pp. 2692–2700, 2015a.
221
+
222
+ Oriol Vinyals, Lukasz Kaiser, Terry Koo, Slav Petrov, Ilya Sutskever, and Geoffrey Hinton. Grammar as a foreign language. In Advances in Neural Information Processing Systems, 2015b.
223
+
224
+ Yao Wan, Zhou Zhao, Min Yang, Guandong Xu, Haochao Ying, Jian Wu, and Philip S Yu. Improving automatic source code summarization via deep reinforcement learning. In Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering, pp. 397–407. ACM, 2018.
225
+
226
+ # A CODE SUMMARIZATION SAMPLES
227
+
228
+ A.1 METHODDOC
229
+
230
+ # C# Sample 1
231
+
232
+ public static bool TryConvertTo(object valueToConvert, Type resultType, IFormatProvider formatProvider, out object result){ result $=$ null; try{ result $=$ ConvertTo(valueToConvert, resultType, formatProvider); catch (InvalidCastException){ return false; catch (ArgumentException){ return false; } return true;
233
+ }
234
+
235
+ # Ground truth
236
+
237
+ sets result to valuetoconvert converted to resulttype considering formatprovider for custom conversions calling the parse method and calling convert . changetype .
238
+ converts the specified type to a primitive type .
239
+ sets result to resulttype
240
+ sets result to valuetoconvert converted to resulttype.
241
+
242
+ BILSTM LSTM BILSTM+GNN $\mathbf { J } \to \mathbf { L S T N }$ M BILSTM+G $\mathbf { \ V N } \to \mathbf { L S T M } + \mathbf { \beta }$ POINTER
243
+
244
+ # C# Sample 2
245
+
246
+ public virtual Task Init(string name, IProviderRuntime providerRuntime, IProviderConfiguration config){ Log $=$ providerRuntime.GetLogger(this.GetType().FullName); this.serializerSettings $=$ OrleansJsonSerializer.GetDefaultSerializerSettings(); return TaskDone.Done;
247
+ }
248
+
249
+ Ground truth BILSTM $\bf \Pi \to L S T N$ I BILSTM+G $\mathbf { \partial } _ { \mathbf { i } } \mathbf { N N } \to \mathbf { L S T M }$ BILSTM+GN $\mathbf { N } \to \mathbf { L S T }$ M+POINTER
250
+
251
+ initializes the storage provider
252
+ creates a grain object
253
+ initializes the provider provider
254
+ initialization function to initialize the specified provider.
255
+
256
+ # C# Sample 3
257
+
258
+ public void NullParameter(){ TaskParameter t $=$ new TaskParameter(null); Assert.Null(t.WrappedParameter); Assert.Equal( TaskParameterType.Null , t.ParameterType ); ((INodePacketTranslatable) t).Translate( TranslationHelpers.GetWriteTranslator()); TaskParameter $\begin{array} { r l } { \pm 2 } & { { } = } \end{array}$ TaskParameter.FactoryForDeserialization( TranslationHelpers.GetReadTranslator()); Assert.Null(t2.WrappedParameter); Assert.Equal(TaskParameterType.Null, t2.ParameterType);
259
+ }
260
+
261
+ Ground truth BILSTM LSTM BILSTM+G $\mathbf { N N } \to \mathbf { L S T M }$ BILSTM+GNN LSTM+POINTER verifies that construction and serialization with a null parameter is ok tests that the value is a value that is a value to the specified type verifies that construction with an parameter parameter verifies that construction and serialization with a parameter that is null
262
+
263
+ # C# Sample 4
264
+
265
+ public override DbGeometryWellKnownValue CreateWellKnownValue(DbGeometry geometryValue){ geometryValue.CheckNull("geometryValue"); var spatialValue $=$ geometryValue.AsSpatialValue(); DbGeometryWellKnownValue result $=$ CreateWellKnownValue(spatialValue,
266
+
267
+ () $= >$ SpatialExceptions.CouldNotCreateWellKnownGeometryValueNoSrid("geometryValue"), () $= >$ SpatialExceptions.CouldNotCreateWellKnownGeometryValueNoWkbOrWkt("geometryValue"), (srid, wkb, wkt) $= >$ new DbGeometryWellKnownValue() { CoordinateSystemId $=$ srid, WellKnownBinary $=$ wkb, WellKnownText $=$ wkt }); return result; }
268
+
269
+ Ground truth BILSTM LSTM B $\mathbf { I L S T M + G N N } \to \mathbf { L S T M }$ BILSTM+GN $\Gamma \to \mathbf { L } \mathbf { S }$ TM+POINTER
270
+
271
+ creates an instance of t:system.data.spatial.dbgeometry value using one or both of the standard well known spatial formats.
272
+ creates a t:system.data.spatial.dbgeography value based on the specified well known binary value .
273
+ creates a new t:system.data.spatial.dbgeography instance using the specified well known spatial formats .
274
+ creates a new instance of the t:system.data.spatial.dbgeometry value based on the provided geometry value and returns the resulting well as known spatial formats .
275
+
276
+ # A.2 METHODNAMING
277
+
278
+ # C# Sample 1
279
+
280
+ public bool _(D d) { return d ! $=$ null && d.Val == Val ;
281
+ }
282
+
283
+ Ground truth equals BILSTM LSTM foo BILSTM+GNN LSTM equals BILSTM+ $\mathbf { G N N } \to \mathbf { L S T M } \mathbf { + P O I }$ NTER equals
284
+
285
+ # C# Sample 2
286
+
287
+ internal void _(string switchName, Hashtable bag, string parameterName) { object obj $=$ bag[parameterName]; if(obj ! $=$ null){ int value $=$ (int) obj; AppendSwitchIfNotNull(switchName, value.ToString(CultureInfo.InvariantCulture));
288
+ }
289
+
290
+ Ground truth append switch with integer BILSTM LSTM set string BILSTM+GN $\ J \to \mathbf { L S T N }$ M append switch BILSTM $\mathbf { + G N N \to L S T M + P O }$ INTER append switch if not null
291
+
292
+ # C# Sample 3
293
+
294
+ internal static string _(){ var currentPlatformString $=$ string.Empty; if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)){ currentPlatformString $=$ "WINDOWS"; } else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)){ currentPlatformString $=$ "LINUX"; } else if ( RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { currentPlatformString $=$ "OSX"; } else { Assert.True(false, "unrecognized current platform"); } return currentPlatformString ;
295
+
296
+ Ground truth BILSTM LSTM BILSTM+GNN LSTM BILSTM+ $\mathbf { G N N } \to \mathbf { L S T M + P O I N T }$ ER
297
+
298
+ get os platform as string get name
299
+ get platform
300
+ get current platform string
301
+
302
+ # C# Sample 4
303
+
304
+ public override DbGeometryWellKnownValue CreateWellKnownValue(DbGeometry geometryValue){ geometryValue.CheckNull("geometryValue"); var spatialValue $=$ geometryValue.AsSpatialValue(); DbGeometryWellKnownValue result $=$ CreateWellKnownValue(spatialValue, () $= >$ SpatialExceptions.CouldNotCreateWellKnownGeometryValueNoSrid("geometryValue"), () $= >$ SpatialExceptions.CouldNotCreateWellKnownGeometryValueNoWkbOrWkt("geometryValue"), (srid, wkb, wkt) $= >$ new DbGeometryWellKnownValue () { CoordinateSystemId $=$ srid , WellKnownBinary $=$ wkb , WellKnownText $=$ wkt }); return result;
305
+ }
306
+
307
+ Ground truth BILSTM LSTM BILSTM+GN $\ J \to \mathbf { L S T N }$ BILSTM+G $\mathbf { N N } \to \mathbf { L S T M } +$ POINTER create well known value spatial geometry from xml geometry point get well known value
308
+
309
+ # Java Sample 1
310
+
311
+ public static void _(String name, int expected, MetricsRecordBuilder rb) { Assert.assertEquals("Bad value for metric " $^ +$ name, expected, getIntCounter(name, rb));
312
+ }
313
+
314
+ Ground truth assert counter BILSTM LSTM assert email value BILSTM+GNN $\ J \to \mathbf { L S T N }$ M assert header BILSTM+GNN LSTM+POINTER assert int counter
315
+
316
+ B NATURAL LANGUAGE SUMMARIZATION SAMPLES
317
+
318
+ <table><tr><td rowspan=1 colspan=1>Input: -LRB- CNN -RRB- Gunshots were fired at rapper Lil Wayne &#x27;s tour bus early Sunday inAtlanta .No one was injured in the shooting ,and no arrests have been made,Atlanta Police spokeswoman Elizabeth Espy said .Police are stillooking for suspects . Ofcers were called to aparking lot in Atlanta &#x27;s Buckhead neighborhood,Espy said .They arrived at 3:25 a.m. and locatedtwo tour buses that had been shot multiple times .The drivers of the buses said the incident occurredon Interstate 285 near Interstate 75,Espy said .Witnesses provided a limited description of the twovehicles suspected to be involved : a“ Corvette style vehicle ”and an SUV .Lil Wayne was in Atlantafor a performance at Compound nightclub Saturday night . CNN &#x27;s Carma Hassan contributed to thisreport .</td></tr><tr><td rowspan=1 colspan=1>Reference: rapper lil wayne not injured after shots fired at his tour bus on an atlanta interstate ,police say . no one has been arrested in the shooting</td></tr><tr><td rowspan=1 colspan=1>See et al. (2017) (+ Pointer): police are stillooking for suspects . the incident occurred on interstate285 near interstate 75 ,police say . witnesses provided a limited description of the two vehicles suspected to be involved : a“ corvette style vehicle ” and an suv .</td></tr><tr><td rowspan=1 colspan=1>See et al. (2017) (+ Pointer + Coverage): lil wayne &#x27;s tour bus was shot multiple times , police say: police are stillooking for suspects .they arrived at 3:25 a.m. and located two tour buses that hadbeen shot .</td></tr><tr><td rowspan=1 colspan=1>BILSTM+GNN → LSTM: the incident occurred on interstate %UNK% near interstate 75 . no onewas injured in the shooting ,and no arrests have been made ,atlanta police spokeswoman says .</td></tr><tr><td rowspan=1 colspan=1>BILSTM+GNN →LSTM+PoINTER gunshots fired at rapper lil wayne &#x27;s tour bus early sundayin atlanta ,police say . no one was injured in the shooting ,and no arrests have been made , policesay.</td></tr></table>
319
+
320
+ <table><tr><td rowspan=1 colspan=1>Input: Tottenham have held further discussions with Marseille over a potential deal for midfielderFlorian Thauvin .The 22-year-old has been left out of the squad for this weekend &#x27;s game withMetz as Marseille push for a f 15m sale .The winger,who can also play behind the striker, wasthe subject of enquiries from Spurs earlier in the year and has also been watched by Chelsea andValencia .Tottenham have held further talks with Ligue 1 side Marseille over a possible deal forFlorian Thauvin .Marseille are already resigned to losing Andre Ayew and Andre-Pierre Gignacwith English sides keen on both .Everton,Newcastle and Swansea,have allshown an interest inAyew,who is a free agent in the summer .</td></tr><tr><td rowspan=1 colspan=1>Reference: florian thauvin has been left out of marseille &#x27;s squad with metz . marseille are pushingfor a f 15m sale and tottenham are interested .the winger has also been watched by chelsea and laliga side valencia .</td></tr><tr><td rowspan=1 colspan=1>See et al. (2O17)(+ Pointer): tottenham have held further discussions with marseille over a potentialdeal for midfelder florian thauvin .the 22-year-old has been left out of the squad for this weekend &#x27;s game with metz as marseille push for a 15m sale .</td></tr><tr><td rowspan=1 colspan=1>See et al. (2017) (+ Pointer + Coverage): florian thauvin has been left out of the squad for thisweekend &#x27;s game with metz as marseille push for a 15m sale .the 22-year-old was the subject ofenquiries from spurs earlier in the year .</td></tr><tr><td rowspan=1 colspan=1>BILSTM+GNN →LSTM: the 22-year-old has been left out of the squad for this weekend &#x27;s gamewith metz .the 22-year-old has been left out of the squad for this weekend &#x27;s game with metz .thewinger has been left out of the squad for this weekend &#x27;s game with metz .</td></tr><tr><td rowspan=1 colspan=1>BILSTM+GNN → LSTM+PoINTER tottenham have held further discussions with marseille overa potential deal .the winger has been left out of the squad for this weekend &#x27;s game .tottenham haveheld further talks with marseille over a potential deal .</td></tr></table>
321
+
322
+ # C CODE DATASETS INFORMATION
323
+
324
+ # C.1 C# DATASET
325
+
326
+ We extract the C# dataset from open-source projects on GitHub. Overall, our dataset contains 460,905 methods, 55,635 of which have a documentation comment. The dataset is split $8 5 - 5 - 1 0 \%$ . The projects and exact state of the repositories used is listed in Table 3
327
+
328
+ Table 3: Projects in our C# dataset. Ordered alphabetically.
329
+
330
+ <table><tr><td>Name</td><td>Git SHA</td><td>Description</td></tr><tr><td>Akka.NET</td><td>6f32f6a7</td><td>Actor-based Concurrent &amp; Distributed Framework</td></tr><tr><td>AutoMapper</td><td>19d6f7fc</td><td>Object-to-Object Mapping Library</td></tr><tr><td>BenchmarkDotNet</td><td>57005f05</td><td>Benchmarking Library</td></tr><tr><td>CommonMark.NET</td><td>f3d54530</td><td>Markdown Parser</td></tr><tr><td>CoreCLR</td><td>cc5dcbe6</td><td>.NET Core Runtime</td></tr><tr><td>CoreFx</td><td>ec1671fd</td><td>.NETFoundationalLibraries</td></tr><tr><td>Dapper</td><td>3c7cde28</td><td>Object Mapper Library</td></tr><tr><td>EntityFramework</td><td>c4d9a269</td><td>Object-Relational Mapper</td></tr><tr><td>Humanizer</td><td>2b1c94c4</td><td>String Manipulation and Formatting</td></tr><tr><td>Lean</td><td>90ee6aae</td><td>Algorithmic Trading Engine</td></tr><tr><td>Mono</td><td>9b9e4f4b</td><td>.NET Implementation</td></tr><tr><td>MsBuild</td><td>7f95dc15</td><td>Build Engine</td></tr><tr><td>Nancy</td><td>de458a9b</td><td>HTTP Service Framework</td></tr><tr><td>NLog</td><td>49fdd08e</td><td>Logging Library</td></tr><tr><td>Opserver</td><td>9e4d3a40</td><td>Monitoring System</td></tr><tr><td>orleans</td><td>f89c5866</td><td>Distributed Virtual Actor Model</td></tr><tr><td>Polly</td><td>f3d2973d</td><td>Resilience &amp; Transient Fault Handling Library</td></tr><tr><td>Powershell</td><td>9ac701db</td><td>Command-line Shell</td></tr><tr><td>ravendb</td><td>6437de30</td><td>Document Database</td></tr><tr><td>roslyn</td><td>8ca0a542</td><td>Compiler &amp; Code Analysis &amp; Compilation</td></tr><tr><td>ServiceStack</td><td>17f081b9</td><td>Real-time web library</td></tr><tr><td>SignalR</td><td>9b05bcb0</td><td>Push Notification Framework</td></tr><tr><td>Wox</td><td>13e6c5ee</td><td>Application Launcher</td></tr></table>
331
+
332
+ # C.2 JAVA METHOD NAMING DATASETS
333
+
334
+ We use the datasets and splits of Alon et al. (2018a) provided by their website. Upon scanning all methods in the dataset, the size of the corpora can be seen in Table 4. More information can be found at Alon et al. (2018a).
335
+
336
+ # C.3 PYTHON METHOD DOCUMENTATION DATASET
337
+
338
+ We use the dataset as split of Barone & Sennrich (2017) provided by their GitHub repository. Upon parsing the dataset, we get 106,065 training samples, 1,943 validation samples and 1,937 test samples. We note that $1 6 . 9 \%$ of the documentation samples in the validation set and $1 5 . 3 \%$ of the samples in test set have a sample with the identical natural language documentation on the training set. This eludes to a potential issue, described by Lopes et al. (2017). See Allamanis (2018) for a lengthier discussion of this issue.
339
+
340
+ Table 4: The statistics of the extracted graphs from the Java method naming dataset of Alon et al. (2018a).
341
+
342
+ <table><tr><td>Dataset</td><td>Train Size</td><td>Valid Size</td><td>Test Size</td></tr><tr><td>Java - Small</td><td>691,505</td><td>23,837</td><td>56,952</td></tr></table>
343
+
344
+ # C.4 GRAPH DATA STATISTICS
345
+
346
+ Below we present the data characteristics of the graphs we use across the datasets.
347
+
348
+ Table 5: Graph Statistics For Datasets.
349
+
350
+ <table><tr><td>Dataset</td><td>Avg Num Nodes</td><td>Avg Num Edges</td></tr><tr><td>CNN/DM</td><td>903.2</td><td>2532.9</td></tr><tr><td>C# Method Names</td><td>125.2</td><td>239.3</td></tr><tr><td>C# Documentation</td><td>133.5</td><td>265.9</td></tr><tr><td>Java-SmallMethod Names</td><td>144.4</td><td>251.6</td></tr></table>
parse/train/H1ersoRqtm/H1ersoRqtm_content_list.json ADDED
@@ -0,0 +1,1902 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "STRUCTURED NEURAL SUMMARIZATION ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 176,
8
+ 98,
9
+ 666,
10
+ 121
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Patrick Fernandes, Miltiadis Allamanis & Marc Brockschmidt ",
17
+ "bbox": [
18
+ 183,
19
+ 143,
20
+ 620,
21
+ 159
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Microsoft Research \nCambridge, United Kingdom \n{t-pafern,miallama,mabrocks}@microsoft.com ",
28
+ "bbox": [
29
+ 184,
30
+ 161,
31
+ 598,
32
+ 202
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "ABSTRACT ",
39
+ "text_level": 1,
40
+ "bbox": [
41
+ 454,
42
+ 237,
43
+ 544,
44
+ 252
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "Summarization of long sequences into a concise statement is a core problem in natural language processing, requiring non-trivial understanding of the input. Based on the promising results of graph neural networks on highly structured data, we develop a framework to extend existing sequence encoders with a graph component that can reason about long-distance relationships in weakly structured data such as text. In an extensive evaluation, we show that the resulting hybrid sequence-graph models outperform both pure sequence models as well as pure graph models on a range of summarization tasks. ",
51
+ "bbox": [
52
+ 233,
53
+ 280,
54
+ 766,
55
+ 391
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "1 INTRODUCTION ",
62
+ "text_level": 1,
63
+ "bbox": [
64
+ 176,
65
+ 444,
66
+ 336,
67
+ 460
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Summarization, the task of condensing a large and complex input into a smaller representation that retains the core semantics of the input, is a classical task for natural language processing systems. Automatic summarization requires a machine learning component to identify important entities and relationships between them, while ignoring redundancies and common concepts. ",
74
+ "bbox": [
75
+ 174,
76
+ 484,
77
+ 825,
78
+ 540
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "Current approaches to summarization are based on the sequence-to-sequence paradigm over the words of some text, with a sequence encoder — typically a recurrent neural network, but sometimes a 1D-CNN (Narayan et al., 2018) or using self-attention (McCann et al., 2018) — processing the input and a sequence decoder generating the output. Recent successful implementations of this paradigm have substantially improved performance by focusing on the decoder, extending it with an attention mechanism over the input sequence and copying facilities (See et al., 2017; McCann et al., 2018). However, while standard encoders (e.g. bidirectional LSTMs) theoretically have the ability to handle arbitrary long-distance relationships, in practice they often fail to correctly handle long texts and are easily distracted by simple noise (Jia & Liang, 2017). ",
85
+ "bbox": [
86
+ 174,
87
+ 547,
88
+ 825,
89
+ 674
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "In this work, we focus on an improvement of sequence encoders that is compatible with a wide range of decoder choices. To mitigate the long-distance relationship problem, we draw inspiration from recent work on highly-structured objects (Li et al., 2015; Kipf & Welling, 2017; Gilmer et al., 2017; Allamanis et al., 2018; Cvitkovic et al., 2018). In this line of work, highly-structured data such as entity relationships, molecules and programs is modelled using graphs. Graph neural networks are then successfully applied to directly learn from these graph representations. Here, we propose to extend this idea to weakly-structured data such as natural language. Using existing tools, we can annotate (accepting some noise) such data with additional relationships (e.g. co-references) to obtain a graph. However, the sequential aspect of the input data is still rich in meaning, and thus we propose a hybrid model in which a standard sequence encoder generates rich input for a graph neural network. In our experiments, the resulting combination outperforms baselines that use pure sequence or pure graph-based representations. ",
96
+ "bbox": [
97
+ 174,
98
+ 680,
99
+ 825,
100
+ 847
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "Briefly, the contributions of our work are: 1. A framework that extends standard sequence encoder models with a graph component that leverages additional structure in sequence data. 2. Application of this extension to a range of existing sequence models and an extensive evaluation on three summarization tasks from the literature. 3. We release all used code and data at https://github.com/CoderPat/structured-neural-summarization. ",
107
+ "bbox": [
108
+ 174,
109
+ 854,
110
+ 825,
111
+ 922
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "public void Add(string name, object value $=$ null, DbType? dbType $=$ null, ParameterDirection? direction $=$ null, int? size $=$ null, byte? precision $=$ null, byte? scale $=$ null) { parameters[Clean(name) $] =$ new ParamInfo{ Name $=$ name, Value $=$ value, ParameterDirection $=$ direction ?? ParameterDirection.Input, DbType $=$ dbType, Size $=$ size, Precision $=$ precision, Scale $=$ scale };} ",
118
+ "bbox": [
119
+ 173,
120
+ 108,
121
+ 808,
122
+ 210
123
+ ],
124
+ "page_idx": 1
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "Ground truth: BILSTM LSTM: $\\mathbf { B I L S T M + G N N } \\to \\mathbf { L S T M } .$ : $\\mathbf { B I L S T M + G N N } \\to \\mathbf { L S T M + P O I N T E R }$ : ",
129
+ "bbox": [
130
+ 183,
131
+ 224,
132
+ 426,
133
+ 275
134
+ ],
135
+ "page_idx": 1
136
+ },
137
+ {
138
+ "type": "text",
139
+ "text": "add a parameter to this dynamic parameter list adds a new parameter to the specified parameter creates a new instance of the dynamic type specified add a parameter to a list of parameters ",
140
+ "bbox": [
141
+ 442,
142
+ 224,
143
+ 753,
144
+ 275
145
+ ],
146
+ "page_idx": 1
147
+ },
148
+ {
149
+ "type": "text",
150
+ "text": "Figure 1: An example from the dataset for the METHODDOC source code summarization task along with the outputs of a baseline and our models. In the METHODNAMING dataset, this method appears as a sample requiring to predict the name Add as a subtoken sequence of length 1. ",
151
+ "bbox": [
152
+ 174,
153
+ 281,
154
+ 821,
155
+ 324
156
+ ],
157
+ "page_idx": 1
158
+ },
159
+ {
160
+ "type": "text",
161
+ "text": "2 STRUCTURED SUMMARIZATION TASKS ",
162
+ "text_level": 1,
163
+ "bbox": [
164
+ 176,
165
+ 359,
166
+ 531,
167
+ 376
168
+ ],
169
+ "page_idx": 1
170
+ },
171
+ {
172
+ "type": "text",
173
+ "text": "In this work, we consider three summarization tasks with different properties. All tasks follow the common pattern of translating a long (structured) sequence into a shorter sequence while trying to preserve as much meaning as possible. The first two tasks are related to the summarization of source code (Figure 1), which is highly structured and thus can profit most from models that can take advantage of this structure; the final task is a classical natural language task illustrating that hybrid sequence-graph models are applicable for less structured inputs as well. ",
174
+ "bbox": [
175
+ 174,
176
+ 397,
177
+ 825,
178
+ 481
179
+ ],
180
+ "page_idx": 1
181
+ },
182
+ {
183
+ "type": "text",
184
+ "text": "METHODNAMING The aim of this task is to infer the name of a function (or method in objectoriented languages, such as Java, Python and C#) given its source code (Allamanis et al., 2016). Although method names are a single token, they are usually composed of one or more subtokens (split using snake case or camelCase) and thus, the method naming task can be cast as predicting a sequence of subtokens. Consequently, method names represent an “extreme” summary of the functionality of a given function (on average, the names in the Java dataset have only 2.9 subtokens). Notably, the vocabulary of tokens used in names is very large (due to abbreviations and domainspecific jargon), but this is mitigated by the fact that $33 \\%$ of subtokens in names can be copied directly from subtokens in the method’s source code. Finally, source code is highly structured input data with known semantics, which can be exploited to support name prediction. ",
185
+ "bbox": [
186
+ 174,
187
+ 507,
188
+ 826,
189
+ 647
190
+ ],
191
+ "page_idx": 1
192
+ },
193
+ {
194
+ "type": "text",
195
+ "text": "METHODDOC Similar to the first task, the aim of this task is to predict a succinct description of the functionality of a method given its source code (Barone & Sennrich, 2017). Such descriptions usually appear as documentation of methods (e.g. “docstrings” in Python or “JavaDocs” in Java). While the task shares many characteristics with the METHODNAMING task, the target sequence is substantially longer (on average 19.1 tokens in our C# dataset) and only $1 9 . 4 \\%$ of tokens in the documentation can be copied from the code. While method documentation is nearer to standard natural language than method names, it mixes project-specific jargon, code segments and often describes non-functional aspects of the code, such as performance characteristics and design considerations. ",
196
+ "bbox": [
197
+ 174,
198
+ 674,
199
+ 825,
200
+ 785
201
+ ],
202
+ "page_idx": 1
203
+ },
204
+ {
205
+ "type": "text",
206
+ "text": "NLSUMMARIZATION Finally, we consider the classic summarization of natural language as widely studied in NLP research. Specifically, we are interested in abstractive summarization, where given some text input (e.g. a news article) a machine learning model produces a novel natural language summary. Traditionally, NLP summarization methods treat text as a sequence of sentences and each one of them as a sequence of words (tokens). The input data has less explicitly defined structure than our first two tasks. However, we recast the task as a structured summarization problem by considering additional linguistic structure, including named entities and entity coreferences as inferred by existing NLP tools. ",
207
+ "bbox": [
208
+ 174,
209
+ 811,
210
+ 825,
211
+ 924
212
+ ],
213
+ "page_idx": 1
214
+ },
215
+ {
216
+ "type": "text",
217
+ "text": "3 MODEL ",
218
+ "text_level": 1,
219
+ "bbox": [
220
+ 176,
221
+ 102,
222
+ 267,
223
+ 117
224
+ ],
225
+ "page_idx": 2
226
+ },
227
+ {
228
+ "type": "text",
229
+ "text": "As discussed above, standard neural approaches to summarization follow the sequence-to-sequence framework. In this setting, most decoders only require a representation $^ { h }$ of the complete input sequence (e.g. the final state of an RNN) and per-token representations $h _ { t _ { i } }$ for each input token $t _ { i }$ These token representations are then used as the “memories” of an attention mechanism (Bahdanau et al., 2014; Luong et al., 2015) or a pointer network (Vinyals et al., 2015a). ",
230
+ "bbox": [
231
+ 174,
232
+ 133,
233
+ 825,
234
+ 204
235
+ ],
236
+ "page_idx": 2
237
+ },
238
+ {
239
+ "type": "text",
240
+ "text": "In this work, we propose an extension of sequence encoders that allows us to leverage known (or inferred) relationships among elements in the input data. To achieve that, we combine sequence encoders with graph neural networks (GNNs) (Li et al., 2015; Gilmer et al., 2017; Kipf & Welling, 2017). For this, we first use a standard sequential encoder (e.g. bidirectional RNNs) to obtain a pertoken representation $h _ { t _ { i } }$ , which we then feed into a GNN as the initial node representations. The resulting per-node (i.e. per-token) representations $\\boldsymbol { h } _ { t _ { i } } ^ { \\prime }$ can then be used by an unmodified decoder. Experimentally, we found this to surpass models that use either only the sequential structure or only the graph structure (see Sect. 4). We now discuss the different parts of our model in detail. ",
241
+ "bbox": [
242
+ 173,
243
+ 210,
244
+ 826,
245
+ 321
246
+ ],
247
+ "page_idx": 2
248
+ },
249
+ {
250
+ "type": "text",
251
+ "text": "Gated Graph Neural Networks To process graphs, we follow Li et al. (2015) and briefly summarize the core concepts of GGNNs here. A graph $\\mathcal { G } = ( \\nu , \\pmb { \\varepsilon } , \\pmb { X } )$ is composed of a set of nodes $\\nu$ , node features $\\boldsymbol { X }$ , and a list of directed edge sets ${ \\pmb { \\mathcal { E } } } = ( { \\mathcal { E } } _ { 1 } , \\dots , { \\mathcal { E } } _ { K } )$ where $K$ is the number of edge types. Each $v \\in \\nu$ is associated with a real-valued vector $\\scriptstyle { \\mathbf { { \\mathit { x } } } } _ { \\mathit { v } }$ representing the features of the node (e.g., the embedding of a string label of that node), which is used for the initial state ${ h } _ { v } ^ { ( 0 ) }$ of a node. ",
252
+ "bbox": [
253
+ 174,
254
+ 338,
255
+ 825,
256
+ 411
257
+ ],
258
+ "page_idx": 2
259
+ },
260
+ {
261
+ "type": "text",
262
+ "text": "Information is propagated through the graph using neural message passing (Gilmer et al., 2017). For this, every node $v$ sends messages to its neighbors by transforming its current representation $\\boldsymbol { h } _ { v } ^ { ( i ) }$ using an edge-type dependent function $f _ { k }$ . Here, $f _ { k }$ can be an arbitrary function; we use a simple linear layer. By computing all messages at the same time, all states can be updated simultaneously. In particular, a new state for a node $v$ is computed by aggregating all incoming messages as $m _ { v } ^ { ( i ) } = \\bar { g } ( \\{ f _ { k } ( h _ { u } ^ { ( i ) } ) \\} )$ there is an edge of type $k$ from $u$ to $v \\}$ ). $g$ is an aggregation function; we use elementwise summation for $g$ . Given the aggregated message $\\mathbf { \\it { m } } _ { v } ^ { ( i ) }$ and the current state vector $\\boldsymbol { h } _ { v } ^ { ( i ) }$ of node $v$ , we can compute the new state 1) = GRU(m(i)v , h(i)v ), where GRU is the recurrent cell function of a gated recurrent unit. These dynamics are rolled out for a fixed number of timesteps $T$ , and the state vectors resulting from the final step are used as output node representations, i.e., $\\mathrm { G N N } ( ( \\mathcal { V } , \\pmb { \\mathcal { E } } , X ) ) = \\{ \\pmb { h } _ { v } ^ { ( T ) } \\} _ { v \\in \\mathcal { V } }$ . ",
263
+ "bbox": [
264
+ 173,
265
+ 417,
266
+ 826,
267
+ 588
268
+ ],
269
+ "page_idx": 2
270
+ },
271
+ {
272
+ "type": "text",
273
+ "text": "Sequence GNNs We now explain our novel combination of GGNNs and standard sequence encoders. As input, we take a sequence $\\boldsymbol { S } = \\left[ s _ { 1 } \\ldots s _ { N } \\right]$ and $K$ binary relationships $R _ { 1 } \\ldots R _ { K } \\in S \\times S$ between elements of the sequence. For example, $R _ { = }$ could be the equality relationship $\\left\\{ \\left( s _ { i } , s _ { j } \\right) \\right. \\mid$ $s _ { i } = s _ { j } \\}$ . The choice and construction of relationships is dataset-dependent, and will be discussed in detail in Sect. 4. Given any sequence encoder $\\mathcal { S E }$ that maps $S$ to per-element representations $\\left[ \\mathbf { e } _ { 1 } \\ldots \\mathbf { e } _ { N } \\right]$ and a sequence representation e (e.g. a bidirectional RNN), we can construct the sequence GNN $\\mathcal { S } \\mathcal { E } _ { G N N }$ by simply computing $\\mathbf { \\bar { e } } _ { 1 } ^ { \\prime } \\cdot \\cdot \\cdot \\mathbf { e } _ { N } ^ { \\prime } ] = \\mathbf { G N N } ( ( S , [ R _ { 1 } \\dots R _ { K } ] , [ \\mathbf { e } _ { 1 } \\dots \\mathbf { e } _ { N } ] ) )$ . To obtain a graph-level representation, we use the weighted averaging mechanism from Gilmer et al. (2017). Concretely, for each node $v$ in the graph, we compute a weight $\\sigma ( w ( \\pmb { h } _ { v } ^ { ( T ) } ) ) \\in [ 0 , 1 ]$ using a learnable function $w$ and the logistic sigmoid $\\sigma$ and compute a graph-level representation as $\\begin{array} { r } { \\hat { \\mathbf { e } } \\equiv \\sum _ { 1 \\leq i \\leq N } \\sigma ( w ( \\mathbf { e } _ { i } ^ { \\prime } ) ) \\cdot \\mathbb { N } ( \\mathbf { e } _ { i } ^ { \\prime } ) } \\end{array}$ , where $\\aleph$ is another learnable projection function. We found that best results were achieved by computing the final $\\mathbf { e ^ { \\prime } }$ as $W \\cdot ( \\mathbf { e } \\hat { \\mathbf { e } } )$ for some learnable matrix $W$ . ",
274
+ "bbox": [
275
+ 173,
276
+ 603,
277
+ 826,
278
+ 775
279
+ ],
280
+ "page_idx": 2
281
+ },
282
+ {
283
+ "type": "text",
284
+ "text": "This method can easily be extended to support additional nodes not present in the original sequence $S$ after running $\\mathcal { S E }$ (e.g., to accommodate meta-nodes representing sentences, or non-terminal nodes from a syntax tree). The initial node representation for these additional nodes can come from other sources, such as a simple embedding of their label. ",
285
+ "bbox": [
286
+ 174,
287
+ 781,
288
+ 825,
289
+ 837
290
+ ],
291
+ "page_idx": 2
292
+ },
293
+ {
294
+ "type": "text",
295
+ "text": "Implementation Details. Processing large graphs of different shapes efficiently requires to overcome some engineering challenges. For example, the CNN/DM corpus has (on average) about 900 nodes per graph. To allow efficient computation, we use the trick of Allamanis et al. (2018) where all graphs in a minibatch are “flattened” into a single graph with multiple disconnected components. The varying graph sizes also represent a problem for the attention and copying mechanisms in the decoder, as they require to compute a softmax over a variable-sized list of memories. To handle this efficiently without padding, we associate each node in the (flattened) “batch” graph with the index of the sample in the minibatch from which the node originated. Then, using TensorFlow’s unsorted segment $\\mathbf { \\nabla } _ { \\cdot } \\star$ operations, we can perform an efficient and numerically stable softmax over the variable number of representations of the nodes of each graph. ",
296
+ "bbox": [
297
+ 174,
298
+ 853,
299
+ 825,
300
+ 924
301
+ ],
302
+ "page_idx": 2
303
+ },
304
+ {
305
+ "type": "text",
306
+ "text": "",
307
+ "bbox": [
308
+ 174,
309
+ 103,
310
+ 825,
311
+ 174
312
+ ],
313
+ "page_idx": 3
314
+ },
315
+ {
316
+ "type": "text",
317
+ "text": "4 EVALUATION ",
318
+ "text_level": 1,
319
+ "bbox": [
320
+ 176,
321
+ 195,
322
+ 315,
323
+ 212
324
+ ],
325
+ "page_idx": 3
326
+ },
327
+ {
328
+ "type": "text",
329
+ "text": "4.1 QUANTITATIVE EVALUATION ",
330
+ "text_level": 1,
331
+ "bbox": [
332
+ 176,
333
+ 227,
334
+ 415,
335
+ 242
336
+ ],
337
+ "page_idx": 3
338
+ },
339
+ {
340
+ "type": "text",
341
+ "text": "We evaluate Sequence GNNs on our three tasks by comparing them to models that use only sequence or graph information, as well as by comparing them to task-specific baselines. We discuss the three tasks, their respective baselines and how we present the data to the models (including the relationships considered in the graph component) next before analyzing the results. ",
342
+ "bbox": [
343
+ 174,
344
+ 253,
345
+ 825,
346
+ 309
347
+ ],
348
+ "page_idx": 3
349
+ },
350
+ {
351
+ "type": "text",
352
+ "text": "4.1.1 SETUP FOR METHODNAMING ",
353
+ "text_level": 1,
354
+ "bbox": [
355
+ 176,
356
+ 327,
357
+ 433,
358
+ 340
359
+ ],
360
+ "page_idx": 3
361
+ },
362
+ {
363
+ "type": "text",
364
+ "text": "Datasets, Metrics, and Models. We consider two datasets for the METHODNAMING task. First, we consider the “Java (small)” dataset of Alon et al. (2018a), re-using the train-validation-test splits they have picked. We additionally generated a new dataset from 23 open-source C# projects mined from GitHub (see below for the reasons for this second dataset), removing any duplicates. More information about these datasets can be found in Appendix C. We follow earlier work on METHODNAMING (Allamanis et al., 2016; Alon et al., 2018a) and measure performance using the F1 score over the generated subtokens. However, since the task can be viewed as a form of (extreme) summarization, we also report ROUGE-2 and ROUGE-L scores (Lin, 2004), which we believe to be additional useful indicators for the quality of results. ROUGE-1 is omitted since it is equivalent to F1 score. We note that there is no widely accepted metric for this task and further work identifying the most appropriate metric is required. ",
365
+ "bbox": [
366
+ 174,
367
+ 351,
368
+ 826,
369
+ 503
370
+ ],
371
+ "page_idx": 3
372
+ },
373
+ {
374
+ "type": "text",
375
+ "text": "We compare to the current state of the art (Alon et al., 2018a), as well as a sequence-to-sequence implementation from the OpenNMT project (Klein et al.). Concretely, we combine two encoders (a bidirectional LSTM encoder with 1 layer and 256 hidden units, and its sequence GNN extension with 128 hidden units unrolled over 8 timesteps) with two decoders (an LSTM decoder with 1 layer and 256 hidden units with attention over the input sequence, and an extension using a pointer network-style copying mechanism (Vinyals et al., 2015a)). Additionally, we consider self-attention as an alternative to RNN-based sequence encoding architectures. For this, we use the Transformer (Vaswani et al., 2017) implementation in OpenNMT (i.e., using self-attention both for the decoder and the encoder) as a baseline and compare it to a version whose encoder is extended with a GNN component. ",
376
+ "bbox": [
377
+ 174,
378
+ 511,
379
+ 825,
380
+ 636
381
+ ],
382
+ "page_idx": 3
383
+ },
384
+ {
385
+ "type": "text",
386
+ "text": "Data Representation Following the work of Allamanis et al. (2016); Alon et al. (2018a), we break up all identifier tokens (i.e. variables, methods, classes, etc.) in the source code into subtokens by splitting them according to camelCase and pascal case heuristics. This allows the models to extract information from the information-rich subtoken structure, and ensures that a copying mechanism in the decoder can directly copy relevant subtokens, something that we found to be very effective for this task. All models are provided with all (sub)tokens belonging to the source code of a method, including its declaration, with the actual method name replaced by a placeholder symbol. ",
387
+ "bbox": [
388
+ 174,
389
+ 651,
390
+ 825,
391
+ 750
392
+ ],
393
+ "page_idx": 3
394
+ },
395
+ {
396
+ "type": "text",
397
+ "text": "To construct a graph from the (sub)tokens, we implement a simplified form of the work of Allamanis et al. (2018). First, we introduce additional nodes for each (full) identifier token, and connect the constituent subtokens appearing in the input sequence using a INTOKEN edge; we additionally connect these nodes using a NEXTTOKEN edge. We also add nodes for the parse tree and use edges to indicate that one node is a CHILD of another. Finally, we add LASTLEXICALUSE edges to connect identifiers to their most (lexically) recent use in the source code. ",
398
+ "bbox": [
399
+ 174,
400
+ 757,
401
+ 825,
402
+ 840
403
+ ],
404
+ "page_idx": 3
405
+ },
406
+ {
407
+ "type": "text",
408
+ "text": "4.1.2 SETUP FOR METHODDOC ",
409
+ "text_level": 1,
410
+ "bbox": [
411
+ 176,
412
+ 856,
413
+ 405,
414
+ 871
415
+ ],
416
+ "page_idx": 3
417
+ },
418
+ {
419
+ "type": "text",
420
+ "text": "Datasets, Metrics, and Models. We tried to evaluate on the Python dataset of Barone & Sennrich (2017) that contains pairs of method declarations and their documentation (“docstring”). However, following the work of Lopes et al. (2017), we found extensive duplication between different folds of the dataset and were only able to reach comparable results by substantially overfitting to the training data that overlapped with the test set. We have documented details in subsection C.3 and in Allamanis (2018), and decided to instead evaluate on our new dataset of 23 open-source C# projects from above, again removing duplicates and methods without documentation. Following Barone & Sennrich (2017), we measure the BLEU score for all models. However, we also report F1, ROUGE-2 and ROUGE-L scores, which should better reflect the summarization aspect of the task. We consider the same models as for the METHODNAMING task, using the same configuration, and use the same data representation. ",
421
+ "bbox": [
422
+ 176,
423
+ 882,
424
+ 825,
425
+ 924
426
+ ],
427
+ "page_idx": 3
428
+ },
429
+ {
430
+ "type": "image",
431
+ "img_path": "images/0f24ece1ecd933d082df2284a4d3190ac4a48d4c10138fc5c01fc0d240b7a43f.jpg",
432
+ "image_caption": [
433
+ "Figure 2: (Partial) graph of an example input from the CNN/DM corpus. "
434
+ ],
435
+ "image_footnote": [],
436
+ "bbox": [
437
+ 173,
438
+ 99,
439
+ 826,
440
+ 266
441
+ ],
442
+ "page_idx": 4
443
+ },
444
+ {
445
+ "type": "text",
446
+ "text": "",
447
+ "bbox": [
448
+ 174,
449
+ 333,
450
+ 825,
451
+ 445
452
+ ],
453
+ "page_idx": 4
454
+ },
455
+ {
456
+ "type": "text",
457
+ "text": "4.1.3 SETUP FOR NLSUMMARIZATION ",
458
+ "text_level": 1,
459
+ "bbox": [
460
+ 176,
461
+ 481,
462
+ 452,
463
+ 494
464
+ ],
465
+ "page_idx": 4
466
+ },
467
+ {
468
+ "type": "text",
469
+ "text": "Datasets, Metrics, and Models. We use the CNN/DM dataset (Hermann et al., 2015) using the exact data and split provided by See et al. (2017). The data is constructed from CNN and Daily Mail news articles along with a few sentences that summarize each article. To measure performance, we use the standard ROUGE metrics. We compare our model with the near-to-state-of-the-art work of See et al. (2017), who use a sequence-to-sequence model with attention and copying as basis, but have additionally substantially improved the decoder component. As our contribution is entirely on the encoder side and our model uses a standard sequence decoder, we are not expecting to outperform more recent models that introduce substantial novelty in the structure or training objective of the decoder (Chen & Bansal, 2018; Narayan et al., 2018). Again, we evaluate our contribution using an OpenNMT-based encoder/decoder combination. Concretely, we use a bidirectional LSTM encoder with 1 layer and 256 hidden units, and its sequence GNN extension with 128 hidden units unrolled over 8 timesteps. As decoder, we use an LSTM with 1 layer and 256 hidden units with attention over the input sequence, and an extension using a pointer network-style copying mechanism. ",
470
+ "bbox": [
471
+ 173,
472
+ 512,
473
+ 825,
474
+ 694
475
+ ],
476
+ "page_idx": 4
477
+ },
478
+ {
479
+ "type": "text",
480
+ "text": "Data Representation We use Stanford CoreNLP (Manning et al., 2014) (version 3.9.1) to tokenize the text and provide the resulting tokens to the encoder. For the graph construction (Figure 2), we extract the named entities and run coreference resolution using CoreNLP. We connect tokens using a NEXT edge and introduce additional super-nodes for each sentence, connecting each token to the corresponding sentence-node using a IN edge. We also connect subsequent sentence-nodes using a NEXT edge. Then, for each multi-token named entity we create a new node, labeling it with the type of the entity and connecting it with all tokens referring to that entity using an IN edge. Finally, coreferences of entities are connected with a special REF edge. Figure 2 shows a partial graph for an article in the CNN/DM dataset. The goal of this graph construction process is to explicitly annotate important relationships that can be useful for summarization. We note that (a) in early efforts we experimented with adding dependency parse edges, but found that they do not provide significant benefits and (b) that since we retrieve the annotations from CoreNLP, they can contain errors and thus, the performance of the our method is influenced by the accuracy of the upstream annotators of named entities and coreferences. ",
481
+ "bbox": [
482
+ 174,
483
+ 729,
484
+ 825,
485
+ 922
486
+ ],
487
+ "page_idx": 4
488
+ },
489
+ {
490
+ "type": "table",
491
+ "img_path": "images/9736507d854d7ae3d25c3d066f5e08fa8e12e5b33e3fbe97e7e9b348dd2f9e0d.jpg",
492
+ "table_caption": [
493
+ "Table 1: Evaluation results for all models and tasks. "
494
+ ],
495
+ "table_footnote": [],
496
+ "table_body": "<table><tr><td>METHODNAMING</td><td>F1</td><td>ROUGE-2</td><td>ROUGE-L</td></tr><tr><td>Java</td><td></td><td></td><td></td></tr><tr><td>Alon et al. (2018a)</td><td>43.0</td><td>一</td><td>1</td></tr><tr><td>SELFATT →SELFATT</td><td>24.9</td><td>8.3</td><td>27.4</td></tr><tr><td>SELFATT+GNN →SELFATT</td><td>44.5</td><td>20.9</td><td>43.4</td></tr><tr><td>BILSTM →LSTM</td><td>35.8</td><td>17.9</td><td>39.7</td></tr><tr><td>BILSTM+GNN →LSTM</td><td>44.7</td><td>21.1</td><td>43.1</td></tr><tr><td>BILSTM →LSTM+POINTER</td><td>42.5</td><td>22.4</td><td>45.6</td></tr><tr><td>GNN →LSTM+POINTER</td><td>50.5</td><td>24.8</td><td>48.9</td></tr><tr><td>BILSTM+GNN→LSTM+POINTER</td><td>51.4</td><td>25.0</td><td>50.0</td></tr><tr><td>C#</td><td></td><td></td><td></td></tr><tr><td>SELFATT →SELFATT</td><td>41.3</td><td>25.2</td><td>43.2</td></tr><tr><td>SELFATT+GNN→→SELFATT</td><td>62.1</td><td>31.0</td><td>61.1</td></tr><tr><td>BILSTM →LSTM</td><td>48.8</td><td>32.8</td><td>51.8</td></tr><tr><td>BILSTM+GNN →LSTM</td><td>62.6</td><td>31.0</td><td>61.3</td></tr><tr><td>BILSTM →LSTM+POINTER</td><td>57.2</td><td>29.7</td><td>60.4</td></tr><tr><td>GNN→LSTM+POINTER</td><td>63.0</td><td>31.5</td><td>61.3</td></tr><tr><td>BILSTM+GNN→LSTM+POINTER</td><td>63.4</td><td>31.9</td><td>62.4</td></tr><tr><td>METHODDOC</td><td>F1</td><td>ROUGE-2</td><td>ROUGE-L</td><td>BLEU</td></tr><tr><td>C#</td><td></td><td></td><td></td><td></td></tr><tr><td>SELFATT →SELFATT</td><td>40.0</td><td>27.8</td><td>41.1</td><td>13.9</td></tr><tr><td>SELFATT+GNN→SELFATT</td><td>37.6</td><td>25.6</td><td>37.9</td><td>21.4</td></tr><tr><td>BILSTM →LSTM</td><td>35.2</td><td>15.3</td><td>30.8</td><td>10.0</td></tr><tr><td>BILSTM+GNN →LSTM</td><td>41.1</td><td>28.9</td><td>41.0</td><td>22.5</td></tr><tr><td>BILSTM →LSTM+POINTER</td><td>35.2</td><td>20.8</td><td>36.7</td><td>14.7</td></tr><tr><td>GNN →LSTM+POINTER</td><td>38.9</td><td>25.6</td><td>37.1</td><td>17.7</td></tr><tr><td>BILSTM+GNN →→LSTM+POINTER (average pooling)</td><td>43.2</td><td>29.0</td><td>41.0</td><td>21.3</td></tr><tr><td>BILSTM+GNN→LSTM+POINTER</td><td>45.4</td><td>28.3</td><td>41.1</td><td>22.2</td></tr><tr><td>NLSUMMARIZATION</td><td>ROUGE-1</td><td>ROUGE-2</td><td>ROUGE-L</td><td></td></tr><tr><td>CNN/DM</td><td></td><td></td><td></td><td></td></tr><tr><td>BILSTM →LSTM</td><td>33.6</td><td>11.4</td><td>27.9</td><td></td></tr><tr><td>BILSTM+GNN→LSTM</td><td>33.0</td><td>13.3</td><td>28.3</td><td></td></tr><tr><td>See et al. (2017) (+ Pointer)</td><td>36.4</td><td>15.7</td><td>33.4</td><td></td></tr><tr><td>BILSTM →LSTM+POINTER</td><td>35.9</td><td>13.9</td><td>30.3</td><td></td></tr><tr><td>BILSTM+GNN →LSTM+POINTER</td><td>38.1</td><td>16.1</td><td>33.2</td><td></td></tr><tr><td>See et al. (2017) (+ Pointer + Coverage)</td><td>39.5</td><td>17.3</td><td>36.4</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr></table>",
497
+ "bbox": [
498
+ 171,
499
+ 119,
500
+ 834,
501
+ 617
502
+ ],
503
+ "page_idx": 5
504
+ },
505
+ {
506
+ "type": "text",
507
+ "text": "4.1.4 RESULTS & ANALYSIS ",
508
+ "text_level": 1,
509
+ "bbox": [
510
+ 174,
511
+ 645,
512
+ 385,
513
+ 660
514
+ ],
515
+ "page_idx": 5
516
+ },
517
+ {
518
+ "type": "text",
519
+ "text": "We show all results in Tab. 1. Results for models from the literature are taken from the respective papers and repeated here. Across all tasks, the results show the advantage of our hybrid sequence GNN encoders over pure sequence encoders. ",
520
+ "bbox": [
521
+ 174,
522
+ 672,
523
+ 825,
524
+ 714
525
+ ],
526
+ "page_idx": 5
527
+ },
528
+ {
529
+ "type": "text",
530
+ "text": "On METHODNAMING, we can see that all GNN-augmented models are able to outperform the current specialized state of the art, requiring only simple graph structure that can easily be obtained using existing parsers for a programming language. The results in performance between the different encoder and decoder configurations nicely show that their effects are largely orthogonal. ",
531
+ "bbox": [
532
+ 174,
533
+ 722,
534
+ 825,
535
+ 777
536
+ ],
537
+ "page_idx": 5
538
+ },
539
+ {
540
+ "type": "text",
541
+ "text": "On METHODDOC, the unmodified SELFATT $ s$ ELFATT model already performs quite well, and the augmentation with graph data only improves the BLEU score and worsens the results on ROUGE. Inspection of the results shows that this is due to the length of predictions. Whereas the ground truth data has on average 19 tokens in each result, SELFATT $ s$ ELFATT predicts on average 11 tokens, and SELFATT+GNN SELFATT 16 tokens. Additionally, we experimented with an ablation in which a model is only using graph information, e.g., a setting comparable to a simplification of the architecture of Allamanis et al. (2018). For this, we configured the GNN to use 128-dimensional representations and unrolled it for 10 timesteps, keeping the decoder configuration as for the other models. The results indicate that this configuration performs less well than a pure sequenced model. We speculate that this is mainly due to the fact that 10 timesteps are insufficient to propagate inforpublic static bool TryFormat(float value, Span<byte> destination, out int bytesWritten, StandardFormat format $=$ default) { return TryFormatFloatingPoint<float>(value, destination, out bytesWritten, format); } ",
542
+ "bbox": [
543
+ 174,
544
+ 785,
545
+ 825,
546
+ 924
547
+ ],
548
+ "page_idx": 5
549
+ },
550
+ {
551
+ "type": "table",
552
+ "img_path": "images/8265df601c5ba5ef05dfa6c6e0c8c05477fe004786c78230eb7168e068ff09b8.jpg",
553
+ "table_caption": [
554
+ "Table 2: Ablations on CNN/DM Corpus "
555
+ ],
556
+ "table_footnote": [],
557
+ "table_body": "<table><tr><td>NLSUMMARIZATION (CNN/DM)</td><td>ROUGE-1</td><td>ROUGE-2</td><td>ROUGE-L</td></tr><tr><td>See et al.(2017) (base)</td><td>31.3</td><td>11.8</td><td>28.8</td></tr><tr><td>See et al. (2017) (+ Pointer)</td><td>36.4</td><td>15.7</td><td>33.4</td></tr><tr><td>See et al.(2017) (+ Pointer + Coverage)</td><td>39.5</td><td>17.3</td><td>36.4</td></tr><tr><td>BILSTM →LSTM</td><td>33.6</td><td>11.4</td><td>27.9</td></tr><tr><td>BILSTM →LSTM+POINTER</td><td>35.9</td><td>13.9</td><td>30.3</td></tr><tr><td>BILSTM →LSTM+PoINTER (+ coref/entity annotations)</td><td>36.2</td><td>14.2</td><td>30.5</td></tr><tr><td>BILSTM+GNN →LSTM</td><td>33.0</td><td>13.3</td><td>28.3</td></tr><tr><td>BILSTM+GNN→LSTM+POINTER (only sentence nodes)</td><td>36.0</td><td>15.2</td><td>29.6</td></tr><tr><td>BILSTM+GNN →LSTM+POINTER (sentence nodes + eq edges)</td><td>36.1</td><td>15.4</td><td>30.3</td></tr><tr><td>BILSTM+GNN→LSTM+POINTER</td><td>38.1</td><td>16.1</td><td>33.2</td></tr></table>",
558
+ "bbox": [
559
+ 173,
560
+ 121,
561
+ 821,
562
+ 282
563
+ ],
564
+ "page_idx": 6
565
+ },
566
+ {
567
+ "type": "text",
568
+ "text": "",
569
+ "bbox": [
570
+ 176,
571
+ 309,
572
+ 767,
573
+ 361
574
+ ],
575
+ "page_idx": 6
576
+ },
577
+ {
578
+ "type": "text",
579
+ "text": "Ground truth BILSTM LSTM BILST $\\mathbf { M } \\mathbf { + } \\mathbf { G N N } \\to \\mathbf { L S T M }$ B $\\mathbf { \\mathbf { \\mathbf { I L S T M + G N N } } } \\mathbf { \\mathbf { \\Phi } } \\to \\mathbf { \\mathbf { \\mathbf { L S T M + P O I N T E R } } }$ formats a single as a utf8 string formats a number of bytes in a utf8 string formats a timespan as a utf8 string formats a float as a utf8 string ",
580
+ "bbox": [
581
+ 183,
582
+ 376,
583
+ 423,
584
+ 425
585
+ ],
586
+ "page_idx": 6
587
+ },
588
+ {
589
+ "type": "text",
590
+ "text": "",
591
+ "bbox": [
592
+ 441,
593
+ 375,
594
+ 686,
595
+ 426
596
+ ],
597
+ "page_idx": 6
598
+ },
599
+ {
600
+ "type": "text",
601
+ "text": "Figure 3: An example from the dataset for the METHODDOC source code summarization task along with the outputs of a baseline and our models. ",
602
+ "bbox": [
603
+ 173,
604
+ 433,
605
+ 821,
606
+ 462
607
+ ],
608
+ "page_idx": 6
609
+ },
610
+ {
611
+ "type": "text",
612
+ "text": "mation across the whole graph, especially in combination with summation as aggregation function for messages in graph information propagation. ",
613
+ "bbox": [
614
+ 174,
615
+ 501,
616
+ 823,
617
+ 529
618
+ ],
619
+ "page_idx": 6
620
+ },
621
+ {
622
+ "type": "text",
623
+ "text": "Finally, on NLSUMMARIZATION, our experiments show that the same model suitable for tasks on highly structured code is competitive with specialized models for natural language tasks. While there is still a gap to the best configuration of See et al. (2017) (and an even larger one to more recent work in the area), we believe that this is entirely due to our simplistic decoder and training objective, and that our contribution can be combined with these advances. ",
624
+ "bbox": [
625
+ 174,
626
+ 535,
627
+ 825,
628
+ 604
629
+ ],
630
+ "page_idx": 6
631
+ },
632
+ {
633
+ "type": "text",
634
+ "text": "In Table 2 we show some ablations for NLSUMMARIZATION. As we use the same hyperparameters across all datasets and tasks, we additionally perform an experiment with the model of See et al. (2017) (as implemented in OpenNMT) but using our settings. The results achieved by these baselines trend to be a bit worse than the results reported in the original paper, which we believe is due to a lack of hyperparameter optimization for this task. We then evaluated how much the additional linguistic structure provided by CoreNLP helps. First, we add the coreference and entity annotations to the baseline $\\mathrm { B I L S T M } \\to \\mathrm { L S T M } + \\mathrm { P O I N T E R }$ model (by extending the embedding of tokens with an embedding of the entity information, and inserting fresh $\\mathrm { ~ \\omega ~ } _ { \\mathrm { i R E F 1 } } \\mathrm { ~ \\omega ~ }$ ”, . . . tokens at the sources/targets of co-references) and observe only minimal improvements. This suggests that our graph-based encoder is better-suited to exploit additional structured information compared to a biLSTM encoder. We then drop all linguistic structure information from our model, keeping only the sentence edges/nodes. This still improves on the baseline $\\mathrm { B I L S T M } \\to \\mathrm { L S T M } + \\mathrm { P O I I }$ NTER model (in the ROUGE-2 score), suggesting that the GNN still yields improvements in the absence of linguistic structure. Finally, we add long-range dependency edges by connecting tokens with equivalent string representations of their stems and observe further minor improvements, indicating that even using only purely syntactical information, without a semantic parse, can already provide gains. ",
635
+ "bbox": [
636
+ 174,
637
+ 612,
638
+ 825,
639
+ 834
640
+ ],
641
+ "page_idx": 6
642
+ },
643
+ {
644
+ "type": "text",
645
+ "text": "4.2 QUALITATIVE EVALUATION ",
646
+ "text_level": 1,
647
+ "bbox": [
648
+ 176,
649
+ 864,
650
+ 405,
651
+ 878
652
+ ],
653
+ "page_idx": 6
654
+ },
655
+ {
656
+ "type": "text",
657
+ "text": "We look at a few sample suggestions in our dataset across the tasks. Here we highlight some observations we make that point out interesting aspects and failure cases of our model. ",
658
+ "bbox": [
659
+ 176,
660
+ 895,
661
+ 823,
662
+ 924
663
+ ],
664
+ "page_idx": 6
665
+ },
666
+ {
667
+ "type": "table",
668
+ "img_path": "images/879ad0593963ca3e074145df80c378944913e18c84b695b9649622deeb04970e.jpg",
669
+ "table_caption": [
670
+ "Figure 4: Sample natural language translations from the CNN-DM dataset. "
671
+ ],
672
+ "table_footnote": [],
673
+ "table_body": "<table><tr><td rowspan=1 colspan=1>Input: Arsenal,Newcastle United and Southampton have checked on Caen midfelder N&#x27;golo Kante .Paris-born Kante is a defensive minded player who has impressed for Caen this season and they are wiling to sellfor around f 5milion.Marseille have been in constant contact with Caen over signing the 24-year-old who has similarities with Lassna Diarra and Claude Makelele in terms of stature and style .N&#x27;Golo Kante is attractinginterest froma host of PremierLeague clubs including Arsenal.Caen would be wiling to sellKante for aroundf5million.</td></tr><tr><td rowspan=1 colspan=1>Reference:n&#x27;golo kante is wanted by arsenal,newcastle and southampton.marseille are also keen on thef5mrated midfielder.kante has been compared to lassana diarra and claude makelele.click here for the latestpremier league news .</td></tr><tr><td rowspan=1 colspan=1>See et al.(2O17) (+ Pointer): arsenal,newcastle united and southampton have checked on caen midfieldern&#x27;golo kante .paris-born kante is attracting interest from a host of premier league clubs including arsenal .paris-born kante is attracting interest from a host of premier league clubs including arsenal</td></tr><tr><td rowspan=1 colspan=1>See et al. (2O17)(+ Pointer + Coverage): arsenal, newcastle united and southampton have checked on caenmidfielder n&#x27;golo kante.paris-born kante is a defensive minded player who has impressed for caen this season.marseille have been in constant contact with caen over signing the 24-year-old .</td></tr><tr><td rowspan=1 colspan=1>BILSTM+GNN →LSTM: marseille have been linked with caen midfielder %UNK% %UNK% . marseillehave been interested from a host of premier league clubs including arsenal .caen have been interested from ahost of premier league clubs including arsenal .</td></tr><tr><td rowspan=1 colspan=1>BILSTM+GNN →LSTM+PoINTER n&#x27;golo kante is attracting interest from a host of premier league clubs .marseilehave been in constant contact with caen over signing the24-year-old.the 24-year-old has similaritieswith lassana diarra and claude makelele in terms of stature .</td></tr></table>",
674
+ "bbox": [
675
+ 173,
676
+ 102,
677
+ 841,
678
+ 406
679
+ ],
680
+ "page_idx": 7
681
+ },
682
+ {
683
+ "type": "text",
684
+ "text": "METHODDOC Figures 1 and 3 illustrate typical results of baselines and our model on the METHODDOC task (see Appendix A for more examples). The hardness of the task stems from the large number of distractors and the need to identify the most relevant parts of the input. In Figure 1, the token “parameter” and variations appears many times, and identifying the correct relationship is non-trivial, but is evidently eased by graph edges explicitly denoting these relationships. Similarly, in Figure 3, many variables are passed around, and the semantics of the method require understanding how information flows between them. ",
685
+ "bbox": [
686
+ 174,
687
+ 464,
688
+ 825,
689
+ 561
690
+ ],
691
+ "page_idx": 7
692
+ },
693
+ {
694
+ "type": "text",
695
+ "text": "NLSUMMARIZATION Figure 4 shows one sample summarization. More samples for this task can be found in Appendix B. First, we notice that the model produces natural-looking summaries with no noticeable negative impact on the fluency of the language over existing methods. Furthermore, the GNN-based model seems to capture the central named entity in the article and creates a summary centered around that entity. We hypothesize that the GNN component that links long-distance relationships helps capture and maintain a better “global” view of the article, allowing for better identification of central entities. Our model still suffers from repetition of information (see Appendix B), and so we believe that our model would also profit from advances such as taking coverage into account (See et al., 2017) or optimizing for ROUGE-L scores directly via reinforcement learning (Chen & Bansal, 2018; Narayan et al., 2018). ",
696
+ "bbox": [
697
+ 174,
698
+ 583,
699
+ 826,
700
+ 723
701
+ ],
702
+ "page_idx": 7
703
+ },
704
+ {
705
+ "type": "text",
706
+ "text": "5 RELATED WORK ",
707
+ "text_level": 1,
708
+ "bbox": [
709
+ 176,
710
+ 750,
711
+ 344,
712
+ 765
713
+ ],
714
+ "page_idx": 7
715
+ },
716
+ {
717
+ "type": "text",
718
+ "text": "Natural language processing research has studied summarization for a long time. Most related is work on abstractive summarization, in which the core content of a given text (usually a news article) is summarized in a novel and concise sentence. Chopra et al. (2016) and Nallapati et al. (2016) use deep learning models with attention on the input text to guide a decoder that generates a summary. See et al. (2017) and McCann et al. (2018) extend this idea with pointer networks (Vinyals et al., 2015a) to allow for copying tokens from the input text to the output summary. These approaches treat text as a simple token sequences, not explicitly exposing additional structure. In principle, deep sequence networks are known to be able to learn the inherent structure of natural language (e.g. in parsing (Vinyals et al., 2015b) and entity recognition (Lample et al., 2016)), but our experiments indicate that explicitly exposing this structure by separating concerns improves performance. ",
719
+ "bbox": [
720
+ 174,
721
+ 785,
722
+ 825,
723
+ 924
724
+ ],
725
+ "page_idx": 7
726
+ },
727
+ {
728
+ "type": "text",
729
+ "text": "Recent work in summarization has proposed improved training objectives for summarization, such as tracking coverage of the input document (See et al., 2017) or using reinforcement learning to directly identify actions in the decoder that improve target measures such as ROUGE-L (Chen & Bansal, 2018; Narayan et al., 2018). These objectives are orthogonal to the graph-augmented encoder discussed in this work, and we are interested in combining these efforts in future work. ",
730
+ "bbox": [
731
+ 174,
732
+ 103,
733
+ 825,
734
+ 172
735
+ ],
736
+ "page_idx": 8
737
+ },
738
+ {
739
+ "type": "text",
740
+ "text": "Exposing more language structure explicitly has been studied over the last years, with a focus on tree-based models (Tai et al., 2015). Very recently, first uses of graphs in natural language processing have been explored. Marcheggiani & Titov (2017) use graph convolutional networks to encode single sentences and assist machine translation. De Cao et al. (2018) create a graph over named entities over a set of documents to assist question answering. Closer to our work is the work of Liu et al. (2018), who use abstract meaning representation (AMR), in which the source document is first parsed into AMR graphs, before a summary graph is created, which is finally rendered in natural language. In contrast to that work we do not use AMRs but directly encode relatively simple relationships directly on the tokenized text, and do not treat summarization as a graph rewrite problem. Combining our encoder with AMRs to use richer graph structures may be a promising future direction. ",
741
+ "bbox": [
742
+ 174,
743
+ 180,
744
+ 825,
745
+ 319
746
+ ],
747
+ "page_idx": 8
748
+ },
749
+ {
750
+ "type": "text",
751
+ "text": "Finally, summarization in source code has also been studied in the forms of method naming, comment and documentation prediction. Method naming has been tackled with a series of models. For example, Allamanis et al. (2015) use a log-bilinear network to predict method names from features, and later extend this idea to use a convolutional attention network over the tokens of a method to predict the subtokens of names (Allamanis et al., 2016). Raychev et al. (2015) and Bichsel et al. (2016) use CRFs for a range of tasks on source code, including the inference of names for variables and methods. Recently, Alon et al. (2018b;a) extract and encode paths from the syntax tree of a program, setting the state of the art in accuracy on method naming. ",
752
+ "bbox": [
753
+ 174,
754
+ 325,
755
+ 825,
756
+ 438
757
+ ],
758
+ "page_idx": 8
759
+ },
760
+ {
761
+ "type": "text",
762
+ "text": "Linking text to code can have useful applications, such as code search (Gu et al., 2018), traceability (Guo et al., 2017), and detection of redundant method comments (Louis et al., 2018). Most approaches on source code either treat it as natural language (i.e., a token sequence), or use a language parser to explicitly expose its tree structure. For example, Barone & Sennrich (2017) use a simple sequenceto-sequence baseline, whereas Hu et al. (2017) summarize source code by linearizing the abstract syntax tree of the code and using a sequence-to-sequence model. Wan et al. (2018) instead directly operate on the tree structure using tree recurrent neural networks (Tai et al., 2015). The use of additional structure on related tasks on source code has been studied recently, for example in models that are conditioned on learned traversals of the syntax tree (Bielik et al., 2016) and in graph-based approaches (Allamanis et al., 2018; Cvitkovic et al., 2018). However, as noted by Liao et al. (2018), GNN-based approaches suffer from a tension between the ability to propagate information across large distances in a graph and the computational expense of the propagation function, which is linear in the number of graph edges per propagation step. ",
763
+ "bbox": [
764
+ 174,
765
+ 444,
766
+ 825,
767
+ 625
768
+ ],
769
+ "page_idx": 8
770
+ },
771
+ {
772
+ "type": "text",
773
+ "text": "6 DISCUSSION & CONCLUSIONS ",
774
+ "text_level": 1,
775
+ "bbox": [
776
+ 176,
777
+ 645,
778
+ 459,
779
+ 661
780
+ ],
781
+ "page_idx": 8
782
+ },
783
+ {
784
+ "type": "text",
785
+ "text": "We presented a framework for extending sequence encoders with a graph component that can leverage rich additional structure. In an evaluation on three different summarization tasks, we have shown that this augmentation improves the performance of a range of different sequence models across all tasks. We are excited about this initial progress and look forward to deeper integration of mixed sequence-graph modeling in a wide range of tasks across both formal and natural languages. The key insight, which we believe to be widely applicable, is that inductive biases induced by explicit relationship modeling are a simple way to boost the practical performance of existing deep learning systems. ",
786
+ "bbox": [
787
+ 174,
788
+ 676,
789
+ 825,
790
+ 787
791
+ ],
792
+ "page_idx": 8
793
+ },
794
+ {
795
+ "type": "text",
796
+ "text": "REFERENCES ",
797
+ "text_level": 1,
798
+ "bbox": [
799
+ 174,
800
+ 102,
801
+ 287,
802
+ 118
803
+ ],
804
+ "page_idx": 9
805
+ },
806
+ {
807
+ "type": "text",
808
+ "text": "Miltiadis Allamanis. The adverse effects of code duplication in machine learning models of code. arXiv preprint arXiv:1812.06469, 2018. ",
809
+ "bbox": [
810
+ 171,
811
+ 126,
812
+ 825,
813
+ 155
814
+ ],
815
+ "page_idx": 9
816
+ },
817
+ {
818
+ "type": "text",
819
+ "text": "Miltiadis Allamanis, Earl T Barr, Christian Bird, and Charles Sutton. Suggesting accurate method and class names. In Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering, pp. 38–49. ACM, 2015. ",
820
+ "bbox": [
821
+ 173,
822
+ 165,
823
+ 823,
824
+ 208
825
+ ],
826
+ "page_idx": 9
827
+ },
828
+ {
829
+ "type": "text",
830
+ "text": "Miltiadis Allamanis, Hao Peng, and Charles Sutton. A convolutional attention network for extreme summarization of source code. In International Conference on Machine Learning, pp. 2091–2100, 2016. ",
831
+ "bbox": [
832
+ 173,
833
+ 218,
834
+ 826,
835
+ 261
836
+ ],
837
+ "page_idx": 9
838
+ },
839
+ {
840
+ "type": "text",
841
+ "text": "Miltiadis Allamanis, Marc Brockschmidt, and Mahmoud Khademi. Learning to represent programs with graphs. In International Conference on Learning Representations, 2018. ",
842
+ "bbox": [
843
+ 173,
844
+ 271,
845
+ 823,
846
+ 301
847
+ ],
848
+ "page_idx": 9
849
+ },
850
+ {
851
+ "type": "text",
852
+ "text": "Uri Alon, Omer Levy, and Eran Yahav. code2seq: Generating sequences from structured representations of code. arXiv preprint arXiv:1808.01400, 2018a. ",
853
+ "bbox": [
854
+ 173,
855
+ 311,
856
+ 825,
857
+ 340
858
+ ],
859
+ "page_idx": 9
860
+ },
861
+ {
862
+ "type": "text",
863
+ "text": "Uri Alon, Meital Zilberstein, Omer Levy, and Eran Yahav. A general path-based representation for predicting program properties. In Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 404–419. ACM, 2018b. ",
864
+ "bbox": [
865
+ 176,
866
+ 351,
867
+ 823,
868
+ 395
869
+ ],
870
+ "page_idx": 9
871
+ },
872
+ {
873
+ "type": "text",
874
+ "text": "Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014. ",
875
+ "bbox": [
876
+ 169,
877
+ 404,
878
+ 823,
879
+ 433
880
+ ],
881
+ "page_idx": 9
882
+ },
883
+ {
884
+ "type": "text",
885
+ "text": "Antonio Valerio Miceli Barone and Rico Sennrich. A parallel corpus of Python functions and documentation strings for automated code documentation and code generation. In Proceedings of the Eighth International Joint Conference on Natural Language Processing (Volume 2: Short Papers), volume 2, pp. 314–319, 2017. ",
886
+ "bbox": [
887
+ 174,
888
+ 443,
889
+ 826,
890
+ 501
891
+ ],
892
+ "page_idx": 9
893
+ },
894
+ {
895
+ "type": "text",
896
+ "text": "Benjamin Bichsel, Veselin Raychev, Petar Tsankov, and Martin Vechev. Statistical deobfuscation of android applications. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, pp. 343–355. ACM, 2016. ",
897
+ "bbox": [
898
+ 173,
899
+ 510,
900
+ 826,
901
+ 554
902
+ ],
903
+ "page_idx": 9
904
+ },
905
+ {
906
+ "type": "text",
907
+ "text": "Pavol Bielik, Veselin Raychev, and Martin Vechev. PHOG: probabilistic model for code. In International Conference on Machine Learning (ICML), 2016. ",
908
+ "bbox": [
909
+ 168,
910
+ 563,
911
+ 825,
912
+ 593
913
+ ],
914
+ "page_idx": 9
915
+ },
916
+ {
917
+ "type": "text",
918
+ "text": "Yen-Chun Chen and Mohit Bansal. Fast abstractive summarization with reinforce-selected sentence rewriting. arXiv preprint arXiv:1805.11080, 2018. ",
919
+ "bbox": [
920
+ 171,
921
+ 603,
922
+ 823,
923
+ 632
924
+ ],
925
+ "page_idx": 9
926
+ },
927
+ {
928
+ "type": "text",
929
+ "text": "Sumit Chopra, Michael Auli, and Alexander M Rush. Abstractive sentence summarization with attentive recurrent neural networks. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 93–98, 2016. ",
930
+ "bbox": [
931
+ 173,
932
+ 642,
933
+ 826,
934
+ 699
935
+ ],
936
+ "page_idx": 9
937
+ },
938
+ {
939
+ "type": "text",
940
+ "text": "Milan Cvitkovic, Badal Singh, and Anima Anandkumar. Deep learning on code with an unbounded vocabulary. In Machine Learning 4 Programming, 2018. ",
941
+ "bbox": [
942
+ 173,
943
+ 709,
944
+ 823,
945
+ 739
946
+ ],
947
+ "page_idx": 9
948
+ },
949
+ {
950
+ "type": "text",
951
+ "text": "Nicola De Cao, Wilker Aziz, and Ivan Titov. Question answering by reasoning across documents with graph convolutional networks. arXiv preprint arXiv:1808.09920, 2018. ",
952
+ "bbox": [
953
+ 171,
954
+ 748,
955
+ 823,
956
+ 779
957
+ ],
958
+ "page_idx": 9
959
+ },
960
+ {
961
+ "type": "text",
962
+ "text": "Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In International Conference on Machine Learning, pp. 1263–1272, 2017. ",
963
+ "bbox": [
964
+ 171,
965
+ 787,
966
+ 825,
967
+ 832
968
+ ],
969
+ "page_idx": 9
970
+ },
971
+ {
972
+ "type": "text",
973
+ "text": "Xiaodong Gu, Hongyu Zhang, and Sunghun Kim. Deep code search. In Proceedings of the 40th International Conference on Software Engineering, pp. 933–944. ACM, 2018. ",
974
+ "bbox": [
975
+ 169,
976
+ 842,
977
+ 825,
978
+ 871
979
+ ],
980
+ "page_idx": 9
981
+ },
982
+ {
983
+ "type": "text",
984
+ "text": "Jin Guo, Jinghui Cheng, and Jane Cleland-Huang. Semantically enhanced software traceability using deep learning techniques. In Software Engineering (ICSE), 2017 IEEE/ACM 39th International Conference on, pp. 3–14. IEEE, 2017. ",
985
+ "bbox": [
986
+ 174,
987
+ 881,
988
+ 825,
989
+ 924
990
+ ],
991
+ "page_idx": 9
992
+ },
993
+ {
994
+ "type": "text",
995
+ "text": "Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. Teaching machines to read and comprehend. In Advances in Neural Information Processing Systems, pp. 1693–1701, 2015. ",
996
+ "bbox": [
997
+ 176,
998
+ 103,
999
+ 823,
1000
+ 147
1001
+ ],
1002
+ "page_idx": 10
1003
+ },
1004
+ {
1005
+ "type": "text",
1006
+ "text": "Xing Hu, Yuhan Wei, Ge Li, and Zhi Jin. Codesum: Translate program language to natural language. arXiv preprint arXiv:1708.01837, 2017. ",
1007
+ "bbox": [
1008
+ 173,
1009
+ 155,
1010
+ 825,
1011
+ 184
1012
+ ],
1013
+ "page_idx": 10
1014
+ },
1015
+ {
1016
+ "type": "text",
1017
+ "text": "Robin Jia and Percy Liang. Adversarial examples for evaluating reading comprehension systems. In Empirical Methods in Natural Language Processing (EMNLP), 2017. ",
1018
+ "bbox": [
1019
+ 173,
1020
+ 194,
1021
+ 823,
1022
+ 223
1023
+ ],
1024
+ "page_idx": 10
1025
+ },
1026
+ {
1027
+ "type": "text",
1028
+ "text": "Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations, 2017. ",
1029
+ "bbox": [
1030
+ 174,
1031
+ 232,
1032
+ 823,
1033
+ 262
1034
+ ],
1035
+ "page_idx": 10
1036
+ },
1037
+ {
1038
+ "type": "text",
1039
+ "text": "G. Klein, Y. Kim, Y. Deng, J. Senellart, and A. M. Rush. OpenNMT: Open-Source Toolkit for Neural Machine Translation. ArXiv e-prints. ",
1040
+ "bbox": [
1041
+ 174,
1042
+ 270,
1043
+ 823,
1044
+ 301
1045
+ ],
1046
+ "page_idx": 10
1047
+ },
1048
+ {
1049
+ "type": "text",
1050
+ "text": "Guillaume Lample, Miguel Ballesteros, Sandeep Subramanian, Kazuya Kawakami, and Chris Dyer. Neural architectures for named entity recognition. In Proceedings the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 2016. ",
1051
+ "bbox": [
1052
+ 176,
1053
+ 309,
1054
+ 826,
1055
+ 353
1056
+ ],
1057
+ "page_idx": 10
1058
+ },
1059
+ {
1060
+ "type": "text",
1061
+ "text": "Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493, 2015. ",
1062
+ "bbox": [
1063
+ 176,
1064
+ 362,
1065
+ 823,
1066
+ 392
1067
+ ],
1068
+ "page_idx": 10
1069
+ },
1070
+ {
1071
+ "type": "text",
1072
+ "text": "Renjie Liao, Marc Brockschmidt, Daniel Tarlow, Alexander Gaunt, Raquel Urtasun, and Richard S. Zemel. Graph partition neural networks for semi-supervised classification. In International Conference on Learning Representations (ICLR) [Workshop Track], 2018. ",
1073
+ "bbox": [
1074
+ 178,
1075
+ 400,
1076
+ 823,
1077
+ 444
1078
+ ],
1079
+ "page_idx": 10
1080
+ },
1081
+ {
1082
+ "type": "text",
1083
+ "text": "Chin-Yew Lin. ROUGE: A package for automatic evaluation of summaries. Text Summarization Branches Out, 2004. ",
1084
+ "bbox": [
1085
+ 171,
1086
+ 453,
1087
+ 825,
1088
+ 483
1089
+ ],
1090
+ "page_idx": 10
1091
+ },
1092
+ {
1093
+ "type": "text",
1094
+ "text": "Fei Liu, Jeffrey Flanigan, Sam Thomson, Norman Sadeh, and Noah A Smith. Toward abstractive summarization using semantic representations. arXiv preprint arXiv:1805.10399, 2018. ",
1095
+ "bbox": [
1096
+ 171,
1097
+ 492,
1098
+ 825,
1099
+ 521
1100
+ ],
1101
+ "page_idx": 10
1102
+ },
1103
+ {
1104
+ "type": "text",
1105
+ "text": "Cristina V Lopes, Petr Maj, Pedro Martins, Vaibhav Saini, Di Yang, Jakub Zitny, Hitesh Sajnani, and Jan Vitek. Dej´ avu: a map of code duplicates on github. \\` Proceedings of the ACM on Programming Languages, 1(OOPSLA):84, 2017. ",
1106
+ "bbox": [
1107
+ 176,
1108
+ 530,
1109
+ 823,
1110
+ 574
1111
+ ],
1112
+ "page_idx": 10
1113
+ },
1114
+ {
1115
+ "type": "text",
1116
+ "text": "Annie Louis, Santanu Kumar Dash, Earl T Barr, and Charles Sutton. Deep learning to detect redundant method comments. arXiv preprint arXiv:1806.04616, 2018. ",
1117
+ "bbox": [
1118
+ 173,
1119
+ 583,
1120
+ 823,
1121
+ 613
1122
+ ],
1123
+ "page_idx": 10
1124
+ },
1125
+ {
1126
+ "type": "text",
1127
+ "text": "Minh-Thang Luong, Hieu Pham, and Christopher D Manning. Effective approaches to attentionbased neural machine translation. arXiv preprint arXiv:1508.04025, 2015. ",
1128
+ "bbox": [
1129
+ 173,
1130
+ 621,
1131
+ 825,
1132
+ 651
1133
+ ],
1134
+ "page_idx": 10
1135
+ },
1136
+ {
1137
+ "type": "text",
1138
+ "text": "Christopher Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven Bethard, and David McClosky. The stanford corenlp natural language processing toolkit. In Proceedings of 52nd annual meeting of the association for computational linguistics: system demonstrations, pp. 55–60, 2014. ",
1139
+ "bbox": [
1140
+ 176,
1141
+ 660,
1142
+ 826,
1143
+ 704
1144
+ ],
1145
+ "page_idx": 10
1146
+ },
1147
+ {
1148
+ "type": "text",
1149
+ "text": "Diego Marcheggiani and Ivan Titov. Encoding sentences with graph convolutional networks for semantic role labeling. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 1506–1515, 2017. ",
1150
+ "bbox": [
1151
+ 176,
1152
+ 713,
1153
+ 825,
1154
+ 756
1155
+ ],
1156
+ "page_idx": 10
1157
+ },
1158
+ {
1159
+ "type": "text",
1160
+ "text": "Bryan McCann, Nitish Shirish Keskar, Caiming Xiong, and Richard Socher. The natural language decathlon: Multitask learning as question answering. arXiv preprint arXiv:1806.08730, 2018. ",
1161
+ "bbox": [
1162
+ 171,
1163
+ 765,
1164
+ 823,
1165
+ 795
1166
+ ],
1167
+ "page_idx": 10
1168
+ },
1169
+ {
1170
+ "type": "text",
1171
+ "text": "Ramesh Nallapati, Bowen Zhou, Cicero dos Santos, Caglar Gulcehre, and Bing Xiang. Abstractive text summarization using sequence-to-sequence rnns and beyond. In Proceedings of The 20th SIGNLL Conference on Computational Natural Language Learning, pp. 280–290, 2016. ",
1172
+ "bbox": [
1173
+ 176,
1174
+ 804,
1175
+ 823,
1176
+ 848
1177
+ ],
1178
+ "page_idx": 10
1179
+ },
1180
+ {
1181
+ "type": "text",
1182
+ "text": "Shashi Narayan, Shay B Cohen, and Mirella Lapata. Ranking sentences for extractive summarization with reinforcement learning. arXiv preprint arXiv:1802.08636, 2018. ",
1183
+ "bbox": [
1184
+ 171,
1185
+ 856,
1186
+ 823,
1187
+ 886
1188
+ ],
1189
+ "page_idx": 10
1190
+ },
1191
+ {
1192
+ "type": "text",
1193
+ "text": "Veselin Raychev, Martin Vechev, and Andreas Krause. Predicting program properties from Big Code. In Principles of Programming Languages (POPL), 2015. ",
1194
+ "bbox": [
1195
+ 174,
1196
+ 895,
1197
+ 823,
1198
+ 924
1199
+ ],
1200
+ "page_idx": 10
1201
+ },
1202
+ {
1203
+ "type": "text",
1204
+ "text": "Abigail See, Peter J Liu, and Christopher D Manning. Get to the point: Summarization with pointergenerator networks. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pp. 1073–1083, 2017. ",
1205
+ "bbox": [
1206
+ 176,
1207
+ 103,
1208
+ 823,
1209
+ 146
1210
+ ],
1211
+ "page_idx": 11
1212
+ },
1213
+ {
1214
+ "type": "text",
1215
+ "text": "Kai Sheng Tai, Richard Socher, and Christopher D Manning. Improved semantic representations from tree-structured long short-term memory networks. 2015. ",
1216
+ "bbox": [
1217
+ 173,
1218
+ 155,
1219
+ 823,
1220
+ 184
1221
+ ],
1222
+ "page_idx": 11
1223
+ },
1224
+ {
1225
+ "type": "text",
1226
+ "text": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pp. 5998–6008, 2017. ",
1227
+ "bbox": [
1228
+ 176,
1229
+ 193,
1230
+ 823,
1231
+ 234
1232
+ ],
1233
+ "page_idx": 11
1234
+ },
1235
+ {
1236
+ "type": "text",
1237
+ "text": "Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In Advances in Neural Information Processing Systems, pp. 2692–2700, 2015a. ",
1238
+ "bbox": [
1239
+ 173,
1240
+ 244,
1241
+ 823,
1242
+ 273
1243
+ ],
1244
+ "page_idx": 11
1245
+ },
1246
+ {
1247
+ "type": "text",
1248
+ "text": "Oriol Vinyals, Lukasz Kaiser, Terry Koo, Slav Petrov, Ilya Sutskever, and Geoffrey Hinton. Grammar as a foreign language. In Advances in Neural Information Processing Systems, 2015b. ",
1249
+ "bbox": [
1250
+ 174,
1251
+ 281,
1252
+ 823,
1253
+ 310
1254
+ ],
1255
+ "page_idx": 11
1256
+ },
1257
+ {
1258
+ "type": "text",
1259
+ "text": "Yao Wan, Zhou Zhao, Min Yang, Guandong Xu, Haochao Ying, Jian Wu, and Philip S Yu. Improving automatic source code summarization via deep reinforcement learning. In Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering, pp. 397–407. ACM, 2018. ",
1260
+ "bbox": [
1261
+ 174,
1262
+ 319,
1263
+ 826,
1264
+ 376
1265
+ ],
1266
+ "page_idx": 11
1267
+ },
1268
+ {
1269
+ "type": "text",
1270
+ "text": "A CODE SUMMARIZATION SAMPLES",
1271
+ "text_level": 1,
1272
+ "bbox": [
1273
+ 176,
1274
+ 102,
1275
+ 493,
1276
+ 118
1277
+ ],
1278
+ "page_idx": 12
1279
+ },
1280
+ {
1281
+ "type": "text",
1282
+ "text": "A.1 METHODDOC ",
1283
+ "bbox": [
1284
+ 176,
1285
+ 133,
1286
+ 315,
1287
+ 147
1288
+ ],
1289
+ "page_idx": 12
1290
+ },
1291
+ {
1292
+ "type": "text",
1293
+ "text": "C# Sample 1 ",
1294
+ "text_level": 1,
1295
+ "bbox": [
1296
+ 174,
1297
+ 159,
1298
+ 263,
1299
+ 174
1300
+ ],
1301
+ "page_idx": 12
1302
+ },
1303
+ {
1304
+ "type": "text",
1305
+ "text": "public static bool TryConvertTo(object valueToConvert, Type resultType, IFormatProvider formatProvider, out object result){ result $=$ null; try{ result $=$ ConvertTo(valueToConvert, resultType, formatProvider); catch (InvalidCastException){ return false; catch (ArgumentException){ return false; } return true; \n} ",
1306
+ "bbox": [
1307
+ 173,
1308
+ 184,
1309
+ 836,
1310
+ 333
1311
+ ],
1312
+ "page_idx": 12
1313
+ },
1314
+ {
1315
+ "type": "text",
1316
+ "text": "Ground truth ",
1317
+ "text_level": 1,
1318
+ "bbox": [
1319
+ 184,
1320
+ 349,
1321
+ 271,
1322
+ 362
1323
+ ],
1324
+ "page_idx": 12
1325
+ },
1326
+ {
1327
+ "type": "text",
1328
+ "text": "sets result to valuetoconvert converted to resulttype considering formatprovider for custom conversions calling the parse method and calling convert . changetype . \nconverts the specified type to a primitive type . \nsets result to resulttype \nsets result to valuetoconvert converted to resulttype. ",
1329
+ "bbox": [
1330
+ 441,
1331
+ 349,
1332
+ 818,
1333
+ 425
1334
+ ],
1335
+ "page_idx": 12
1336
+ },
1337
+ {
1338
+ "type": "text",
1339
+ "text": "BILSTM LSTM BILSTM+GNN $\\mathbf { J } \\to \\mathbf { L S T N }$ M BILSTM+G $\\mathbf { \\ V N } \\to \\mathbf { L S T M } + \\mathbf { \\beta }$ POINTER ",
1340
+ "bbox": [
1341
+ 183,
1342
+ 386,
1343
+ 423,
1344
+ 424
1345
+ ],
1346
+ "page_idx": 12
1347
+ },
1348
+ {
1349
+ "type": "text",
1350
+ "text": "C# Sample 2 ",
1351
+ "text_level": 1,
1352
+ "bbox": [
1353
+ 174,
1354
+ 438,
1355
+ 264,
1356
+ 452
1357
+ ],
1358
+ "page_idx": 12
1359
+ },
1360
+ {
1361
+ "type": "text",
1362
+ "text": "public virtual Task Init(string name, IProviderRuntime providerRuntime, IProviderConfiguration config){ Log $=$ providerRuntime.GetLogger(this.GetType().FullName); this.serializerSettings $=$ OrleansJsonSerializer.GetDefaultSerializerSettings(); return TaskDone.Done; \n} ",
1363
+ "bbox": [
1364
+ 174,
1365
+ 460,
1366
+ 895,
1367
+ 535
1368
+ ],
1369
+ "page_idx": 12
1370
+ },
1371
+ {
1372
+ "type": "text",
1373
+ "text": "Ground truth BILSTM $\\bf \\Pi \\to L S T N$ I BILSTM+G $\\mathbf { \\partial } _ { \\mathbf { i } } \\mathbf { N N } \\to \\mathbf { L S T M }$ BILSTM+GN $\\mathbf { N } \\to \\mathbf { L S T }$ M+POINTER ",
1374
+ "bbox": [
1375
+ 181,
1376
+ 551,
1377
+ 423,
1378
+ 602
1379
+ ],
1380
+ "page_idx": 12
1381
+ },
1382
+ {
1383
+ "type": "text",
1384
+ "text": "initializes the storage provider \ncreates a grain object \ninitializes the provider provider \ninitialization function to initialize the specified provider. ",
1385
+ "bbox": [
1386
+ 439,
1387
+ 551,
1388
+ 772,
1389
+ 603
1390
+ ],
1391
+ "page_idx": 12
1392
+ },
1393
+ {
1394
+ "type": "text",
1395
+ "text": "C# Sample 3 ",
1396
+ "text_level": 1,
1397
+ "bbox": [
1398
+ 174,
1399
+ 609,
1400
+ 264,
1401
+ 625
1402
+ ],
1403
+ "page_idx": 12
1404
+ },
1405
+ {
1406
+ "type": "text",
1407
+ "text": "public void NullParameter(){ TaskParameter t $=$ new TaskParameter(null); Assert.Null(t.WrappedParameter); Assert.Equal( TaskParameterType.Null , t.ParameterType ); ((INodePacketTranslatable) t).Translate( TranslationHelpers.GetWriteTranslator()); TaskParameter $\\begin{array} { r l } { \\pm 2 } & { { } = } \\end{array}$ TaskParameter.FactoryForDeserialization( TranslationHelpers.GetReadTranslator()); Assert.Null(t2.WrappedParameter); Assert.Equal(TaskParameterType.Null, t2.ParameterType); \n} ",
1408
+ "bbox": [
1409
+ 174,
1410
+ 633,
1411
+ 746,
1412
+ 770
1413
+ ],
1414
+ "page_idx": 12
1415
+ },
1416
+ {
1417
+ "type": "text",
1418
+ "text": "Ground truth BILSTM LSTM BILSTM+G $\\mathbf { N N } \\to \\mathbf { L S T M }$ BILSTM+GNN LSTM+POINTER verifies that construction and serialization with a null parameter is ok tests that the value is a value that is a value to the specified type verifies that construction with an parameter parameter verifies that construction and serialization with a parameter that is null ",
1419
+ "bbox": [
1420
+ 183,
1421
+ 786,
1422
+ 423,
1423
+ 838
1424
+ ],
1425
+ "page_idx": 12
1426
+ },
1427
+ {
1428
+ "type": "text",
1429
+ "text": "",
1430
+ "bbox": [
1431
+ 439,
1432
+ 786,
1433
+ 852,
1434
+ 838
1435
+ ],
1436
+ "page_idx": 12
1437
+ },
1438
+ {
1439
+ "type": "text",
1440
+ "text": "C# Sample 4 ",
1441
+ "text_level": 1,
1442
+ "bbox": [
1443
+ 174,
1444
+ 849,
1445
+ 264,
1446
+ 864
1447
+ ],
1448
+ "page_idx": 12
1449
+ },
1450
+ {
1451
+ "type": "text",
1452
+ "text": "public override DbGeometryWellKnownValue CreateWellKnownValue(DbGeometry geometryValue){ geometryValue.CheckNull(\"geometryValue\"); var spatialValue $=$ geometryValue.AsSpatialValue(); DbGeometryWellKnownValue result $=$ CreateWellKnownValue(spatialValue, ",
1453
+ "bbox": [
1454
+ 176,
1455
+ 873,
1456
+ 949,
1457
+ 924
1458
+ ],
1459
+ "page_idx": 12
1460
+ },
1461
+ {
1462
+ "type": "text",
1463
+ "text": "() $= >$ SpatialExceptions.CouldNotCreateWellKnownGeometryValueNoSrid(\"geometryValue\"), () $= >$ SpatialExceptions.CouldNotCreateWellKnownGeometryValueNoWkbOrWkt(\"geometryValue\"), (srid, wkb, wkt) $= >$ new DbGeometryWellKnownValue() { CoordinateSystemId $=$ srid, WellKnownBinary $=$ wkb, WellKnownText $=$ wkt }); return result; } ",
1464
+ "bbox": [
1465
+ 174,
1466
+ 104,
1467
+ 957,
1468
+ 194
1469
+ ],
1470
+ "page_idx": 13
1471
+ },
1472
+ {
1473
+ "type": "text",
1474
+ "text": "Ground truth BILSTM LSTM B $\\mathbf { I L S T M + G N N } \\to \\mathbf { L S T M }$ BILSTM+GN $\\Gamma \\to \\mathbf { L } \\mathbf { S }$ TM+POINTER ",
1475
+ "bbox": [
1476
+ 181,
1477
+ 207,
1478
+ 424,
1479
+ 297
1480
+ ],
1481
+ "page_idx": 13
1482
+ },
1483
+ {
1484
+ "type": "text",
1485
+ "text": "creates an instance of t:system.data.spatial.dbgeometry value using one or both of the standard well known spatial formats. \ncreates a t:system.data.spatial.dbgeography value based on the specified well known binary value . \ncreates a new t:system.data.spatial.dbgeography instance using the specified well known spatial formats . \ncreates a new instance of the t:system.data.spatial.dbgeometry value based on the provided geometry value and returns the resulting well as known spatial formats . ",
1486
+ "bbox": [
1487
+ 441,
1488
+ 208,
1489
+ 841,
1490
+ 321
1491
+ ],
1492
+ "page_idx": 13
1493
+ },
1494
+ {
1495
+ "type": "text",
1496
+ "text": "A.2 METHODNAMING ",
1497
+ "text_level": 1,
1498
+ "bbox": [
1499
+ 176,
1500
+ 343,
1501
+ 343,
1502
+ 358
1503
+ ],
1504
+ "page_idx": 13
1505
+ },
1506
+ {
1507
+ "type": "text",
1508
+ "text": "C# Sample 1 ",
1509
+ "text_level": 1,
1510
+ "bbox": [
1511
+ 174,
1512
+ 369,
1513
+ 263,
1514
+ 385
1515
+ ],
1516
+ "page_idx": 13
1517
+ },
1518
+ {
1519
+ "type": "text",
1520
+ "text": "public bool _(D d) { return d ! $=$ null && d.Val == Val ; \n} ",
1521
+ "bbox": [
1522
+ 174,
1523
+ 392,
1524
+ 500,
1525
+ 430
1526
+ ],
1527
+ "page_idx": 13
1528
+ },
1529
+ {
1530
+ "type": "text",
1531
+ "text": "Ground truth equals BILSTM LSTM foo BILSTM+GNN LSTM equals BILSTM+ $\\mathbf { G N N } \\to \\mathbf { L S T M } \\mathbf { + P O I }$ NTER equals ",
1532
+ "bbox": [
1533
+ 181,
1534
+ 445,
1535
+ 496,
1536
+ 496
1537
+ ],
1538
+ "page_idx": 13
1539
+ },
1540
+ {
1541
+ "type": "text",
1542
+ "text": "C# Sample 2 ",
1543
+ "text_level": 1,
1544
+ "bbox": [
1545
+ 174,
1546
+ 502,
1547
+ 264,
1548
+ 517
1549
+ ],
1550
+ "page_idx": 13
1551
+ },
1552
+ {
1553
+ "type": "text",
1554
+ "text": "internal void _(string switchName, Hashtable bag, string parameterName) { object obj $=$ bag[parameterName]; if(obj ! $=$ null){ int value $=$ (int) obj; AppendSwitchIfNotNull(switchName, value.ToString(CultureInfo.InvariantCulture)); \n} ",
1555
+ "bbox": [
1556
+ 173,
1557
+ 526,
1558
+ 818,
1559
+ 626
1560
+ ],
1561
+ "page_idx": 13
1562
+ },
1563
+ {
1564
+ "type": "text",
1565
+ "text": "Ground truth append switch with integer BILSTM LSTM set string BILSTM+GN $\\ J \\to \\mathbf { L S T N }$ M append switch BILSTM $\\mathbf { + G N N \\to L S T M + P O }$ INTER append switch if not null ",
1566
+ "bbox": [
1567
+ 181,
1568
+ 641,
1569
+ 673,
1570
+ 693
1571
+ ],
1572
+ "page_idx": 13
1573
+ },
1574
+ {
1575
+ "type": "text",
1576
+ "text": "C# Sample 3 ",
1577
+ "text_level": 1,
1578
+ "bbox": [
1579
+ 174,
1580
+ 699,
1581
+ 264,
1582
+ 713
1583
+ ],
1584
+ "page_idx": 13
1585
+ },
1586
+ {
1587
+ "type": "text",
1588
+ "text": "internal static string _(){ var currentPlatformString $=$ string.Empty; if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)){ currentPlatformString $=$ \"WINDOWS\"; } else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)){ currentPlatformString $=$ \"LINUX\"; } else if ( RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { currentPlatformString $=$ \"OSX\"; } else { Assert.True(false, \"unrecognized current platform\"); } return currentPlatformString ; ",
1589
+ "bbox": [
1590
+ 200,
1591
+ 723,
1592
+ 758,
1593
+ 914
1594
+ ],
1595
+ "page_idx": 13
1596
+ },
1597
+ {
1598
+ "type": "text",
1599
+ "text": "Ground truth BILSTM LSTM BILSTM+GNN LSTM BILSTM+ $\\mathbf { G N N } \\to \\mathbf { L S T M + P O I N T }$ ER ",
1600
+ "bbox": [
1601
+ 183,
1602
+ 102,
1603
+ 423,
1604
+ 151
1605
+ ],
1606
+ "page_idx": 14
1607
+ },
1608
+ {
1609
+ "type": "text",
1610
+ "text": "get os platform as string get name \nget platform \nget current platform string ",
1611
+ "bbox": [
1612
+ 439,
1613
+ 102,
1614
+ 681,
1615
+ 152
1616
+ ],
1617
+ "page_idx": 14
1618
+ },
1619
+ {
1620
+ "type": "text",
1621
+ "text": "C# Sample 4 ",
1622
+ "text_level": 1,
1623
+ "bbox": [
1624
+ 174,
1625
+ 159,
1626
+ 264,
1627
+ 174
1628
+ ],
1629
+ "page_idx": 14
1630
+ },
1631
+ {
1632
+ "type": "text",
1633
+ "text": "public override DbGeometryWellKnownValue CreateWellKnownValue(DbGeometry geometryValue){ geometryValue.CheckNull(\"geometryValue\"); var spatialValue $=$ geometryValue.AsSpatialValue(); DbGeometryWellKnownValue result $=$ CreateWellKnownValue(spatialValue, () $= >$ SpatialExceptions.CouldNotCreateWellKnownGeometryValueNoSrid(\"geometryValue\"), () $= >$ SpatialExceptions.CouldNotCreateWellKnownGeometryValueNoWkbOrWkt(\"geometryValue\"), (srid, wkb, wkt) $= >$ new DbGeometryWellKnownValue () { CoordinateSystemId $=$ srid , WellKnownBinary $=$ wkb , WellKnownText $=$ wkt }); return result; \n} ",
1634
+ "bbox": [
1635
+ 174,
1636
+ 184,
1637
+ 955,
1638
+ 321
1639
+ ],
1640
+ "page_idx": 14
1641
+ },
1642
+ {
1643
+ "type": "text",
1644
+ "text": "Ground truth BILSTM LSTM BILSTM+GN $\\ J \\to \\mathbf { L S T N }$ BILSTM+G $\\mathbf { N N } \\to \\mathbf { L S T M } +$ POINTER create well known value spatial geometry from xml geometry point get well known value ",
1645
+ "bbox": [
1646
+ 181,
1647
+ 338,
1648
+ 423,
1649
+ 388
1650
+ ],
1651
+ "page_idx": 14
1652
+ },
1653
+ {
1654
+ "type": "text",
1655
+ "text": "",
1656
+ "bbox": [
1657
+ 439,
1658
+ 338,
1659
+ 661,
1660
+ 388
1661
+ ],
1662
+ "page_idx": 14
1663
+ },
1664
+ {
1665
+ "type": "text",
1666
+ "text": "Java Sample 1 ",
1667
+ "text_level": 1,
1668
+ "bbox": [
1669
+ 174,
1670
+ 396,
1671
+ 276,
1672
+ 411
1673
+ ],
1674
+ "page_idx": 14
1675
+ },
1676
+ {
1677
+ "type": "text",
1678
+ "text": "public static void _(String name, int expected, MetricsRecordBuilder rb) { Assert.assertEquals(\"Bad value for metric \" $^ +$ name, expected, getIntCounter(name, rb)); \n} ",
1679
+ "bbox": [
1680
+ 173,
1681
+ 420,
1682
+ 825,
1683
+ 479
1684
+ ],
1685
+ "page_idx": 14
1686
+ },
1687
+ {
1688
+ "type": "text",
1689
+ "text": "",
1690
+ "bbox": [
1691
+ 174,
1692
+ 472,
1693
+ 184,
1694
+ 483
1695
+ ],
1696
+ "page_idx": 14
1697
+ },
1698
+ {
1699
+ "type": "text",
1700
+ "text": "Ground truth assert counter BILSTM LSTM assert email value BILSTM+GNN $\\ J \\to \\mathbf { L S T N }$ M assert header BILSTM+GNN LSTM+POINTER assert int counter ",
1701
+ "bbox": [
1702
+ 183,
1703
+ 498,
1704
+ 602,
1705
+ 550
1706
+ ],
1707
+ "page_idx": 14
1708
+ },
1709
+ {
1710
+ "type": "table",
1711
+ "img_path": "images/17c8bb677ca1727c64543deca803078e74c9931cdd483d303dc153dacdc4aa06.jpg",
1712
+ "table_caption": [
1713
+ "B NATURAL LANGUAGE SUMMARIZATION SAMPLES"
1714
+ ],
1715
+ "table_footnote": [],
1716
+ "table_body": "<table><tr><td rowspan=1 colspan=1>Input: -LRB- CNN -RRB- Gunshots were fired at rapper Lil Wayne &#x27;s tour bus early Sunday inAtlanta .No one was injured in the shooting ,and no arrests have been made,Atlanta Police spokeswoman Elizabeth Espy said .Police are stillooking for suspects . Ofcers were called to aparking lot in Atlanta &#x27;s Buckhead neighborhood,Espy said .They arrived at 3:25 a.m. and locatedtwo tour buses that had been shot multiple times .The drivers of the buses said the incident occurredon Interstate 285 near Interstate 75,Espy said .Witnesses provided a limited description of the twovehicles suspected to be involved : a“ Corvette style vehicle ”and an SUV .Lil Wayne was in Atlantafor a performance at Compound nightclub Saturday night . CNN &#x27;s Carma Hassan contributed to thisreport .</td></tr><tr><td rowspan=1 colspan=1>Reference: rapper lil wayne not injured after shots fired at his tour bus on an atlanta interstate ,police say . no one has been arrested in the shooting</td></tr><tr><td rowspan=1 colspan=1>See et al. (2017) (+ Pointer): police are stillooking for suspects . the incident occurred on interstate285 near interstate 75 ,police say . witnesses provided a limited description of the two vehicles suspected to be involved : a“ corvette style vehicle ” and an suv .</td></tr><tr><td rowspan=1 colspan=1>See et al. (2017) (+ Pointer + Coverage): lil wayne &#x27;s tour bus was shot multiple times , police say: police are stillooking for suspects .they arrived at 3:25 a.m. and located two tour buses that hadbeen shot .</td></tr><tr><td rowspan=1 colspan=1>BILSTM+GNN → LSTM: the incident occurred on interstate %UNK% near interstate 75 . no onewas injured in the shooting ,and no arrests have been made ,atlanta police spokeswoman says .</td></tr><tr><td rowspan=1 colspan=1>BILSTM+GNN →LSTM+PoINTER gunshots fired at rapper lil wayne &#x27;s tour bus early sundayin atlanta ,police say . no one was injured in the shooting ,and no arrests have been made , policesay.</td></tr></table>",
1717
+ "bbox": [
1718
+ 174,
1719
+ 131,
1720
+ 839,
1721
+ 477
1722
+ ],
1723
+ "page_idx": 15
1724
+ },
1725
+ {
1726
+ "type": "table",
1727
+ "img_path": "images/2582be1a64ce7532a8da18bfc0c3cf0f0d35e813ef43615062ab39e18a886462.jpg",
1728
+ "table_caption": [],
1729
+ "table_footnote": [],
1730
+ "table_body": "<table><tr><td rowspan=1 colspan=1>Input: Tottenham have held further discussions with Marseille over a potential deal for midfielderFlorian Thauvin .The 22-year-old has been left out of the squad for this weekend &#x27;s game withMetz as Marseille push for a f 15m sale .The winger,who can also play behind the striker, wasthe subject of enquiries from Spurs earlier in the year and has also been watched by Chelsea andValencia .Tottenham have held further talks with Ligue 1 side Marseille over a possible deal forFlorian Thauvin .Marseille are already resigned to losing Andre Ayew and Andre-Pierre Gignacwith English sides keen on both .Everton,Newcastle and Swansea,have allshown an interest inAyew,who is a free agent in the summer .</td></tr><tr><td rowspan=1 colspan=1>Reference: florian thauvin has been left out of marseille &#x27;s squad with metz . marseille are pushingfor a f 15m sale and tottenham are interested .the winger has also been watched by chelsea and laliga side valencia .</td></tr><tr><td rowspan=1 colspan=1>See et al. (2O17)(+ Pointer): tottenham have held further discussions with marseille over a potentialdeal for midfelder florian thauvin .the 22-year-old has been left out of the squad for this weekend &#x27;s game with metz as marseille push for a 15m sale .</td></tr><tr><td rowspan=1 colspan=1>See et al. (2017) (+ Pointer + Coverage): florian thauvin has been left out of the squad for thisweekend &#x27;s game with metz as marseille push for a 15m sale .the 22-year-old was the subject ofenquiries from spurs earlier in the year .</td></tr><tr><td rowspan=1 colspan=1>BILSTM+GNN →LSTM: the 22-year-old has been left out of the squad for this weekend &#x27;s gamewith metz .the 22-year-old has been left out of the squad for this weekend &#x27;s game with metz .thewinger has been left out of the squad for this weekend &#x27;s game with metz .</td></tr><tr><td rowspan=1 colspan=1>BILSTM+GNN → LSTM+PoINTER tottenham have held further discussions with marseille overa potential deal .the winger has been left out of the squad for this weekend &#x27;s game .tottenham haveheld further talks with marseille over a potential deal .</td></tr></table>",
1731
+ "bbox": [
1732
+ 174,
1733
+ 510,
1734
+ 839,
1735
+ 868
1736
+ ],
1737
+ "page_idx": 15
1738
+ },
1739
+ {
1740
+ "type": "text",
1741
+ "text": "C CODE DATASETS INFORMATION ",
1742
+ "text_level": 1,
1743
+ "bbox": [
1744
+ 176,
1745
+ 102,
1746
+ 473,
1747
+ 118
1748
+ ],
1749
+ "page_idx": 16
1750
+ },
1751
+ {
1752
+ "type": "text",
1753
+ "text": "C.1 C# DATASET ",
1754
+ "text_level": 1,
1755
+ "bbox": [
1756
+ 174,
1757
+ 133,
1758
+ 307,
1759
+ 148
1760
+ ],
1761
+ "page_idx": 16
1762
+ },
1763
+ {
1764
+ "type": "text",
1765
+ "text": "We extract the C# dataset from open-source projects on GitHub. Overall, our dataset contains 460,905 methods, 55,635 of which have a documentation comment. The dataset is split $8 5 - 5 - 1 0 \\%$ . The projects and exact state of the repositories used is listed in Table 3 ",
1766
+ "bbox": [
1767
+ 174,
1768
+ 160,
1769
+ 825,
1770
+ 203
1771
+ ],
1772
+ "page_idx": 16
1773
+ },
1774
+ {
1775
+ "type": "table",
1776
+ "img_path": "images/8f3e3b14cf0c4e66fb1d5598a0c36f7ae9096fd31a267c2ba5b215c552d07249.jpg",
1777
+ "table_caption": [
1778
+ "Table 3: Projects in our C# dataset. Ordered alphabetically. "
1779
+ ],
1780
+ "table_footnote": [],
1781
+ "table_body": "<table><tr><td>Name</td><td>Git SHA</td><td>Description</td></tr><tr><td>Akka.NET</td><td>6f32f6a7</td><td>Actor-based Concurrent &amp; Distributed Framework</td></tr><tr><td>AutoMapper</td><td>19d6f7fc</td><td>Object-to-Object Mapping Library</td></tr><tr><td>BenchmarkDotNet</td><td>57005f05</td><td>Benchmarking Library</td></tr><tr><td>CommonMark.NET</td><td>f3d54530</td><td>Markdown Parser</td></tr><tr><td>CoreCLR</td><td>cc5dcbe6</td><td>.NET Core Runtime</td></tr><tr><td>CoreFx</td><td>ec1671fd</td><td>.NETFoundationalLibraries</td></tr><tr><td>Dapper</td><td>3c7cde28</td><td>Object Mapper Library</td></tr><tr><td>EntityFramework</td><td>c4d9a269</td><td>Object-Relational Mapper</td></tr><tr><td>Humanizer</td><td>2b1c94c4</td><td>String Manipulation and Formatting</td></tr><tr><td>Lean</td><td>90ee6aae</td><td>Algorithmic Trading Engine</td></tr><tr><td>Mono</td><td>9b9e4f4b</td><td>.NET Implementation</td></tr><tr><td>MsBuild</td><td>7f95dc15</td><td>Build Engine</td></tr><tr><td>Nancy</td><td>de458a9b</td><td>HTTP Service Framework</td></tr><tr><td>NLog</td><td>49fdd08e</td><td>Logging Library</td></tr><tr><td>Opserver</td><td>9e4d3a40</td><td>Monitoring System</td></tr><tr><td>orleans</td><td>f89c5866</td><td>Distributed Virtual Actor Model</td></tr><tr><td>Polly</td><td>f3d2973d</td><td>Resilience &amp; Transient Fault Handling Library</td></tr><tr><td>Powershell</td><td>9ac701db</td><td>Command-line Shell</td></tr><tr><td>ravendb</td><td>6437de30</td><td>Document Database</td></tr><tr><td>roslyn</td><td>8ca0a542</td><td>Compiler &amp; Code Analysis &amp; Compilation</td></tr><tr><td>ServiceStack</td><td>17f081b9</td><td>Real-time web library</td></tr><tr><td>SignalR</td><td>9b05bcb0</td><td>Push Notification Framework</td></tr><tr><td>Wox</td><td>13e6c5ee</td><td>Application Launcher</td></tr></table>",
1782
+ "bbox": [
1783
+ 174,
1784
+ 243,
1785
+ 820,
1786
+ 617
1787
+ ],
1788
+ "page_idx": 16
1789
+ },
1790
+ {
1791
+ "type": "text",
1792
+ "text": "C.2 JAVA METHOD NAMING DATASETS ",
1793
+ "text_level": 1,
1794
+ "bbox": [
1795
+ 176,
1796
+ 643,
1797
+ 459,
1798
+ 659
1799
+ ],
1800
+ "page_idx": 16
1801
+ },
1802
+ {
1803
+ "type": "text",
1804
+ "text": "We use the datasets and splits of Alon et al. (2018a) provided by their website. Upon scanning all methods in the dataset, the size of the corpora can be seen in Table 4. More information can be found at Alon et al. (2018a). ",
1805
+ "bbox": [
1806
+ 174,
1807
+ 670,
1808
+ 825,
1809
+ 713
1810
+ ],
1811
+ "page_idx": 16
1812
+ },
1813
+ {
1814
+ "type": "text",
1815
+ "text": "C.3 PYTHON METHOD DOCUMENTATION DATASET ",
1816
+ "text_level": 1,
1817
+ "bbox": [
1818
+ 174,
1819
+ 731,
1820
+ 542,
1821
+ 746
1822
+ ],
1823
+ "page_idx": 16
1824
+ },
1825
+ {
1826
+ "type": "text",
1827
+ "text": "We use the dataset as split of Barone & Sennrich (2017) provided by their GitHub repository. Upon parsing the dataset, we get 106,065 training samples, 1,943 validation samples and 1,937 test samples. We note that $1 6 . 9 \\%$ of the documentation samples in the validation set and $1 5 . 3 \\%$ of the samples in test set have a sample with the identical natural language documentation on the training set. This eludes to a potential issue, described by Lopes et al. (2017). See Allamanis (2018) for a lengthier discussion of this issue. ",
1828
+ "bbox": [
1829
+ 173,
1830
+ 757,
1831
+ 826,
1832
+ 813
1833
+ ],
1834
+ "page_idx": 16
1835
+ },
1836
+ {
1837
+ "type": "table",
1838
+ "img_path": "images/f7c6b5866c07b5ce850ebf6cf50afa0b805a47d8f43b2da9868cff4166d9f0f8.jpg",
1839
+ "table_caption": [
1840
+ "Table 4: The statistics of the extracted graphs from the Java method naming dataset of Alon et al. (2018a). "
1841
+ ],
1842
+ "table_footnote": [],
1843
+ "table_body": "<table><tr><td>Dataset</td><td>Train Size</td><td>Valid Size</td><td>Test Size</td></tr><tr><td>Java - Small</td><td>691,505</td><td>23,837</td><td>56,952</td></tr></table>",
1844
+ "bbox": [
1845
+ 320,
1846
+ 877,
1847
+ 678,
1848
+ 921
1849
+ ],
1850
+ "page_idx": 16
1851
+ },
1852
+ {
1853
+ "type": "text",
1854
+ "text": "",
1855
+ "bbox": [
1856
+ 173,
1857
+ 103,
1858
+ 823,
1859
+ 132
1860
+ ],
1861
+ "page_idx": 17
1862
+ },
1863
+ {
1864
+ "type": "text",
1865
+ "text": "C.4 GRAPH DATA STATISTICS ",
1866
+ "text_level": 1,
1867
+ "bbox": [
1868
+ 174,
1869
+ 148,
1870
+ 395,
1871
+ 164
1872
+ ],
1873
+ "page_idx": 17
1874
+ },
1875
+ {
1876
+ "type": "text",
1877
+ "text": "Below we present the data characteristics of the graphs we use across the datasets. ",
1878
+ "bbox": [
1879
+ 173,
1880
+ 174,
1881
+ 710,
1882
+ 190
1883
+ ],
1884
+ "page_idx": 17
1885
+ },
1886
+ {
1887
+ "type": "table",
1888
+ "img_path": "images/07b4d3250602bafe5f8460cf8adff0266382ea181ed4a4ad40d4fe86dc094a52.jpg",
1889
+ "table_caption": [
1890
+ "Table 5: Graph Statistics For Datasets. "
1891
+ ],
1892
+ "table_footnote": [],
1893
+ "table_body": "<table><tr><td>Dataset</td><td>Avg Num Nodes</td><td>Avg Num Edges</td></tr><tr><td>CNN/DM</td><td>903.2</td><td>2532.9</td></tr><tr><td>C# Method Names</td><td>125.2</td><td>239.3</td></tr><tr><td>C# Documentation</td><td>133.5</td><td>265.9</td></tr><tr><td>Java-SmallMethod Names</td><td>144.4</td><td>251.6</td></tr></table>",
1894
+ "bbox": [
1895
+ 271,
1896
+ 228,
1897
+ 725,
1898
+ 314
1899
+ ],
1900
+ "page_idx": 17
1901
+ }
1902
+ ]
parse/train/H1ersoRqtm/H1ersoRqtm_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1ersoRqtm/H1ersoRqtm_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/tL89RnzIiCd/images/042e1d5439f75f9511e496726e2b84d2054e738501fd36c673296c39964d9b81.jpg ADDED

Git LFS Details

  • SHA256: 0262c2e38a74934761d1ecb30d4fbf50f33790de8885184801ca5e50d86814ad
  • Pointer size: 130 Bytes
  • Size of remote file: 11.1 kB
parse/train/tL89RnzIiCd/images/07f61faf695e47c9e2536edaa51df49b54bebd95eb9227f935a655718c3b2186.jpg ADDED

Git LFS Details

  • SHA256: f5742055c11cddc98f8d56555b6cdcab48f5375e9ddc2e2b5a5a7fb2dac9ab35
  • Pointer size: 129 Bytes
  • Size of remote file: 6.23 kB
parse/train/tL89RnzIiCd/images/0d47d9fb79658c8401ba9cd4ebfcb9e0e83a09b3a11e045f15995eb4918d659f.jpg ADDED

Git LFS Details

  • SHA256: bbd2a03ea8103614f29943fbe1d2c26c8677cc9c8207fbe8f15fa4bb5fc115f5
  • Pointer size: 129 Bytes
  • Size of remote file: 2.26 kB
parse/train/tL89RnzIiCd/images/146d1dca6f4f5336a30d475798a577e48af58dd83735d21ab3a2758b241866b5.jpg ADDED

Git LFS Details

  • SHA256: a3e6a66347fd5dcd2df109db40a97387187e9dd8ff0ff9927399edaa93840e6b
  • Pointer size: 129 Bytes
  • Size of remote file: 5.17 kB
parse/train/tL89RnzIiCd/images/14c1b6836f4d1f321564480254bd0eb6aac7b5154801d2fb86b63ffce70e8914.jpg ADDED

Git LFS Details

  • SHA256: 5cbdcc057a5f2bc14b1bba946aa65fa8ce68450a0fdfd7b77516866faeaef006
  • Pointer size: 129 Bytes
  • Size of remote file: 2.03 kB
parse/train/tL89RnzIiCd/images/2159cd7bb128f57cbb32cafecb86cd5ed257d950abf5cf41ada8a302e5f67250.jpg ADDED

Git LFS Details

  • SHA256: bec2cc8090859e34d8e10e4f742f5621a415a0ddcf1ef1c91a6fcc4cdc7fe758
  • Pointer size: 130 Bytes
  • Size of remote file: 13.9 kB
parse/train/tL89RnzIiCd/images/29d91d86507c41379d4ae134b14c98b8c16bc9f2f9cb69e299fcfdb0320470d7.jpg ADDED

Git LFS Details

  • SHA256: 641f62904b4aa6e6c1cc234c2869f2bb0d3aa10632993381f2809e99d9fdd651
  • Pointer size: 129 Bytes
  • Size of remote file: 3.94 kB
parse/train/tL89RnzIiCd/images/2bfbad340f78378ed4828c7ac3f1db498faf7e90ea37666efae75b8042efdc19.jpg ADDED

Git LFS Details

  • SHA256: 39e1a1d0a8fa114043abd714647bb11bdbf348c4d80f3dcc803241ea7a113063
  • Pointer size: 129 Bytes
  • Size of remote file: 2.62 kB
parse/train/tL89RnzIiCd/images/33e7e08ff8a133881d57ab2c3d98ba052c629914e7a6517ec2a268509dca806e.jpg ADDED

Git LFS Details

  • SHA256: 92ec005699653d93e74d376101fbb9029b160e7439acde4ce06e3d8ade68873f
  • Pointer size: 129 Bytes
  • Size of remote file: 6.45 kB
parse/train/tL89RnzIiCd/images/37ef8ac9a9c39eef0cf777b309bebdbee7778892b260e14d83ed671bbcad4020.jpg ADDED

Git LFS Details

  • SHA256: 4e322d4d290b6366bd8c38bd2b5f906e09c04aa450f02d1456abd094bc2f847d
  • Pointer size: 130 Bytes
  • Size of remote file: 19.2 kB
parse/train/tL89RnzIiCd/images/384428ec4e24fd98f95e10f3c3a0be6bfa51603520e1b3b78913e0b5797accc3.jpg ADDED

Git LFS Details

  • SHA256: 48de2add4ab6c12942c149e40939f5b7c16fcd15637f972d57b411b357daa8cd
  • Pointer size: 129 Bytes
  • Size of remote file: 7.73 kB
parse/train/tL89RnzIiCd/images/3f73b79f6a79e73b9971f387a49a432bc6222afbe3f0dd518288ae7da148daaa.jpg ADDED

Git LFS Details

  • SHA256: fbe5b50b3df72e512ee03380e252d9133aa854d2622a8b15a78689ecf6409e17
  • Pointer size: 129 Bytes
  • Size of remote file: 5.46 kB
parse/train/tL89RnzIiCd/images/3f884bb1241f4eabdae24d4b77578a51680b98ee112beb142cba4083fe782460.jpg ADDED

Git LFS Details

  • SHA256: 0034cc087a56a008b3527792ff88e4fb17f5ced50578653d5e612a0047fb644a
  • Pointer size: 129 Bytes
  • Size of remote file: 3.35 kB
parse/train/tL89RnzIiCd/images/461d7c77734d6e86a7b4d04b495ef0b9b7559a6729be63cceac4d1dc93ca5203.jpg ADDED

Git LFS Details

  • SHA256: 9232a577d9a69d4dd42f92320901a81e60a4aece446283b0f99db60e983d573f
  • Pointer size: 129 Bytes
  • Size of remote file: 2.72 kB
parse/train/tL89RnzIiCd/images/491cd1ca98150615a3effb7e3896c2d59263cf547c3a3fdc7d0920f78c1b5f37.jpg ADDED

Git LFS Details

  • SHA256: 6aec0a73d168d3d176f5857466c8b275cc9b70b04f8fe8cb0a9ca6eb6842ec90
  • Pointer size: 129 Bytes
  • Size of remote file: 8.31 kB
parse/train/tL89RnzIiCd/images/4bb42082ff379fe5ed0acf322190ad00aca2a5babbddc33dbf032edaa30bd0d9.jpg ADDED

Git LFS Details

  • SHA256: ef19f27b72e29b1b9951fbf5a14e6fbbdfd2e811d614d5bf93b918e8e0e5d294
  • Pointer size: 130 Bytes
  • Size of remote file: 18.6 kB
parse/train/tL89RnzIiCd/images/551e211393e896efbdd041343e4b08941cc17b6bc861d48da7d2b75da3eebf4c.jpg ADDED

Git LFS Details

  • SHA256: d1c262f84b5b56c72ca576f8eea2d87c95aa2c25a98d0c8cf5b68cfd8b9a2a19
  • Pointer size: 130 Bytes
  • Size of remote file: 33.6 kB
parse/train/tL89RnzIiCd/images/56e69e27b335c3a9130734904fac724655aa508e6bdf0a4bf4228d9ed3678ac7.jpg ADDED

Git LFS Details

  • SHA256: de58bafc489a4726e39e4ccc8bfa82c8fcb23d3886544329a9788ecf480c32e2
  • Pointer size: 129 Bytes
  • Size of remote file: 3.07 kB
parse/train/tL89RnzIiCd/images/5805d3ea196ea1f81d84613500bae5a3b4be227d1511b59e7e07a48a36ae9dc3.jpg ADDED

Git LFS Details

  • SHA256: 959042b75d5b3e313be2970d6e46f430b1bcb893c64c42b89a652c670dab05a0
  • Pointer size: 129 Bytes
  • Size of remote file: 6.99 kB
parse/train/tL89RnzIiCd/images/5d286687868ac3253bf3a7dbb50478224bf709f6e7fdbd82d4f24dacd2e82cb6.jpg ADDED

Git LFS Details

  • SHA256: 6993425b7ef9abecab12e485813e6b6ac799d6acaab2f04679e27a5f91133a24
  • Pointer size: 129 Bytes
  • Size of remote file: 3.02 kB
parse/train/tL89RnzIiCd/images/610f7a476ef2204c1c8c7a2faa09e6c9c20839150eff9a0a83ac172fd7861e29.jpg ADDED

Git LFS Details

  • SHA256: 0796561e6898971906bb09008134679a25df8224ed33c3d9e8d3c9f05d3027b0
  • Pointer size: 129 Bytes
  • Size of remote file: 7.13 kB
parse/train/tL89RnzIiCd/images/6341d7d4f484984ef43140dc286e5d2965d25130a6fb56a93c751b5b39d98091.jpg ADDED

Git LFS Details

  • SHA256: b7cb838cec300f6ab6c9d035a94e715d45be92da8f0c0fd7da672ad3c26cacf1
  • Pointer size: 130 Bytes
  • Size of remote file: 15.7 kB
parse/train/tL89RnzIiCd/images/69b95d4c9f39888ccc2c4d33bd73bd814e42d3f18278393bf491840673555a33.jpg ADDED

Git LFS Details

  • SHA256: 8fccd2907ac48ab6cb765f9a209a8cb2075852633b4d4a297956c7177aa1105e
  • Pointer size: 130 Bytes
  • Size of remote file: 19.5 kB
parse/train/tL89RnzIiCd/images/6d0557aba83450978b26fda2cccad77270dcc33a70953269636db1c63c650003.jpg ADDED

Git LFS Details

  • SHA256: 6bd9b72ad16f56a2f7b279a06c71211c44eeb94bf55c0280a9b9f323806bfb3b
  • Pointer size: 130 Bytes
  • Size of remote file: 13.6 kB
parse/train/tL89RnzIiCd/images/6e6e51933f308510130393a18066d569d4f8f3eae45bb686d4483465462d0e79.jpg ADDED

Git LFS Details

  • SHA256: 85a760081744b788713b91e17394fc819afc4956027faef2bd4f0938cfafcdd2
  • Pointer size: 130 Bytes
  • Size of remote file: 84.4 kB
parse/train/tL89RnzIiCd/images/6fe37b2c3a938a045a1b4dbdd8960646ea02f35f03eebca6443838b062b7dd32.jpg ADDED

Git LFS Details

  • SHA256: 262b2122a15fd4ff9c1c366ea629ecbe5f013868c363dad3a9e35ce0c25dfb5e
  • Pointer size: 129 Bytes
  • Size of remote file: 4.4 kB
parse/train/tL89RnzIiCd/images/72675c81306017c80ae54fa81be15badb2d70c430c4f7d1c384a5cd09590e74a.jpg ADDED

Git LFS Details

  • SHA256: e99dd0ace1191ee6ff99b30652a52ccde82b1e3c798faf8a48c20ea8f9dc1ed3
  • Pointer size: 130 Bytes
  • Size of remote file: 21.6 kB
parse/train/tL89RnzIiCd/images/7ca5211d93b96bf40d7582cbe9e30622314937f00dcdfd86febc90fe0b66ecdf.jpg ADDED

Git LFS Details

  • SHA256: b9cefa21ddab382ffe34b0925286ed83a9150f5a2121b055268393259cd5e1ec
  • Pointer size: 129 Bytes
  • Size of remote file: 3.55 kB
parse/train/tL89RnzIiCd/images/7ef3d588f304b9a5a76926f89d242f85f3f379954da705f4bbbf6965e7ae76a2.jpg ADDED

Git LFS Details

  • SHA256: d5910a5de9e45002886420cec50ddcfee23c5031631c212e793c642fc0e11024
  • Pointer size: 130 Bytes
  • Size of remote file: 17.7 kB
parse/train/tL89RnzIiCd/images/8316be427423ae3ed8854bd10242fe3668463998495795102138f8103cc836b6.jpg ADDED

Git LFS Details

  • SHA256: 263294afd0edae997bfa6d0adeb93de25f6bed298e8ea54678c3caa7953d2e10
  • Pointer size: 129 Bytes
  • Size of remote file: 7.34 kB
parse/train/tL89RnzIiCd/images/8929985ebadaa5502bf136ece50ff17f0bd4cd5340a36ea9a7bbb6cf36231d45.jpg ADDED

Git LFS Details

  • SHA256: 1deb707a8648038ef4b146ab46eb2703b90c18361f312ef34476ec5c862aaefc
  • Pointer size: 129 Bytes
  • Size of remote file: 4.75 kB
parse/train/tL89RnzIiCd/images/8d132ace58ddbb52207795276ba9f810462d87d283961e92d23e325a4bbeae0b.jpg ADDED

Git LFS Details

  • SHA256: 927671decade08ee00aecd74beea110c59cbe9e61e434792c4203ed196d38808
  • Pointer size: 130 Bytes
  • Size of remote file: 13.7 kB
parse/train/tL89RnzIiCd/images/90c6e58a3156bd7a7b5401fe44b99cd02b6f6ec8586f1984fc7886a615a595a4.jpg ADDED

Git LFS Details

  • SHA256: 03a520f4c079bf2fbd12ad1c2491dd4ac53ded1a7a0d8831f6a8f2ce447c285d
  • Pointer size: 129 Bytes
  • Size of remote file: 4.46 kB
parse/train/tL89RnzIiCd/images/95da2b92250fe2096a5fba8b13fbe39b323d13fe13f5905981688294fb892393.jpg ADDED

Git LFS Details

  • SHA256: ee1d16fab43c0a86cf1528bbce4b9eea733328e2aa101968e73260628dd308e1
  • Pointer size: 129 Bytes
  • Size of remote file: 4.66 kB