Existing work on probing of pretrained language models (LMs) has predominantly focused on sentence-level syntactic tasks. In this paper, we introduce document-level discourse probing to evaluate the ability of pretrained LMs to capture document-level relations. We experiment with 7 pretrained LMs, 4 languages, and 7 discourse probing tasks, and find BART to be overall the best model at capturing discourse  but only in its encoder, with BERT performing surprisingly well as the baseline model. Across the different models, there are substantial differences in which layers best capture discourse information, and large disparities between models. The remarkable development of pretrained language models (Devlin et al., 2019; Lewis et al., 2020; Lan et al., 2020) has raised questions about what precise aspects of language these models do and do not capture. Probing tasks offer a means to perform fine-grained analysis of the capabilities of such models, but most existing work has focused on sentence-level analysis such as syntax (Hewitt and Manning, 2019; Jawahar et al., 2019; de Vries et al., 2020), entities/relations (Papanikolaou et al., 2019), and ontological knowledge (Michael et al., 2020). Less is known about how well such models capture broader discourse in documents. Rhetorical Structure Theory is a framework for capturing how sentences are connected and describing the overall structure of a document (Mann and Thompson, 1986). A number of studies have used pretrained models to classify discourse markers (Sileo et al., 2019) and discourse relations (Nie et al., 2019; Shi and Demberg, 2019), but few (Koto et al., to appear) have systematically investigated the ability of pretrained models to model discourse structure. Furthermore, existing work relating to discourse probing has typically focused exclusively Model Type #Param #Data Objective BERT Enc 110M 16GB MLM+NSP RoBERTa 110M 160GB MLM ALBERT 12M 16GB MLM+SOP ELECTRA 110M 16GB MLM+DISC GPT-2 Dec 117M 40GB LM BART Enc+Dec 121M 160GB DAE T5 110M 750GB DAE Table 1: Summary of all English pretrained language models used in this work. on the BERT-base model, leaving open the question of how well these findings generalize to other models with different pretraining objectives, for different languages, and different model sizes. Our research question in this paper is: How much discourse structure do layers of different pretrained language models capture, and do the findings generalize across languages? There are two contemporaneous related studies that have examined discourse modelling in pretrained language models. Upadhye et al. (2020) analyzed how well two pretrained models capture referential biases of different classes of English verbs. Zhu et al. (2020) applied the model of Feng and Hirst (2014) to parse IMDB documents (Maas et al., 2011) into discourse trees. Using this (po-tentially noisy) data, probing tasks were conducted by mapping attention layers into single vectors of document-level rhetorical features. These features, however, are unlikely to capture all the intricacies of inter-sentential abstraction as their input is formed based on discourse relations 1 and aggregate statistics on the distribution of discourse units. To summarize, we introduce 7 discourse-related probing tasks, which we use to analyze 7 pretrained language models over 4 languages: English, Mandarin Chinese, German, and Spanish. Code and public-domain data associated with this research is available at https://github.com/fajri91/discourse_ probing. We outline the 7 pretrained models in Table 1. They comprise 4 encoder-only models: BERT (Devlin et al., 2019), RoBERTa (Liu et al., 2019), ALBERT (Lan et al., 2020), and ELECTRA (Clark et al., 2020); 1 decoder-only model: GPT-2 (Rad-ford et al., 2019); and 2 encoderdecoder models: BART (Lewis et al., 2020) and T5 (Raffel et al., 2019). To reduce the confound of model size, we use pretrained models of similar size (  110m model parameters), with the exception of ALBERT which is designed to be lighter weight. All models have 12 transformer layers in total; for BART and T5, this means their encoder and decoder have 6 layers each. Further details of the models are provided in the Supplementary Material. We experiment with a total of seven probing tasks, as detailed below. Tasks 46 are component tasks of discourse parsing based on rhetorical structure theory (RST; Mann and Thompson (1986)). In an RST discourse tree, EDUs are typically clauses or sentences, and are hierarchically connected with discourse labels denoting: (1) nuclearity = nucleus (N) vs. satellite (S); 2 and (2) discourse relations (e.g. elaborate ). An example of a binarized RST discourse tree is given in Figure 1. 1. Next sentence prediction. Similar to the next sentence prediction (NSP) objective in BERT pretraining, but here we frame it as a 4-way classification task, with one positive and 3 negative candidates for the next sentence. The preceding context takes the form of between 2 and 8 sentences, but the candidates are always single sentences. 2. Sentence ordering. We shuffle 37 sentences and attempt to reproduce the original order. This task is based on Barzilay and Lapata (2008) and Koto et al. (2020), and is assessed based on rank correlation relative to the original order. 2 The satellite is a supporting EDU for the nucleus. or , or although (Nie et al., 2019), representing the conceptual relation between the sen-tences/clauses. 4. RST nuclearity prediction. For a given ordered pairing of (potentially complex) EDUs which are connected by an unspecified relation, predict the nucleus/satellite status of each (see Figure 1). 5. RST relation prediction. For a given ordered pairing of (potentially complex) EDUs which are connected by an unspecified relation, predict the relation that holds between them (see Figure 1). 6. RST elementary discourse unit (EDU) segmentation. Chunk a concatenated sequence of EDUs into its component EDUs. 7. Cloze story test. Given a 4-sentence story context, pick the best ending from two possible options (Mostafazadeh et al., 2016; Sharma et al., 2018). This task is harder than NSP, as it requires an understanding of commonsense and storytelling (Chaturvedi et al., 2017; Liu et al., 2018). We summarize all data (sources, number of labels, and data split) in Table 2. This includes English, Chinese, German, and Spanish for each probing task. For NSP and sentence ordering, we generate data from news articles and Wikipedia. For the RST tasks, we use discourse treebanks for each of the four languages. We formulate all probing tasks except sentence ordering and EDU segmentation as a classification problem, and evaluate using accuracy. During fine-tuning, we add an MLP layer on top of the pretrained model for classification, and only update the MLP parameters (all other layers are frozen). We use the [CLS] embedding for BERT and ALBERT following standard practice, while for other models we perform average pooling to obtain a vector for each sentence, and concatenate them as the input to the MLP. 3 3 BERT and ALBERT performance with average pooling For sentence ordering, we follow Koto et al. (2020) and frame it as a sentence-level sequence labelling task, where the goal is to estimate P ( r | s ) , where r is the rank position and s the sentence. The task has 7 classes, as we have 37 sentences (see Section 3). At test time, we choose the label sequence that maximizes the sequence probability. Sentence embeddings are obtained by average pooling. The EDU segmentation task is also framed as a binary sequence labelling task (segment boundary or not) at the (sub)word level. We use Spearman rank correlation and macro-averaged F1 score to evaluate sentence ordering and EDU segmentation, respectively. We use a learning rate 1 e  3 , warm-up of 10% of total steps, and the development set for early stopping in all experiments. All presented results are averaged over three runs. 4 5 Results and Analysis In Figure 2, we present the probing task performance on English for all models based on a representation generated from each of the 12 layers of the model. First, we observe that most performance fluctuates (non-monotonic) across layers except for some models in the NSP task and some ALBERT results in the other probing tasks. We also found that most models except ALBERT tend to have a very low standard deviation based on three runs with different random seeds. We discover that all models except T5 and early layers of BERT and ALBERT perform well over the NSP task, with accuracy  0.8, implying it is a simple task. However, they all struggle at sentence ordering (topping out at   0 . 4 ), suggesting that they are ineffective at modelling discourse over multiple sentences; this is borne out in Figure 4, where performance degrades as the number of sentences to re-order increases. Interestingly, for Discourse Connectives, RST Nuclearity, and RST Relation Prediction, the models produce similar patterns, even though the discourse connective data is derived from a different dataset and theoretically divorced from RST. BART outperforms most other models in layers 16 for these tasks (a similar observation is found for NSP and Sentence Ordering) with BERT and ALBERT struggling particularly in the earlier layers. For is in included in the Appendix. EDU segmentation, RoBERTa and again the first few layers of BART perform best. For the Cloze Story Test, all models seem to improve as we go deeper into the layers, suggesting that high-level story understanding is captured deeper in the models. We summarize the overall performance by calculating the averaged normalized scores in the last plot in Figure 2. 5 RoBERTa and BART appear to be the best overall models at capturing discourse information, but only in the encoder layers (the first 6 layers) for BART. We hypothesize that the BART decoder focuses on sequence generation, and as such is less adept at language understanding. This is supported by a similar trend for T5, also a denoising autoencoder. BERT does surprisingly well (given that it's the baseline model), but mostly in the deeper layers (710), while ELECTRA performs best at the three last layers. In terms of the influence of training data, we see mixed results. BART and RoBERTa are the two best models, and both are trained with more data than most models (an order of magnitude more; see Table 1). But T5 (and to a certain extent GPT-2) are also trained with more data (in fact T5 has the most training data), but their discourse modelling performance is underwhelming. In terms of training objectives, it appears that a pure decoder with an LM objective (GPT-2) is less effective at capturing discourse structure. ALBERT, the smallest model (an order of magnitude less parameters than most), performs surprisingly well (with high standard de-viation), but only at its last layer, suggesting that discourse knowledge is concentrated deep inside the model. Lastly, we explore whether these trends hold if we use a larger model (BERT-base vs. BERT-large) and for different languages (again based on monolingual BERT models for the respective languages). Results are presented in Figure 3. For model size (English (large) vs. English), the overall pattern is remarkably similar, with a slight uplift in absolute results with the larger model. Between the 4 different languages (English, Chinese, German, and Spanish), performance varies for all tasks except for NSP (e.g. EDU segmentation appears to be easiest in Chinese, and relation prediction is the hardest in German), but the shape of the lines is largely the same, indicating the optimal layers for 5 Given a task, we perform minmax normalization for all model-layer scores (7  12 scores in total), and then compute the average over all tasks for each model's layer. a particular task are consistent across languages. We perform probing on 7 pretrained language models across 4 languages to investigate what discourse effects they capture. We find that BART's encoder and RoBERTa perform best, while pure language models (GPT-2) struggle. Interestingly, we see a consistent pattern across different languages and model sizes, suggesting that the trends we found are robust across these dimensions. We are grateful to the anonymous reviewers for their helpful feedback and suggestions. The first author is supported by the Australia Awards Scholarship (AAS), funded by the Department of Foreign Affairs and Trade (DFAT), Australia. This research was undertaken using the LIEF HPC-GPGPU Facility hosted at The University of Melbourne. This facility was established with the assistance of LIEF Grant LE170100200.
abstain method result abstain abstain abstain abstain abstain abstain objective abstain abstain abstain abstain abstain abstain abstain objective other abstain other method abstain abstain method abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain method abstain method method method method method method method method abstain abstain method method abstain method method method method abstain abstain abstain abstain abstain method method abstain method abstain abstain method abstain abstain abstain abstain method abstain abstain method abstain objective result result other other other other