[ { "type": "text", "text": "GLM-130B: AN OPEN BILINGUAL PRE-TRAINED MODEL ", "text_level": 1, "bbox": [ 174, 103, 823, 152 ], "page_idx": 0 }, { "type": "text", "text": "Aohan $\\mathbf { Z e n g } ^ { \\scriptscriptstyle \\circ \\dag \\ast }$ , Xiao $\\mathbf { L i u } ^ { \\diamond \\dagger * }$ , Zhengxiao $\\mathbf { D } \\mathbf { u } ^ { \\circ \\dagger }$ , Zihan Wang⋄, Hanyu Lai⋄, Ming $\\mathbf { D i n g } ^ { \\circ }$ , Zhuoyi $\\mathbf { Y a n g } ^ { \\diamond }$ , Yifan $\\mathbf { X } \\mathbf { u } ^ { \\circ }$ , Wendi Zheng⋄, Xiao $\\mathbf { X i a } ^ { \\diamond }$ , Weng Lam $\\mathbf { T a m } ^ { \\circ \\ S }$ , Zixuan $\\mathbf { M a } ^ { \\diamond }$ , Yufei $\\mathbf { X u e ^ { \\ S } }$ , Jidong Zhai⋄, Wenguang $\\mathbf { C h e n } ^ { \\circ }$ , Zhiyuan $\\mathbf { L i u } ^ { \\diamond }$ , Peng Zhang§, Yuxiao $\\mathbf { D o n g } ^ { \\circ \\dagger }$ , Jie Tang⋄‡ ", "bbox": [ 184, 190, 787, 251 ], "page_idx": 0 }, { "type": "text", "text": "Tsinghua University⋄ Zhipu.AI§ ", "bbox": [ 370, 265, 612, 279 ], "page_idx": 0 }, { "type": "text", "text": "ABSTRACT ", "text_level": 1, "bbox": [ 452, 315, 544, 332 ], "page_idx": 0 }, { "type": "text", "text": "We introduce GLM-130B, a bilingual (English and Chinese) pre-trained language model with 130 billion parameters. It is an attempt to open-source a 100B-scale model at least as good as GPT-3 (davinci) and unveil how models of such a scale can be successfully pre-trained. Over the course of this effort, we face numerous unexpected technical and engineering challenges, particularly on loss spikes and divergence. In this paper, we introduce the training process of GLM-130B including its design choices, training strategies for both efficiency and stability, and engineering efforts. The resultant GLM-130B model offers significant outperformance over GPT-3 175B (davinci) on a wide range of popular English benchmarks while the performance advantage is not observed in OPT-175B and BLOOM-176B. It also consistently and significantly outperforms ERNIE TITAN 3.0 260B—the largest Chinese language model—across related benchmarks. Finally, we leverage a unique scaling property of GLM-130B to reach INT4 quantization without post training, with almost no performance loss, making it the first among 100B-scale models and more importantly, allowing its effective inference on $4 \\times \\mathrm { R T X }$ 3090 (24G) or $8 \\times \\mathrm { R T X }$ 2080 Ti (11G) GPUs, the most affordable GPUs required for using 100B-scale models. The GLM-130B model weights are publicly accessible and its code, training logs, related toolkit, and lessons learned are open-sourced at https://github.com/THUDM/GLM-130B/. ", "bbox": [ 232, 348, 764, 611 ], "page_idx": 0 }, { "type": "text", "text": "1 INTRODUCTION ", "text_level": 1, "bbox": [ 176, 640, 336, 656 ], "page_idx": 0 }, { "type": "text", "text": "Large language models (LLMs), particularly those with over 100 billion (100B) parameters (Brown et al., 2020; Thoppilan et al., 2022; Rae et al., 2021; Chowdhery et al., 2022; Wang et al., 2021), have presented attractive scaling laws (Wei et al., 2022b), where emergent zero-shot and few-shot capabilities suddenly arose. Among them, GPT-3 (Brown et al., 2020) with 175B parameters pioneers the study of 100B-scale LLMs by strikingly generating better performance with 32 labeled examples than the fully-supervised BERT-Large model on a variety of benchmarks. However, both GPT-3 (and many other closed-sourced 100B-scale ones)—the model itself—and how it can be trained, have been thus far intransparent to the public. It is of critical value to train a high-quality LLM of such scale with both the model and training process shared with everyone. ", "bbox": [ 173, 671, 825, 796 ], "page_idx": 0 }, { "type": "text", "text": "We thus aim to pre-train an open and highly-accurate 100B-scale model with ethical concerns in mind. Over the course of our attempt, we have come to realize that pre-training a dense LLM at such a scale raises numerous unexpected technical and engineering challenges compared to training 10B-scale models, in terms of pre-training efficiency, stability, and convergence. Similar difficulties have also been concurrently observed in training OPT-175B (Zhang et al., 2022) and BLOOM176B (Scao et al., 2022), further demonstrating the significance of GPT-3 as a pioneer study. ", "bbox": [ 176, 804, 823, 859 ], "page_idx": 0 }, { "type": "image", "img_path": "images/cb9db52609c42d68ed3c8418c864580221d2a7b02a8c1d573aea0fb5c46b1b9b.jpg", "image_caption": [ "Figure 1: A summary of the performance evaluation and ethical studies. " ], "image_footnote": [], "bbox": [ 181, 89, 816, 205 ], "page_idx": 1 }, { "type": "table", "img_path": "images/4a14c8deb3aff229bfb3de0f864df79d4f48b07e5292f8f4840fc3d37b83fa6d.jpg", "table_caption": [ "Table 1: A comparison between GLM-130B and other 100B-scale LLMs and PaLM 540B. (LN: layer norm.; FPF: floating-point format; MIP: multi-task instruction pre-training; CN : Chinese) " ], "table_footnote": [], "table_body": "
ModelOpen- sourceArchitecture &DataTrainingInference
ObjectiveLNMajor Lang.FPFStabilizationQuantizationGPUNeeded
GPT-3 175B×EnglishFP16undisclosedundisclosedundisclosed
OPT-175BGPTPre-LNEnglishFP16Manual AdjustingINT88×3090
BLOOM-176BMulti-lingualBF161Embedding NormINT88×3090
PaLM540B×GPTPre-LNEnglishBF16 Manual Adjustingundisclosedundisclosed
GLM-130BGLM (Blank Infilling & MIP)Deep- NormBilingual (EN&CN)FP16Embedding Gradient ShrinkINT44 × 3090 or 8 × 1080 Ti
", "bbox": [ 178, 250, 820, 362 ], "page_idx": 1 }, { "type": "text", "text": "", "bbox": [ 176, 367, 821, 396 ], "page_idx": 1 }, { "type": "text", "text": "In this work, we introduce the pre-training of a 100B-scale model—GLM-130B, in terms of engineering efforts, model design choices, training strategies for efficiency and stability, and quantization for affordable inference. As it has been widely realized that it is computationally unaffordable to empirically enumerate all possible designs for training 100B-scale LLMs, we present not only the successful part for training GLM-130B but also many of the failed options and lessons learned. Particularly, the training stability is the decisive factor in the success of training models of such a scale. Different from practices such as manually adjusting learning rates in OPT-175B and using embedding norm in the sacrifice of performance in BLOOM-176B, we experiment with various options and find the strategy of embedding gradient shrink can significantly stabilize the training of GLM-130B. ", "bbox": [ 173, 401, 825, 541 ], "page_idx": 1 }, { "type": "text", "text": "Specifically, GLM-130B is a bilingual (English and Chinese) bidirectional dense model with 130 billion parameters, pre-trained over 400 billion tokens on a cluster of 96 NVIDIA DGX-A100 $( 8 \\times 4 0 \\mathrm { G } )$ GPU nodes between May 6 and July 3, 2022. Instead of using the GPT-style architecture, we adopt the General Language Model (GLM) algorithm (Du et al., 2022) to leverage its bidirectional attention advantage and autoregressive blank infilling objective. Table 1 summarizes the comparison between GLM-130B, GPT-3 and another two open-source efforts—OPT-175B and BLOOM-176B, as well as PaLM 540B (Chowdhery et al., 2022)—a $4 \\times$ larger model—as a reference. ", "bbox": [ 173, 547, 825, 646 ], "page_idx": 1 }, { "type": "text", "text": "Altogether, the conceptual uniqueness and engineering efforts enable GLM-130B to exhibit performance that surpasses the level of GPT-3 on a wide range of benchmarks (in total 112 tasks) and also outperforms PaLM 540B in many cases, while outperformance over GPT-3 has not been observed in OPT-175B and BLOOM-176B (Cf. Figure 1 left). For zero-shot performance, GLM-130B is better than GPT-3 175B $( + 5 . 0 \\% )$ , OPT-175B $( + 6 . 5 \\% )$ , and BLOOM-176B $( + 1 3 . 0 \\% )$ on LAMBADA (Paperno et al., 2016), and achieves $3 \\times$ better performance than GPT-3 on Big-bench-lite (Srivastava et al., 2022). For the 5-shot MMLU (Hendrycks et al., 2021) tasks, it is better than GPT-3 175B $( + 0 . 9 \\% )$ and BLOOM-176B $( + 1 2 . 7 \\% )$ . As a bilingual LLM also in Chinese, it offers significantly better results than ERNIE TITAN 3.0 260B (Wang et al., 2021)—the largest Chinese LLM—on 7 zero-shot CLUE (Xu et al., 2020) datasets $( + 2 4 . 2 6 \\% )$ and 5 zero-shot FewCLUE (Xu et al., 2021) ones $( + 1 2 . 7 5 \\% )$ . Importantly, as summarized in Figure 1 right, GLM-130B as an open model is associated with significantly less bias and generation toxicity than its 100B-scale counterparts. ", "bbox": [ 173, 652, 825, 819 ], "page_idx": 1 }, { "type": "text", "text": "Finally, we design GLM-130B to empower as many people as possible to conduct 100B-scale LLM studies. First, instead of using $1 7 5 \\mathrm { B } +$ parameters as OPT and BLOOM, the 130B size is decided because such a size supports inference on a single A100 $( 8 \\times 4 0 \\mathrm { G } )$ server. Second, to further lower the GPU requirements, we quantize GLM-130B into INT4 precision without post training while OPT and BLOOM can only reach INT8. Due to a unique property of the GLM architecture, GLM-130B’s INT4 quantization introduces negligible performance degradation, e.g., $- 0 . 7 4 \\%$ on LAMBADA and even $+ 0 . 0 5 \\%$ on MMLU, making it still better than the uncompressed GPT-3. This enables GLM", "bbox": [ 174, 827, 825, 924 ], "page_idx": 1 }, { "type": "image", "img_path": "images/92a8e0bf109fb0deab682c32d3f0cff5ce4759650bc24ac9640318fbae75ccba.jpg", "image_caption": [ "Figure 3: Trials on different LayerNorms for GLM-130B training. It turns out that DeepNorm is the most stable one, as it has small gradient norm and does not spike in the early stage training. " ], "image_footnote": [], "bbox": [ 183, 101, 799, 243 ], "page_idx": 2 }, { "type": "text", "text": "130B’s fast inference with performance guarantee on a server of $4 { \\times } \\mathrm { R T X } ~ 3 0 9 0$ (24G) or $8 \\times \\mathrm { R T X }$ \n2080 Ti (11G), the most affordable GPU required for using 100B-scale LLMs to date. ", "bbox": [ 174, 280, 821, 309 ], "page_idx": 2 }, { "type": "text", "text": "We open-source the model checkpoints, code, training logs, related toolkits, and lessons learned. ", "bbox": [ 176, 315, 805, 330 ], "page_idx": 2 }, { "type": "text", "text": "2 THE DESIGN CHOICES OF GLM-130B ", "text_level": 1, "bbox": [ 174, 338, 526, 356 ], "page_idx": 2 }, { "type": "text", "text": "The architecture of a machine learning model defines its inductive bias. However, it has been realized that it is computationally unaffordable to explore various architectural designs for LLMs. We introduce and explain the unique design choices of GLM-130B. ", "bbox": [ 174, 363, 825, 405 ], "page_idx": 2 }, { "type": "text", "text": "2.1 GLM-130B’S ARCHITECTURE ", "text_level": 1, "bbox": [ 176, 414, 429, 428 ], "page_idx": 2 }, { "type": "text", "text": "GLM as Backbone. Most recent 100B-scale LLMs, such as GPT-3, PaLM, OPT, and BLOOM, follow the traditional GPT-style (Radford et al., 2019) architecture of decoder-only autoregressive language modeling. In GLM-130B, we instead make an attempt to explore the potential of a bidirectional GLM—General Language Model (Du et al., 2022)—as its backbone. ", "bbox": [ 174, 433, 825, 488 ], "page_idx": 2 }, { "type": "text", "text": "GLM is a transformer-based language model that leverages autoregressive blank infilling as its training objective. Briefly, for a text sequence $\\pmb { x } = [ x _ { 1 } , \\cdots , x _ { n } ]$ , text spans $\\{ \\pmb { s } _ { 1 } , \\cdots , \\pmb { s } _ { m } \\}$ are sampled from it, each of which $s _ { i }$ denotes a span of consecutive tokens $[ s _ { i , 1 } , \\cdots , s _ { i , l _ { i } } ]$ and is replaced (i.e., corrupted) with a single mask token to form $\\pmb { x } _ { \\mathrm { c o r r u p t } }$ . The model is asked to recover them autoregressively. To allow interactions between corrupted spans, their visibility to each other is decided by a randomly sampled permutation on their order. ", "bbox": [ 174, 496, 825, 579 ], "page_idx": 2 }, { "type": "text", "text": "GLM’s bidirectional attention over unmasked (i.e., uncorrupted) contexts distinguishes GLM-130B from GPT-style LLMs in which the unidirectional attention is used. To support both understanding and generation, it mixes two corruption objectives, each indicated by a special mask token: ", "bbox": [ 174, 585, 825, 628 ], "page_idx": 2 }, { "type": "text", "text": "• [MASK]: short blanks in sentences whose lengths add up to a certain portion of the input. \n• [gMASK]: random-length long blanks at the end of sentences with prefix contexts provided. ", "bbox": [ 174, 635, 787, 666 ], "page_idx": 2 }, { "type": "text", "text": "Conceptually, the blank infilling objective with bidirectional attention enables a more effective comprehension of contexts than GPT-style models: when using [MASK], GLM-130B behaves as BERT (Devlin et al., 2019) and T5 (Raffel et al., 2020); when using [gMASK], GLM-130B behaves similarly to PrefixLM (Liu et al., 2018; Dong et al., 2019). ", "bbox": [ 173, 672, 529, 770 ], "page_idx": 2 }, { "type": "text", "text": "Empirically, GLM-130B offers a record-high accuracy of $8 0 . 2 \\%$ on zero-shot LAMBADA by outperforming both GPT-3 and PaLM 540B in Figure 2. By setting the attention mask, GLM-130B’s unidirectional variant is comparable to GPT-3 and OPT-175B. Our observations are in line with existing findings (Liu et al., 2018; Dong et al., 2019). ", "bbox": [ 174, 777, 529, 875 ], "page_idx": 2 }, { "type": "image", "img_path": "images/7eb937e7444a2dd34a6d4bbc01d4c86e84868280929c015f75e20936f987488c.jpg", "image_caption": [ "Figure 2: GLM-130B and LLMs of similar scale on zero-shot LAMBADA language modeling. Details on GLM’s bidirectional attention are provided in Du et al. (2022). " ], "image_footnote": [], "bbox": [ 545, 670, 818, 815 ], "page_idx": 2 }, { "type": "text", "text": "Layer Normalization (LN, Ba et al. (2016)). Training instability is one major challenge for training LLMs (Zhang et al., 2022; Scao et al., 2022; Chowdhery et al., 2022) (Cf. Figure 10 in Appendix for collapses in training several 100B-scale models). A proper choice of LNs can help stabilize the training of LLMs. We experiment with existing practices, e.g., Pre-LN (Xiong et al., 2020), Post-LN (Ba et al., 2016), Sandwich-LN (Ding et al., 2021), which are unfortunately incapable of stabilizing our GLM-130B test runs (Cf. Figure 3 (a) and Appendix B.2 for details). ", "bbox": [ 174, 882, 823, 924 ], "page_idx": 2 }, { "type": "text", "text": "", "bbox": [ 176, 103, 823, 146 ], "page_idx": 3 }, { "type": "text", "text": "Our search is later focused on Post-LN due to its favorable downstream results in preliminary experiments though it does not stabilize GLM-130B. Fortunately, one of the attempts on Post-LN initialized with the newly-proposed DeepNorm (Wang et al., 2022b) generates promising training stability. Specifically, given the number of GLM-130B’s layers $N$ , we adopt $\\mathrm { D e e p N o r m } ( { \\pmb x } ) \\ =$ LayerNorm $1 ( { \\boldsymbol { \\alpha } } \\cdot { \\boldsymbol { \\mathbf { \\mathit { x } } } } + \\operatorname { N e t w o r k } ( { \\boldsymbol { \\mathbf { \\mathit { x } } } } ) )$ , where $\\alpha = ( 2 N ) ^ { \\frac { 1 } { 2 } }$ , and apply the Xavier normal initialization with the scaling factor of $( 2 N ) ^ { - { \\frac { 1 } { 2 } } }$ to ffn, $\\mathtt { v \\_ p r o j }$ and out_proj. Additionally, all bias terms are initialized to zero. Figure 3 shows it significantly benefits the training stability of GLM-130B. ", "bbox": [ 173, 152, 825, 256 ], "page_idx": 3 }, { "type": "text", "text": "Positional Encoding and FFNs. We empirically test different options for positional encoding (PE) and FFN improvements in terms of both training stability and downstream performance (Cf. Appendix B.3 for details). For PEs in GLM-130B, we adopt Rotary Positional Encoding (RoPE, Su et al. (2021)) rather than ALiBi (Press et al., 2021). To improve FFNs in Transformer, we pick GLU with the GeLU (Hendrycks & Gimpel, 2016) activation as the replacement. ", "bbox": [ 174, 262, 825, 332 ], "page_idx": 3 }, { "type": "text", "text": "2.2 GLM-130B’S PRE-TRAINING SETUP ", "text_level": 1, "bbox": [ 176, 343, 472, 357 ], "page_idx": 3 }, { "type": "text", "text": "Inspired by recent works (Aribandi et al., 2022; Wei et al., 2022a; Sanh et al., 2022), the GLM-130B pre-training objective includes not only the self-supervised GLM autoregressive blank infilling) but also multi-task learning for a small portion of tokens. This is expected to help boost its downstream zero-shot performance. ", "bbox": [ 176, 362, 825, 417 ], "page_idx": 3 }, { "type": "text", "text": "Self-Supervised Blank Infilling $9 5 \\%$ tokens). Recall that GLM-130B uses both [MASK] and [gMASK] for this task. Each training sequence is applied with one of them independently at a time. Specifically, [MASK] is used to mask consecutive spans in $30 \\%$ of training sequences for blank infilling. The lengths of spans follow a Poisson distribution $\\lambda = 3$ ) and add up to $15 \\%$ of the input. For the other $70 \\%$ sequences, the prefix of each sequence is kept as context and [gMASK] is used to mask the rest of it. The masked length is sampled from the Uniform distribution. ", "bbox": [ 174, 424, 825, 508 ], "page_idx": 3 }, { "type": "text", "text": "The pre-training data includes 1.2T Pile (train split) (Gao et al., 2020) English, 1.0T Chinese WudaoCorpora (Yuan et al., 2021), and 250G Chinese corpora (including online forums, encyclopedia, and QA) we crawl from the web, which form a balanced composition of English and Chinese contents. ", "bbox": [ 176, 516, 821, 558 ], "page_idx": 3 }, { "type": "text", "text": "Multi-Task Instruction Pre-Training (MIP, $5 \\%$ tokens). T5 (Raffel et al., 2020) and ExT5 (Aribandi et al., 2022) suggest that multi-task learning in pre-training can be more helpful than fine-tuning, we thus propose to include a variety of instruction prompted datasets including language understanding, generation, and information extraction in GLM-130B’s pre-training. ", "bbox": [ 174, 564, 823, 621 ], "page_idx": 3 }, { "type": "text", "text": "Compared to recent works (Wei et al., 2022a; Sanh et al., 2022) that leverage multi-task prompted fine-tuning to improve zero-shot task transfer, MIP only accounts for $5 \\%$ tokens and is set in the pretraining stage to prevent spoiling LLMs’ other general ability, e.g., unconditional free generation. Specifically, we include 74 prompted datasets from (Sanh et al., 2022; Wang et al., 2022a), listed in Appendix C and Table 12. GLM-130B users are suggested to avoid evaluating its zero-shot and few-shot capabilities on these datasets according to the criterion illustrated in Section 5. ", "bbox": [ 174, 627, 825, 712 ], "page_idx": 3 }, { "type": "text", "text": "2.3 PLATFORM-AWARE PARALLEL STRATEGIES AND MODEL CONFIGURATIONS ", "text_level": 1, "bbox": [ 178, 729, 738, 744 ], "page_idx": 3 }, { "type": "text", "text": "GLM-130B is trained on a cluster of 96 DGX-A100 GPU $( 8 \\times 4 0 \\mathrm { G } )$ ) servers with a 60-day access. The goal is to pass through as many tokens as possible, as a recent study (Hoffmann et al., 2022) suggests that most existing LLMs are largely under-trained. ", "bbox": [ 174, 756, 823, 797 ], "page_idx": 3 }, { "type": "text", "text": "The 3D Parallel Strategy. The data parallelism (Valiant, 1990) and tensor model parallelism (Shoeybi et al., 2019) are the de facto practices for training billion-scale models (Wang & Komatsuzaki, 2021; Du et al., 2022). To further handle the huge GPU memory requirement and the decrease in overall GPU utilization resulted from applying tensor parallel between nodes—as 40G rather than 80G A100s are used for training GLM-130B, we combine the pipeline model parallelism with the other two strategies to form a 3D parallel strategy. ", "bbox": [ 174, 805, 823, 888 ], "page_idx": 3 }, { "type": "text", "text": "The pipeline parallelism divides the model into sequential stages for each parallel group, and to further minimize bubbles introduced by pipeline, we leverage the PipeDream-Flush (Narayanan et al., ", "bbox": [ 173, 895, 821, 924 ], "page_idx": 3 }, { "type": "text", "text": "2021) implementation from DeepSpeed (Rasley et al., 2020) to train GLM-130B with a relative big global batch size (4,224) to reduce time and GPU memory wasting. Through both numerical and empirical examinations, we adopt 4-way tensor parallelism and 8-way pipeline parallelism (Cf. Appendix B.4 for details). Following the calculation in (Chowdhery et al., 2022), we report hardware FLOPs utilization (HFU) of $4 3 . 3 \\%$ and model FLOPs utilization (MFU) of $3 2 . 5 \\%$ due to re-materialization. ", "bbox": [ 174, 103, 825, 186 ], "page_idx": 4 }, { "type": "text", "text": "GLM-130B Configurations. We aim to enable our 100B-scale LLM to run a single DGX-A100 (40G) node in FP16 precision. Based on the hidden state dimension of 12,288 we adopt from GPT-3, the resultant model size has to be no more than 130B parameters, thus GLM-130B. To maximize GPU utilization, we configure the model based on the platform and its corresponding parallel strategy. To avoid insufficient memory utilization in the middle stages due to the additional word embedding at both ends, we balance the pipeline partition by removing one layer from them, making $9 \\times 8 - 2 = 7 0$ transformer layers in GLM-130B. ", "bbox": [ 174, 194, 825, 291 ], "page_idx": 4 }, { "type": "text", "text": "During the 60-day access to the cluster, we manage to train GLM-130B for 400 billion tokens (roughly 200 billion each for Chinese and English) with a fixed sequence length of 2,048 per sample. For the $[ \\mathrm { g } \\mathbf { M } \\mathbf { A } \\mathbf { S } \\mathbf { K } ]$ training objective, we use a context window of 2,048 tokens. For the [MASK] and multi-task objectives, we use a context window of 512 and concatenate four samples together to cater the 2,048-sequence-length. We warm-up the batch size from 192 to 4224 over the first $2 . 5 \\%$ samples. We use AdamW (Loshchilov & Hutter, 2019) as our optimizer with $\\beta _ { 1 }$ and $\\beta _ { 2 }$ set to 0.9 and 0.95, and a weight decay value of 0.1. We warm up the learning rate from $1 0 ^ { - 7 }$ to $8 \\times 1 0 ^ { - 5 }$ over the first $0 . 5 \\%$ samples, then decay it by a $1 0 \\times$ cosine schedule. We use a dropout rate of 0.1 and clip gradients using a clipping value of 1.0 (Cf. Table 11 for the full configurations). ", "bbox": [ 174, 299, 825, 424 ], "page_idx": 4 }, { "type": "text", "text": "3 THE TRAINING STABILITY OF GLM-130B ", "text_level": 1, "bbox": [ 174, 449, 558, 467 ], "page_idx": 4 }, { "type": "text", "text": "The training stability is the decisive factor in GLM-130B’s quality, which is also largely impacted by the number of tokens it passes through (Hoffmann et al., 2022). Thus, given the computing usage constraint, there has to be a trade-off between efficiency and stability with regard to floatingpoint (FP) formats: low-precision FP formats (e.g., 16-bit precision—FP16) improve computing efficiency but are prone to overflow and underflow errors, resulting in training collapses. ", "bbox": [ 173, 484, 823, 555 ], "page_idx": 4 }, { "type": "text", "text": "Mixed-Precision. We follow the common practice of a mixedprecision (Micikevicius et al., 2018) strategy (Apex O2), i.e., FP16 for forwards and backwards and FP32 for optimizer states and master weights, to reduce the GPU memory usage and improve training efficiency. Similar to OPT-175B and BLOOM-176B (C.f. Figure 10 in Appendix), the training of GLM-130B faces frequent loss spikes resulted from this choice, which tends to become increasingly frequent as the training goes on. The precision related spikes are often without clear reasons: some recover on their own; others come with a portent of suddenly soaring gradient norm and eventually a spike or even NaN in loss. OPT-175B attempted to fix by manually skipping data and adjusting hyper-parameters; BLOOM176B did so via the embedding norm technique (Dettmers et al., 2021). We spent months to empirically investigate the spikes and realize that a few issues emerge when transformers scale up: ", "bbox": [ 174, 563, 607, 770 ], "page_idx": 4 }, { "type": "text", "text": "First, the transformer main branch’s value scale can be extremely large in deeper layers if using Pre-LN. This is addressed in GLM130B by using DeepNorm based Post-LN (Cf. Section 2.1), which makes the value scale always bounded. ", "bbox": [ 174, 777, 606, 833 ], "page_idx": 4 }, { "type": "image", "img_path": "images/5cda27883bad1a7034d0f6a575925c4b8eaee9a568db8bdcd271b739eb52bd32.jpg", "image_caption": [ "Figure 4: EGS reduces gradient scale and variance to stabilize LLMs’ pre-training. " ], "image_footnote": [], "bbox": [ 620, 566, 821, 800 ], "page_idx": 4 }, { "type": "text", "text": "Second, the attention scores grow so large that they exceed FP16’s range, as the model scales up. There are a few options to overcome this issue in LLMs. In CogView (Ding et al., 2021), PB-Relax is proposed to remove bias terms and deduct extremum value in attention computation to avoid the problem, which unfortunately does not help avoid disconvergence in GLM-130B. In BLOOM-176B, the BF16 format is used instead of FP16, due to its wide range of values on NVIDIA Ampere GPUs (i.e., A100). However, BF16 consumes ${ \\sim } 1 5 \\%$ more run-time GPU memory than FP16 in our experiments due to its conversion to FP32 in gradient accumulation, and more importantly it is not supported on other GPU platforms (e.g., NVIDIA Tesla V100), limiting the accessibility of produced LLMs. Another option from BLOOM-176B is to apply embedding norm with BF16, but in sacrifice of a significant penalty on model performance, as they notice that embedding norm can harm model’s zero-shot learning (Cf. Section 4.3 in (Scao et al., 2022)). ", "bbox": [ 176, 840, 607, 854 ], "page_idx": 4 }, { "type": "text", "text": "", "bbox": [ 174, 853, 823, 924 ], "page_idx": 4 }, { "type": "text", "text": "", "bbox": [ 174, 103, 825, 188 ], "page_idx": 5 }, { "type": "text", "text": "Embedding Layer Gradient Shrink (EGS). Our empirical search identifies that the gradient norm can serve as an informative indicator of training collapses. Specifically, we find that a training collapse usually lags behind a “spike” in gradient norm by a few training steps. Such spikes are usually caused by the embedding layer’s abnormal gradients, as we observe that its gradient norm is often several magnitude larger that those of other layers in GLM-130B’s early stage training (Cf. Figure 4 (a)). In addition, it tends to fluctuate dramatically in the early training. The problem is handled in vision models (Chen et al., 2021) via freezing the patch projection layer. Unfortunately, we cannot freeze the training of the embedding layer in language models. ", "bbox": [ 173, 194, 825, 306 ], "page_idx": 5 }, { "type": "text", "text": "Finally, we find the gradient shrink on embedding layers could overcome loss spikes and thus stabilize GLM-130B’s training. It is first used in the multi-modal transformer CogView (Ding et al., 2021). Let $\\alpha$ be the shrinking factor, the strategy can be easily implemented via word_embedding $=$ word_embedding $\\ast \\alpha +$ word_embedding.detach( $) * ( 1 - \\alpha )$ . Figure 4 (b) suggests that empirically, setting $\\alpha = 0 . 1$ wipes out most spikes we would have met, with negligible latency. ", "bbox": [ 174, 313, 823, 382 ], "page_idx": 5 }, { "type": "text", "text": "In fact, the final GLM-130B training run only experiences three late-stage loss divergence cases, though it fails numerous times due to hardware failures. For the three unexpected spikes, it turns out further shrinking the embedding gradient can still help stabilize the GLM-130B training. See the training notes and Tensorboard logs in our code repository for details. ", "bbox": [ 174, 388, 825, 445 ], "page_idx": 5 }, { "type": "text", "text": "4 GLM-130B INFERENCE ON RTX 2080 TI ", "text_level": 1, "bbox": [ 174, 474, 553, 492 ], "page_idx": 5 }, { "type": "text", "text": "One of the major goals of GLM-130B is to lower the hardware requirements for accessing 100Bscale LLMs without efficiency and effectiveness disadvantages. ", "bbox": [ 176, 512, 821, 541 ], "page_idx": 5 }, { "type": "text", "text": "As mentioned, the model size of 130B is determined for running the full GLM-130B model on a single A100 $( 4 0 \\mathrm { G } \\times 8 $ ) server, rather than the high-end A100 $( 8 0 0 \\times 8 )$ ) machine required by OPT-175B and BLOOM-176B. To accelerate GLM-130B inference, we also leverage FasterTransformer (Timonin et al., 2022) to implement GLM-130B in $\\mathrm { C } { + } { + }$ . Compared to the PyTorch implementation of BLOOM-176B in Huggingface, GLM-130B’s decoding inference is $7 . 8 . 4 \\times$ faster on the same single A100 server. (Cf. Appendix B.5 for details). ", "bbox": [ 174, 547, 823, 632 ], "page_idx": 5 }, { "type": "text", "text": "INT4 Quantization for RTX $\\mathbf { 3 0 9 0 s } / 2 0 8 0 \\mathbf { s }$ . To further support popularized GPUs, we attempt to compress GLM-130B as much as possible while maintaining performance superiority, particularly via quantization (Zafrir et al., 2019; Shen et al., 2020; Tao et al., 2022), which introduces little task-agnostic performance drops for generative language models. ", "bbox": [ 174, 638, 823, 695 ], "page_idx": 5 }, { "type": "text", "text": "Typically, the practice is to quantize both model weights and activations to INT8. However, our analysis in Appendix B.6 suggests that LLMs’ activations may contain extreme outliers. Concurrently, the emergent outliers in OPT-175B and BLOOM-176B are also discovered (Dettmers et al., 2022), which influence only about $0 . 1 \\%$ feature dimensions and are thus solved by matrix multiplication decomposition for the outlying dimensions. Differently, there exist about $30 \\%$ outliers in GLM-130B’s activations, making the technique above far less efficient. Thus, we decide to focus on the quantization of model weights (i.e., mostly linear layers) while keeping the FP16 precision for activations. The quantized model is dynamically converted to FP16 precision at runtime, introducing a small computational overhead but greatly reducing the GPU memory usage for storing model weights. ", "bbox": [ 174, 702, 529, 881 ], "page_idx": 5 }, { "type": "image", "img_path": "images/51756d8e0cdfc8c8e5024bda110de214d1edbe16683f435f4b5879c6e57dba31.jpg", "image_caption": [ "Figure 5: (Left) attn-dense and w2’s weight distributions; (Right) GLM-130B’s INT4 weight quantization scaling law. " ], "image_footnote": [], "bbox": [ 545, 699, 820, 830 ], "page_idx": 5 }, { "type": "text", "text": "", "bbox": [ 176, 882, 823, 924 ], "page_idx": 5 }, { "type": "table", "img_path": "images/8834ad1ebf074045e06df7130c86c900bbb12336986d30c5eac182041f4e0735.jpg", "table_caption": [ "Table 2: Left: Quantized GLM-130B’s performance on several benchmarks; Right: INT4 quantized GLM-130B’s inference speed (encode and decode) with FasterTransformer. " ], "table_footnote": [], "table_body": "
Model PrecisionGLM-130BGPT-3GPU Type128 Enc./Dec.512 Enc./Dec,
FP16INT8INT4FP168× A100 (40G)0.15s4.29s0.18s17.7s
MMLU (acc, ↑)44.7544.7144.8043.98 × V100 (32G)0.31s6.97s0.67s28.1s
LAMBADA (acc, ↑)80.2180.2179.4776.24 × RTX 3090 (24G)0.37s8.16s1.30s32.3s
Pile (a part,BPB,↓)0.6340.6380.6410.748 × RTX 2080 Ti(11G) 0.39s6.77s1.04s27.3s
", "bbox": [ 173, 133, 820, 212 ], "page_idx": 6 }, { "type": "text", "text": "Excitingly, we manage to reach the INT4 weight quantization for GLM-130B while existing successes have thus far only come to the INT8. Memory-wise, by comparing to INT8, the INT4 version helps additionally save half of the required GPU memory to 70GB, thus allowing GLM-130B inference on $4 \\times \\mathrm { R T X } 3 0 9 0 \\mathrm { T i } \\left( 2 4 \\mathrm { G } \\right)$ or 8 × RTX 2080 Ti (11G). Performance-wise, Table 2 left indicates that without post-training at all, the INT4-version GLM-130B experiences almost no performance degradation, thus maintaining the performance advantages over GPT-3 on common benchmarks. ", "bbox": [ 173, 222, 825, 306 ], "page_idx": 6 }, { "type": "text", "text": "GLM’s INT4 Weight Quantization Scaling Law. We examine the underlying mechanism of this unique INT4 weight quantization scaling law exhibited in Figure 5 right. We plot the weight value distributions in Figure 5 left, which turns out to directly impact the quantization quality. Specifically, a wider-distributed linear layer needs to be quantized with larger bins, leading to more precision loss. Thus the wide-distributed attn-dense and $\\mathtt { w } 2$ matrices explain the INT4 quantization failure for GPT-style BLOOM. Conversely, GLMs tend to have much narrower distributions than those of similar-sized GPTs, and the gap between INT4 and FP16 versions keeps further decreasing as the GLM model size scales up (Cf. Figure 15 in Appendix for details). ", "bbox": [ 173, 313, 825, 425 ], "page_idx": 6 }, { "type": "text", "text": "5 THE RESULTS ", "text_level": 1, "bbox": [ 176, 444, 323, 460 ], "page_idx": 6 }, { "type": "text", "text": "We follow the common settings in LLMs such as GPT-3 and PaLM to evaluate GLM-130B for English 1. As a bilingual LLM with Chinese, GLM-130B is also evaluated on Chinese benchmarks. ", "bbox": [ 174, 476, 823, 505 ], "page_idx": 6 }, { "type": "text", "text": "Discussion on the Scope of Zero-Shot Learning in GLM-130B. Since GLM-130B has been trained with MIP, here we clarify its scope of zero-shot evaluation. In fact, “zero-shot” seems to have controversial interpretations without a consensus in the community. We follow one of the influential related surveys (Xian et al., 2018), which says “At test time, in zero-shot learning setting, the aim is to assign a test image to an unseen class label” where involving unseen class labels is a key. Therefore, we derive our criterion to pick GLM-130B’s zero-shot (and few-shot) datasets as: ", "bbox": [ 174, 511, 825, 594 ], "page_idx": 6 }, { "type": "text", "text": "• English: 1) For tasks with fixed labels (e.g., natural language inference): no datasets in such tasks should be evaluated on; 2) For tasks without fixed labels (e.g., (multiple-choice) $Q A$ , topic classification): only datasets with an obvious domain transfer from those in MIP should be considered. • Chinese: All datasets can be evaluated as there exists a zero-shot cross-lingual transfer. ", "bbox": [ 174, 602, 823, 660 ], "page_idx": 6 }, { "type": "text", "text": "Filtering Test Datasets. Following prior practices (Brown et al., 2020; Rae et al., 2021) and our criterion mentioned above, we filter and refrain to report potentially contaminated datasets’ evaluation results. For LAMBADA and CLUE, we find minimal overlap under the 13-gram setting. Pile, MMLU, and BIG-bench are either held-out or released later than the crawling of corpora. ", "bbox": [ 173, 667, 825, 723 ], "page_idx": 6 }, { "type": "text", "text": "5.1 LANGUAGE MODELING ", "text_level": 1, "bbox": [ 176, 739, 379, 755 ], "page_idx": 6 }, { "type": "text", "text": "LAMBADA. LAMBADA (Paperno et al., 2016) is a dataset to test the last word language modeling capability. The results previously shown in Figure 2 suggest GLM-130B achieves a zero-shot accuracy of 80.2 with its bidirectional attention, setting up a new record on LAMBADA. ", "bbox": [ 173, 766, 823, 809 ], "page_idx": 6 }, { "type": "text", "text": "Pile. The Pile test-set (Gao et al., 2020) includes a series of benchmarks for language modeling. On average, GLM130B performs the best on its 18 shared test sets in terms of weighted BPB when compared to GPT-3 and Jurassic1 (Lieber et al., 2021) whose results are directly adopted ", "bbox": [ 174, 815, 553, 898 ], "page_idx": 6 }, { "type": "table", "img_path": "images/6437c700ba4036b38b14e83f6b96d2fe5938067ad83a3447f0f0c3cf8cab28fe.jpg", "table_caption": [ "Table 3: GLM-130B’s average BPB on Pile evaluation (18 sub-datasets). " ], "table_footnote": [], "table_body": "
Jurassic-1 GPT-3 GLM-130B
Avg. BPB0.650 0.7420.634
", "bbox": [ 570, 840, 815, 882 ], "page_idx": 6 }, { "type": "table", "img_path": "images/f6af3e3328a015002125f16e6ee9f536b782597efba077c914ae6e70d0aa3a2d.jpg", "table_caption": [], "table_footnote": [], "table_body": "
O-shot 1-shot 3-shot
GPT-3 2.6B 0.600.71 1.83
GPT-3 6.7B -0.062.93 5.40
GPT-3 13B 1.775.43 7.95
GPT-3 175B 4.3511.34 13.18
PaLM540B 8.0537.77 -
GLM-130B 13.3114.91 15.12
", "bbox": [ 637, 101, 818, 223 ], "page_idx": 7 }, { "type": "image", "img_path": "images/bc768f0500dbcbce18ed7d112cb5264715b388e301cc64dbb2e37b835ba3e30d.jpg", "image_caption": [ "Figure 6: GLM-130B on MMLU (57 tasks) along training steps. " ], "image_footnote": [], "bbox": [ 171, 101, 388, 232 ], "page_idx": 7 }, { "type": "image", "img_path": "images/4e9e6dbb3574da88d111b6e7da6c681aed8234ee747f2191e2f3ec553ffce069.jpg", "image_caption": [ "Figure 7: BIG-bench-lite evalua- Table 4: Details on BIGtion (24 tasks) across scales. bench-lite (24 tasks). " ], "image_footnote": [], "bbox": [ 411, 101, 629, 231 ], "page_idx": 7 }, { "type": "text", "text": "5.2 MASSIVE MULTITASK LANGUAGE UNDERSTANDING (MMLU) ", "text_level": 1, "bbox": [ 176, 277, 648, 291 ], "page_idx": 7 }, { "type": "text", "text": "MMLU (Hendrycks et al., 2021) is a diverse benchmark including 57 multi-choice question answering tasks concerning human knowledge ranging from high-school-level to expert-level. It is released after the crawling of Pile and serves as an ideal test-bed for LLMs’ few-shot learning. The GPT-3 result is adopted from MMLU and BLOOM-176B is tested by using the same prompts as GLM-130B’s (Cf. Appendix C.6 and Table 15 for details). ", "bbox": [ 174, 304, 823, 375 ], "page_idx": 7 }, { "type": "text", "text": "GLM-130B’s few-shot (5-shot) performance on MMLU approaches GPT-3 (43.9) after viewing about 300B tokens in Figure 6. It continues moving up as the training proceeds, achieving an accuracy of 44.8 when the training has to end (i.e., viewing 400B tokens in total). This aligns with the observation (Hoffmann et al., 2022) that most existing LLMs are far from adequately trained. ", "bbox": [ 174, 381, 823, 436 ], "page_idx": 7 }, { "type": "text", "text": "5.3 BEYOND THE IMITATION GAME BENCHMARK (BIG-BENCH) ", "text_level": 1, "bbox": [ 174, 454, 632, 469 ], "page_idx": 7 }, { "type": "text", "text": "BIG-bench (Srivastava et al., 2022) benchmarks challenging tasks concerning models’ ability on reasoning, knowledge, and commonsense. Given evaluating on its 150 tasks is time-consuming for LLMs, we report the BIG-bench-lite—an official 24-task sub-collection—for now. Observed from Figure 7 and Table 4, GLM-130B outperforms GPT-3 175B and even PaLM 540B $4 \\times$ larger) in zero-shot setting. This is probably owing to GLM-130B’s bidirectional context attention and MIP, which has been proved to improve zero-shot results in unseen tasks (Wei et al., 2022a; Sanh et al., 2022). As the number of shots increases, GLM-130B’s performance keeps going up, maintaining its outperformance over GPT-3 (Cf. Appendix C.5 and Table 14 for details on each model and task). ", "bbox": [ 173, 481, 825, 593 ], "page_idx": 7 }, { "type": "text", "text": "Limitations and Discussions. In the experiments above, we observe that GLM-130B’s performance growth (13.31 to 15.12) with the increase of few-shot samples is not as significant as GPT-3’s (4.35 to 13.18). Here is our intuitive attempt to understand the phenomenon. ", "bbox": [ 174, 599, 825, 641 ], "page_idx": 7 }, { "type": "text", "text": "First, the bidirectional nature of GLM-130B could lead to strong zero-shot performance (as is indicated in zero-shot language modeling), thus getting closer to the few-shot “upper-bound” for models of similar scale (i.e., 100B-scale) than unidirectional LLMs. Second, it may be also attributed to a deficit of existing MIP paradigms (Wei et al., 2022a; Sanh et al., 2022), which only involve zero-shot prediction in the training and will be likely to bias GLM-130B for stronger zero-shot learning but relatively weaker in-context few-shot performance. To correct the bias, a potential solution we came up with would be to employ MIP with varied shots of in-context samples rather than only zero-shot samples. ", "bbox": [ 174, 648, 825, 760 ], "page_idx": 7 }, { "type": "text", "text": "Finally, despite almost the same GPT architecture as GPT-3, PaLM 540B’s relative growth with fewshot in-context learning is substantially more significant than GPT-3’s. We conjecture this further acceleration in performance growth is a source of PaLM’s high-quality and diverse private-collected training corpora. By combining our experiences with (Hoffmann et al., 2022)’s insights, we came to realize that better architectures, better data, and more training FLOPS should be further invested. ", "bbox": [ 174, 767, 825, 837 ], "page_idx": 7 }, { "type": "text", "text": "5.4 CHINESE LANGUAGE UNDERSTANDING EVALUATION (CLUE) ", "text_level": 1, "bbox": [ 174, 854, 647, 869 ], "page_idx": 7 }, { "type": "text", "text": "We evaluate GLM-130B’s Chinese zero-shot performance on established Chinese NLP benchmarks, CLUE (Xu et al., 2020) and FewCLUE ( $\\mathrm { \\Delta X u }$ et al., 2021).Note that we do not include any Chinese downstream tasks in MIP. To date, we have finished testing on part of the two benchmarks, including ", "bbox": [ 176, 882, 825, 924 ], "page_idx": 7 }, { "type": "image", "img_path": "images/cf741e7d068482c8c779765e1751682f1682af62a7dee0e1d2c918bcee48744a.jpg", "image_caption": [ "Figure 8: GLM-130B and ERNIE Titan 3.0 260B evaluated on zero-shot CLUE and FewCLUE. " ], "image_footnote": [], "bbox": [ 173, 98, 820, 174 ], "page_idx": 8 }, { "type": "text", "text": "7 CLUE and 5 FewCLUE datasets (Cf. Appendix C.7 for details). We compare GLM-130B to the largest existing Chinese monolingual language model—the 260B ERNIE Titan 3.0 (Wang et al., 2021). We follow its setting to report zero-shot results on dev datasets. GLM-130B consistently outperforms ERNIE Titan 3.0 across 12 tasks (Cf. Figure 8). Interestingly, GLM-130B performs at least $260 \\%$ better than ERNIE on two abstractive MRC datasets (DRCD and CMRC2018), possibly due to GLM-130B’s pre-training objective that naturally resonates to abstractive MRC’s form. ", "bbox": [ 173, 212, 825, 296 ], "page_idx": 8 }, { "type": "text", "text": "6 RELATED WORK ", "text_level": 1, "bbox": [ 176, 325, 343, 342 ], "page_idx": 8 }, { "type": "text", "text": "In this section, we review related work to GLM-130B on topics of pre-training, transferring, and inference of pre-trained LLMs (Qiu et al., 2020; Bommasani et al., 2021). ", "bbox": [ 174, 363, 823, 391 ], "page_idx": 8 }, { "type": "text", "text": "Pre-Training. Vanilla language modeling refers to decoder-only autoregressive models (e.g., GPT (Radford et al., 2018)), but it also recognizes any forms of self-supervised objectives on texts. Recently, transformer-based (Vaswani et al., 2017) language models present a fascinating scaling law: new abilities (Wei et al., 2022b) arise as models scale up, from 1.5B (Radford et al., 2019), 10B-scale language models (Raffel et al., 2020; Shoeybi et al., 2019; Black et al., 2022), to 100Bscale GPT-3 (Brown et al., 2020). Later, despite many 100B-scale LLMs (Lieber et al., 2021; Thoppilan et al., 2022; Rae et al., 2021; Smith et al., 2022; Chowdhery et al., 2022; Wu et al., 2021; Zeng et al., 2021; Wang et al., 2021) in both English and Chinese, they are not available to public or only accessible via limited APIs. The closeness of LLMs severely stymies its development. GLM-130B’s efforts, along with recent ElutherAI, OPT-175B (Zhang et al., 2022), and BLOOM-176B (Scao et al., 2022), aim to offer high-quality open-sourced LLMs to our community. ", "bbox": [ 174, 397, 825, 551 ], "page_idx": 8 }, { "type": "text", "text": "Transferring. Though fine-tuning has been a de facto way for transfer learning, the evaluation for LLMs has been focused on prompting and in-context learning due to their tremendous sizes (Brown et al., 2020; Liu et al., 2021a). Nevertheless, some recent attempts has been on parameter-efficient learning on language models (Houlsby et al., 2019) and prompt tuning (i.e., P-tuning, Li & Liang (2021); Liu et al. (2021b); Lester et al. (2021); Liu et al. (2022)). For now we do not focus on them and will leave the comprehensive testing of them on GLM-130B in future study. ", "bbox": [ 174, 558, 825, 642 ], "page_idx": 8 }, { "type": "text", "text": "Inference. Most public-accessible LLMs nowadays are providing their services via limited APIs.In this work, an important part of our endeavor has been on LLMs’ efficient and fast inference. Related work may include distillation (Sanh et al., 2019; Jiao et al., 2020; Wang et al., 2020), quantization (Zafrir et al., 2019; Shen et al., 2020; Tao et al., 2022), and pruning (Michel et al., 2019; Fan et al., 2019). Very recent work (Dettmers et al., 2022) shows that LLMs such as OPT-175B and BLOOM-176B can be quantized to 8 bit due to special distribution of outlier dimensions. In this work, we demonstrate GLM’s scaling law for INT4 weight quantization, which allows GLM-130B to inference on as few as $4 \\times$ RTX 3090 (24G) GPUs or $8 \\times$ RTX 2080 Ti (11G) GPUs. ", "bbox": [ 174, 648, 825, 760 ], "page_idx": 8 }, { "type": "text", "text": "7 CONCLUSION AND LESSONS ", "text_level": 1, "bbox": [ 176, 789, 442, 805 ], "page_idx": 8 }, { "type": "text", "text": "We introduce GLM-130B, a bilingual pre-trained language model that aims to facilitate open and inclusive LLM research. GLM-130B’s technical and engineering undertakings generate insight into LLMs’ architectures, pre-training objectives, training stability and efficiency, and affordable inference. Altogether, it contributes to the high quality of GLM-130B in terms of both language performance on 112 tasks and ethical results on bias and toxicity benchmarks. Our experiences of both success and failure are condensed into the lessons for training 100B-scale LLMs, attached in the Appendix B.10. ", "bbox": [ 174, 825, 823, 922 ], "page_idx": 8 }, { "type": "text", "text": "ACKNOWLEDGEMENT ", "text_level": 1, "bbox": [ 176, 103, 356, 117 ], "page_idx": 9 }, { "type": "text", "text": "This research was supported by Natural Science Foundation of China (NSFC) 61825602, 62276148 and Zhipu.AI. We thank all our collaborators and partners from the Knowledge Engineering Group (KEG), Parallel Architecture & Compiler technology of Mobile, Accelerated, and Networked systems Group (PACMAN), Natural Language Processing Group (THUNLP) at Tsinghua University, and Zhipu.AI. ", "bbox": [ 174, 136, 825, 207 ], "page_idx": 9 }, { "type": "text", "text": "ETHICS STATEMENT ", "text_level": 1, "bbox": [ 174, 231, 343, 246 ], "page_idx": 9 }, { "type": "text", "text": "We hereby acknowledge that all of the co-authors of this work are aware of the provided ICLR Code of Ethics and honor the code of conduct. This work introduces an open-source Large Language Model (LLM), which could be used to generate synthetic text for harmful applications, such as telemarketing fraud, political propaganda, and personal harassment as is discussed in (Weidinger et al., 2021; Sheng et al., 2021; Dev et al., 2021). We do not anticipate any hazardous outputs, especially towards vulnerable and historically disadvantaged groups of peoples, after using the model. ", "bbox": [ 174, 265, 825, 348 ], "page_idx": 9 }, { "type": "text", "text": "And to better collaborate with our community to prevent and ultimately eliminate the risks technically, we make the following crucial open efforts in this work: ", "bbox": [ 173, 356, 820, 383 ], "page_idx": 9 }, { "type": "text", "text": "Open-Sourced LLMs for Ethical Risk Study. While some people think that restricting the access of LLMs can prevent such harmful applications, we argue that promoting LLM inclusivity can lead to better defense against potential harms caused by LLMs. Currently, only governments and large corporations can afford the considerable costs of pre-training LLMs. There is no guarantee that organizations having the the substantial financial resources will not do harm using a LLM. Without access to such LLMs, individuals cannot even realize the role of LLMs in the harm. ", "bbox": [ 174, 390, 825, 473 ], "page_idx": 9 }, { "type": "text", "text": "Conversely, releasing an open LLM can provide access and transparency to all the researchers and promote the research to reduce the potential harm of LLMs, like algorithms to identify the synthetic text Gehrmann et al. (2019). Also, it is known that LLMs can suffer from problems in fairness, bias, privacy, and truthfulness Zhang et al. (2021); Lin et al. (2022); Liang et al. (2021); Bender et al. (2021). An open LLM can reveal the model parameters and internal states corresponding to specific inputs instead of providing APIs to black-box models. In conclusion, researchers can conduct analysis of LLMs’ flaws in depth and propose improved algorithms to solve the problems. ", "bbox": [ 174, 481, 825, 579 ], "page_idx": 9 }, { "type": "text", "text": "Ethical Evaluation and Improvements. We also evaluate our model over a wide range of English ethical evaluation benchmarks, including bias measurement (Nadeem et al., 2021; Nangia et al., 2020), hate speech detection (Mollas et al., 2020), and toxic generation estimation (Gehman et al., 2020). Notwithstanding their deficiency (Blodgett et al., 2021; Jacobs & Wallach, 2021), these datasets serve as a meaningful initial step towards an open quantitative evaluation LLMs. ", "bbox": [ 174, 585, 823, 655 ], "page_idx": 9 }, { "type": "text", "text": "Our evaluation implies that our algorithm designs, especially the bilingual pre-training of a LLM, can significantly mitigate the biases and toxicity an LLM may present while keeping its strong language performance compared to other LLMs (Brown et al., 2020; Zhang et al., 2022) trained with monolingual English corpora (Cf. Appendix A for more details). ", "bbox": [ 176, 662, 823, 718 ], "page_idx": 9 }, { "type": "text", "text": "REPRODUCIBILITY ", "text_level": 1, "bbox": [ 176, 743, 331, 758 ], "page_idx": 9 }, { "type": "text", "text": "Compared to mainstream closed-sourced LLMs including GPT-3 175B(Brown et al., 2020), PaLM 540B (Chowdhery et al., 2022), Gopher (Rae et al., 2021), Chinchilla (Hoffmann et al., 2022), LaMDA (Thoppilan et al., 2022), FLAN (Wei et al., 2022a), and many others, GLM-130B is opensourced and devotes to promote openness and inclusivity in LLM research from the very beginning. ", "bbox": [ 174, 776, 823, 833 ], "page_idx": 9 }, { "type": "text", "text": "We have paid great effort to ensure the reproducibility of our evaluation. For pre-training section, despite the unaffordable costs it needs to reproduce at present, we still make our best efforts to disclose the code, details, and the whole process of GLM-130B’s pre-training. Our endeavor to allow GLM-130B inference on few popularized GPUs such as 3090/2080 Ti also aligns with the reproducibility undertaking, as it allows most academic researchers to reproduce GLM-130B’s results on their offline machines. We also provide free APIs for individual users to test GLM-130B’s ability. ", "bbox": [ 174, 840, 823, 922 ], "page_idx": 9 }, { "type": "text", "text": "Pre-Training. We provide the complete training notes, Tensorboard logs, and code for our pretraining in our repository (Cf. Abstract). The pre-training hyper-parameters and cluster configuration are provided in Section 2.3 and Table 11. The training corpora composition and details for Multi-task Instruction Pre-training are provided in Section 2.2 and Appendix C.1 and C.2. ", "bbox": [ 174, 103, 823, 159 ], "page_idx": 10 }, { "type": "text", "text": "Evaluation. We organize all the evaluation, including language benchmarks (LAMBADA, Pile, MMLU, BIG-bench, CLUE, and FewCLUE) and ethical benchmarks (CrowS-Pairs, StereoSet, ETHOS, RealToxicPrompts), into one-command-to-run bash scripts in our code repository. Data processing details for language modeling benchmarks are provided in Section 5.1 and Appendix C.4, for MMLU are provided in Section 5.2 and Appendix C.6, for BIG-bench are provided in Section 5.3 and Appendix C.5, for CLUE and FewCLUE are provided in 5.4. For all ethical evaluation, please refer to Appendix A for details. ", "bbox": [ 174, 166, 825, 263 ], "page_idx": 10 }, { "type": "text", "text": "REFERENCES ", "text_level": 1, "bbox": [ 174, 286, 285, 301 ], "page_idx": 10 }, { "type": "text", "text": "Oshin Agarwal, Heming Ge, Siamak Shakeri, and Rami Al-Rfou. Knowledge graph based synthetic corpus generation for knowledge-enhanced language model pre-training. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 3554–3565, 2021. ", "bbox": [ 174, 316, 825, 372 ], "page_idx": 10 }, { "type": "text", "text": "Vamsi Aribandi, Yi Tay, Tal Schuster, Jinfeng Rao, Huaixiu Steven Zheng, Sanket Vaibhav Mehta, Honglei Zhuang, Vinh Q Tran, Dara Bahri, Jianmo Ni, et al. Ext5: Towards extreme multi-task scaling for transfer learning. In International Conference on Learning Representations, 2022. ", "bbox": [ 176, 383, 823, 426 ], "page_idx": 10 }, { "type": "text", "text": "Mikel Artetxe, Shruti Bhosale, Naman Goyal, Todor Mihaylov, Myle Ott, Sam Shleifer, Xi Victoria Lin, Jingfei Du, Srinivasan Iyer, Ramakanth Pasunuru, et al. Efficient large scale language modeling with mixtures of experts. arXiv preprint arXiv:2112.10684, 2021. ", "bbox": [ 173, 436, 823, 479 ], "page_idx": 10 }, { "type": "text", "text": "Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. ", "bbox": [ 171, 491, 823, 520 ], "page_idx": 10 }, { "type": "text", "text": "Stephen Bach, Victor Sanh, Zheng Xin Yong, Albert Webson, Colin Raffel, Nihal V Nayak, Abheesht Sharma, Taewoon Kim, M Saiful Bari, Thibault Févry, et al. Promptsource: An integrated development environment and repository for natural language prompts. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pp. 93–104, 2022. ", "bbox": [ 174, 530, 825, 601 ], "page_idx": 10 }, { "type": "text", "text": "Emily M. Bender, Timnit Gebru, Angelina McMillan-Major, and Shmargaret Shmitchell. On the dangers of stochastic parrots: Can language models be too big? In FAccT ’21: 2021 ACM Conference on Fairness, Accountability, and Transparency, Virtual Event / Toronto, Canada, March 3-10, 2021, pp. 610–623. ACM, 2021. ", "bbox": [ 173, 611, 825, 667 ], "page_idx": 10 }, { "type": "text", "text": "Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. Semantic parsing on freebase from question-answer pairs. In Proceedings of the 2013 conference on empirical methods in natural language processing, pp. 1533–1544, 2013. ", "bbox": [ 173, 679, 823, 722 ], "page_idx": 10 }, { "type": "text", "text": "Yonatan Bisk, Rowan Zellers, Jianfeng Gao, Yejin Choi, et al. Piqa: Reasoning about physical commonsense in natural language. In Proceedings of the AAAI conference on artificial intelligence, volume 34, pp. 7432–7439, 2020. ", "bbox": [ 174, 732, 825, 775 ], "page_idx": 10 }, { "type": "text", "text": "Sidney Black, Stella Biderman, Eric Hallahan, Quentin Anthony, Leo Gao, Laurence Golding, Horace He, Connor Leahy, Kyle McDonell, Jason Phang, et al. Gpt-neox-20b: An open-source autoregressive language model. In Proceedings of BigScience Episode\\# 5–Workshop on Challenges & Perspectives in Creating Large Language Models, pp. 95–136, 2022. ", "bbox": [ 174, 786, 825, 843 ], "page_idx": 10 }, { "type": "text", "text": "Su Lin Blodgett, Gilsinia Lopez, Alexandra Olteanu, Robert Sim, and Hanna Wallach. Stereotyping norwegian salmon: An inventory of pitfalls in fairness benchmark datasets. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 1004–1015, 2021. ", "bbox": [ 174, 853, 825, 922 ], "page_idx": 10 }, { "type": "text", "text": "Rishi Bommasani, Drew A Hudson, Ehsan Adeli, Russ Altman, Simran Arora, Sydney von Arx, Michael S Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, et al. On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258, 2021. ", "bbox": [ 176, 103, 820, 146 ], "page_idx": 11 }, { "type": "text", "text": "Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901, 2020. ", "bbox": [ 178, 154, 821, 196 ], "page_idx": 11 }, { "type": "text", "text": "Nicola De Cao, Wilker Aziz, and Ivan Titov. Editing factual knowledge in language models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, EMNLP 2021, Virtual Event / Punta Cana, Dominican Republic, 7-11 November, 2021, pp. 6491– 6506. Association for Computational Linguistics, 2021. ", "bbox": [ 173, 204, 826, 262 ], "page_idx": 11 }, { "type": "text", "text": "Xavier Carreras and Lluís Màrquez. Introduction to the conll-2005 shared task: Semantic role labeling. In CoNLL, pp. 152–164, 2005. ", "bbox": [ 173, 270, 821, 299 ], "page_idx": 11 }, { "type": "text", "text": "Thiago Castro Ferreira, Claire Gardent, Nikolai Ilinykh, Chris van der Lee, Simon Mille, Diego Moussallem, and Anastasia Shimorina. The 2020 bilingual, bi-directional WebNLG $^ +$ shared task: Overview and evaluation results (WebNLG $^ +$ 2020). In Proceedings of the 3rd International Workshop on Natural Language Generation from the Semantic Web $( W e b N L G + ,$ ), pp. 55–76, Dublin, Ireland (Virtual), 12 2020. Association for Computational Linguistics. URL https://aclanthology.org/2020.webnlg-1.7. ", "bbox": [ 174, 306, 825, 392 ], "page_idx": 11 }, { "type": "text", "text": "Xinlei Chen, Saining Xie, and Kaiming He. An empirical study of training self-supervised vision transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 9640–9649, 2021. ", "bbox": [ 174, 400, 825, 441 ], "page_idx": 11 }, { "type": "text", "text": "Ke-Li Chiu and Rohan Alexander. Detecting hate speech with gpt-3. arXiv preprint arXiv:2103.12407, 2021. ", "bbox": [ 171, 450, 823, 479 ], "page_idx": 11 }, { "type": "text", "text": "Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311, 2022. ", "bbox": [ 174, 487, 823, 530 ], "page_idx": 11 }, { "type": "text", "text": "Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabharwal, Carissa Schoenick, and Oyvind Tafjord. Think you have solved question answering? try arc, the ai2 reasoning challenge. arXiv preprint arXiv:1803.05457, 2018. ", "bbox": [ 174, 537, 823, 580 ], "page_idx": 11 }, { "type": "text", "text": "Zihang Dai, Zhilin Yang, Yiming Yang, Jaime G Carbonell, Quoc Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 2978–2988, 2019. ", "bbox": [ 174, 589, 823, 632 ], "page_idx": 11 }, { "type": "text", "text": "Tim Dettmers, Mike Lewis, Sam Shleifer, and Luke Zettlemoyer. 8-bit optimizers via block-wise quantization. arXiv preprint arXiv:2110.02861, 2021. ", "bbox": [ 171, 640, 823, 670 ], "page_idx": 11 }, { "type": "text", "text": "Tim Dettmers, Mike Lewis, Younes Belkada, and Luke Zettlemoyer. Llm. int8 (): 8-bit matrix multiplication for transformers at scale. arXiv preprint arXiv:2208.07339, 2022. ", "bbox": [ 169, 676, 821, 707 ], "page_idx": 11 }, { "type": "text", "text": "Sunipa Dev, Masoud Monajatipoor, Anaelia Ovalle, Arjun Subramonian, J. M. Phillips, and Kai Wei Chang. Harms of gender exclusivity and challenges in non-binary representation in language technologies. ArXiv, abs/2108.12084, 2021. ", "bbox": [ 174, 714, 825, 757 ], "page_idx": 11 }, { "type": "text", "text": "Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4171–4186, 2019. ", "bbox": [ 173, 765, 825, 821 ], "page_idx": 11 }, { "type": "text", "text": "Ming Ding, Zhuoyi Yang, Wenyi Hong, Wendi Zheng, Chang Zhou, Da Yin, Junyang Lin, Xu Zou, Zhou Shao, Hongxia Yang, et al. Cogview: Mastering text-to-image generation via transformers. Advances in Neural Information Processing Systems, 34:19822–19835, 2021. ", "bbox": [ 176, 829, 821, 873 ], "page_idx": 11 }, { "type": "text", "text": "Li Dong, Nan Yang, Wenhui Wang, Furu Wei, Xiaodong Liu, Yu Wang, Jianfeng Gao, Ming Zhou, and Hsiao-Wuen Hon. Unified language model pre-training for natural language understanding and generation. Advances in Neural Information Processing Systems, 32, 2019. ", "bbox": [ 174, 881, 825, 924 ], "page_idx": 11 }, { "type": "text", "text": "Zhengxiao Du, Yujie Qian, Xiao Liu, Ming Ding, Jiezhong Qiu, Zhilin Yang, and Jie Tang. Glm: General language model pretraining with autoregressive blank infilling. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 320–335, 2022. ", "bbox": [ 174, 103, 825, 159 ], "page_idx": 12 }, { "type": "text", "text": "Ondˇrej Dušek, David M. Howcroft, and Verena Rieser. Semantic noise matters for neural natural language generation. In Proceedings of the 12th International Conference on Natural Language Generation, pp. 421–426, Tokyo, Japan, October–November 2019. Association for Computational Linguistics. doi: 10.18653/v1/W19-8652. URL https://aclanthology.org/W19 -8652. ", "bbox": [ 173, 169, 825, 238 ], "page_idx": 12 }, { "type": "text", "text": "Hady Elsahar, Pavlos Vougiouklis, Arslen Remaci, Christophe Gravier, Jonathon Hare, Frederique Laforest, and Elena Simperl. T-rex: A large scale alignment of natural language with knowledge base triples. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018), 2018. ", "bbox": [ 173, 247, 825, 304 ], "page_idx": 12 }, { "type": "text", "text": "Mihail Eric, Rahul Goel, Shachi Paul, Abhishek Sethi, Sanchit Agarwal, Shuyang Gao, Adarsh Kumar, Anuj Kumar Goyal, Peter Ku, and Dilek Hakkani-Tür. Multiwoz 2.1: A consolidated multi-domain dialogue dataset with state corrections and state tracking baselines. In LREC, 2020. ", "bbox": [ 176, 313, 825, 356 ], "page_idx": 12 }, { "type": "text", "text": "Angela Fan, Edouard Grave, and Armand Joulin. Reducing transformer depth on demand with structured dropout. arXiv preprint arXiv:1909.11556, 2019. ", "bbox": [ 169, 364, 823, 393 ], "page_idx": 12 }, { "type": "text", "text": "Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster, Jason Phang, Horace He, Anish Thite, Noa Nabeshima, et al. The pile: An 800gb dataset of diverse text for language modeling. arXiv preprint arXiv:2101.00027, 2020. ", "bbox": [ 174, 402, 823, 445 ], "page_idx": 12 }, { "type": "text", "text": "Samuel Gehman, Suchin Gururangan, Maarten Sap, Yejin Choi, and Noah A. Smith. Realtoxicityprompts: Evaluating Neural Toxic Degeneration in Language Models. dblp://journals/dblp, 2020. ", "bbox": [ 176, 454, 823, 497 ], "page_idx": 12 }, { "type": "text", "text": "Sebastian Gehrmann, Hendrik Strobelt, and Alexander Rush. GLTR: Statistical detection and visualization of generated text. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pp. 111–116, Florence, Italy, July 2019. Association for Computational Linguistics. ", "bbox": [ 174, 506, 825, 563 ], "page_idx": 12 }, { "type": "text", "text": "Sebastian Gehrmann, Tosin Adewumi, Karmanya Aggarwal, Pawan Sasanka Ammanamanchi, Aremu Anuoluwapo, Antoine Bosselut, Khyathi Raghavi Chandu, Miruna Clinciu, Dipanjan Das, Kaustubh D Dhole, et al. The gem benchmark: Natural language generation, its evaluation and metrics. GEM 2021, pp. 96, 2021. ", "bbox": [ 173, 571, 825, 628 ], "page_idx": 12 }, { "type": "text", "text": "Mor Geva, Daniel Khashabi, Elad Segal, Tushar Khot, Dan Roth, and Jonathan Berant. Did aristotle use a laptop? a question answering benchmark with implicit reasoning strategies. Transactions of the Association for Computational Linguistics, 9:346–361, 2021. ", "bbox": [ 173, 637, 826, 680 ], "page_idx": 12 }, { "type": "text", "text": "Peter Hase, Mona T. Diab, Asli Celikyilmaz, Xian Li, Zornitsa Kozareva, Veselin Stoyanov, Mohit Bansal, and Srinivasan Iyer. Do language models have beliefs? methods for detecting, updating, and visualizing model beliefs. CoRR, abs/2111.13654, 2021. ", "bbox": [ 176, 689, 825, 732 ], "page_idx": 12 }, { "type": "text", "text": "Ruining He, Anirudh Ravula, Bhargav Kanagal, and Joshua Ainslie. Realformer: Transformer likes residual attention. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pp. 929–943, 2021. ", "bbox": [ 173, 739, 825, 784 ], "page_idx": 12 }, { "type": "text", "text": "Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415, 2016. ", "bbox": [ 169, 791, 825, 820 ], "page_idx": 12 }, { "type": "text", "text": "Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. Measuring massive multitask language understanding. In International Conference on Learning Representations, 2021. ", "bbox": [ 174, 829, 823, 872 ], "page_idx": 12 }, { "type": "text", "text": "Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, et al. Training compute-optimal large language models. arXiv preprint arXiv:2203.15556, 2022. ", "bbox": [ 174, 882, 825, 924 ], "page_idx": 12 }, { "type": "text", "text": "Wenyi Hong, Ming Ding, Wendi Zheng, Xinghan Liu, and Jie Tang. Cogvideo: Large-scale pretraining for text-to-video generation via transformers. arXiv preprint arXiv:2205.15868, 2022. ", "bbox": [ 171, 103, 821, 132 ], "page_idx": 13 }, { "type": "text", "text": "Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-efficient transfer learning for nlp. In International Conference on Machine Learning, pp. 2790–2799. PMLR, 2019. ", "bbox": [ 174, 142, 825, 185 ], "page_idx": 13 }, { "type": "text", "text": "Yanping Huang, Youlong Cheng, Ankur Bapna, Orhan Firat, Dehao Chen, Mia Chen, HyoukJoong Lee, Jiquan Ngiam, Quoc V Le, Yonghui Wu, et al. Gpipe: Efficient training of giant neural networks using pipeline parallelism. Advances in neural information processing systems, 32, 2019. ", "bbox": [ 174, 196, 825, 252 ], "page_idx": 13 }, { "type": "text", "text": "Abigail Z Jacobs and Hanna Wallach. Measurement and fairness. In Proceedings of the 2021 ACM conference on fairness, accountability, and transparency, pp. 375–385, 2021. ", "bbox": [ 171, 265, 823, 294 ], "page_idx": 13 }, { "type": "text", "text": "Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao Chen, Linlin Li, Fang Wang, and Qun Liu. Tinybert: Distilling bert for natural language understanding. In Findings of the Association for Computational Linguistics: EMNLP 2020, pp. 4163–4174, 2020. ", "bbox": [ 179, 304, 823, 347 ], "page_idx": 13 }, { "type": "text", "text": "Mandar Joshi, Eunsol Choi, Daniel S Weld, and Luke Zettlemoyer. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1601–1611, 2017. ", "bbox": [ 174, 357, 825, 414 ], "page_idx": 13 }, { "type": "text", "text": "Paul R Kingsbury and Martha Palmer. From treebank to propbank. Citeseer. ", "bbox": [ 174, 425, 673, 440 ], "page_idx": 13 }, { "type": "text", "text": "Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, et al. Natural questions: a benchmark for question answering research. Transactions of the Association for Computational Linguistics, 7:453–466, 2019. ", "bbox": [ 174, 452, 825, 507 ], "page_idx": 13 }, { "type": "text", "text": "Alexandre Lacoste, Alexandra Luccioni, Victor Schmidt, and Thomas Dandres. Quantifying the carbon emissions of machine learning. CoRR, abs/1910.09700, 2019. ", "bbox": [ 173, 518, 823, 547 ], "page_idx": 13 }, { "type": "text", "text": "Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 3045–3059, 2021. ", "bbox": [ 174, 559, 825, 602 ], "page_idx": 13 }, { "type": "text", "text": "Hector Levesque, Ernest Davis, and Leora Morgenstern. The winograd schema challenge. In Thirteenth international conference on the principles of knowledge representation and reasoning, 2012. ", "bbox": [ 174, 613, 825, 655 ], "page_idx": 13 }, { "type": "text", "text": "Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 4582–4597, 2021. ", "bbox": [ 173, 666, 825, 723 ], "page_idx": 13 }, { "type": "text", "text": "Xiangyang Li, Yu Xia, Xiang Long, Zheng Li, and Sujian Li. Exploring text-transformers in aaai 2021 shared task: Covid-19 fake news detection in english. In CONSTRAINT@AAAI, 2021. ", "bbox": [ 173, 733, 821, 762 ], "page_idx": 13 }, { "type": "text", "text": "Paul Pu Liang, Chiyu Wu, Louis-Philippe Morency, and Ruslan Salakhutdinov. Towards understanding and mitigating social biases in language models. In Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pp. 6565–6576. PMLR, 2021. ", "bbox": [ 173, 773, 825, 830 ], "page_idx": 13 }, { "type": "text", "text": "Opher Lieber, Or Sharir, Barak Lenz, and Yoav Shoham. Jurassic-1: Technical details and evaluation. White Paper. AI21 Labs, 2021. ", "bbox": [ 171, 842, 823, 871 ], "page_idx": 13 }, { "type": "text", "text": "Chin-Yew Lin. ROUGE: A package for automatic evaluation of summaries. In Text Summarization Branches Out, pp. 74–81, Barcelona, Spain, July 2004. Association for Computational Linguistics. URL https://aclanthology.org/W04-1013. ", "bbox": [ 174, 882, 823, 924 ], "page_idx": 13 }, { "type": "text", "text": "Stephanie Lin, Jacob Hilton, and Owain Evans. TruthfulQA: Measuring how models mimic human falsehoods. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 3214–3252, Dublin, Ireland, May 2022. Association for Computational Linguistics. ", "bbox": [ 174, 103, 825, 160 ], "page_idx": 14 }, { "type": "text", "text": "Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. Pretrain, prompt, and predict: A systematic survey of prompting methods in natural language processing. arXiv preprint arXiv:2107.13586, 2021a. ", "bbox": [ 173, 171, 825, 214 ], "page_idx": 14 }, { "type": "text", "text": "Peter J Liu, Mohammad Saleh, Etienne Pot, Ben Goodrich, Ryan Sepassi, Lukasz Kaiser, and Noam Shazeer. Generating wikipedia by summarizing long sequences. In International Conference on Learning Representations, 2018. ", "bbox": [ 174, 227, 823, 268 ], "page_idx": 14 }, { "type": "text", "text": "Xiao Liu, Yanan Zheng, Zhengxiao Du, Ming Ding, Yujie Qian, Zhilin Yang, and Jie Tang. Gpt understands, too. arXiv preprint arXiv:2103.10385, 2021b. ", "bbox": [ 169, 280, 823, 310 ], "page_idx": 14 }, { "type": "text", "text": "Xiao Liu, Kaixuan Ji, Yicheng Fu, Weng Tam, Zhengxiao Du, Zhilin Yang, and Jie Tang. P-tuning: Prompt tuning can be comparable to fine-tuning across scales and tasks. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 61–68, 2022. ", "bbox": [ 173, 320, 825, 378 ], "page_idx": 14 }, { "type": "text", "text": "Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019, 2019. ", "bbox": [ 174, 390, 823, 431 ], "page_idx": 14 }, { "type": "text", "text": "Paul Michel, Omer Levy, and Graham Neubig. Are sixteen heads really better than one? Advances in neural information processing systems, 32, 2019. ", "bbox": [ 173, 444, 823, 473 ], "page_idx": 14 }, { "type": "text", "text": "Paulius Micikevicius, Sharan Narang, Jonah Alben, Gregory Diamos, Erich Elsen, David Garcia, Boris Ginsburg, Michael Houston, Oleksii Kuchaiev, Ganesh Venkatesh, and Hao Wu. Mixed precision training. In International Conference on Learning Representations, 2018. ", "bbox": [ 173, 484, 825, 529 ], "page_idx": 14 }, { "type": "text", "text": "Todor Mihaylov, Peter Clark, Tushar Khot, and Ashish Sabharwal. Can a suit of armor conduct electricity? a new dataset for open book question answering. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 2381–2391, 2018. ", "bbox": [ 176, 540, 823, 583 ], "page_idx": 14 }, { "type": "text", "text": "Eric Mitchell, Charles Lin, Antoine Bosselut, Christopher D. Manning, and Chelsea Finn. Memorybased model editing at scale. In International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pp. 15817–15831. PMLR, 2022. ", "bbox": [ 173, 594, 825, 651 ], "page_idx": 14 }, { "type": "text", "text": "Ioannis Mollas, Zoe Chrysopoulou, Stamatis Karlos, and Grigorios Tsoumakas. Ethos: an online hate speech detection dataset. arXiv preprint arXiv:2006.08328, 2020. ", "bbox": [ 171, 662, 825, 693 ], "page_idx": 14 }, { "type": "text", "text": "Moin Nadeem, Anna Bethke, and Siva Reddy. Stereoset: Measuring stereotypical bias in pretrained language models. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 5356–5371, 2021. ", "bbox": [ 173, 704, 825, 761 ], "page_idx": 14 }, { "type": "text", "text": "Nikita Nangia, Clara Vania, Rasika Bhalerao, and Samuel Bowman. Crows-pairs: A challenge dataset for measuring social biases in masked language models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1953–1967, 2020. ", "bbox": [ 173, 772, 825, 829 ], "page_idx": 14 }, { "type": "text", "text": "Deepak Narayanan, Amar Phanishayee, Kaiyu Shi, Xie Chen, and Matei Zaharia. Memory-efficient pipeline-parallel dnn training. In International Conference on Machine Learning, pp. 7937–7947. PMLR, 2021. ", "bbox": [ 173, 840, 825, 883 ], "page_idx": 14 }, { "type": "text", "text": "Tomoko Ohta, Yuka Tateisi, and Jin-Dong Kim. The genia corpus: An annotated research abstract corpus in molecular biology domain. In HLT, pp. 82–86, 2002. ", "bbox": [ 173, 895, 823, 924 ], "page_idx": 14 }, { "type": "text", "text": "Denis Paperno, Germán Kruszewski, Angeliki Lazaridou, Ngoc-Quan Pham, Raffaella Bernardi, Sandro Pezzelle, Marco Baroni, Gemma Boleda, and Raquel Fernández. The lambada dataset: Word prediction requiring a broad discourse context. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1525–1534, 2016. ", "bbox": [ 174, 103, 825, 160 ], "page_idx": 15 }, { "type": "text", "text": "David A. Patterson, Joseph Gonzalez, Quoc V. Le, Chen Liang, Lluis-Miquel Munguia, Daniel Rothchild, David R. So, Maud Texier, and Jeff Dean. Carbon emissions and large neural network training. CoRR, abs/2104.10350, 2021. ", "bbox": [ 174, 171, 823, 213 ], "page_idx": 15 }, { "type": "text", "text": "Sameer Pradhan, Alessandro Moschitti, Nianwen Xue, Hwee Tou Ng, Anders Björkelund, Olga Uryupina, Yuchen Zhang, and Zhi Zhong. Towards robust linguistic analysis using ontonotes. In CoNLL, pp. 143–152, 2013. ", "bbox": [ 173, 224, 825, 267 ], "page_idx": 15 }, { "type": "text", "text": "Ofir Press, Noah Smith, and Mike Lewis. Train short, test long: Attention with linear biases enables input length extrapolation. In International Conference on Learning Representations, 2021. ", "bbox": [ 171, 279, 823, 308 ], "page_idx": 15 }, { "type": "text", "text": "Amy Pu, Hyung Won Chung, Ankur Parikh, Sebastian Gehrmann, and Thibault Sellam. Learning compact metrics for MT. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 751–762, Online and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.emnlp-main.58. URL https://aclanthology.org/2021.emnlp-main.58. ", "bbox": [ 174, 318, 825, 388 ], "page_idx": 15 }, { "type": "text", "text": "Xipeng Qiu, Tianxiang Sun, Yige Xu, Yunfan Shao, Ning Dai, and Xuanjing Huang. Pre-trained models for natural language processing: A survey. Science China Technological Sciences, 63(10): 1872–1897, 2020. ", "bbox": [ 173, 400, 826, 443 ], "page_idx": 15 }, { "type": "text", "text": "Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding with unsupervised learning. 2018. ", "bbox": [ 171, 453, 823, 482 ], "page_idx": 15 }, { "type": "text", "text": "Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. ", "bbox": [ 169, 492, 823, 522 ], "page_idx": 15 }, { "type": "text", "text": "Jack W Rae, Sebastian Borgeaud, Trevor Cai, Katie Millican, Jordan Hoffmann, Francis Song, John Aslanides, Sarah Henderson, Roman Ring, Susannah Young, et al. Scaling language models: Methods, analysis & insights from training gopher. arXiv preprint arXiv:2112.11446, 2021. ", "bbox": [ 173, 532, 825, 577 ], "page_idx": 15 }, { "type": "text", "text": "Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J Liu, et al. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140):1–67, 2020. ", "bbox": [ 174, 587, 825, 630 ], "page_idx": 15 }, { "type": "text", "text": "Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. Zero-shot text-to-image generation. In International Conference on Machine Learning, pp. 8821–8831. PMLR, 2021. ", "bbox": [ 173, 640, 823, 683 ], "page_idx": 15 }, { "type": "text", "text": "Jeff Rasley, Samyam Rajbhandari, Olatunji Ruwase, and Yuxiong He. Deepspeed: System optimizations enable training deep learning models with over 100 billion parameters. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 3505–3506, 2020. ", "bbox": [ 173, 694, 825, 751 ], "page_idx": 15 }, { "type": "text", "text": "Sebastian Riedel, Limin Yao, and Andrew McCallum. Modeling relations and their mentions without labeled text. In ECML-PKDD, pp. 148–163, 2010. ", "bbox": [ 171, 761, 823, 791 ], "page_idx": 15 }, { "type": "text", "text": "Adam Roberts, Colin Raffel, and Noam Shazeer. How much knowledge can you pack into the parameters of a language model? In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 5418–5426, 2020. ", "bbox": [ 174, 801, 823, 844 ], "page_idx": 15 }, { "type": "text", "text": "Dan Roth and Wen-tau Yih. A linear programming formulation for global inference in natural language tasks. In HLT-NAACL, pp. 1–8, 2004. ", "bbox": [ 171, 854, 823, 885 ], "page_idx": 15 }, { "type": "text", "text": "Rachel Rudinger, Jason Naradowsky, Brian Leonard, and Benjamin Van Durme. Gender bias in coreference resolution. In NAACL-HLT (2), 2018. ", "bbox": [ 174, 895, 823, 924 ], "page_idx": 15 }, { "type": "text", "text": "Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Raphael Gontijo-Lopes, Burcu Karagol Ayan, Tim Salimans, et al. Photorealistic text-to-image diffusion models with deep language understanding. In Advances in Neural Information Processing Systems. ", "bbox": [ 174, 103, 825, 160 ], "page_idx": 16 }, { "type": "text", "text": "Keisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. Winogrande: An adversarial winograd schema challenge at scale. Communications of the ACM, 64(9):99–106, 2021. ", "bbox": [ 171, 167, 823, 196 ], "page_idx": 16 }, { "type": "text", "text": "Erik F. Tjong Kim Sang and Fien De Meulder. Introduction to the conll-2003 shared task: Languageindependent named entity recognition. In HLT-NAACL, pp. 142–147, 2003. ", "bbox": [ 173, 204, 821, 234 ], "page_idx": 16 }, { "type": "text", "text": "Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108, 2019. ", "bbox": [ 173, 242, 823, 271 ], "page_idx": 16 }, { "type": "text", "text": "Victor Sanh, Albert Webson, Colin Raffel, Stephen Bach, Lintang Sutawika, Zaid Alyafeai, Antoine Chaffin, Arnaud Stiegler, Teven Le Scao, Arun Raja, et al. Multitask prompted training enables zero-shot task generalization. In The Tenth International Conference on Learning Representations, 2022. ", "bbox": [ 174, 279, 826, 335 ], "page_idx": 16 }, { "type": "text", "text": "Teven Le Scao, Angela Fan, Christopher Akiki, Ellie Pavlick, Suzana Ilic, Daniel Hesslow, Roman ´ Castagné, Alexandra Sasha Luccioni, François Yvon, Matthias Gallé, et al. Bloom: A 176bparameter open-access multilingual language model. arXiv preprint arXiv:2211.05100, 2022. ", "bbox": [ 176, 344, 825, 387 ], "page_idx": 16 }, { "type": "text", "text": "Timo Schick, Sahana Udupa, and Hinrich Schütze. Self-diagnosis and self-debiasing: A proposal for reducing corpus-based bias in nlp. Transactions of the Association for Computational Linguistics, 9:1408–1424, 2021. ", "bbox": [ 174, 395, 825, 438 ], "page_idx": 16 }, { "type": "text", "text": "Thomas Scialom, Paul-Alexis Dray, Sylvain Lamprier, Benjamin Piwowarski, and Jacopo Staiano. MLSUM: The multilingual summarization corpus. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 8051–8067, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.647. URL https://aclanthology.org/2020.emnlp-main.647. ", "bbox": [ 173, 445, 825, 517 ], "page_idx": 16 }, { "type": "text", "text": "Sheng Shen, Zhen Dong, Jiayu Ye, Linjian Ma, Zhewei Yao, Amir Gholami, Michael W Mahoney, and Kurt Keutzer. Q-bert: Hessian based ultra low precision quantization of bert. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 8815–8821, 2020. ", "bbox": [ 174, 523, 825, 568 ], "page_idx": 16 }, { "type": "text", "text": "Emily Sheng, Kai-Wei Chang, P. Natarajan, and Nanyun Peng. Societal biases in language generation: Progress and challenges. In ACL, 2021. ", "bbox": [ 173, 575, 823, 604 ], "page_idx": 16 }, { "type": "text", "text": "Sam Shleifer, Jason Weston, and Myle Ott. Normformer: Improved transformer pretraining with extra normalization. arXiv preprint arXiv:2110.09456, 2021. ", "bbox": [ 173, 613, 825, 642 ], "page_idx": 16 }, { "type": "text", "text": "Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper, and Bryan Catanzaro. Megatron-lm: Training multi-billion parameter language models using model parallelism. arXiv preprint arXiv:1909.08053, 2019. ", "bbox": [ 176, 650, 823, 693 ], "page_idx": 16 }, { "type": "text", "text": "Shaden Smith, Mostofa Patwary, Brandon Norick, Patrick LeGresley, Samyam Rajbhandari, Jared Casper, Zhun Liu, Shrimai Prabhumoye, George Zerveas, Vijay Korthikanti, et al. Using deepspeed and megatron to train megatron-turing nlg 530b, a large-scale generative language model. arXiv preprint arXiv:2201.11990, 2022. ", "bbox": [ 173, 700, 825, 757 ], "page_idx": 16 }, { "type": "text", "text": "Aarohi Srivastava, Abhinav Rastogi, Abhishek Rao, Abu Awal Md Shoeb, Abubakar Abid, Adam Fisch, Adam R Brown, Adam Santoro, Aditya Gupta, Adrià Garriga-Alonso, et al. Beyond the imitation game: Quantifying and extrapolating the capabilities of language models. arXiv preprint arXiv:2206.04615, 2022. ", "bbox": [ 174, 765, 826, 821 ], "page_idx": 16 }, { "type": "text", "text": "Emma Strubell, Ananya Ganesh, and Andrew McCallum. Energy and policy considerations for deep learning in NLP. In Proceedings of the 57th Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28- August 2, 2019, Volume 1: Long Papers, pp. 3645–3650. Association for Computational Linguistics, 2019. ", "bbox": [ 173, 830, 825, 887 ], "page_idx": 16 }, { "type": "text", "text": "Jianlin Su, Yu Lu, Shengfeng Pan, Bo Wen, and Yunfeng Liu. Roformer: Enhanced transformer with rotary position embedding. arXiv preprint arXiv:2104.09864, 2021. ", "bbox": [ 174, 895, 821, 924 ], "page_idx": 16 }, { "type": "text", "text": "Alon Talmor, Jonathan Herzig, Nicholas Lourie, and Jonathan Berant. Commonsenseqa: A question answering challenge targeting commonsense knowledge. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4149–4158, 2019. ", "bbox": [ 174, 103, 825, 160 ], "page_idx": 17 }, { "type": "text", "text": "Chaofan Tao, Lu Hou, Wei Zhang, Lifeng Shang, Xin Jiang, Qun Liu, Ping Luo, and Ngai Wong. Compression of generative pre-trained language models via quantization. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 4821–4836, 2022. ", "bbox": [ 173, 171, 825, 227 ], "page_idx": 17 }, { "type": "text", "text": "Romal Thoppilan, Daniel De Freitas, Jamie Hall, Noam Shazeer, Apoorv Kulshreshtha, Heng-Tze Cheng, Alicia Jin, Taylor Bos, Leslie Baker, Yu Du, et al. Lamda: Language models for dialog applications. arXiv preprint arXiv:2201.08239, 2022. ", "bbox": [ 176, 238, 823, 281 ], "page_idx": 17 }, { "type": "text", "text": "Denis Timonin, Bo Yang Hsueh, and Vinh Nguyen. Accelerated inference for large transformer models using nvidia triton inference server. NVIDIA blog, 2022. ", "bbox": [ 169, 291, 823, 321 ], "page_idx": 17 }, { "type": "text", "text": "Leslie G Valiant. A bridging model for parallel computation. Communications of the ACM, 33(8): 103–111, 1990. ", "bbox": [ 171, 332, 823, 361 ], "page_idx": 17 }, { "type": "text", "text": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017. ", "bbox": [ 174, 371, 825, 415 ], "page_idx": 17 }, { "type": "text", "text": "David Wadden, Ulme Wennberg, Yi Luan, and Hannaneh Hajishirzi. Entity, relation, and event extraction with contextualized span representations. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 5784–5789, 2019. ", "bbox": [ 173, 425, 825, 483 ], "page_idx": 17 }, { "type": "text", "text": "C. Walker and Linguistic Data Consortium. ACE 2005 Multilingual Training Corpus. Linguistic Data Consortium, 2005. ISBN 9781585633760. ", "bbox": [ 171, 492, 823, 522 ], "page_idx": 17 }, { "type": "text", "text": "Alex Wang, Yada Pruksachatkun, Nikita Nangia, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. SuperGLUE: A Stickier Benchmark for General-Purpose Language Understanding Systems. In NeurIPS 2019, pp. 3261–3275, 2019. ", "bbox": [ 174, 532, 825, 575 ], "page_idx": 17 }, { "type": "text", "text": "Ben Wang and Aran Komatsuzaki. GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model. https://github.com/kingoflolz/mesh-transformer-jax, May 2021. ", "bbox": [ 173, 587, 823, 616 ], "page_idx": 17 }, { "type": "text", "text": "Chenguang Wang, Xiao Liu, Zui Chen, Haoyun Hong, Jie Tang, and Dawn Song. Deepstruct: Pretraining of language models for structure prediction. In Findings of the Association for Computational Linguistics: ACL 2022, pp. 803–823, 2022a. ", "bbox": [ 176, 626, 820, 670 ], "page_idx": 17 }, { "type": "text", "text": "Hongyu Wang, Shuming Ma, Li Dong, Shaohan Huang, Dongdong Zhang, and Furu Wei. Deepnet: Scaling transformers to 1,000 layers. arXiv preprint arXiv:2203.00555, 2022b. ", "bbox": [ 169, 680, 823, 709 ], "page_idx": 17 }, { "type": "text", "text": "Shuohuan Wang, Yu Sun, Yang Xiang, Zhihua Wu, Siyu Ding, Weibao Gong, Shikun Feng, Junyuan Shang, Yanbin Zhao, Chao Pang, et al. Ernie 3.0 titan: Exploring larger-scale knowledge enhanced pre-training for language understanding and generation. arXiv preprint arXiv:2112.12731, 2021. ", "bbox": [ 174, 719, 825, 776 ], "page_idx": 17 }, { "type": "text", "text": "Wenhui Wang, Furu Wei, Li Dong, Hangbo Bao, Nan Yang, and Ming Zhou. Minilm: Deep selfattention distillation for task-agnostic compression of pre-trained transformers. Advances in Neural Information Processing Systems, 33:5776–5788, 2020. ", "bbox": [ 174, 787, 823, 830 ], "page_idx": 17 }, { "type": "text", "text": "Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, and Denny Zhou. Rationaleaugmented ensembles in language models. arXiv preprint arXiv:2207.00747, 2022c. ", "bbox": [ 169, 842, 823, 871 ], "page_idx": 17 }, { "type": "text", "text": "Jason Wei, Maarten Bosma, Vincent Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, Andrew M Dai, and Quoc V Le. Finetuned language models are zero-shot learners. In International Conference on Learning Representations, 2022a. ", "bbox": [ 174, 881, 825, 924 ], "page_idx": 17 }, { "type": "text", "text": "Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yogatama, Maarten Bosma, Denny Zhou, Donald Metzler, et al. Emergent abilities of large language models. arXiv preprint arXiv:2206.07682, 2022b. ", "bbox": [ 176, 103, 823, 146 ], "page_idx": 18 }, { "type": "text", "text": "Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Ed Chi, Quoc Le, and Denny Zhou. Chain of thought prompting elicits reasoning in large language models. arXiv preprint arXiv:2201.11903, 2022c. ", "bbox": [ 174, 155, 823, 196 ], "page_idx": 18 }, { "type": "text", "text": "Laura Weidinger, John Mellor, Maribeth Rauh, Conor Griffin, Jonathan Uesato, Po-Sen Huang, Myra Cheng, Mia Glaese, Borja Balle, Atoosa Kasirzadeh, et al. Ethical and social risks of harm from language models. arXiv preprint arXiv:2112.04359, 2021. ", "bbox": [ 173, 205, 823, 250 ], "page_idx": 18 }, { "type": "text", "text": "Shaohua Wu, Xudong Zhao, Tong Yu, Rongguo Zhang, Chong Shen, Hongli Liu, Feng Li, Hong Zhu, Jiangang Luo, Liang Xu, et al. Yuan 1.0: Large-scale pre-trained language model in zeroshot and few-shot learning. arXiv preprint arXiv:2110.04725, 2021. ", "bbox": [ 176, 257, 823, 301 ], "page_idx": 18 }, { "type": "text", "text": "Yongqin Xian, Christoph H Lampert, Bernt Schiele, and Zeynep Akata. Zero-shot learning—a comprehensive evaluation of the good, the bad and the ugly. IEEE transactions on pattern analysis and machine intelligence, 41(9):2251–2265, 2018. ", "bbox": [ 173, 309, 823, 353 ], "page_idx": 18 }, { "type": "text", "text": "Ruibin Xiong, Yunchang Yang, Di He, Kai Zheng, Shuxin Zheng, Chen Xing, Huishuai Zhang, Yanyan Lan, Liwei Wang, and Tieyan Liu. On layer normalization in the transformer architecture. In International Conference on Machine Learning, pp. 10524–10533. PMLR, 2020. ", "bbox": [ 174, 361, 823, 405 ], "page_idx": 18 }, { "type": "text", "text": "Liang Xu, Hai Hu, Xuanwei Zhang, Lu Li, Chenjie Cao, Yudong Li, Yechen Xu, Kai Sun, Dian Yu, Cong Yu, et al. Clue: A chinese language understanding evaluation benchmark. In Proceedings of the 28th International Conference on Computational Linguistics, pp. 4762–4772, 2020. ", "bbox": [ 174, 412, 823, 457 ], "page_idx": 18 }, { "type": "text", "text": "Liang Xu, Xiaojing Lu, Chenyang Yuan, Xuanwei Zhang, Huilin Xu, Hu Yuan, Guoao Wei, Xiang Pan, Xin Tian, Libo Qin, et al. Fewclue: A chinese few-shot learning evaluation benchmark. arXiv preprint arXiv:2107.07498, 2021. ", "bbox": [ 174, 463, 823, 507 ], "page_idx": 18 }, { "type": "text", "text": "Sha Yuan, Hanyu Zhao, Zhengxiao Du, Ming Ding, Xiao Liu, Yukuo Cen, Xu Zou, Zhilin Yang, and Jie Tang. Wudaocorpora: A super large-scale chinese corpora for pre-training language models. AI Open, 2:65–68, 2021. ", "bbox": [ 173, 515, 825, 559 ], "page_idx": 18 }, { "type": "text", "text": "Ofir Zafrir, Guy Boudoukh, Peter Izsak, and Moshe Wasserblat. Q8bert: Quantized 8bit bert. In 2019 Fifth Workshop on Energy Efficient Machine Learning and Cognitive Computing-NeurIPS Edition (EMC2-NIPS), pp. 36–39. IEEE, 2019. ", "bbox": [ 173, 566, 825, 611 ], "page_idx": 18 }, { "type": "text", "text": "Wei Zeng, Xiaozhe Ren, Teng Su, Hui Wang, Yi Liao, Zhiwei Wang, Xin Jiang, ZhenZhang Yang, Kaisheng Wang, Xiaoda Zhang, et al. Pangu- $\\cdot \\backslash \\alpha$ : Large-scale autoregressive pretrained chinese language models with auto-parallel computation. arXiv preprint arXiv:2104.12369, 2021. ", "bbox": [ 174, 618, 823, 662 ], "page_idx": 18 }, { "type": "text", "text": "Chiyuan Zhang, Daphne Ippolito, Katherine Lee, Matthew Jagielski, Florian Tramèr, and Nicholas Carlini. Counterfactual memorization in neural language models. CoRR, abs/2112.12938, 2021. ", "bbox": [ 174, 670, 823, 700 ], "page_idx": 18 }, { "type": "text", "text": "Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuohui Chen, Christopher Dewan, Mona Diab, Xian Li, Xi Victoria Lin, et al. Opt: Open pre-trained transformer language models. arXiv preprint arXiv:2205.01068, 2022. ", "bbox": [ 174, 708, 823, 751 ], "page_idx": 18 }, { "type": "text", "text": "Yuhao Zhang, Victor Zhong, Danqi Chen, Gabor Angeli, and Christopher D. Manning. Positionaware attention and supervised data improve slot filling. In EMNLP, pp. 35–45, 2017. ", "bbox": [ 173, 760, 823, 789 ], "page_idx": 18 }, { "type": "text", "text": "Ben Zhou, Daniel Khashabi, Qiang Ning, and Dan Roth. “going on a vacation” takes longer than “going for a walk”: A study of temporal commonsense understanding. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 3363–3369, 2019. ", "bbox": [ 173, 797, 826, 853 ], "page_idx": 18 }, { "type": "text", "text": "Chen Zhu, Ankit Singh Rawat, Manzil Zaheer, Srinadh Bhojanapalli, Daliang Li, Felix X. Yu, and Sanjiv Kumar. Modifying memories in transformer models. CoRR, abs/2012.00363, 2020. ", "bbox": [ 174, 863, 825, 892 ], "page_idx": 18 }, { "type": "text", "text": "Part I ", "text_level": 1, "bbox": [ 174, 99, 236, 118 ], "page_idx": 19 }, { "type": "text", "text": "Appendix ", "text_level": 1, "bbox": [ 176, 131, 316, 159 ], "page_idx": 19 }, { "type": "text", "text": "Table of Contents ", "text_level": 1, "bbox": [ 174, 184, 352, 203 ], "page_idx": 19 }, { "type": "text", "text": "A Ethics: Evaluation on Biases and Toxicity 21 ", "text_level": 1, "bbox": [ 214, 210, 787, 224 ], "page_idx": 19 }, { "type": "text", "text": "A.1 Bias Measurement: CrowS-Pairs 21 \nA.2 Bias Measurement: StereoSet 21 \nA.3 Hate Speech Detection: ETHOS 22 \nA.4 Toxic Genearation: RealToxicPrompts 22 ", "bbox": [ 235, 227, 785, 286 ], "page_idx": 19 }, { "type": "text", "text": "B Technical Details 23 ", "text_level": 1, "bbox": [ 212, 300, 785, 313 ], "page_idx": 19 }, { "type": "text", "text": "B.1 Tokenization 23 \nB.2 Layer Normalization 24 \nB.3 Positional Encoding and Feed-forward Network 24 \nB.4 Pipeline Parallel Analysis 25 \nB.5 Inference Acceleration . 27 \nB.6 Activation Outlier Analysis 27 \nB.7 Weight Quantization . 28 \nB.8 Quantization settings 28 \nB.9 Ablation on Contribution Attribution 29 \nB.10 Lessons Learned 30 ", "bbox": [ 235, 315, 787, 467 ], "page_idx": 19 }, { "type": "text", "text": "C Dataset and Evaluation Details 32 ", "text_level": 1, "bbox": [ 214, 478, 790, 493 ], "page_idx": 19 }, { "type": "text", "text": "C.1 Multi-task Instruction Pre-training (MIP) 32 \nC. Data and prompts in MIP for DeepStruct 32 \nC. Result Sources for GPT-3, BLOOM-176B, and OPT-175B 39 \n. Pile Test-set Evaluation 39 \nC. BIG-bench-lite Evaluation 40 \nC.6 MMLU Evaluation 40 \nChinese Language Understanding Evaluation 40 \nC.8 Natural Language Generation 41 \nC.9 Winograd-Style Tasks 43 \nC.10 Closed-book Question Answering 43 \nC.11 Commonsense Reasoning 44 \nC.12 Fixed Label Datasets: A Case Study in Natural Language Inference 44 \nC.13 SuperGLUE 44 \nC.14 Chain-of-Thought Prompting 45 ", "bbox": [ 235, 496, 787, 709 ], "page_idx": 19 }, { "type": "text", "text": "D Scaling and Emergent Abilities in GLM-130B 46 ", "text_level": 1, "bbox": [ 204, 722, 785, 734 ], "page_idx": 19 }, { "type": "text", "text": "E Contributions 52 ", "text_level": 1, "bbox": [ 210, 750, 787, 762 ], "page_idx": 19 }, { "type": "text", "text": "E.1 Preparation 52 \nE.2 Model Training 52 \nE.3 Post Training 52 \nE.4 Project Management . 52 \nE.5 Computation Sponsor 52 ", "bbox": [ 235, 765, 787, 840 ], "page_idx": 19 }, { "type": "text", "text": "F A Brief History of GLM-130B 53 ", "text_level": 1, "bbox": [ 214, 852, 784, 866 ], "page_idx": 19 }, { "type": "text", "text": "G Broader Impact ", "text_level": 1, "bbox": [ 214, 880, 338, 892 ], "page_idx": 19 }, { "type": "text", "text": "5 ", "text_level": 1, "bbox": [ 238, 878, 776, 891 ], "page_idx": 19 }, { "type": "text", "text": "G.1 Impact on AI Research 55 \nG.2 Impact on Individual Developers and Small Companies . 55 ", "bbox": [ 230, 895, 787, 924 ], "page_idx": 19 }, { "type": "text", "text": "A ETHICS: EVALUATION ON BIASES AND TOXICITY ", "text_level": 1, "bbox": [ 176, 184, 620, 200 ], "page_idx": 20 }, { "type": "text", "text": "Albeit LLMs’ strong abilities in language and beyond, which could bring substantial welfare to human beings, they can potentially produce toxic and illegal contents for evil use (Weidinger et al., 2021; Sheng et al., 2021; Dev et al., 2021; Bommasani et al., 2021). In GLM-130B, before granting model weight to applicants, in the model license we demand them to agree that they will not use it for any deeds that may be harmful to society and human beings. ", "bbox": [ 174, 215, 825, 285 ], "page_idx": 20 }, { "type": "text", "text": "Additionally, from a technical perspective, we argue that we must also understand LLMs’ toxic and biased behaviors and ultimately eliminate them. This aligns with our commitment to “LLM Inclusivity”, as it is necessary to include more people in the open-sourced LLM research to facilitate the process. Moreover, if an LLM is shown to be good at identifying toxic and biased content, techniques such as self-diagnoses (Schick et al., 2021) can help to reduce the harmful generation in a self-consistent post-processing procedure. Therefore, as an initial step, we evaluate GLM130B over a variety of related benchmarks to shed light on the challenging topic. Despite their limitations (Blodgett et al., 2021; Jacobs & Wallach, 2021) which should be addressed in future work, they still serve as a good start to arouse the community’s awareness of the problem. ", "bbox": [ 174, 292, 825, 417 ], "page_idx": 20 }, { "type": "text", "text": "A.1 BIAS MEASUREMENT: CROWS-PAIRS ", "text_level": 1, "bbox": [ 176, 434, 478, 448 ], "page_idx": 20 }, { "type": "text", "text": "CrowS-Pairs (Nangia et al., 2020), or namely Crowdsourced Stereotype Pairs benchmark, is widely used for measuring biases for masked language models. It collects 1508 examples with nine different conventional biases and adopts a probing-based approach to compare the pseudolog-likelihood of a pair of stereotypical and antistereotypical sentences. Since GLM-130B is pre-trained with autoregressive blanking infilling, CrowS-Pairs evaluation is directly applicable. We compare the GPT-3 Davinci and OPT-175B’s results on CrowS-Pairs reported in (Zhang et al., 2022) with GLM-130B. ", "bbox": [ 176, 460, 491, 640 ], "page_idx": 20 }, { "type": "table", "img_path": "images/ffb552451ea3b8dfe682691748d9c5d4d1e14ba51fce85dcca656dfcec58d90e.jpg", "table_caption": [ "Table 5: CrowS-Pairs (Nangia et al., 2020) Bias Measurement. The lower scores the better. " ], "table_footnote": [], "table_body": "
Category GPT-3 OPT-175B GLM-130B
Gender 62.665.7 55.7
Religion 73.368.6 73.3
Race/Color 64.768.6 58.5
Sexual orientation 76.278.6 60.7
Age 64.467.8 63.2
Nationality 61.662.9 64.1
Disability 76.776.7 71.6
Physical appearance 74.676.2 74.6
Socioeconomic status 73.876.2 70.9
Overall 67.269.5 65.8
", "bbox": [ 504, 473, 821, 636 ], "page_idx": 20 }, { "type": "text", "text": "Our results are presented in Table 5. GLM-130B shows fewer biases on almost all kinds of stereotypes except for religion and nationality. We speculate that it is because GLM-130B is a bilingual pre-trained LLM that learns the semantics for certain content from both English and Chinese corpora. Since CrowsS-Pairs’ stereotypes mainly draw from the US Equal Employment Opportunities Commission’s $\\operatorname { l i s t } ^ { 2 }$ , the bias distributions in two different cultures and languages may be different and consequently reconcile social biases in GLM-130B on a benchmark originally designed for English-language society. We think this is an interesting finding, as multi-lingual pre-training may help LLMs to present less harmful biases for better fairness. Finally, we also admit that GLM130B may in turn presents some special Chinese biases which currently lack testing benchmarks and require considerable future efforts to detect and prevent. ", "bbox": [ 174, 647, 825, 786 ], "page_idx": 20 }, { "type": "text", "text": "A.2 BIAS MEASUREMENT: STEREOSET ", "text_level": 1, "bbox": [ 176, 804, 460, 818 ], "page_idx": 20 }, { "type": "text", "text": "Another widely used bias and stereotype evaluation benchmark is StereoSet (Nadeem et al., 2021), which is also adopted in (Lieber et al., 2021; Artetxe et al., 2021; Zhang et al., 2022). To balance the evaluation between bias detecting and language modeling quality, StereoSet reports a series of metrics including Language Modeling Scores (LMS), Stereotype Score (SS), and Idealized Context Association Test Score (ICAT) as an overall averaged metric. For example, given the premise “She is the twin’s mother”, StereoSet provides three candidate hypothesis: 1) “the water is deep”, 2) “she is a lazy, unkind person”, and 3) “she is a kind, caring woman”. The first option servers as a distractor to test models’ language capability and calculate LMS; the second and third statements are anti-stereotypical and stereotypical respectively and used for calculating SS. A widely-adopted technique here is to calibrate the likelihood of an option according to its length (Lieber et al., 2021; Zhang et al., 2022), as the distractor term is particularly short. ", "bbox": [ 176, 829, 825, 900 ], "page_idx": 20 }, { "type": "text", "text": "", "bbox": [ 174, 103, 825, 188 ], "page_idx": 21 }, { "type": "text", "text": "Following (Zhang et al., 2022), we normalize scores over tokens rather than characters (Lieber et al., 2021) to yield model predictions for calculating the metrics. The results are shown in Table 6. As we observe, GLM-130B exceedingly outperforms GPT-3 Davinci and OPT-175B on all metrics. Such results accurately align with our discoveries in language modeling experiments and CrowS-Pairs bias evaluation, that GLM-130B has a high quality in both language modeling and social fairness. ", "bbox": [ 174, 194, 825, 263 ], "page_idx": 21 }, { "type": "table", "img_path": "images/074722f226828fbedadb3f634d27bfadfa9265acdf01ba18f2d16f46f3292997.jpg", "table_caption": [ "Table 6: StereoSet (Nadeem et al., 2021) Bias Measurement with LMS (↑), SS (↓), and ICAT (↑). " ], "table_footnote": [], "table_body": "
CategoryProfessionGenderReligionRaceOverall
LMSssICATLMSSSICATLMSssICATLMSSsICATLMSssICAT
GPT-378.463.457.575.666.550.680.859.066.377.057.465.777.660.860.8
OPT-175B74.162.655.474.063.653.884.059.068.974.956.864.874.859.960.0
GLM-130B86.559.669.983.963.561.291.053.584.685.754.178.786.057.373.5
", "bbox": [ 173, 292, 821, 378 ], "page_idx": 21 }, { "type": "text", "text": "A.3 HATE SPEECH DETECTION: ETHOS ", "text_level": 1, "bbox": [ 176, 392, 470, 407 ], "page_idx": 21 }, { "type": "text", "text": "Social media corpus may contain hate speeches, and to investigate to what extent LLMs know and can help to identify them is crucial. We adopt the ETHOS dataset originally proposed in (Mollas et al., 2020) to detect sexism and racism speech on zero-shot or few-shot datasets created by (Chiu & Alexander, 2021). GPT-3 Davinci (a public-accessible variant of GPT-3 175B) and OPT 175B are also tested on the benchmark (whose results are reported in (Zhang et al., 2022)). For binary classification including Zero-shot, One-shot, and Few-shot (binary) (which answers “yes” or “no”), we report binary F1; for multiclass classification (which answers “yes”, “no”, or “neither”), we report micro F1. We adopt almost the same prompts as in (Chiu & Alexander, 2021), except aligning the Few-shot (binary) prompt to the form used in One-shot and adding the word “Classification” before the colon in the original Few-shot (multiclass) prompt. ", "bbox": [ 173, 419, 825, 558 ], "page_idx": 21 }, { "type": "text", "text": "Results are shown in Table 7. We find that GLM-130B outperforms two other LLMs among four different settings. On one hand, GLM130B’s pre-training over unsupervised diverse corpora from online forums and social media including sections such as “hackernews”, “stackexchange”, and “pile_cc” can endow our model with the background knowledge to identify those speeches. On the other hand, the MIP training may also improve GLM-130B’s zero-shot and few-shot capabilities. ", "bbox": [ 174, 564, 491, 717 ], "page_idx": 21 }, { "type": "text", "text": "Table 7: ETHOS (Mollas et al., 2020) Hate speech detection. “(bi)” and “(mul)” denote binary and multiclass classification respectively. All scores are F1 and the higher the better. ", "bbox": [ 504, 564, 823, 619 ], "page_idx": 21 }, { "type": "table", "img_path": "images/eed18b33148c91c98f80a02a48e8ded0d8e6111e7a94a7db61a719b27f8d3380.jpg", "table_caption": [], "table_footnote": [], "table_body": "
GPT-3OPT-175BGLM-130B
Zero-shot66.768.8
One-shot71.379.1
Few-shot (bi)75.979.7
35.4 Few-shot (mul) 67.281.285.8
", "bbox": [ 509, 631, 816, 712 ], "page_idx": 21 }, { "type": "text", "text": "A.4 TOXIC GENEARATION: REALTOXICPROMPTS ", "text_level": 1, "bbox": [ 174, 734, 531, 748 ], "page_idx": 21 }, { "type": "text", "text": "Evaluating the toxicity of generation by given prompts is an important part of a model’s safe deployment. We evaluate the toxic generation of GLM-130B on the RealToxicPrompts (Gehman et al., 2020) dataset. Following its settings, we use nucleus sampling $( p = 0 . 9 $ ) to generate 25 continuations for each of the 10K random sampled prompts, limiting the maximum generated length to 128 tokens. Then we report the mean toxicity probabilities of 25 continuations evaluated by Perspective $\\mathrm { A P I } ^ { 3 }$ . In order to make a fair comparison ", "bbox": [ 174, 761, 529, 900 ], "page_idx": 21 }, { "type": "image", "img_path": "images/08773a74b3cd771639013ca94c05ccd8eeccf3abb07ec9d9a9a95bd17e6f5871.jpg", "image_caption": [ "Figure 9: RealToxicPrompts (Gehman et al., 2020) evaluation. Lower continuation toxicity probability is better. " ], "image_footnote": [], "bbox": [ 544, 731, 823, 873 ], "page_idx": 21 }, { "type": "image", "img_path": "images/c67c925396528fc4c06822d4368a2a80da44553e5b09b35c0d856a9a9173b334.jpg", "image_caption": [ "Figure 10: Handling training collapses and instability is the first priority when training LLMs. " ], "image_footnote": [], "bbox": [ 174, 102, 823, 477 ], "page_idx": 22 }, { "type": "text", "text": "under different tokenization methods, we only report \nthe toxicity score of the first complete sentence of a \ncontinuation as we found that the score returned by the Perspective API seems to increase with sentence length. ", "bbox": [ 174, 534, 825, 590 ], "page_idx": 22 }, { "type": "text", "text": "Results are shown in Figure 9. Generally, as the toxicity of the given prompt increases, the toxicity probability of the continuation increases accordingly in both models. Compared to GPT-3 Davinci, GLM-130B has a lower toxicity rate in all cases, indicating that GLM-130B is less prone to generating toxic content. ", "bbox": [ 174, 597, 825, 654 ], "page_idx": 22 }, { "type": "text", "text": "B TECHNICAL DETAILS ", "text_level": 1, "bbox": [ 176, 675, 387, 691 ], "page_idx": 22 }, { "type": "text", "text": "In this section, we introduce additional details about the technical issues we have identified and solved throughout the GLM-130B training. Along with concurrent open-source LLM efforts, we believe that those published details could serve as great cornerstones to future LLM training. ", "bbox": [ 174, 708, 825, 751 ], "page_idx": 22 }, { "type": "text", "text": "B.1 TOKENIZATION ", "text_level": 1, "bbox": [ 176, 770, 325, 784 ], "page_idx": 22 }, { "type": "text", "text": "For the tokenization of the corpus, we implement a text tokenizer based on the package icetk with several adjustments. As an image-text unified tokenizer, the vocabulary size of icetk is 150000. The first 20000 tokens are image tokens and the rest are text tokens. The text tokenizer of icetk is formulated and trained by sentencepiece4, on a 25GB bilingual corpus equally distributed with English and Chinese contents. We divide tokens recognized by the tokenizer into four categories. The common tokens are assigned from No.20000 to No.20099, consisting of punctuations, numbers and spaces free of extended definition. No.20100 to No.83822 are English tokens and No.83823 to ", "bbox": [ 174, 796, 825, 895 ], "page_idx": 22 }, { "type": "text", "text": "No.145653 are Chinese tokens. Tokens after No.145653 are other special tokens including concatenated punctuations and pieces from other languages, etc. ", "bbox": [ 173, 103, 821, 132 ], "page_idx": 23 }, { "type": "text", "text": "During our implementation, We ignore the first 20000 image tokens and simply utilize the latter 130000 intended for text tokenization. we disable the ignoring of linebreak to tokenize the linebreak mark \\n into No. 20004 token $< \\mathrm { n } >$ . On the basis of inherent tokens, we add special tokens [MASK] and [gMASK] for model prediction. We also add special tokens ${ < S \\mathrm { O p } > }$ , , for sentence and passage separation. ", "bbox": [ 174, 138, 823, 208 ], "page_idx": 23 }, { "type": "text", "text": "B.2 LAYER NORMALIZATION ", "text_level": 1, "bbox": [ 174, 224, 390, 239 ], "page_idx": 23 }, { "type": "text", "text": "Here we briefly introduce the history of layer normalization in language modeling problems, and how its variants perform in recent LLMs including our experiments for them on GLM-130B. ", "bbox": [ 173, 251, 823, 280 ], "page_idx": 23 }, { "type": "text", "text": "Post-LN (Vaswani et al., 2017). Post-LN is jointly proposed with the transformer architecture and is placed between the residual blocks. It is then adopted by BERT (Devlin et al., 2019) for bidirectional language model pre-training. Nevertheless, Post-LN was later accused of transformers’ slow and vulnerable converging (Xiong et al., 2020) and the Pre-LN emerged as a substitute. ", "bbox": [ 174, 286, 825, 343 ], "page_idx": 23 }, { "type": "text", "text": "Pre-LN (Xiong et al., 2020). On the contrary, Pre-LN is located in the residual blocks to reduce exploding gradients and becomes dominant in existing language models, including all recent LLMs. However, OPT-175B (Zhang et al., 2022), BLOOM (Scao et al., 2022), and text-to-image model CogView Ding et al. (2021) later observe that Pre-LN is still unable to handle the vulnerable training when models scale up to 100B or meet multi-modal data. This is also justified in GLM-130B’s preliminary experiments, where Pre-LN consistently crashes in its early stage training. ", "bbox": [ 173, 349, 825, 434 ], "page_idx": 23 }, { "type": "text", "text": "Additionally, another problem rooted in Pre-LN transformers is that it may harm the model performance after tuning compared to Post-LN. This is observed in (He et al., 2021). ", "bbox": [ 171, 439, 820, 468 ], "page_idx": 23 }, { "type": "text", "text": "Sandwich-LN (Ding et al., 2021). As a remedy, on top of Pre-LN, CogView (later in Normformer (Shleifer et al., 2021)) develops Sandwich-LN which appends extra normalization to the end of each residual branch. Accompanied with PB-Relax (Precision-Bottleneck Relaxation) techniques, they stabilize the training of a 4-billion text-to-image generation model. Despite its superiority over Pre-LN, sadly Sandwich-LN is also proved to collapse in GLM-130B training; let alone the potential consequent weaker tuning performance caused by its Pre-LN nature. ", "bbox": [ 173, 474, 825, 559 ], "page_idx": 23 }, { "type": "text", "text": "B.3 POSITIONAL ENCODING AND FEED-FORWARD NETWORK ", "text_level": 1, "bbox": [ 173, 575, 612, 590 ], "page_idx": 23 }, { "type": "text", "text": "Positional Encoding Vanilla transformer adopts absolute (or sinuous) position encoding, and is later evolved into relative positional encoding (Dai et al., 2019). Relative PEs can capture word relevance better than absolute positional encoding. Rotary Positional Embedding (RoPE) (Su et al., 2021) is a relative position encoding implemented in the form of absolute position encoding, and its core idea is shown in the following equation. ", "bbox": [ 173, 602, 825, 671 ], "page_idx": 23 }, { "type": "equation", "img_path": "images/7c39b448c929c0ce05529312005fb62c9869e153cab7f74f6aa516197f78ccb3.jpg", "text": "$$\n\\left( \\pmb { R _ { m } q } \\right) ^ { \\top } \\left( \\pmb { R _ { n } k } \\right) = q ^ { \\top } \\pmb { R _ { m } ^ { \\top } \\pmb { R _ { n } k } } = q ^ { \\top } \\pmb { R _ { n - m } k }\n$$", "text_format": "latex", "bbox": [ 348, 678, 650, 698 ], "page_idx": 23 }, { "type": "text", "text": "The product of $q$ at position $m$ and $k$ at position $n$ is related to their distance $n - m$ , which reflects the relativity of the position encoding. The definition of $\\pmb { R }$ in the above equation is ", "bbox": [ 171, 712, 823, 741 ], "page_idx": 23 }, { "type": "equation", "img_path": "images/15bfbab5f50ac332839b347a3ee762c3b49ac9e470a27caf5cbea359ec1d77a1.jpg", "text": "$$\n\\pmb { R _ { \\theta , m } ^ { d } } = \\left( \\begin{array} { c c c c c c c c } { \\cos m \\theta _ { 1 } } & { - \\sin m \\theta _ { 1 } } & { 0 } & { 0 } & { \\cdots } & { 0 } & { 0 } \\\\ { \\sin m \\theta _ { 1 } } & { \\cos m \\theta _ { 1 } } & { 0 } & { 0 } & { \\cdots } & { 0 } & { 0 } \\\\ { 0 } & { 0 } & { \\cos m \\theta _ { 2 } } & { - \\sin m \\theta _ { 2 } } & { \\cdots } & { 0 } & { 0 } \\\\ { 0 } & { 0 } & { \\sin m \\theta _ { 2 } } & { \\cos m \\theta _ { 2 } } & { \\cdots } & { 0 } & { 0 } \\\\ { \\vdots } & { \\vdots } & { \\vdots } & { \\vdots } & { \\ddots } & { \\vdots } & { \\vdots } \\\\ { 0 } & { 0 } & { 0 } & { 0 } & { \\cdots } & { \\cos m \\theta _ { d / 2 } } & { - \\sin m \\theta _ { d / 2 } } \\\\ { 0 } & { 0 } & { 0 } & { 0 } & { \\cdots } & { \\sin m \\theta _ { d / 2 } } & { \\cos m \\theta _ { d / 2 } } \\end{array} \\right) .\n$$", "text_format": "latex", "bbox": [ 181, 746, 797, 861 ], "page_idx": 23 }, { "type": "text", "text": "To allow its value to decay as the distance increases, $\\theta$ takes the value ", "bbox": [ 174, 872, 630, 887 ], "page_idx": 23 }, { "type": "equation", "img_path": "images/b021461a2b5904156e6410fd967e6010763dcac7ad5bc405b2f767265ae20292.jpg", "text": "$$\n\\theta = \\left. \\theta _ { i } = 1 0 0 0 0 ^ { \\frac { - 2 ( i - 1 ) } { d } } , \\quad i \\in \\left[ 1 , 2 , \\cdots , { \\frac { d } { 2 } } \\right] \\right.\n$$", "text_format": "latex", "bbox": [ 338, 893, 658, 929 ], "page_idx": 23 }, { "type": "text", "text": "A two-dimensional absolute position encoding method is proposed in vanilla GLM for modeling both intra- and inter-span position information. In GLM-130B, different from the two-dimensional positional encoding used in vanilla GLM, we turn back to conventional one-dimensional positional encoding. However, we originally thought that two-dimensional form cannot be directly applied to $\\mathrm { R o P E } ^ { 5 }$ . As a substitute plan, in GLM-130B we simply remove the second dimension used in the original GLM as we find that the unidirectional attention mask sub-matrices for [MASK] generation indicate the token order as well. This observation results in our transforming GLM-130B’s positional encoding into a one-dimensional one according to the following strategies: ", "bbox": [ 173, 103, 825, 215 ], "page_idx": 24 }, { "type": "text", "text": "• For sequences corrupted by short spans, we discard the second-dimensional position encoding. • For sequences corrupted by a long span at the end, we change the positional ids to one-dimensional $0 , 1 , \\cdots , s - 1$ , and generated tokens will just prolong the first-dimensional positional encoding from the last context token $s - 1$ . ", "bbox": [ 173, 222, 825, 280 ], "page_idx": 24 }, { "type": "text", "text": "Feed-forward Network Some recent efforts to improve transformer architecture have been on the FFN, including replacing it with GLU (adopted in PaLM). Research shows that using GLU can improve model performance, which is consistent with our experimental results (Cf. Table 8). Specifically, we use GLU with the GeLU (Hendrycks & Gimpel, 2016) activation. as ", "bbox": [ 173, 295, 825, 352 ], "page_idx": 24 }, { "type": "equation", "img_path": "images/22107530ea396a9bd3fe7f93edafd226368fa4aaa293e3a49bc70bcac9249739.jpg", "text": "$$\n\\operatorname { F F N } _ { \\operatorname { G e G L U } } \\left( \\pmb { x } ; W _ { 1 } , V , W _ { 2 } \\right) = \\left( \\operatorname { G e L U } ( \\pmb { x } W _ { 1 } ) \\otimes \\pmb { x } V \\right) W _ { 2 }\n$$", "text_format": "latex", "bbox": [ 302, 358, 696, 377 ], "page_idx": 24 }, { "type": "text", "text": "In order to keep the same parameter as the vanilla FFN, the feed-forward size $d _ { \\mathrm { { f f n } } }$ (which is usually $4 d _ { \\mathrm { H } }$ , where $d _ { \\mathrm { H } }$ is the hidden dimension) is reduced to $\\textstyle { \\frac { 8 } { 3 } } d _ { \\mathrm { H } }$ as the $V$ is additionally introduced. ", "bbox": [ 173, 390, 823, 420 ], "page_idx": 24 }, { "type": "table", "img_path": "images/92edee97bab72c732d5eda0392648a0731ea41aa35f65c49d87dea104309d28a.jpg", "table_caption": [ "Table 8: Ablation Study for PE and FFN on $\\mathrm { G L M _ { B a s e } }$ " ], "table_footnote": [], "table_body": "
ModelTest PPL
GLMBase24.58
+ ALiBi24.14
+RoPE22.95
+RoPE+GeGLU22.31
", "bbox": [ 622, 473, 813, 560 ], "page_idx": 24 }, { "type": "text", "text": "Ablation Study on PE and FFN In order to validate our PE and FFN choices, we test them in our experiments by pre-training $\\mathrm { G L M _ { B a s e } }$ (110M) over a random 50G Chinese and English mixed corpus. We compare absolute PE with two recent popular relative PE variants, RoPE (Chowdhery et al., 2022) and ALiBi (Press et al., 2021). For FFN, we compare vanilla FFN with Gate Linear Unit with GeLU activations. Results from Table 8 show that both ALiBi and RoPE improve perplexity on the test set, and the improvement is more significant with RoPE while using GeGLU can further improve the model’s performance. ", "bbox": [ 174, 434, 599, 574 ], "page_idx": 24 }, { "type": "text", "text": "B.4 PIPELINE PARALLEL ANALYSIS", "text_level": 1, "bbox": [ 176, 590, 434, 604 ], "page_idx": 24 }, { "type": "text", "text": "In pipeline parallelism, each stage consists of three operations (Cf. Figure 11(a)): forward (denoted as F), backward (denoted as B), and optimizer step (denoted as U). However, naive sequential pipeline implementation leads to an unbearable amount of bubbles. The improved Gpipe (Huang et al., 2019) (Cf. Figure 11(b)) strategy reduces bubbles drastically via splitting data into microbatches; the more micro-batches there are, the more stages can compute simultaneously in an iteration. The recent PipeDream-Flush (Narayanan et al., 2021) (Cf. Figure 11(c)) additionally optimizes the GPU memory usage by interweaving forward and backward from different stages to reduce forward activation’s memory occupation. ", "bbox": [ 173, 616, 825, 728 ], "page_idx": 24 }, { "type": "text", "text": "We analyze the bubble share in GLM-130B’s pre-training by assuming that the number of pipeline segments is $p$ , the number of micro-batches is $m$ , and the time for forward and backward per microbatch are $t _ { f }$ and $t _ { b }$ . In ideal case, forward and backward take $t _ { \\mathrm { i d e a l } } = m ( t _ { f } + t _ { b } )$ . But in practice, the default pipeline delivery strategy causes $p - 1$ forward propagation and $p - 1$ backward propagation bubbles, respectively, for a total time of ${ \\bar { t } } _ { \\mathrm { b u b b l e } } = ( p - 1 ) { \\bar { ( } } t _ { f } ^ { - } + t _ { b } )$ , so that the bubble occupancy is ", "bbox": [ 174, 734, 825, 806 ], "page_idx": 24 }, { "type": "equation", "img_path": "images/3847be85aa99a1ae5867e02f7a85163641f628ae0115601a81c7a78273c81d30.jpg", "text": "$$\n\\mathrm { \\ b u b b l e - r a t i o } = { \\frac { t _ { \\mathrm { b u b b l e } } } { t _ { \\mathrm { i d e a l } } + t _ { \\mathrm { b u b b l e } } } } = { \\frac { p - 1 } { m + p - 1 } }\n$$", "text_format": "latex", "bbox": [ 346, 813, 650, 844 ], "page_idx": 24 }, { "type": "text", "text": "For larger numbers of micro-batches, the bubble percentage will be reduced to an acceptable level. In particular, experiments in GPipe Huang et al. (2019) show that when $m \\geq 4 p$ , the total percentage of pipeline bubble time is reduced to a negligible level due to the forward recomputation technique in backpropagation that allows some overlap in computational communication, thus showing that the bubbles introduced in parallel by the pipeline model do not seriously deplete the training efficiency. ", "bbox": [ 176, 858, 823, 887 ], "page_idx": 24 }, { "type": "image", "img_path": "images/a96eb3848f98214e82b1d04e1d931ed77e78fa3ba2749ac14aaaf26481722d78.jpg", "image_caption": [ "(a) Naive pipeline implementation, which can be extremely inefficient. " ], "image_footnote": [], "bbox": [ 183, 99, 831, 218 ], "page_idx": 25 }, { "type": "image", "img_path": "images/7e097da26a924a78e2067e9e562dba64d650231ddaa84fe3f23aa55b2d62a697.jpg", "image_caption": [ "(b) GPipe (Huang et al., 2019) implementation. " ], "image_footnote": [], "bbox": [ 179, 250, 830, 362 ], "page_idx": 25 }, { "type": "image", "img_path": "images/36308eab87c4dc4bffb3cea67d031f68ec29f4d6fbc206fe0e2dfd880037a8ec.jpg", "image_caption": [ "", "(c) Pipedream (Narayanan et al., 2021) implementation (used in GLM-130B). Figure 11: Different pipeline strategies and their conceptual comparison. " ], "image_footnote": [], "bbox": [ 183, 393, 833, 518 ], "page_idx": 25 }, { "type": "text", "text": "", "bbox": [ 174, 583, 825, 626 ], "page_idx": 25 }, { "type": "text", "text": "In general, in order to make full use of the hardware, it is common to place models into model parallel groups consisting of multiple nodes and try to use the full memory of each node. In this case, we can freely adjust the ratio of pipeline model parallelism and tensor model parallelism. Since data parallelism hardly affects the computation time, we assume that the scale of data parallelism is $d = 1$ , the total number of nodes is $n$ , the scale of tensor model parallelism is $t$ , and the scale of pipeline model parallelism is $p$ , and satisfies $n = t \\times p$ , the bubble share in this case is ", "bbox": [ 173, 632, 825, 717 ], "page_idx": 25 }, { "type": "equation", "img_path": "images/003beb6e0c11efa6db561de001d7b6f94305ce3cc95fc5e12d4041c765ca3bef.jpg", "text": "$$\n\\mathrm { b u b b l e - r a t i o } = { \\frac { n / t - 1 } { m + n / t - 1 } }\n$$", "text_format": "latex", "bbox": [ 400, 737, 596, 771 ], "page_idx": 25 }, { "type": "text", "text": "From the above equation, we can see that increasing the size of tensor parallelism will further reduce the bubble ratio. However, the tensor parallelism scale cannot be increased indefinitely, which would lead to a reduction in computational granularity and greatly increase the communication cost across a certain threshold. Therefore, we can conclude that the size of tensor model parallelism should increase slowly as the model size increases, but not more than the number of graphics cards in a single machine. In the training of GLM-130B, the experiments show that the optimal tensor parallelism scale is $t = 4$ and does not scale up to the scale of $t = 8$ in the DGX-A100 system. The other parameters are $m = 1 7 6 , p = 8$ , and the bubble share is calculated to be only $3 . 8 \\%$ , which is sufficient to demonstrate the efficiency of pipeline model parallelism. ", "bbox": [ 173, 797, 825, 924 ], "page_idx": 25 }, { "type": "table", "img_path": "images/c1f7a01b5144d69959a19f3ed5272867731042b40722118e8dd837d7f5f3f423.jpg", "table_caption": [ "Table 9: Decoding speed in our real trials between BLOOM-176B (Scao et al., 2022) (from Huggingface Transformers) and GLM-130B’s implementation in 16-bit precision with $8 \\times \\mathrm { A l 0 0 }$ (80G). " ], "table_footnote": [], "table_body": "
Decode Tokens12851210242048
BLOOM-176B36.76s137.91s287.93s631.81s
GLM-130B4.40s (×8.4)18.77s (×7.3)39.81s (×7.2)89.88s (×7.0)
", "bbox": [ 235, 137, 758, 193 ], "page_idx": 26 }, { "type": "image", "img_path": "images/e71b7646c6ec61977504538c7bb8a99c10f56c1aebce1f8a2cb7186d4f7242f4.jpg", "image_caption": [ "Figure 12: Distribution of outliers in GLM-130B’s activations. The vertical axis denotes the hidden state dimensions (4,096 rather than 12,288 as this is a parallel segment), and the horizontal denotes tokens in a input sentence. Using a $1 2 8 \\times 1 2 8$ 2D histogram to get a better view of the distribution of outliers. The figure on the right swaps some of the vertical coordinates so that it can be clearly seen that the outlier occur about $30 \\%$ of its dimensions. " ], "image_footnote": [], "bbox": [ 178, 213, 790, 362 ], "page_idx": 26 }, { "type": "text", "text": "B.5 INFERENCE ACCELERATION ", "text_level": 1, "bbox": [ 176, 460, 411, 474 ], "page_idx": 26 }, { "type": "text", "text": "A model’s plain PyTorch implementation is easy to read and run, but it can be intolerably slow for LLMs. Based on NVIDIA’s FasterTransformer6 we spend two months implementing GLM-130B into $\\mathrm { C } { + } { + }$ to speed up inference, including the following main optimizations: ", "bbox": [ 173, 486, 825, 529 ], "page_idx": 26 }, { "type": "text", "text": "• Optimize time-costing operations such as GeGLU, Layer Normalization, and SoftMax. \n• Reduce the number of GPU kernel calls (e.g., fuse MultiheadAttention into one computation kernel). \n• Specify the algorithm of the best performance when calling cuBLAS. \n• Improve the computing efficiency by transposing the model parameters in advance. \n• Use half2 in FP16 computation to double the half’s access bandwidth and computing throughput. ", "bbox": [ 173, 535, 825, 628 ], "page_idx": 26 }, { "type": "text", "text": "We currently pack up the full FasterTransformer implementation for GLM-130B into a plug-andplay docker image for users’ convenience, and we are still working on adapting it to our Pytorch implementation by only changing one line of code. A comparison between our speeding up GLM130B implementation and the so far default available BLOOM-176B implementation in Huggingface Transformers7 is shown in Table 9. Our implementation for GLM-130B can be 7.0 to 8.4 times faster than BLOOM-176B’s Pytorch implementation. The exertion to accelerate LLM for tolerable response speed could be extremely crucial to its popularization. ", "bbox": [ 173, 636, 825, 733 ], "page_idx": 26 }, { "type": "text", "text": "B.6 ACTIVATION OUTLIER ANALYSIS ", "text_level": 1, "bbox": [ 176, 752, 447, 766 ], "page_idx": 26 }, { "type": "text", "text": "As is described in prior sections, GLM-130B’s weight can be quantized into INT4 to drastically cut down parameter redundancy in the inference. However, we also find that GLM-130B’s activations (i.e., hidden states between layers) cannot be properly quantized, as they contain value outliers as is also suggested in concurrent literature (Dettmers et al., 2022). ", "bbox": [ 174, 777, 825, 834 ], "page_idx": 26 }, { "type": "text", "text": "What is special in GLM-130B is that $30 \\%$ of its dimensions may present value outliers (Cf. Figure 12), while other GPT-based LLMs (e.g., OPT-175B and BLOOM 176B) only has very few outlying dimensions (Dettmers et al., 2022). Therefore, the solution to decompose matrix multiplication for higher-precision computation in outlying dimensions proposed in (Dettmers et al., 2022) is not applicable to GLM-130B. ", "bbox": [ 176, 840, 825, 883 ], "page_idx": 26 }, { "type": "text", "text": "", "bbox": [ 173, 103, 821, 131 ], "page_idx": 27 }, { "type": "text", "text": "We study whether these outliers can be ignored in LLM quantization, and the answer is interestingly “no”. These values can be several orders of magnitude larger than ordinary activation values (Cf. Figure 13). While most values (accounts for $9 9 . 9 8 \\%$ dimensions in a hidden state) stay less them 6, those two outlying dimensions can reach 50 or even over 100. They are speculated to be some important clues for GLM-130B and potentially other LLMs to memorize some fixed world or language knowledge, and thus removing or omitting them in quantization can lead to significant performance degradation. ", "bbox": [ 174, 138, 622, 265 ], "page_idx": 27 }, { "type": "image", "img_path": "images/1b2c2a68649c2516e4c5a6a77950542b0e7f807a6d377488dcc67eef22b8b90d.jpg", "image_caption": [ "Figure 13: GLM-130B’s activation outliers’ absolute value scale. " ], "image_footnote": [], "bbox": [ 642, 131, 821, 229 ], "page_idx": 27 }, { "type": "text", "text": "B.7 WEIGHT QUANTIZATION", "text_level": 1, "bbox": [ 176, 281, 390, 296 ], "page_idx": 27 }, { "type": "text", "text": "B.7.1 PRELIMINARIES ", "text_level": 1, "bbox": [ 174, 308, 343, 321 ], "page_idx": 27 }, { "type": "text", "text": "Absmax Quantization is a symmetric quantization that a range of $[ - \\mathrm { a b s m a x } ( x )$ , absmax $( x ) ]$ is mapped to $[ - ( 2 ^ { b } - 1 ) , 2 ^ { b } - 1 ]$ for $x$ . ", "bbox": [ 174, 332, 823, 361 ], "page_idx": 27 }, { "type": "equation", "img_path": "images/bafb457a3bba93fd81e4c16616a8eea2269d7b102ffd3da67049d06fe7c84d86.jpg", "text": "$$\n\\begin{array} { l c l } { s _ { x } = \\displaystyle \\frac { \\mathrm { a b s m a x } ( x ) } { 2 ^ { b - 1 } - 1 } } \\\\ { x _ { q } = \\mathrm { r o u n d } ( x / s _ { x } ) } \\end{array}\n$$", "text_format": "latex", "bbox": [ 433, 368, 563, 421 ], "page_idx": 27 }, { "type": "text", "text": "where $s _ { x }$ is the scaling factor, $x _ { q }$ is the quantization result and $b$ is the bit width. ", "bbox": [ 171, 426, 697, 441 ], "page_idx": 27 }, { "type": "text", "text": "Zeropoint Quantization is an asymmetric quantization that a range of $[ \\operatorname* { m i n } ( x ) , \\operatorname* { m a x } ( x ) ]$ is mapped to $[ - ( 2 ^ { b } - 1 ) , 2 ^ { b } - 1 ]$ . ", "bbox": [ 171, 450, 823, 479 ], "page_idx": 27 }, { "type": "equation", "img_path": "images/58a4ada37404e3b8263ea60b53f97cdd223dd744f7f92718c65486e80fcc85fa.jpg", "text": "$$\n\\begin{array} { l } { s _ { x } = \\frac { \\operatorname* { m a x } ( x ) - \\operatorname* { m i n } ( x ) } { 2 ^ { b } - 2 } } \\\\ { z _ { x } = \\operatorname { r o u n d } ( \\operatorname* { m i n } ( x ) / s _ { x } ) + 2 ^ { b - 1 } - 1 } \\\\ { x _ { q } = \\operatorname { r o u n d } ( x / s _ { x } ) - z _ { x } } \\end{array}\n$$", "text_format": "latex", "bbox": [ 372, 486, 625, 559 ], "page_idx": 27 }, { "type": "text", "text": "where $z _ { x }$ is the zero point. ", "bbox": [ 174, 564, 348, 579 ], "page_idx": 27 }, { "type": "text", "text": "Col/Row-wise Quantization Using a single scaling factor for the weight matrix often leads to more quantization errors because one single outlier leads to a decrease in the quantization precision of all other elements. A common workaround is to group the weight matrix by rows or by columns, with each group being quantized separately and having independent scaling factors. ", "bbox": [ 174, 588, 823, 645 ], "page_idx": 27 }, { "type": "text", "text": "B.8 QUANTIZATION SETTINGS ", "text_level": 1, "bbox": [ 176, 661, 398, 676 ], "page_idx": 27 }, { "type": "text", "text": "Our goal is to save GPU memory as much as possible without hurting model performance. In practice, we only quantize linear layers, which take up most of the transformer parameters, and leave input/output embedding, layer normalization, and bias terms unchanged. At the quantization precision of INT4, two INT4 weights are compressed into one INT8 weight for saving GPU memory usage. Absmax quantization is adopted since we found it enough to maintain model performance, and it is more computationally efficient than zeropoint quantization. During inference, only quantized weights are stored in GPU memory, the FP16 weights for linear layers will be dequantized at runtime. ", "bbox": [ 173, 688, 825, 799 ], "page_idx": 27 }, { "type": "text", "text": "B.8.1 QUANTIZATION RESULTS AT SCALES ", "text_level": 1, "bbox": [ 176, 815, 488, 830 ], "page_idx": 27 }, { "type": "text", "text": "GLM models at 110M to 10B scale are from GLM’s original paper(Du et al., 2022). Although the architecture of smaller scale GLMs are not the same as GLM-130B, we believe that the training objective is the key factor for quantization. Table 10 shows the performance of GLM and BLOOM family models at different scales on the LAMBADA dataset with different quantization methods. Almost all models maintain performance at INT8 precision. In general, GLM maintains better performance than BLOOM at INT4 precision as it scales. ", "bbox": [ 174, 839, 825, 924 ], "page_idx": 27 }, { "type": "table", "img_path": "images/203b62d8832946c6fd9cc21f6e5eb0f9c1368d2eac8ee7320127723bebe6f3c3.jpg", "table_caption": [ "Table 10: Accuracy on LAMBADA dataset for GLM and BLOOM family at 100M to 176B scales across different quantization precision. " ], "table_footnote": [], "table_body": "
BLOOM-560MBLOOM-1B1BLOOM-3BBLOOM-7BBLOOM-176B
Original31.40%40.68%48.30%54.91%64.37%
Absmax INT8,col-wise26.12%40.69%48.83%55.33%65.03%
Absmax INT4, col-wise9.30%17.43%37.88%38.04%34.83%
Absmax INT4,row-wise21.37%35.80%40.95%46.75%NaN
Zeropoint INT4,col-wise11.51%26.51%41.65%46.63%48.26%
Zeropoint INT4, row-wise24.95%33.05%43.63%49.41%NaN
GLM-110MGLM-335MGLM-2BGLM-10BGLM-130B
Original29.36%48.51%68.19%72.35%80.21%
Absmax INT8,row-wise29.25%48.69%68.12%72.37%80.21%
Absmax INT4, row-wise3.26%38.25%62.62%71.03%79.47%
Zeropoint INT4,row-wise5.45%42.64%64.74%70.50%80.63%
", "bbox": [ 179, 137, 815, 318 ], "page_idx": 28 }, { "type": "image", "img_path": "images/faccb6b4f330b6e5a7cc8f4cf024e0967f7c913a5163fa0ef856dc8fcf6b3d89.jpg", "image_caption": [ "Figure 14: Contribution attribution analysis on GLM objective and MIP training. We take GLM10B (English only) as an example in the ablation. Generally, GLM objective’s bidirectional attention accounts for $70 \\%$ of the improvements, while MIP’s major contribution lies in text similarity tasks. " ], "image_footnote": [], "bbox": [ 171, 335, 820, 430 ], "page_idx": 28 }, { "type": "text", "text": "B.8.2 WEIGHT DISTRIBUTION ANALYSIS ", "text_level": 1, "bbox": [ 176, 496, 473, 511 ], "page_idx": 28 }, { "type": "text", "text": "To achieve INT4 weight quantization, we analyze the weight value distribution of major linear layers in GLM-130B and a counterpart BLOOM-176B in a histogram (Cf. Figure 15). The horizontal axis denotes the weight value, and the vertical axis denotes the number of weights of such value in log scale. As we can see, it is majorly the w2 linear layers in BLOOM-176B that present skewed distributions, which would hinder the symmetrical quantization. On the contrary, GLM-130B’s w2 is well-shaped without many outliers and skewed distribution, and thus paces the way for its INT4 quantization with little performance loss. ", "bbox": [ 173, 522, 825, 621 ], "page_idx": 28 }, { "type": "text", "text": "B.9 ABLATION ON CONTRIBUTION ATTRIBUTION ", "text_level": 1, "bbox": [ 174, 643, 531, 657 ], "page_idx": 28 }, { "type": "text", "text": "We analyze the contribution attribution of techniques leveraged in GLM-130B. A series of ablation studies have been presented in the paper, and for the convenience of reading, they were originally scattered around the whole passage. Here we summarize them here into the following list for readers’ reference: ", "bbox": [ 173, 671, 825, 727 ], "page_idx": 28 }, { "type": "text", "text": "• Ablation on ordinary PostLN and DeepNorm: Figure 3. \n• Ablation on Bidirectional/Unidirectional Attention: Figure 2 (LAMBADA), Table 16 (Conditional NLG), Figure 17 (SuperGLUE). \n• Ablation on Embedding Layer Gradient Shrink (EGS): Figure 4. \n• Ablation on Positional Encodings and FFN: Appendix B.3 Table 8. ", "bbox": [ 173, 734, 823, 813 ], "page_idx": 28 }, { "type": "text", "text": "Additionally, we conduct the following study to justify the contribution of the two most influential techniques–GLM Objective and Multi-task Instruction Pre-training (MIP)–used in GLM-130B. ", "bbox": [ 173, 819, 825, 847 ], "page_idx": 28 }, { "type": "text", "text": "GLM Objective and MIP. Ablating a 100B-scale LLM from scratch can be too expensive. As a substitute, we try our best to conduct the comparison between GLM objective and MIP on GLM10B (an English-only version released in (Du et al., 2022), without MIP). We additionally train a GLM-10B initialized from a middle-stage original checkpoint with MIP $( 5 \\% )$ to match the same training tokens of the original self-supervision-only GLM-130B. The MIP, this time, follows the exact dataset setting in T0 (Sanh et al., 2022) and the information extraction datasets in GLM-130B to allow the correct evaluation on some types of tasks (e.g., NLI). ", "bbox": [ 174, 853, 825, 924 ], "page_idx": 28 }, { "type": "text", "text": "", "bbox": [ 171, 103, 823, 132 ], "page_idx": 29 }, { "type": "text", "text": "Figure 14 shows the ablation results. On the 8 datasets we test, we find that the GLM objective is a major contributor to the improvement (from GLM (uni) to $\\mathrm { G L M } + \\mathrm { M I P }$ (bi)). For example, it accounts for $73 \\%$ improvement in LAMBADA and $90 \\%$ improvement in MMLU, which are very widely adopted challenging benchmarks for LLMs. As for MIP, on some datasets (e.g., WiC, ReCoRD, Hellaswag), MIP may even harm the performance. While for datasets related to text similarity and coreference (e.g., WSC, BoolQ, ANLI R1), MIP is the main contributor. It is likely because the text similarity and coreference challenges, which people usually construct intentionally to test language models’ ability, are seldom seen in the self-supervised corpus that makes up people’s daily written texts. Thus, MIP training mainly helps to bridge the gap between self-supervised pre-training and these tasks. ", "bbox": [ 173, 138, 825, 277 ], "page_idx": 29 }, { "type": "text", "text": "B.10 LESSONS LEARNED ", "text_level": 1, "bbox": [ 174, 295, 362, 309 ], "page_idx": 29 }, { "type": "text", "text": "Lesson 1 (Bidirectional Architecture). The bidirectional-attention GLM is a strong architecture alternative, in addition to GPTs. ", "bbox": [ 186, 321, 807, 351 ], "page_idx": 29 }, { "type": "text", "text": "Lesson 2 (Platform-aware Configuration). Configure LLMs based on the cluster and parallel strategy used to squeeze hardware potential. ", "bbox": [ 187, 373, 810, 402 ], "page_idx": 29 }, { "type": "text", "text": "Lesson 3 (Improved Post-LN). Counter-stereotypically, DeepNorm, a type of Post-LN, is the option to stabilize GLM-130B. ", "bbox": [ 187, 426, 808, 454 ], "page_idx": 29 }, { "type": "text", "text": "Lesson 4 (Training Stability Categorization). Unexpected training instability that LLMs suffer from arouses systematically and numerically. ", "bbox": [ 184, 478, 808, 507 ], "page_idx": 29 }, { "type": "text", "text": "Lesson 5 (Systematical Instability: FP16). Though FP16 induces more instability, it enables training and inference on diverse platforms. ", "bbox": [ 186, 530, 808, 560 ], "page_idx": 29 }, { "type": "text", "text": "Lesson 6 (Numerical Instability: Embedding Gradient Shrink). Shrinking embedding layer’s gradient to its 0.1 can solve most numerical instability problems. ", "bbox": [ 187, 583, 807, 612 ], "page_idx": 29 }, { "type": "text", "text": "Lesson 7 (GLM’s INT4 Quantization Scaling Law). GLM has a unique INT4 weight quantization scaling law unobserved in GPT-style BLOOM. ", "bbox": [ 187, 636, 808, 665 ], "page_idx": 29 }, { "type": "text", "text": "Lesson 8 (Future Direction). To create powerful LLMs, the main focus can be on 1) more and better data, 2) better architectures and pre-training objectives, and 3) more sufficient training. ", "bbox": [ 189, 688, 810, 717 ], "page_idx": 29 }, { "type": "image", "img_path": "images/627d6cd4ded25aa893ca472ba392c2d4946af9b3fa7ca6451ae8daca8971bbe4.jpg", "image_caption": [ "Figure 15: Weight value distribution of linear layers in GLM-130B (in orange, attn-dense, attn-qkv, glu-w1, glu-w2) and BLOOM-176B (in blue, attn-dense, attn-qkv, ffn-w1, ffn-w2)’s first 28 transformer layers. Generally for GLM-130B it is attn-dense and w2 that may present narrow value distributions. attn-qkv and w1 may also be a reason for enabling INT4 quantization in middle layers of GLM-130B. " ], "image_footnote": [], "bbox": [ 210, 93, 782, 771 ], "page_idx": 30 }, { "type": "text", "text": "C DATASET AND EVALUATION DETAILS ", "text_level": 1, "bbox": [ 174, 102, 519, 118 ], "page_idx": 31 }, { "type": "text", "text": "C.1 MULTI-TASK INSTRUCTION PRE-TRAINING (MIP) ", "bbox": [ 174, 145, 562, 159 ], "page_idx": 31 }, { "type": "text", "text": "Following practices in (Raffel et al., 2020; Wei et al., 2022a; Sanh et al., 2022; Aribandi et al., 2022), we include a number of prompted instruction datasets in GLM-130B’s MIP training, which accounts for $5 \\%$ of the training tokens. All prompts for T0 datasets are from PromptSource (Bach et al., 2022) and prompts for DeepStruct datasets are newly created. Their composition is shown in Table 12, which makes up natural language understanding and generation datasets from T0 (Sanh et al., 2022) and promptsource (Bach et al., 2022), and information extraction datasets from DeepStruct (Wang et al., 2022a). In GLM-130B’s training, we calculate that approximately $36 \\%$ of the samples in each dataset has been seen. ", "bbox": [ 174, 176, 825, 287 ], "page_idx": 31 }, { "type": "text", "text": "T0 originally splits datasets for 1) multi-task prompted training and 2) zero-shot task transfer two sections. We initially planed to only include training sets of T0’s multi-task prompted training section and DeepStruct (Wang et al., 2022a), but by a mistake we included both multi-task prompted training and zero-shot task transfer sections’ datasets in MIP and excluded DeepStruct datasets. The mistake was fixed at around 23k steps and our model continued to train on the correct version. ", "bbox": [ 174, 295, 825, 364 ], "page_idx": 31 }, { "type": "text", "text": "Natural Language Understanding and Generation. We adopt datasets and corresponding prompts from promptsource (Bach et al., 2022). For all prompted samples in each dataset, we set a truncation of maximal 10,0000 samples per dataset and combine them together as the MIP dataset. Details of the prompted samples and datasets are provided in promptsource’s GitHub repository8. ", "bbox": [ 174, 372, 825, 428 ], "page_idx": 31 }, { "type": "text", "text": "Information Extraction. Based on the datasets from DeepStruct (Wang et al., 2022a), a multitask language model pre-training approach for information extraction tasks, we create instructions and prompts for part of its datasets (as is shown in Table 12). We reformulate information extraction tasks into instruction tuning formats to allow zero-shot generalization to new extraction schema. For all prompted samples in each dataset, we set a truncation of maximal 20,0000 samples per dataset as there are fewer information extraction datasets than common language understanding and generation ones. For KELM (Agarwal et al., 2021) and PropBank (Kingsbury & Palmer) datasets, since their original size is gigantic, we sample 50,0000 samples for each of them from their prompted samples. ", "bbox": [ 174, 434, 825, 546 ], "page_idx": 31 }, { "type": "text", "text": "C.2 DATA AND PROMPTS IN MIP FOR DEEPSTRUCT ", "text_level": 1, "bbox": [ 174, 578, 544, 593 ], "page_idx": 31 }, { "type": "text", "text": "Prompts and instructions for all datasets in DeepStruct (Wang et al., 2022a) are newly created by authors manually. The introduction, task description, and full prompts for each dataset are attached in the following sections. To allow template infilling, all prompts are written into Jinja9 templates. When a dataset sample is provided in our format, Joinja engine will render it into a prompted sample with instruction. ", "bbox": [ 174, 609, 825, 680 ], "page_idx": 31 }, { "type": "text", "text": "A more systematic evaluation on GLM-130B’s information extraction ability is left for a future work, as the concentration in this work is on the training and designing details of an LLM. ", "bbox": [ 174, 686, 823, 715 ], "page_idx": 31 }, { "type": "text", "text": "C.2.1 DIALOGUE STATE TRACKING ", "text_level": 1, "bbox": [ 176, 746, 434, 761 ], "page_idx": 31 }, { "type": "text", "text": "We adopt Multiwoz 2.1 (Eric et al., 2020) dialogue state tracking dataset. The dataset is reformulated into two tasks, each with one prompt correspondingly: ", "bbox": [ 173, 776, 825, 806 ], "page_idx": 31 }, { "type": "text", "text": "• Dialogue state tracking: which asks the model to extract information from dialogues given a list of certain slots, e.g., taxi_arrival_time and destination. ", "bbox": [ 174, 813, 820, 840 ], "page_idx": 31 }, { "type": "text", "text": "• Slot filling: which model should fill in one provided slot and identify situations without answer. ", "bbox": [ 176, 843, 815, 857 ], "page_idx": 31 }, { "type": "text", "text": "(Dialogue State Tracking, Prompt 0) ", "text_level": 1, "bbox": [ 178, 103, 433, 118 ], "page_idx": 32 }, { "type": "text", "text": "Read the dialogues between \"[User]\" and \"[Agent]\", ", "bbox": [ 178, 125, 619, 138 ], "page_idx": 32 }, { "type": "text", "text": "{{text}} ", "bbox": [ 181, 150, 250, 164 ], "page_idx": 32 }, { "type": "text", "text": "identify and extract the information related to the following categories (from top to down): ", "bbox": [ 178, 175, 818, 200 ], "page_idx": 32 }, { "type": "text", "text": "- {{allowed_relations | join(\"\\n- \")}} ", "bbox": [ 179, 212, 514, 227 ], "page_idx": 32 }, { "type": "text", "text": "in the form of \"( [User] ; Y ; Z )\": ||| {{format_triple(relations, allowed_relations) | join(\" \")}} ", "bbox": [ 179, 238, 767, 265 ], "page_idx": 32 }, { "type": "text", "text": "(Slot Filling, Prompt 0) ", "text_level": 1, "bbox": [ 178, 311, 343, 327 ], "page_idx": 32 }, { "type": "text", "text": "Given the following dialogue: ", "bbox": [ 179, 334, 434, 348 ], "page_idx": 32 }, { "type": "text", "text": "{{text}} ", "bbox": [ 181, 359, 250, 372 ], "page_idx": 32 }, { "type": "text", "text": "please answer the question: has \"[User]\" mentioned \"{{allowed_relations[ relation_idx].split(': ') | join(\"'s \")}}\" ? If yes, please write down the answer from the dialogue; if not, please answer \"not given\". ", "bbox": [ 178, 385, 815, 422 ], "page_idx": 32 }, { "type": "text", "text": "Answer: ||| {% if filter_relation(relations, allowed_relations[ relation_idx]).__len__() $>$ 0 %}{{filter_relation(relations, allowed_relations[relation_idx])[0]['tail']}}{% else %}not given{% endif %} ", "bbox": [ 178, 435, 815, 484 ], "page_idx": 32 }, { "type": "text", "text": "C.2.2 EVENT EXTRACTION ", "text_level": 1, "bbox": [ 174, 541, 379, 556 ], "page_idx": 32 }, { "type": "text", "text": "We adopt ACE05 (Walker & Consortium, 2005) event extraction datasets following the setting in (Wadden et al., 2019). The dataset is reformulated into two tasks with three prompts as follows: ", "bbox": [ 173, 579, 825, 607 ], "page_idx": 32 }, { "type": "text", "text": "• Event Argument Extraction: given a trigger in text and a list of its argument roles, the model is asked to extract the arguments from the provided text. ", "bbox": [ 173, 614, 823, 642 ], "page_idx": 32 }, { "type": "text", "text": "• Argument Identification: given a trigger and a certain argument role, the model is asked to extract the argument if it exists in the provided text; otherwise, the model should generate nothing. ", "bbox": [ 174, 645, 823, 672 ], "page_idx": 32 }, { "type": "text", "text": "(Event Argument Extraction, Prompt 0) ", "text_level": 1, "bbox": [ 178, 710, 459, 726 ], "page_idx": 32 }, { "type": "text", "text": "For the task of \"Event Extraction\", given a trigger one should extract its related arguments conditioned on a list of potential roles. ", "bbox": [ 178, 733, 797, 758 ], "page_idx": 32 }, { "type": "text", "text": "Given the following list of roles: ", "bbox": [ 179, 770, 478, 784 ], "page_idx": 32 }, { "type": "text", "text": "- {{shuffle(allowed_arguments[trigger['event_type']].values()) | join(\"\\ n- \")}} ", "bbox": [ 173, 795, 813, 821 ], "page_idx": 32 }, { "type": "text", "text": "extract related arguments of the trigger \"{{trigger['text']}} ({{ allowed_triggers[trigger['event_type']]}})\" in the following sentence: ", "bbox": [ 176, 833, 795, 859 ], "page_idx": 32 }, { "type": "text", "text": "{{text}} ", "bbox": [ 181, 871, 250, 883 ], "page_idx": 32 }, { "type": "text", "text": "Extractions: ||| {{format_triple(relations, \"\") | join(\" \")}} ", "bbox": [ 178, 896, 715, 910 ], "page_idx": 32 }, { "type": "text", "text": "(Event Argument Extraction, Prompt 1) ", "text_level": 1, "bbox": [ 179, 103, 459, 118 ], "page_idx": 33 }, { "type": "text", "text": "TEST ", "bbox": [ 179, 126, 215, 137 ], "page_idx": 33 }, { "type": "text", "text": "1. (Event Extraction) {{text}} ", "bbox": [ 181, 150, 442, 162 ], "page_idx": 33 }, { "type": "text", "text": "Please write down ALL event arguments related to the trigger \"{{trigger ['text']}} ({{allowed_triggers[trigger['event_type']]}})\" marked with \"[ ]\", given the following categories: ", "bbox": [ 179, 175, 815, 213 ], "page_idx": 33 }, { "type": "text", "text": "- {{shuffle(allowed_arguments[trigger['event_type']].values()) | join(\"\\ n- \")}} ", "bbox": [ 176, 226, 812, 252 ], "page_idx": 33 }, { "type": "text", "text": "Answer: ||| {{format_triple(relations, \"\") | join(\" \")}} ", "bbox": [ 179, 262, 673, 276 ], "page_idx": 33 }, { "type": "text", "text": "(Argument Identification, Prompt 0) ", "text_level": 1, "bbox": [ 179, 342, 433, 357 ], "page_idx": 33 }, { "type": "text", "text": "Let extract event related arguments! ", "bbox": [ 183, 364, 495, 377 ], "page_idx": 33 }, { "type": "text", "text": "In the following passage, an argument with the type \"{{query_arg}}\" is related to the event trigger \"{{trigger['text']}} ({{allowed_triggers[ trigger['event_type']]}})\": ", "bbox": [ 179, 390, 797, 428 ], "page_idx": 33 }, { "type": "text", "text": "{{text}} ", "bbox": [ 181, 439, 250, 452 ], "page_idx": 33 }, { "type": "text", "text": "The argument should be (copy from the context if you find it; if not, do not generate): ||| {{filter_type(relations, query_arg) | join(\" \")}} ", "bbox": [ 178, 465, 815, 491 ], "page_idx": 33 }, { "type": "text", "text": "C.2.3 JOINT ENTITY AND RELATION EXTRACTION ", "text_level": 1, "bbox": [ 173, 565, 539, 580 ], "page_idx": 33 }, { "type": "text", "text": "Joint entity and relation extraction aims to recognize named entities in a piece of text and judge the relationships between them. It is closely related to knowledge acquisition, where the ultimate target is to structuring the unstructured web contents into knowledge triples (e.g., (London, capital_of, Britain)). The task can be formulated into either a pipeline framework (a combination of named entity recognition and relation extraction), or end-to-end training. ", "bbox": [ 173, 609, 825, 680 ], "page_idx": 33 }, { "type": "text", "text": "In this work, we adopt three classical joint entity and relation extraction datasets: CoNLL04 (Roth & Yih, 2004), NYT (Riedel et al., 2010), and ACE2005 (Walker & Consortium, 2005). In GLM-130B, we follow (Wang et al., 2022a) to formulate such challenges into sequence-to-sequence generation, where our inputs are raw texts and outputs are triples. We only conduct relation-related tasks for these datasets here, and leave the entity-related ones to the named entity recognition section. ", "bbox": [ 174, 686, 825, 756 ], "page_idx": 33 }, { "type": "text", "text": "• Relation Extraction: here we extract knowledge triples consisting of “head entity”, “relation”, and “tail entity”, given a list of relation candidates. For example, given the input “In Kunming the 800-some faculty and student established the National Southwestern Associated University.”, the model output could be (National Southwestern Associated University, location of formation, Kunming). \n• Conditional Relation Extraction: given a single relation candidate, judge if the input text contains the relation. If so, extraction all related triples; if not, do not generate. \n• Knowledge Slot Filling: assign a certain entity from text, and ask the model to extract all triples that takes the entity as the head. \n• Relation Classification: given two entities from texts, ask the model to judge the relation between them based on a list of candidate relations. ", "bbox": [ 171, 763, 826, 924 ], "page_idx": 33 }, { "type": "text", "text": "(Relation Extraction, Prompt 0) ", "text_level": 1, "bbox": [ 178, 103, 403, 117 ], "page_idx": 34 }, { "type": "text", "text": "Can you figure out all triples regarding the relations of \"{{shuffle( allowed_relations) | join('\", \"')}}\" from the sentence? List them in the shape of \"( X ; Y ; Z )\": ", "bbox": [ 178, 126, 816, 162 ], "page_idx": 34 }, { "type": "text", "text": "{{text}} $= >$ ||| {{format_triple(relations, allowed_relations) | join(\" \")}} ", "bbox": [ 179, 175, 800, 200 ], "page_idx": 34 }, { "type": "text", "text": "(Conditional Relation Extraction, Prompt 0) ", "text_level": 1, "bbox": [ 179, 222, 490, 237 ], "page_idx": 34 }, { "type": "text", "text": "Conditioned on the relation \"{{allowed_relations[relation_idx]}}\", what knowledge triples can be extracted from: ", "bbox": [ 174, 244, 803, 270 ], "page_idx": 34 }, { "type": "text", "text": "{{text}} ", "bbox": [ 181, 281, 250, 295 ], "page_idx": 34 }, { "type": "text", "text": "Please write them down here: ||| {{format_triple(relations, [ allowed_relations[relation_idx]]) | join(\" \")}} ", "bbox": [ 178, 308, 717, 333 ], "page_idx": 34 }, { "type": "text", "text": "(Knowledge Slot Filling, Prompt 0) ", "text_level": 1, "bbox": [ 179, 353, 423, 369 ], "page_idx": 34 }, { "type": "text", "text": "{% if entity_types.__len__() > 0 %} In the sentence ", "bbox": [ 179, 376, 488, 401 ], "page_idx": 34 }, { "type": "text", "text": "{{text}} ", "bbox": [ 181, 412, 250, 426 ], "page_idx": 34 }, { "type": "text", "text": "the $\\mathrm { ~ ~ { ~ X ~ } ~ } =$ \"{{entities[entity_idx]}}\" is an entity of the type \"{{ entity_types[entity_idx]}}\". Extract all possible triples contains \"{{ entities[entity_idx]}}\" in the form of ( X ; Y ; Z ), given the following candidate properties Y: ", "bbox": [ 178, 439, 797, 489 ], "page_idx": 34 }, { "type": "text", "text": "{% for r in allowed_relations %}- {{r}} \n{% endfor %} \nAnswer: ||| {% for r in relations %}{% if r['head'][0] $= =$ entities[ \nentity_idx] %}{{format_triple([r], allowed_relations) | join(\" \")}}{% \nendif %}{% endfor %} \n{% endif %} ", "bbox": [ 178, 501, 789, 577 ], "page_idx": 34 }, { "type": "text", "text": "(Relation Classification, Prompt 0) ", "text_level": 1, "bbox": [ 179, 598, 421, 613 ], "page_idx": 34 }, { "type": "text", "text": "QUIZ ", "bbox": [ 178, 621, 215, 632 ], "page_idx": 34 }, { "type": "text", "text": "1. Given the candidate relations: ", "bbox": [ 181, 645, 470, 659 ], "page_idx": 34 }, { "type": "text", "text": "- {{shuffle(allowed_relations) | join(\"\\n- \")}} what is the relation between \"{{relations[triple_idx]['head'][0]}}\" and \"{{relations[triple_idx]['tail'][0]}}\" in the following sentence? ", "bbox": [ 179, 670, 593, 684 ], "page_idx": 34 }, { "type": "text", "text": "", "bbox": [ 176, 695, 807, 722 ], "page_idx": 34 }, { "type": "text", "text": "{{text}} ", "bbox": [ 181, 733, 250, 747 ], "page_idx": 34 }, { "type": "text", "text": "Answer: ||| {{relations[triple_idx]['relation']}} ", "bbox": [ 178, 758, 609, 773 ], "page_idx": 34 }, { "type": "text", "text": "Nevertheless, existing joint entity and relation extraction datasets have very limited relation schema. For example, CoNLL04 only contains five different relations; the most diverse NYT dataset contains 24 Freebase predicates. To allow the model to capture a diverse range of potential verbalized predicates, we extend the task with automatically generated knowledge-text aligned data from KELM (Agarwal et al., 2021). We do not include other distantly supervised dataset (e.g., T-Rex (Elsahar et al., 2018)) since they can be extremely noisy. ", "bbox": [ 174, 791, 825, 875 ], "page_idx": 34 }, { "type": "text", "text": "For KELM data, since it is based on the full Wikidata schema (which contains too many relations to be enumerated), we create two KELM-specific prompts for the task of Relation Extraction and Knowledge Slot Filling: ", "bbox": [ 176, 881, 823, 924 ], "page_idx": 34 }, { "type": "text", "text": "(Relation Extraction, Prompt 1, KELM ONLY) ", "text_level": 1, "bbox": [ 178, 102, 509, 118 ], "page_idx": 35 }, { "type": "text", "text": "{# kelm #} ", "bbox": [ 179, 126, 266, 137 ], "page_idx": 35 }, { "type": "text", "text": "Can you figure out all knowledge triples regarding whole Wikidata properties from the sentence? List them in the shape of \"( X ; Y ; Z )\": ", "bbox": [ 184, 142, 812, 162 ], "page_idx": 35 }, { "type": "text", "text": "{{text}} $= >$ ||| {{format_triple(relations, \"\") | join(\" \")}} ", "bbox": [ 179, 175, 707, 189 ], "page_idx": 35 }, { "type": "text", "text": "(Knowledge Slot Filling, Prompt 1, KELM ONLY) ", "text_level": 1, "bbox": [ 179, 218, 531, 234 ], "page_idx": 35 }, { "type": "text", "text": "{# kelm #} \nGiven the entity \"{{entities[entity_idx]}}\" marked with \"[\" and \"]\" in \nthe context: ", "bbox": [ 178, 241, 802, 279 ], "page_idx": 35 }, { "type": "text", "text": "{{text}} ", "bbox": [ 181, 291, 250, 304 ], "page_idx": 35 }, { "type": "text", "text": "please list all triples related to it (do not generate if there is no answer): ||| {% for r in relations %}{% if r['head'][0] $= =$ entities[ entity_idx] %}{{format_triple([r], \"\") | join(\" \")}}{% endif %}{% endfor %} ", "bbox": [ 178, 318, 815, 367 ], "page_idx": 35 }, { "type": "text", "text": "C.2.4 NAMED ENTITY RECOGNITION ", "text_level": 1, "bbox": [ 178, 405, 446, 420 ], "page_idx": 35 }, { "type": "text", "text": "Named entity recognition is a task which targets identifying named entities from raw text corpus and assign them with proper entity types. For example, in the sentence “In 1916 GM was reincorporated in Detroit as \"General Motors Corporation\".”, General Motors Corporation could be of entity type organization. We design two different types of tasks based on named entity recognition datasets CoNLL03 (Sang & Meulder, 2003), OntoNotes 5.0 (Pradhan et al., 2013), and GENIA (Ohta et al., 2002). We also include named entity recognition sub-tasks from joint entity and relation datasets. ", "bbox": [ 173, 434, 825, 532 ], "page_idx": 35 }, { "type": "text", "text": "• Named Entity Recognition: given a certain list of possible entity types (e.g., location, person, organization), extract all related entities from the provided text content. ", "bbox": [ 173, 540, 823, 568 ], "page_idx": 35 }, { "type": "text", "text": "• Entity Typing: entity typing is one of the important derivative tasks from named entity recognition. It aims to classify the correct type of an entity mention (without entity types), and is often appended to the entity mention extraction as post-processing. ", "bbox": [ 174, 570, 825, 612 ], "page_idx": 35 }, { "type": "text", "text": "(Named Entity Recognition, Prompt 0) ", "text_level": 1, "bbox": [ 178, 632, 449, 647 ], "page_idx": 35 }, { "type": "text", "text": "Given the following list of entity types: ", "bbox": [ 179, 654, 539, 667 ], "page_idx": 35 }, { "type": "text", "text": "$\\begin{array} { r l } { \\mathrm { ~ Z ~ } } & { { } = } \\end{array}$ {{shuffle(allowed_types) | join(\", \")}} ", "bbox": [ 174, 679, 558, 693 ], "page_idx": 35 }, { "type": "text", "text": "please extract all mentioned entities from left to right in the sentence , in the form of \"( X ; instance of ; Z )\". ", "bbox": [ 174, 704, 813, 729 ], "page_idx": 35 }, { "type": "text", "text": "{{text}} $= >$ ||| {% for entity, type in zip(entities, entity_types) %}( {{entity}} ; instance of ; {{type}} ) {% endfor %} ", "bbox": [ 176, 742, 797, 768 ], "page_idx": 35 }, { "type": "text", "text": "(Entity Typing, Prompt 0) ", "text_level": 1, "bbox": [ 178, 797, 361, 814 ], "page_idx": 35 }, { "type": "text", "text": "Extract all entity mentioned in the sentence with entity type \"{{ allowed_types[type_idx]}}\" in the form of \"( X ; instance of ; {{ allowed_types[type_idx]}} )\" ", "bbox": [ 181, 820, 751, 859 ], "page_idx": 35 }, { "type": "text", "text": "{{text}} $= >$ ||| {% for entity, type in zip(entities, entity_types) %}{% if type $= =$ allowed_types[type_idx] %}( {{entity}} ; instance of ; {{type }} ) {% endif %}{% endfor %} ", "bbox": [ 179, 871, 815, 909 ], "page_idx": 35 }, { "type": "text", "text": "(Entity Typing, Prompt 1) ", "text_level": 1, "bbox": [ 178, 103, 361, 118 ], "page_idx": 36 }, { "type": "text", "text": "List all \"{{allowed_types[type_idx]}}\" entities appeared in the following passage, joined by \" | \": ", "bbox": [ 179, 125, 736, 151 ], "page_idx": 36 }, { "type": "text", "text": "{{text}} $= >$ ||| {{filter_type(zip(entities, entity_types), allowed_types [type_idx]) | join(\" | \")}} ", "bbox": [ 179, 162, 818, 189 ], "page_idx": 36 }, { "type": "text", "text": "(Entity Typing, Prompt 2) ", "text_level": 1, "bbox": [ 179, 222, 361, 237 ], "page_idx": 36 }, { "type": "text", "text": "{% if entity_types.__len__() > 0 %} ", "bbox": [ 183, 243, 486, 256 ], "page_idx": 36 }, { "type": "text", "text": "Based on the list of potential entity types and ignore their order: ", "bbox": [ 178, 257, 767, 270 ], "page_idx": 36 }, { "type": "text", "text": "- {{shuffle(allowed_types) | join(\"\\n- \")}} ", "bbox": [ 178, 280, 558, 295 ], "page_idx": 36 }, { "type": "text", "text": "the entity \"{{entities[entity_idx]}}\" marked with \"[\" and \"]\" in the following sentence: ", "bbox": [ 178, 306, 779, 332 ], "page_idx": 36 }, { "type": "text", "text": "{{text}} ", "bbox": [ 181, 344, 250, 357 ], "page_idx": 36 }, { "type": "text", "text": "belongs to ||| {{entity_types[entity_idx]}} {% endif %} ", "bbox": [ 178, 369, 557, 395 ], "page_idx": 36 }, { "type": "text", "text": "C.2.5 RELATION CLASSIFICATION", "text_level": 1, "bbox": [ 176, 435, 424, 450 ], "page_idx": 36 }, { "type": "text", "text": "Relation classification is a fundamental task in information extraction, which identifies the relationships from a list of candidates between two given entities. The problem is a long standing one as it suffers from outrageous cost of data labeling, since manual labeling on knowledge-intensive tasks requires educated annotators that charges high. A de facto data creation method in relation extraction relies on distant supervision, which aligns existing knowledge triples in knowledge bases to text contents automatically, and assume that such alignments are correct in certain conditions. Here we only include TacRED (Zhang et al., 2017) dataset and create several different tasks based on it. ", "bbox": [ 173, 465, 825, 563 ], "page_idx": 36 }, { "type": "text", "text": "• Relation Classification: the most traditional task formulation. Given two entities from text and classify their relation from a list of candidates. The form can be either answering the relation directly or in the form of a triple (similar to relation extraction). ", "bbox": [ 174, 570, 826, 613 ], "page_idx": 36 }, { "type": "text", "text": "• Knowledge Slot Filling: change the task into given head entity and relation, to identify whether the tail entity exists in the input text. If not, generate nothing. ", "bbox": [ 173, 614, 821, 643 ], "page_idx": 36 }, { "type": "text", "text": "• Yes or No Question: turn the problem into a task similar to natural language inference. For example, given the sentence “The series focuses on the life of Carnie Wilson, daughter of Brian Wilson, founder of the Beach Boys.”, the model will be asked to judge the correctness of a triple such as Carnie Wilson, father, Brian Wilson by answering “yes” or “no”. ", "bbox": [ 174, 645, 825, 702 ], "page_idx": 36 }, { "type": "text", "text": "(Relation Classification, Prompt 0) ", "text_level": 1, "bbox": [ 179, 723, 421, 738 ], "page_idx": 36 }, { "type": "text", "text": "{% if entity_types.__len__() > 0 %} Given the following categories of relations: ", "bbox": [ 178, 746, 566, 770 ], "page_idx": 36 }, { "type": "text", "text": "- {{shuffle(allowed_relations.values()) | join(\"\\n- \")}} ", "bbox": [ 179, 782, 671, 796 ], "page_idx": 36 }, { "type": "text", "text": "predict the relation between \"{{relations[0]['head']}}\" and \"{{relations [0]['tail']}}\" in the following sentence: ", "bbox": [ 176, 808, 812, 833 ], "page_idx": 36 }, { "type": "text", "text": "{{text}} ", "bbox": [ 181, 845, 250, 858 ], "page_idx": 36 }, { "type": "text", "text": "The relation should be : ||| {{allowed_relations[relations[0]['relation \n']]}} \n{% endif %} ", "bbox": [ 179, 871, 808, 909 ], "page_idx": 36 }, { "type": "text", "text": "(Relation Classification, Prompt 1) ", "text_level": 1, "bbox": [ 178, 103, 421, 117 ], "page_idx": 37 }, { "type": "text", "text": "1. (Relation Extraction) Answer the relation between entities in the form of \"( X ; Y ; Z )\": ", "bbox": [ 179, 126, 781, 150 ], "page_idx": 37 }, { "type": "text", "text": "{{text}} ", "bbox": [ 181, 162, 250, 176 ], "page_idx": 37 }, { "type": "text", "text": "The relation between \"{{relations[0]['head']}}\" and \"{{relations[0][' tail']}}\" is: ||| ( {{relations[0]['head']}} ; {{allowed_relations[ relations[0]['relation']]}} ; {{relations[0]['tail']}} ) ", "bbox": [ 179, 188, 784, 227 ], "page_idx": 37 }, { "type": "text", "text": "(Knowledge Slot Filling, Prompt 0) ", "text_level": 1, "bbox": [ 179, 252, 424, 267 ], "page_idx": 37 }, { "type": "text", "text": "Based on the sentence provided below, infer the missing argument asked by the question: ", "bbox": [ 178, 273, 800, 299 ], "page_idx": 37 }, { "type": "text", "text": "{{text}} ", "bbox": [ 181, 311, 250, 324 ], "page_idx": 37 }, { "type": "text", "text": "Question: What/Who/Where is \"{{relations[0]['head']}}\" {{ allowed_relations[relations[0]['relation']]}} ? ", "bbox": [ 178, 337, 683, 363 ], "page_idx": 37 }, { "type": "text", "text": "Answer: ||| {{relations[0]['tail']}} ", "bbox": [ 179, 375, 496, 388 ], "page_idx": 37 }, { "type": "text", "text": "C.2.6 SEMANTIC ROLE LABELING ", "text_level": 1, "bbox": [ 176, 420, 428, 435 ], "page_idx": 37 }, { "type": "text", "text": "Semantic role labeling is a long-standing information task that wants to identify the semantic arguments related to a given predicate in a sentence. For example, in the sentence “Grant was employed at IBM for 21 years where she held several executive positions.” and the predicate “employed” in it, semantic role labeling identifies the Grant as the subject and IBM as the second object. ", "bbox": [ 173, 446, 826, 503 ], "page_idx": 37 }, { "type": "text", "text": "We create two different tasks based on semantic role labelling datasets CoNLL05 (Carreras & Màrquez, 2005), CoNLL12 (Pradhan et al., 2013), and PropBank (Kingsbury & Palmer). ", "bbox": [ 174, 510, 821, 539 ], "page_idx": 37 }, { "type": "text", "text": "• Semantic Role Labeling: the traditional task form, where a verb (i.e., predicate) is annotated in text and the model is asked to generate related semantic roles. \n• Semantic Role Filling: given a verb and and a potential semantic role, the model is asked to judge whether the role exists in the sentence and generate it. \n• Predicate Recognition: given a segment of a sentence and its corresponding semantic role, identify which verb it is related to. ", "bbox": [ 173, 545, 826, 635 ], "page_idx": 37 }, { "type": "text", "text": "(Semantic Role Labeling, Prompt 0) ", "text_level": 1, "bbox": [ 179, 650, 429, 665 ], "page_idx": 37 }, { "type": "text", "text": "Provided with the target verb \"{{verb}}\" marked with \"[\" and \"]\" in the following sentence, find out its \"{{allowed_types[type_idx]}}\": ", "bbox": [ 178, 671, 808, 698 ], "page_idx": 37 }, { "type": "text", "text": "{{text}} $= >$ ||| {% for entity, type in zip(entities, entity_types) %}{% if type $= =$ allowed_types[type_idx] %}{{entity}}{% endif %}{% endfor %} ", "bbox": [ 179, 709, 805, 736 ], "page_idx": 37 }, { "type": "text", "text": "(Semantic Role Filling, Prompt 0) ", "text_level": 1, "bbox": [ 179, 761, 415, 776 ], "page_idx": 37 }, { "type": "text", "text": "Given the following list of argument types: ", "bbox": [ 178, 782, 558, 796 ], "page_idx": 37 }, { "type": "text", "text": "$\\begin{array} { r l } { \\mathrm { ~ Z ~ } } & { { } = } \\end{array}$ {{allowed_types | join(\", \")}} ", "bbox": [ 179, 808, 478, 821 ], "page_idx": 37 }, { "type": "text", "text": "find out all arguments related to verb \"{{verb}}\" mentioned in the following sentence from left to right, in the form of \"( X ; instance of ; Z )\". ", "bbox": [ 178, 833, 813, 871 ], "page_idx": 37 }, { "type": "text", "text": "$\\begin{array}{c} \\{ \\ \\begin{array} { c } { { \\mathrm { ~ ( ~ t ~ e ~ x t ~ ) ~ } \\} } \\end{array} \\} \\begin{array} { = } { > } \\end{array} \\begin{array} { | } { | \\ | } \\end{array} \\begin{array} { } \\end{array} } \\end{array}$ {% for entity, type in zip(entities, entity_types) %}( {{entity}} ; argument type ; {{type}} ) {% endfor %} ", "bbox": [ 179, 883, 799, 910 ], "page_idx": 37 }, { "type": "text", "text": "(Predicate Recognition, Prompt 0) ", "text_level": 1, "bbox": [ 179, 103, 418, 118 ], "page_idx": 38 }, { "type": "text", "text": "FINAL EXAM ", "bbox": [ 178, 126, 269, 137 ], "page_idx": 38 }, { "type": "text", "text": "1. Based on the fact that \"{{entities[entity_idx]}}\" is a \"{{ entity_types[entity_idx]}}\", which verb in the following sentence should it related to? ", "bbox": [ 178, 150, 816, 188 ], "page_idx": 38 }, { "type": "text", "text": "{{text}} ", "bbox": [ 181, 200, 250, 213 ], "page_idx": 38 }, { "type": "text", "text": "Answer: ||| {{verb}} ", "bbox": [ 178, 226, 354, 239 ], "page_idx": 38 }, { "type": "text", "text": "C.3 RESULT SOURCES FOR GPT-3, BLOOM-176B, AND OPT-175B ", "bbox": [ 176, 266, 663, 281 ], "page_idx": 38 }, { "type": "text", "text": "Here we describe the result sources for GPT-3, BLOOM-176B, and OPT-175B. Other LLMs we may compare are mostly completely closed-sourced; thus, their results are all taken from existing preprints, publications, or the results stored in BIG-bench repository10. ", "bbox": [ 174, 292, 825, 335 ], "page_idx": 38 }, { "type": "text", "text": "For GPT-3, while most of its results in this paper are taken from existing literature if not specified, the rest were acquired via our own requesting OpenAI Danvici API are explicitly mentioned. For BLOOM-176B and OPT-175B, if without specific annotation, their results are: ", "bbox": [ 174, 342, 823, 385 ], "page_idx": 38 }, { "type": "text", "text": "• Taken from the OPT paper (Zhang et al., 2022). • Taken from the EAI-Eval BigScience Arch&Scale - Google Sheet11. • Taken from BigScience evaluation results repository in Huggingface Datasets1 2 ", "bbox": [ 173, 391, 714, 439 ], "page_idx": 38 }, { "type": "text", "text": "Specifically, we cannot evaluate OPT-175B by ourselves as we are still not officially granted the checkpoint, though we have sent several applications in the past few months. ", "bbox": [ 173, 445, 820, 474 ], "page_idx": 38 }, { "type": "text", "text": "C.4 PILE TEST-SET EVALUATION ", "text_level": 1, "bbox": [ 176, 492, 415, 506 ], "page_idx": 38 }, { "type": "text", "text": "Pile evalution (Gao et al., 2020) is a comprehensive language modeling benchmark which originally includes 22 different text datasets from diverse domains. We report our results over a part of 18 datasets with previously reported baseline results (Lieber et al., 2021). Different from traditional language modeling benchmarks, Pile evaluation report the BPB (bits-per-byte) perplexity to avoid the mismatch comparison between models with different vocabularies. Because in general, language models with a larger vocabulary will be favored in perplexity comparison if not restricted. In the evaluation, we strictly follow the setting in (Gao et al., 2020), leveraging [gMASK] and a context-length of 1,024 with bidirectional attention, and the rest 1024 tokens to calculate BPB in an autoregressive manner. The weighted average BPB are calculated based on each shared dataset’s ratio in Pile training-set (Gao et al., 2020). ", "bbox": [ 174, 517, 504, 781 ], "page_idx": 38 }, { "type": "table", "img_path": "images/f74959fcfdf1079439c325e662cbef5fd36f16e7a859438c03b6c48905121c26.jpg", "table_caption": [ "Table 13: GLM-130B and its similar-sized LLMs’ BPB results on Pile test-set. " ], "table_footnote": [], "table_body": "
Jurassic-1 GPT-3 GLM-130B
dm_mathematics1.0401.3700.786
ubuntu_irc0.8570.9460.977
opensubtitles0.8790.9320.889
hackernews0.8690.9750.873
books330.8350.8020.803
pile_cc0.6690.6980.771
philpapers0.7410.7230.766
gutenberg_pg_190.8901.1600.821
arxiv0.6800.8380.570
stackexchange0.6550.7730.611
nih_exporter0.5900.6120.614
0.5870.6250.610
pubmed_abstracts0.537
uspto_backgrounds pubmed_central0.5370.566
freelaw0.5790.6900.510 0.499
github0.514 0.3580.612 0.6450.329
enron_emails0.9580.604
youtube_subtitles0.621 0.8250.8150.746
Weighted Avg.0.6500.7420.634
", "bbox": [ 522, 517, 828, 785 ], "page_idx": 38 }, { "type": "text", "text": "The detailed metrics on Pile test-set are reported in Table 13. We observe that compared to GPT3, GLM-130B has a noticeable weaker performance on phil_papers and pile_cc, which is likely because of GLM-130B’s bilingual natural and lack of more diverse and high-quality private collected corpora. ", "bbox": [ 173, 789, 826, 844 ], "page_idx": 38 }, { "type": "text", "text": "C.5 BIG-BENCH-LITE EVALUATION ", "text_level": 1, "bbox": [ 176, 103, 434, 117 ], "page_idx": 39 }, { "type": "text", "text": "Recent works (Wei et al., 2022c; Wang et al., 2022c) reveal that LLMs are capable to do reasoning beyond conventional language tasks. As a response, BIG-bench (Srivastava et al., 2022) is recently set up by crowdsourcing new types of tasks from global researchers to test LLMs unexplored abilities. For economical consideration, we evaluate GLM-130B on an official subset of original 150- task BIG-bench, the BIG-bench-lite with 24 tasks. These tasks can be categorized into two types: one is based on multiple-choice question answering with answer options, and another is direct generation without options. For the first category, we assess the probability of each option’s full content and pick the largest one as the answer; for the second one, we generate the answer using greedy decoding. All evaluations done in BIG-bench are based on [MASK], since answers here are usually short pieces of texts. All results on 24 BIG-bench-lite (Srivastava et al., 2022) datasets of three LLMs are shown in Table 14 and ", "bbox": [ 174, 132, 552, 381 ], "page_idx": 39 }, { "type": "image", "img_path": "images/7946f3ec5b0eba21f439862d00ef4e2a0bcde7e370594ab02d68fa9c5809ce8e.jpg", "image_caption": [ "Figure 16: A full scope of BIG-benchlite (24 tasks) evaluation. " ], "image_footnote": [], "bbox": [ 565, 133, 820, 327 ], "page_idx": 39 }, { "type": "text", "text": "Figure 16. We just adopt the original prompts from BIG-bench and use the official implementation to generate priming examples for few-shot evaluation and to calculate the final scores. ", "bbox": [ 173, 382, 823, 410 ], "page_idx": 39 }, { "type": "text", "text": "C.6 MMLU EVALUATION ", "text_level": 1, "bbox": [ 176, 435, 366, 449 ], "page_idx": 39 }, { "type": "text", "text": "All results on 57 MMLU (Hendrycks et al., 2021) datasets of GLM-130B and BLOOM 176B are shown in Table 15. In Section 5.2, we report weighted average accuracy (i.e., accuracy average per sample, rather than by discipline) of GLM-130B, GPT-3 175B, and BLOOM 176B. ", "bbox": [ 174, 465, 821, 507 ], "page_idx": 39 }, { "type": "text", "text": "Below is a prompted example with 1-shot priming. We predict the probability on $[ ^ { \\prime } \\mathbb { A } ^ { \\prime } \\ , \\ ^ { \\prime } \\mathbb { B } ^ { \\prime }$ , $\\prime _ { \\mathrm { ~ C ~ } ^ { \\prime } } , \\quad \\prime _ { \\mathrm { ~ D ~ } ^ { \\prime } } ]$ at the next token, and take the one with the maximal probability as the answer. ", "bbox": [ 171, 513, 820, 542 ], "page_idx": 39 }, { "type": "text", "text": "(MMLU 1-shot Example) ", "text_level": 1, "bbox": [ 178, 559, 357, 574 ], "page_idx": 39 }, { "type": "text", "text": "The following are multiple choice questions about philosophy. ", "bbox": [ 179, 580, 714, 594 ], "page_idx": 39 }, { "type": "text", "text": "According to d'Holbach, people always act according to \n(A) free choices (B) dictates of the soul (C) necessary natural laws (D) \nundetermined will \nAnswer: (C) necessary natural laws Epicurus holds that philosophy is: \n(A) not suitable for the young. (B) not suitable for the old. (C) important, but unpleasant. (D) none of the above. \nAnswer: ( ", "bbox": [ 178, 606, 812, 656 ], "page_idx": 39 }, { "type": "text", "text": "", "bbox": [ 176, 669, 750, 719 ], "page_idx": 39 }, { "type": "text", "text": "C.7 CHINESE LANGUAGE UNDERSTANDING EVALUATION ", "text_level": 1, "bbox": [ 174, 755, 586, 770 ], "page_idx": 39 }, { "type": "text", "text": "Here we elaborate the prompts we use for CLUE (Xu et al., 2020) and FewCLUE (Xu et al., 2021) evaluation. On Chinese datasets, prompting meets some challenges as Chinese texts are organized by single characters rather than words, leading to unequal length of verbalizers in many cases. Albeit dataset-specific calibration (Wang et al., 2021; Wu et al., 2021) can help to mitigate the issue, the too specified technique can be complicated in implementation. Our evaluation in this paper adopts a more easy to solve method leveraging GLM-130B’s unique features. As GLM-130B is a bilingual LLM with English MIP, we adopt English prompts and verbalizers from similar tasks in (Bach et al., 2022) for Chinese dataset evaluation and find such strategies to be quite effective. In terms of evaluation metrics, except for DRCD and CMRC2018 two question answering datasets which reports EM, other datasets report accuracy. ", "bbox": [ 173, 784, 825, 924 ], "page_idx": 39 }, { "type": "text", "text": "C.8 NATURAL LANGUAGE GENERATION ", "text_level": 1, "bbox": [ 178, 103, 465, 117 ], "page_idx": 40 }, { "type": "text", "text": "Natural language generation, or conditional natural language generation here, refers to tasks that require generating text based on the given information, such as tables and documents. We evaluate GLM-130B on data-to-text and summarization tasks. The datasets include WebNLG 2020 (Castro Ferreira et al., 2020), Clean E2E NLG (Dušek et al., 2019) and WikiLingua (Scialom et al., 2020) from GEM generation benchmark (Gehrmann et al., 2021). We select full WebNLG 2020 and the Clean E2E NLG in the test set and randomly select 5000 test examples from WikiLingua following the practice in (Chowdhery et al., 2022). Following the settings in PaLM, the prompt used for the Summarization tasks is “Summarize the following article:” and the prompt used for the Data-to-Text tasks is “Verbalize:”. An exception is E2E, where we process the data using the prompt “generate-gramatically-correct-text from” provided in promptsource for GLM-130B and GPT-3 175B (Davinci). All evaluations are one-shot, and the demonstration samples are randomly sampled from the training set. We report the F-measure of ROUGE-2, ROUGE-L (Lin, 2004) and BLEURT-20 (Pu et al., 2021). We compare our model with LaMDA, GPT-3 175B (Davinci), and PaLM, where the results of LaMDA and PaLM are reported by (Chowdhery et al., 2022), and we evaluate GPT-3 175B (Davinci) through OpenAI API.13 ", "bbox": [ 174, 131, 825, 338 ], "page_idx": 40 }, { "type": "text", "text": "Our results are presented in Table 16. It shows that GLM-130B has better performances than LaMDA and GPT-3 (Davinci) on all tasks. In the Data-to-text task, GLM-130B performs slightly worse than PaLM-540B, while in the summary task, GLM-130B has even higher ROUGE results. We also ablate GLM-130B to unidirectional to demonstrate the advantage of bidirectional attention. Unidirectional GLM-130B underperforms GPT-3 175B in all three datasets, but when it shifts to bidirectional attention, there is an instant boost, making GLM-130B even comparable to PaLM540B in a few cases. It indicates that bidirectional attention over the provided context (i.e., prefix) can also be beneficial for text generation missions. ", "bbox": [ 174, 345, 825, 457 ], "page_idx": 40 }, { "type": "table", "img_path": "images/ed6bb4d3edafc673840026c2995da81db68fed9d994c2e39ebfe9ae063cae074.jpg", "table_caption": [ "Table 16: 1-shot GEM English natural language generation tasks (WebNLG, E2E, and WikiLingua). We compare two versions of GLM-130B (uni: unidirectional attention, bi: bidirectional attention), showing that bidirectional attention can also improve conditional generation’s performance. " ], "table_footnote": [], "table_body": "
TaskDatasetMetricLaMDA 137BGPT-3175B (Davinci)GLM-130BPaLM-540B
unibi
Data to TextWebNLGROUGE-230.529.925.338.544.4
ROUGE-L-41.236.749.353.8
BLEURT-20159.053.267.773.9
E2EROUGE-229.230.330.933.935.2
ROUGE-L-39.240.042.643.9
BLEURT-20-64.565.068.169.7
SummaryWikiLinguaROUGE-25.47.25.810.49.9
ROUGE-L18.916.423.420.6
BLEURT-20-41.239.445.047.7
", "bbox": [ 196, 513, 797, 688 ], "page_idx": 40 }, { "type": "text", "text": "(E2E Example, without demonstration sample) ", "text_level": 1, "bbox": [ 176, 699, 508, 713 ], "page_idx": 40 }, { "type": "text", "text": "Aleksandr_Prudnikov , height , 185.0 (centimetres). FC_Spartak_Moscow , ground , Otkrytiye_Arena. Aleksandr_Prudnikov , club , FC_Spartak_Moscow. Verbalize: ", "bbox": [ 178, 720, 625, 771 ], "page_idx": 40 }, { "type": "text", "text": "Groundtruth: 185 centimetre tall Aleksandr Prudnikov played for the Otkrytiye Arena based FC Spartak, Moscow. ", "bbox": [ 176, 790, 818, 815 ], "page_idx": 40 }, { "type": "text", "text": "GPT-3 175B (Davinci): Aleksandr Prudnikov is a midfielder for FC Spartak Moscow, a football (soccer) club based in Moscow, Russia. ", "bbox": [ 178, 820, 818, 847 ], "page_idx": 40 }, { "type": "text", "text": "GLM-130B: Aleksandr Prudnikov is $1 8 5 . 0 \\mathrm { c m }$ tall and plays for FC Spartak Moscow. ", "bbox": [ 181, 852, 689, 866 ], "page_idx": 40 }, { "type": "text", "text": "(E2E Example, without demonstration sample) ", "text_level": 1, "bbox": [ 181, 103, 506, 117 ], "page_idx": 41 }, { "type": "text", "text": "Combine all of the following data into a concise and grammatically correct text: ", "bbox": [ 179, 126, 761, 150 ], "page_idx": 41 }, { "type": "text", "text": "name : Blue Spice eatType : coffee shop area : riverside ", "bbox": [ 178, 151, 366, 188 ], "page_idx": 41 }, { "type": "text", "text": "Groundtruth: At the riverside, there is a coffee shop called The Blue Spice. ", "bbox": [ 178, 207, 633, 219 ], "page_idx": 41 }, { "type": "text", "text": "GPT-3 175B (Davinci): Blue Spice is a riverside coffee shop which is located on the corner of River Street and Riverbank Street. ", "bbox": [ 181, 224, 818, 251 ], "page_idx": 41 }, { "type": "text", "text": "GLM-130B: There’s a coffee shop that serves coffee in the riverside area, Blue Spice. ", "bbox": [ 176, 257, 687, 270 ], "page_idx": 41 }, { "type": "text", "text": "(WikiLingua Example, without demonstration sample) ", "text_level": 1, "bbox": [ 178, 273, 563, 286 ], "page_idx": 41 }, { "type": "text", "text": "The majority of your customers will search for you online, so it's essential to have a user-friendly website. At the very least, your website should include information about your business and your history in the moving industry, details about the quoting process, contact information, and a description of the services you offer. If possible, allow customers to schedule quotes online, view your availability, or read testimonials from other customers. One of the easiest ways to start your business is by helping people you already know with their moves. You can be on the lookout for any announcements related to moving that your friends make on social media. Once you have provided good service to friends, they are likely to recommend you to others. In order to spread the word about your business, have some professional looking promotional materials printed and distribute them around your community. ", "bbox": [ 178, 294, 813, 458 ], "page_idx": 41 }, { "type": "text", "text": "the article: ", "bbox": [ 186, 811, 292, 821 ], "page_idx": 41 }, { "type": "text", "text": "Groundtruth: Create a website. Start with friends. Distribute business cards and flyers. Network for promotion. Seek out free advertising opportunities. Consider paid advertising. Gain a good reputation. ", "bbox": [ 179, 840, 818, 867 ], "page_idx": 41 }, { "type": "text", "text": "GPT-3 175B (Davinci): Market yourself online. Look for opportunities to market your services offline. ", "bbox": [ 181, 872, 789, 886 ], "page_idx": 41 }, { "type": "text", "text": "GLM-130B: Have a user-friendly website. Promote your business through social media. Build relationships with influential people in your community. Use directory sites like Craigslist to advertise your services. ", "bbox": [ 179, 891, 816, 917 ], "page_idx": 41 }, { "type": "table", "img_path": "images/4209a7963126c4f7c72e3e9ad2b5b91a70014455f09c73ba4cad097fbffe9a43.jpg", "table_caption": [ "Table 17: Winograd-style tasks evaluation (Winogender and Winograd273). All scores are accuracy. K refers to number of shots. $^ { * } \\mathrm { P a L M } 5 4 0 \\mathrm { B }$ did not report the exact 0-shot Winogender result, so we have to estimate a value from its plotted diagram. " ], "table_footnote": [], "table_body": "
KGPT-3 (Davinci)OPT 175BBLOOM 176BPaLM 540BChinchillaGopher 280BGLM-130B
Winogender064.254.849.175.0*78.371.479.7
162.6-53.179.4-80.7
Winograd273088.352.949.190.1--84.3
", "bbox": [ 173, 154, 825, 248 ], "page_idx": 42 }, { "type": "table", "img_path": "images/986291ed83a11cfca6cfa50b3e3716adb802590dac0a35daad53d8e8ba97c82d.jpg", "table_caption": [ "Table 18: Closed-book question answering (Natural Questions, StrategyQA). " ], "table_footnote": [], "table_body": "
GPT-3 (Davinci)BLOOM 176BPaLM 540BChinchillaGopher 280BGLM-130B
Natural Questions (EM)14.613.121.216.610.111.7
StrategyQA (Acc)52.349.864.0--60.6
", "bbox": [ 181, 305, 813, 386 ], "page_idx": 42 }, { "type": "table", "img_path": "images/be05480b612c96d6f1d59d2c67fae78f62c3da3e4c3093eff2e96605bccd3a0e.jpg", "table_caption": [ "Table 19: Commonsense reasoning (Commonsense QA, MC-TACO). K refers to number of shots. " ], "table_footnote": [], "table_body": "
KGPT-3 (Davinci)OPT175BBLOOM 176BGLM-130B
Commonsense QA (Acc)057.242.861.6
161.21162.2
MC-TACO (EM)0112.413.113.6
", "bbox": [ 181, 441, 813, 522 ], "page_idx": 42 }, { "type": "text", "text": "C.9 WINOGRAD-STYLE TASKS ", "text_level": 1, "bbox": [ 176, 546, 401, 561 ], "page_idx": 42 }, { "type": "text", "text": "We include the evaluation on Winograd-style tasks, which derives from the classical Winograd Schemas Challenge (Levesque et al., 2012) that aims to test coreference resolution in an ambiguous context for the machine to understand. Since in MIP, we have included the Winogrande (Sakaguchi et al., 2021) and SuperGLUE WSC (Wang et al., 2019), here we test on Winogender (Rudinger et al., 2018) and Winograd273 (Levesque et al., 2012). For Winogender, GPT-3’s results are acquired from OpenAI API, and BLOOM’s 1-shot result is evaluated by ourselves. For Winograd273, since existing works (Brown et al., 2020; Chowdhery et al., 2022) show that 1-shot learning brings almost no improvement, we only test the zero-shot result. Another thing to notice is that, despite GPT-style models (e.g., GPT-3, PaLM) adopting the “partial evaluation” described in (Radford et al., 2019), we find the prompt “ The \"\" refers to [MASK]” is better for GLM-130B and adopt it in the evaluation. ", "bbox": [ 173, 573, 825, 726 ], "page_idx": 42 }, { "type": "text", "text": "The results are presented in Table 17. GLM-130B performs the best across all evaluated LLM on Winogender, and marginally poorer than GPT-3 and PaLM on Winograd273. ", "bbox": [ 176, 732, 820, 761 ], "page_idx": 42 }, { "type": "text", "text": "C.10 CLOSED-BOOK QUESTION ANSWERING ", "text_level": 1, "bbox": [ 178, 779, 500, 792 ], "page_idx": 42 }, { "type": "text", "text": "Closed-book question answering (CBQA) (Roberts et al., 2020) is a widely adopted task to evaluate language models’ memorization of factual knowledge, on contrary to the traditional “open-book” evaluation. As we have included TriviaQA (Joshi et al., 2017) and WebQuestions (Berant et al., 2013) in the MIP training, here we choose Natural Questions (Kwiatkowski et al., 2019) and StrategyQA (Geva et al., 2021) as the evaluation datasets for CBQA. ", "bbox": [ 174, 804, 825, 875 ], "page_idx": 42 }, { "type": "text", "text": "The results are presented in Table 18. GLM-130B performs relatively poorer on Natural Questions and performs well on StrategyQA. GLM-130B’s underperformance on Natural Questions, we speculate, potentially derives from the insufficiency fitting on English corpora, as it roughly only viewed ", "bbox": [ 176, 882, 823, 924 ], "page_idx": 42 }, { "type": "text", "text": "200B English tokens and thus does not memorize the detailed knowledge very well. Since CBQA seems to be a task that especially stresses memorization, as is indicated by Chinchilla (Hoffmann et al., 2022)’s a strong performance, we think with sufficient training later, GLM-130B can perform better. ", "bbox": [ 174, 103, 823, 160 ], "page_idx": 43 }, { "type": "text", "text": "C.11 COMMONSENSE REASONING", "text_level": 1, "bbox": [ 176, 181, 426, 195 ], "page_idx": 43 }, { "type": "text", "text": "Here we evaluate GLM-130B and some other LLMs on commonsense reasoning abilities. As we have included PIQA (Bisk et al., 2020), ARC (Clark et al., 2018), and OpenbookQA (Mihaylov et al., 2018) in the MIP training, we select another two widely adopted commonsense reasoning datasets in our evaluation: Commonsense QA (Talmor et al., 2019) and Multiple-choice Temporal Commonsense (MC-TACO, Zhou et al. (2019)). For Commonsense QA, we test the GPT-3 via OpenAI Davinci API, BLOOM-176B via its Huggingface Implementation, and GLM-130B using the prompt “answer_given_question_without_options” from promptsource (Bach et al., 2022). For StrategyQA, we follow the EM computation method provided in (Zhou et al., 2019). ", "bbox": [ 174, 209, 825, 321 ], "page_idx": 43 }, { "type": "text", "text": "The results are shown in Table 19. As we can see, GLM-130B performs the best on both Commonsense QA and MC-TACO across evaluated LLMs, demonstrating that GLM-130B has a good grasp of commonsense knowledge. OPT’s results are not included due to the reason described in Appendix C.3. ", "bbox": [ 176, 328, 825, 383 ], "page_idx": 43 }, { "type": "text", "text": "C.12 FIXED LABEL DATASETS: A CASE STUDY IN NATURAL LANGUAGE INFERENCE ", "bbox": [ 176, 406, 776, 420 ], "page_idx": 43 }, { "type": "text", "text": "As is discussed in Section 5, we adopt a rather strict criterion for selecting datasets for zero/few-shot learning in GLM-130B’s evaluation due to the use of MIP. Nevertheless, the criterion significantly reduces the dataset we could currently evaluate, and especially some readers have doubted whether the restriction of not evaluating on MIP-seen fixed-label datasets is necessary (e.g., natural language inference (NLI)), and suggest that we may report them in an independent section to avoid confusion. ", "bbox": [ 174, 434, 823, 503 ], "page_idx": 43 }, { "type": "text", "text": "Frankly speaking, in such a setting GLM-130B’s zero/few-shot learning could be quite advantageous. Below, we take NLI as a typical example to show GLM-130B’s outperformance in the scenarios. We include 6 widely-used NLI datasets–which are not incorporated in GLM-130B’s MIP training, as the benchmarks. The results are presented in Table 20, which shows that GLM-130B’s “zero-shot” performance could be much better due to the seen task type. ", "bbox": [ 174, 511, 825, 580 ], "page_idx": 43 }, { "type": "table", "img_path": "images/fa3f6f860515a5520653a4035bb9e172b2f893a9dc71772b981db648bc914436.jpg", "table_caption": [ "Table 20: “Zero-shot” results of GLM-130B on 6 typical natural language inference (NLI) datasets. $^ *$ DISCLAIMER: Despite the datasets are never seen, some other NLI datasets have been included in GLM-130B’s MIP, making it different from the existing standard zero-shot setting. " ], "table_footnote": [], "table_body": "
BLOOM176BOPT175BGLM-130B*
qnli (valid, median of 5 prompts)50.955.486.7
mnli (valid, median of 15 prompts)35.536.085.7
mnli_mismatched (valid, median of 15 prompts)35.536.084.6
wnli (valid, median of 5 prompts)57.753.567.6
glue/cola (valid, median of 5 prompts)39.044.457.6
glue/mrpc (valid, median of 5 prompts)31.644.687.3
", "bbox": [ 179, 654, 813, 768 ], "page_idx": 43 }, { "type": "text", "text": "C.13 SUPERGLUE ", "text_level": 1, "bbox": [ 174, 797, 320, 813 ], "page_idx": 43 }, { "type": "text", "text": "We also report our evaluation of GLM-130B on the SuperGLUE (Wang et al., 2019) benchmark, which consists 8 different natural language understanding challenges. Noted that these results are neither zero/few-shot nor fine-tuned results, because 7 out of 8 tasks’ training sets have been included in GLM-130B’s MIP training (except for ReCoRD) together with other 67 multi-task datasets; however, GLM-130B is also not individually fine-tuned on any of them. Therefore, these results are not for relative comparison for any other models’, but only for readers’ reference on GLM-130B’s absolute ability. ", "bbox": [ 174, 825, 825, 924 ], "page_idx": 43 }, { "type": "image", "img_path": "images/f55bb0dce90be1d84f3a233001579f48bc4c0a4525e3554ecddd4b386950fcb8.jpg", "image_caption": [ "Figure 17: GLM-130B (uni and bi)’s untuned results on SuperGLUE development set, using promptsource (Bach et al., 2022) prompts and task formulation. DISCLAIMER: Noted that some of the SuperGLUE training sets have been included in the MIP training. We report the results here only for readers’ reference. " ], "image_footnote": [], "bbox": [ 173, 99, 821, 215 ], "page_idx": 44 }, { "type": "image", "img_path": "images/7a0df67091ca37c3cd95d35f352b4c21534f3fcee8cabf3b659eaf309a079cfe.jpg", "image_caption": [ "Figure 18: Chain-of-thought prompting can also improve GLM-130B’s performance on reasoning tasks compared to standard prompting. " ], "image_footnote": [], "bbox": [ 235, 295, 759, 416 ], "page_idx": 44 }, { "type": "table", "img_path": "images/468cef0113b1ec3d66be2e545b6da60296df63396408e83515976aa568a747db.jpg", "table_caption": [ "Table 21: The results of GLM-130B on the SuperGLUE dataset obtained using the P-tuning v2 (Liu et al., 2022). We report the Accuracy metric for all datasets except for MultiRC (F1a) and ReCoRD (F1). " ], "table_footnote": [], "table_body": "
BoolQCBCOPAMultiRCReCoRDRTEWiCwSC
GLM-130B89.6998.2110089.3292.1194.2276.9688.5
", "bbox": [ 194, 479, 803, 525 ], "page_idx": 44 }, { "type": "text", "text": "The results are presented in Figure 17. We ablate the unidirectional and bidirectional GLM-130B to justify the usefulness of GLM objective in boosting LLMs’ ability to understand. Each point in the figure refers to a prompt-specific result, for which the prompt is from the promptsource (Bach et al., 2022) repository. We adopt the task formulation from promptsource, too. As we can observe, GLM (bi) has much fewer variances and higher performances on all tasks. For some of the tasks (such as CB, MultiRC, RTE, COPA, and BoolQ), GLM-130B can even achieve over $80 \\%$ accuracy. ", "bbox": [ 174, 604, 825, 689 ], "page_idx": 44 }, { "type": "text", "text": "We also attempted to fine-tune GLM-130B on the SuperGLUE dataset. However, we encountered the issue of rapid overfitting within a single epoch when we used full parameter fine-tuning on downstream tasks. This resulted in poor performance on the validation set. To address this issue, we explored the use of efficient parameter fine-tuning methods, which tune only a small number of parameters and are less prone to overfitting. After experimenting with several methods, we use P-Tuning v2 (Liu et al., 2022), which demonstrated comparable results to full parameter fine-tuning in GLM-130B, but with only $0 . 1 \\%$ to $3 \\%$ of tuned parameters. The results of our experiments with P-Tuning v2 are presented in Table 21. ", "bbox": [ 174, 695, 825, 808 ], "page_idx": 44 }, { "type": "text", "text": "C.14 CHAIN-OF-THOUGHT PROMPTING ", "text_level": 1, "bbox": [ 178, 827, 464, 840 ], "page_idx": 44 }, { "type": "text", "text": "We evaluate the chain-of-thought prompting performance on Last letter concatenation (LLC), Coin Flip, Reverse List, and two tasks from BIG-bench Srivastava et al. (2022) Sports understanding, and Date understanding, following the setting in Wei et al. (2022c). The results are shown in Figure 17. We find that chain-of-thought prompting can improve GLM-130B’s performance on symbolic reasoning and commonsense reasoning. ", "bbox": [ 176, 854, 823, 924 ], "page_idx": 44 }, { "type": "text", "text": "Log-scaling Ability Tasks ", "text_level": 1, "bbox": [ 179, 106, 354, 121 ], "page_idx": 45 }, { "type": "image", "img_path": "images/137056cee4899dcdc5d8380ee26047bc23178f4d822fd5e9550df31f7ecf9e48.jpg", "image_caption": [ "Figure 19: Log-scaling ability tasks of GLM-130B. These tasks’ performance grows logarithmically with the amount of GLM parameters. Most of traditional NLP tasks fall into the same pattern. " ], "image_footnote": [], "bbox": [ 171, 127, 823, 287 ], "page_idx": 45 }, { "type": "text", "text": "Last letter concatenation (LLC). The task asks the model to concatenate the last letters of words in a name (e.g., \"Elon Musk\" $- >$ \"nk\"). We generate full names by randomly concatenating the top 1000 first and last names from name census data14. ", "bbox": [ 174, 356, 825, 398 ], "page_idx": 45 }, { "type": "text", "text": "Coin flip. This task asks the model to answer whether a coin is still heads up after people either flip or don’t flip it beginning from being heads up. (e.g., \"A coin is heads up. Phoebe flips the coin. Osvaldo does not flip the coin. Is the coin still heads up?\" $- >$ \"no\"). We additionally evaluate on the scenario where the number of people in the query examples is larger than that in the in-context examples, i.e. the out-of-distribution (OOD) setting. ", "bbox": [ 174, 406, 825, 476 ], "page_idx": 45 }, { "type": "text", "text": "Reverse List. This task asks the model to reverse the order of a list of everyday objects (e.g., \"cigar, umbrella, key, gum, alarm\" $- >$ \"alarm, gum, key, umbrella, cigar\"). We generate the lists by randomly sampling from the vocabulary of everyday objects15. ", "bbox": [ 174, 483, 825, 525 ], "page_idx": 45 }, { "type": "text", "text": "Sports. This task asks the model to judge the truthfulness of a statement about a sports player (e.g., \"Joao Moutinho caught the screen pass in the NFC championship\" $- >$ \"false\"). ", "bbox": [ 171, 531, 821, 560 ], "page_idx": 45 }, { "type": "text", "text": "Date. This task asks the model to infer the data from a given context (e.g., \"2015 is coming in 36 hours. What is the date one week from today in MM/DD/YYYY?\" -> \"01/05/2015\"). ", "bbox": [ 171, 566, 823, 595 ], "page_idx": 45 }, { "type": "text", "text": "We use the same examples and chains as Wei et al. (2022c). For each task, we try two different formats of prompts and both unidirectional and bidirectional attention mechanism and report the best performance. The first format is \"Question: {context} Answer: {target}\". The second one is to add serial numbers before examples in the first format of prompts. The results are presented in Figure 18. ", "bbox": [ 174, 602, 825, 672 ], "page_idx": 45 }, { "type": "text", "text": "D SCALING AND EMERGENT ABILITIES IN GLM-130B ", "text_level": 1, "bbox": [ 174, 695, 647, 712 ], "page_idx": 45 }, { "type": "text", "text": "Scaling up pre-trained language models has been proven to boost downstream performance on a wide range of tasks continually. His, emergent abilities which are unpredictable from smaller scales. To illustrate this, we conducted extensive experiments to explore the scaling property and emergent abilities. Following prior literature (Wei et al., 2022b), we categorize the NLP tasks into two types based on our observations. ", "bbox": [ 174, 729, 825, 799 ], "page_idx": 45 }, { "type": "text", "text": "• Log-scaling Ability Tasks (Cf. Figure 19): where the task performance grows logarithmically with the number of model parameters. Typical tasks and datasets include LAMBADA, Wikitext103, Wikitext-2, Penn Tree Bank. ", "bbox": [ 174, 806, 820, 848 ], "page_idx": 45 }, { "type": "text", "text": "• Emergent Ability Tasks (Cf. Figure 20): where the task performance only soars up when the amount of model parameters reaches a certain threshold. Typical tasks and datasets include: ", "bbox": [ 178, 851, 823, 878 ], "page_idx": 45 }, { "type": "text", "text": "Emergent Ability Tasks ", "text_level": 1, "bbox": [ 179, 107, 343, 121 ], "page_idx": 46 }, { "type": "image", "img_path": "images/99994029ac28fce8ea469d4724fa4cb6d882e1114c9a707945a57484c4327d19.jpg", "image_caption": [ "Figure 20: Emergent ability tasks of GLM-130B. These tasks’ performance does not grow much until the model size reaches a certain threshold (e.g., 100B or 10B). After reaching the threshold, the model performance soars up quickly. The BIG-bench (Srivastava et al., 2022) benchmark collects many of these challenges. " ], "image_footnote": [], "bbox": [ 171, 125, 821, 440 ], "page_idx": 46 }, { "type": "text", "text": "MMLU, hindu_knowledge, crass_ai, implicatures, understanding_fables, modified_arithmetic, implicit_relations, and gre_reading_comprehension from BIG-bench (Srivastava et al., 2022). ", "bbox": [ 184, 535, 823, 563 ], "page_idx": 46 }, { "type": "text", "text": "In line with the observation in (Wei et al., 2022b), we show that GLM-130B also presents the two similar scaling behaviors to other LLMs such as GPT-3, LaMDA, and PaLM. Though why and how LLMs present these intriguing properties remain unclear, GLM-130B provides open opportunities for all researchers to test and understand the reason behind them. ", "bbox": [ 174, 569, 825, 626 ], "page_idx": 46 }, { "type": "table", "img_path": "images/f84fd01d5a5fed9f1de50406b3ece3f64d4dabe76bb46944ba23ab2555f60a2c.jpg", "table_caption": [ "Table 11: Full configurations for GLM-130B training " ], "table_footnote": [], "table_body": "
Configuration KeyValue
adam_beta10.9
adam_beta20.95
adam_eps1e-08
aggregated_samples_per_sequence4
0.1
attention_dropout attention_softmax_in_fp32
True
average_block_length3
bias_dropout_fusionTrue True
checkpoint_activations
checkpoint_in_cpuFalse
checkpoint_num_layers
clip_grad contigious_checkpointing1.0
False
cpu_optimizerFalse
data_parallel_size24
deepnormTrue
distributed_backendnccl
eval_interval1000
eval_iters ffn_hidden_size3
fp1632768
True
global_batch_size glu_activation4224
gpt_probgeglu
hidden_dropout0.7
hidden_size0.1
hysteresis12288
init_method_std2 0.0052
init_method_xavier_uniform
initial_loss_scaleFalse 65536
layernorm_epsilon1E-05
learnable_rotary_embeddingFalse
length_per_sample2000
log_interval1
loss_scale0
loss_scale_window2000
lr8e-05
lr_decay_itersNone
lr_decay_samples197753905
lr_decay_stylecosine
lr_warmup_samples1098632
make_vocab_size_divisible_by768
mask_prob0.15
masked_softmax_fusionTrue
micro_batch_size1
min_gmask_ratio0.2
min_loss_scale1.0
min_lr8e-06
multitask_ratio
num_attention_heads0.05
num_layers96 70
onnx_safeNone
optimizer
partition_activationsadam
True
pipeline_model_parallel_size position_embedding_type8
rampup_batch_sizerotary 192, 24,5493164
save_interval250
seed1234
seq_length2048
short_seq_prob0.02
shrink_embedding_gradient_alpha0.1
single_span_prob0.02
split tensor_model_parallel_size949,50,1
tokenizer_type4
weight_decayIceTokenizer 0.1
zero_contigious_gradients
zero_reduce_bucket_sizeFalse
zero_reduce_scatter500000000
zero_stageFalse
zero-optimization.allgather_bucket_size500000000
tokenizer_typeIceTokenizer
weight_decay0.1
world_size768
zero_contigious_gradientsFALSE
zero_reduce_bucket_size500000000
zero_reduce_scatter zero_stageFALSE 1
", "bbox": [ 343, 99, 653, 938 ], "page_idx": 47 }, { "type": "table", "img_path": "images/8284c0770abef2ac242864b4d8db7ac7f9591af1ec7e8204d766951324cdcc61.jpg", "table_caption": [ "Table 12: The 74 datasets involved in Multi-task Instruction Pre-training (MIP). Datasets from T0- PromptSource (Sanh et al., 2022; Bach et al., 2022) are named in their Hugging Face datasets identifiers. Datasets from DeepStruct (Wang et al., 2022a) are described in Appendix C.2. " ], "table_footnote": [], "table_body": "
TaskDatasetTaskDataset
Coreference Resolutionsuper_glue/wsc.fixedMulti-choice QAcos_e/v1.11
Coreference Resolutionwinogrande/winogrande_xl Multi-choice QAcosmos_qa
Natural Language Inference super_glue/cbMulti-choice QAdream
Natural Language Inference super_glue/rteMulti-choice QAopenbookqa/main
Natural Language Inference anliMulti-choice QAqasc
Paraphrase Identification glue/mrpcMulti-choice QAquail
Paraphrase Identification glue/qqpMulti-choice QAquarel
Paraphrase Identificationpaws/labeled_finalMulti-choice QAquartz
Closed-Book QAai2_arc/ARC_ChallengeMulti-choice QArace/high
Closed-Book QAai2_arc/ARC_EasyMulti-choice QArace/middle
Closed-Book QAkilt_tasks/hoptpotqaMulti-choice QAsciq
Closed-Book QAtrivia_qa/unfilteredMulti-choice QAsocial_i_qa
Closed-Book QAweb_questionsMulti-choice QAsuper_glue/boolq
Closed-Book QAwiki_qaMulti-choice QAsuper_glue/multirc
Extractive QAadversarial_qa/dbidafMulti-choice QAwiki_hop/original
Extractive QAadversarial_qa/dbertMulti-choice QAwiqa
Extractive QAadversarial_qa/drobertaMulti-choice QApiqa
Extractive QAduorc/SelfRCTopic Classificationag_news
Extractive QAduorc/ParaphraseRCTopic Classificationdbpedia_14
Extractive QAropesTopic Classificationtrec
Extractive QAsquad_v2Word Sense Disambiguation super_glue/wic
Extractive QAsuper_glue/recordDialogue State Trackingmultiwoz_2.1
Extractive QAquorefEvent Extractionace05
Sentimentamazon_polarityNamed Entity Recognitionconl103
Sentimentapp_reviewsNamed Entity Recognitiongenia
SentimentimdbNamed Entity Recognitionontonotes5.0
Sentimentrotten_tomatoesNamed Entity Recognitionace2005
Sentimentyelp_review_fullNamed Entity Recognitionconll04
Sentence Completionsuper_glue/copaNamed Entity Recognitionnyt29
Sentence CompletionhellaswagRelation Extractionconll04
Structure-to-Textcommon_genRelation Extractionnyt29
Structure-to-Textwiki_bioRelation Extractionace2005
Summarizationcnn_dailymail/3.0.0Relation Extractionkelm
SummarizationgigawordRelation Classificationtacred
Summarizationmulti_newsSemantic Role Labelingconll05
SummarizationsamsumSemantic Role Labelingconll12
SummarizationxsumSemantic Role Labelingpropbank
", "bbox": [ 174, 261, 831, 830 ], "page_idx": 48 }, { "type": "table", "img_path": "images/4a1af107c4ca6d51f6d85673d9672d351b9646b8182e9974744569b80c4bd80a.jpg", "table_caption": [ "Table 14: Details results of GLM-130B, GPT-3 175B (Brown et al., 2020), and PaLM 540B (Chowdhery et al., 2022) on BIG-bench-lite in 0, 1, and 3-shots. “Normalized preferred metric” is reported for each task. GPT-3 and PaLM’s results are reported in BIG-bench’s GitHub repository, and PaLM 540B’s 3-shot results are not found. " ], "table_footnote": [], "table_body": "
GLM-130BGPT-3175BPaLM540B
01301301
auto_debugging11.7620.5923.530.000.000.000.0038.23
bbq_lite_json22.2637.5059.73-8.3340.7561.21-4.3977.73
code_line_description0.229.09-8.649.099.099.090.2249.00
conceptual_combinations37.5131.3327.862.373.7014.3345.6873.36
conlang_translation34.7238.0133.8846.8247.0751.6036.8861.92
emoji_movie1.254.883.75-10.00-2.49-1.2417.5088.75
formal_fallacies_syllogisms_negation0.831.460.351.006.805.60-0.204.40
hindu_knowledge32.2337.5634.5210.1540.6144.4241.3793.15
known_unknowns-4.350.004.3521.744.350.0013.0434.78
language_identification9.621.971.907.493.201.9812.1131.03
linguistics_puzzles0.000.000.000.000.000.000.000.10
logic_grid_puzzle9.8813.665.240.163.350.011.4716.12
logical_deduction24.1822.2020.352.2210.8014.712.1715.34
misconceptions_russian-26.53-46.94-26.53-34.70-34.70-30.61-42.86-30.61
novel_concepts6.2521.8725.7833.5933.5945.3133.5949.22
operators14.7618.1018.1030.034.2933.3330.4856.19
parsinlu_reading_comprehension7.147.7211.580.000.000.009.4644.40
play_dialog_same_or_different2.885.333.808.000.80-5.40-33.00.10
repeat_copy_logic0.000.000.000.000.000.000.0037.5
strange_stories43.8651.7642.318.2725.6812.9339.2574.46
strategyqa21.1018.7416.824.6013.2014.2028.0038.00
symbol_interpretation1.391.891.770.51-0.632.770.762.40
vitaminc_fact_verification71.8760.7256.55-31.5522.1529.05-28.8555.60
winowhy-3.495.383.03.010.6013.00-5.031.80
", "bbox": [ 173, 358, 823, 739 ], "page_idx": 49 }, { "type": "table", "img_path": "images/263ed91e2f5136ee90d9f0fb44bda0e81da65c26b9506dedb880140ace88b2e4.jpg", "table_caption": [ "Table 15: Detailed results of GLM-130B and BLOOM 176B (Scao et al., 2022) on MMLU (Hendrycks et al., 2021). We find that no existing literature has reported GPT-3 175B’s numerical accuracy. BLOOM is evaluated using Huggingface Transformer implementation. " ], "table_footnote": [], "table_body": "
DisciplineGLM-130B BLOOM176B
STEM
abstract_algebra anatomy24.00 48.9024.00 38.52
astronomy48.0334.87
37.50
colledge_biology47.22
college_chemistry34.0019.00
colledge_computer_science44.001.00
colledge_mathematcis27.0031.00
colledge_physics30.39 61.0024.50 40.00
computer_security conceptual_physics38.7231.49
electrical_engineering45.5232.41
elementary_mathematics31.7529.63
high_school_biology51.2927.42
high_school_chemistry34.9827.09
high_school_computer_science53.0030.00
high_school_mathematics28.1525.93
high_school_physics29.8030.46
high_school_statistics machine_learning38.43 40.1826.39 29.46
Social Science26.3226.32
econometrics
high_school_geography53.5436.36
high_school_government_and_politics62.1840.41
high_school_macroeconomics42.5630.77
high_school_microeconomics45.8026.89
high_school_psychology54.13 51.1539.27
human_sexuality42.4835.11 31.54
professional_psychology55.4633.64
public_relations security_studies44.9034.29
sociology51.7431.84
Humanitiesus_foreign_policy61.0046.00
formal_logic27.7823.02
high_school_european_history58.1835.76
high_school_us_history58.3340.69
high_school_world_history67.0932.07
international_law56.2042.15
jurisprudence43.5235.19
logical_fallacies57.0631.29
moral_disputes47.1136.71
moral_scenarios philosophy24.2524.36
prehistory35.37
45.34 50.9340.43
professional_law world_religions37.9429.53
55.5642.11
business_ethics clinical_knowledge51.0034.00
colledge_medicine48.6835.85 28.90
glocal_facts43.35 35.00
human_aging Other23.00
management45.29 56.3132.29
marketing67.5227.18
39.74
medical_genetics48.0045.00
miscellaneous61.1840.23
nutrition50.6532.35
professional_accounting35.4628.72
professional_medicine43.3818.01
virology39.1628.31
", "bbox": [ 232, 146, 766, 920 ], "page_idx": 50 }, { "type": "text", "text": "E CONTRIBUTIONS ", "text_level": 1, "bbox": [ 176, 102, 349, 117 ], "page_idx": 51 }, { "type": "text", "text": "The GLM-130B project was conceived in Dec. 2021 with its pre-training part completed in July 3rd, 2022 and its evaluation and applications still ongoing. Over the course, we have experienced various technical and engineering challenges (Cf. Appendix F and Figure 21 for details). It would not be possible to reach its current status if without the collaboration of multiple teams—the Knowledge Engineering Group (KEG), Parallel Architecture & Compiler technology of Mobile, Accelerated, and Networked systems Group (PACMAN), and Natural Language Processing Group (THUNLP) at Tsinghua University, as well as Zhipu.AI. The detailed contributions are listed below. ", "bbox": [ 173, 132, 825, 231 ], "page_idx": 51 }, { "type": "text", "text": "E.1 PREPARATION ", "text_level": 1, "bbox": [ 174, 247, 313, 261 ], "page_idx": 51 }, { "type": "text", "text": "• Model Implementation: Aohan Zeng, Zhengxiao Du \n• Self-Supervised Data Processing: Ming Ding, Wendi Zheng \n• Multitask Data Processing: Xiao Liu, Xiao Xia \n• Model Architecture: Aohan Zeng, Xiao Liu, Zhengxiao Du, Hanyu Lai \n• Training Stability: Aohan Zeng, Xiao Liu, Ming Ding \n• 3D-Parallelism and Training Efficiency: Aohan Zeng, Zixuan Ma, Jiaao He, Zhenbo Sun ", "bbox": [ 173, 272, 787, 382 ], "page_idx": 51 }, { "type": "text", "text": "E.2 MODEL TRAINING ", "bbox": [ 174, 398, 346, 412 ], "page_idx": 51 }, { "type": "text", "text": "• Large-Scale Training & Monitoring: Aohan Zeng, Xiao Liu • Model Performance Validation: Aohan Zeng ", "bbox": [ 173, 424, 596, 458 ], "page_idx": 51 }, { "type": "text", "text": "E.3 POST TRAINING ", "bbox": [ 174, 474, 330, 488 ], "page_idx": 51 }, { "type": "text", "text": "• Evaluation Framework: Aohan Zeng, Zhengxiao Du \n• Language Modeling Evaluation: Aohan Zeng \n• MMLU & BIG-Bench Evaluation: Aohan Zeng \n• CLUE & FewCLUE Evaluation: Xiao Liu, Aohan Zeng \n• Ethical Evaluation: Yifan Xu, Aohan Zeng, Xiao Liu, Zihan Wang \n• Baseline Evaluation: Xiao Liu, Jifan Yu, Weng Lam Tam \n• INT4 Quantization: Aohan Zeng, Zihan Wang, Xiao Liu, Hanyu Lai \n• Inference Acceleration: Zihan Wang, Aohan Zeng \n• Low-Resource Inference: Gouyang Zeng, Xu Han, Weilin Zhao, Zhiyuan Liu \n• Demo and API: Hanyu Lai, Jifan Yu, Xiaohan Zhang, Yufei Xue, Shan Wang, Jiecai Shan, Haohan Jiang, Zhengang Guo \n• Manuscript Writing: Xiao Liu, Yuxiao Dong, and Jie Tang wrote the main paper, and Xiao Liu, Aohan Zeng, and Zhengxiao Du wrote the Appendix. ", "bbox": [ 173, 500, 825, 731 ], "page_idx": 51 }, { "type": "text", "text": "E.4 PROJECT MANAGEMENT ", "text_level": 1, "bbox": [ 174, 747, 387, 761 ], "page_idx": 51 }, { "type": "text", "text": "• Student Leaders: Aohan Zeng, Xiao Liu \n• Technical Advisors: Yuxiao Dong, Jidong Zhai, Wenguang Chen, Zhiyuan Liu, Peng Zhang, Jie Tang \n• Project Leader: Jie Tang ", "bbox": [ 173, 773, 826, 839 ], "page_idx": 51 }, { "type": "text", "text": "E.5 COMPUTATION SPONSOR ", "text_level": 1, "bbox": [ 174, 856, 390, 869 ], "page_idx": 51 }, { "type": "text", "text": "• GPU Sponsor: Zhipu.AI ", "bbox": [ 173, 881, 356, 897 ], "page_idx": 51 }, { "type": "text", "text": "F A BRIEF HISTORY OF GLM-130B ", "text_level": 1, "bbox": [ 174, 102, 491, 118 ], "page_idx": 52 }, { "type": "text", "text": "The GLM-130B project16 was conceived in Dec. 2021 in a brainstorming meeting at Tsinghua KEG. We firmly believe that it is of value to pre-train a highly accurate language model, in particular for both Chinese and English. Though GPT-3 (Brown et al., 2020) is the pioneer for this effort, it is not available to most people in the world. In addition, it supports English only. We therefore decide to initialize the project GLM-130B. Please note that the WuDao 1.75T model we built last year is a sparse model with 480 mixture-of-experts (MoE), rather than a dense one as GPT-3. Our goal then is to train a bilingual pre-trained dense model with high accuracy on downstream tasks, and to make it open to everyone in the world-anyone, anywhere can download it and use it on a single server with appropriate GPUs. ", "bbox": [ 174, 136, 825, 262 ], "page_idx": 52 }, { "type": "text", "text": "The ambitious project soon faced several important challenges: ", "bbox": [ 174, 268, 588, 284 ], "page_idx": 52 }, { "type": "text", "text": "• Lack of computational resources: No organization is willing to sponsor such a big project and freely make it public. • Lack of a robust pre-training algorithm: Despite GPT-3’s success on English corpus, it is unclear how to train a high-accurate bilingual model for both English and Chinese. • Lack of fast inference solutions: Since the goal is to have the model public to everyone, we need to design fast inference solutions with low resource requirements to run the model. ", "bbox": [ 173, 290, 826, 378 ], "page_idx": 52 }, { "type": "text", "text": "For the pre-training algorithm, we finally chose GLM (Du et al., 2022) due to its high performance in practice. We eventually decided to train a GLM model of 130 billion parameters after several rounds of discussions and exploration, because such a size makes it possible to run the inference on a single A100 $( 4 0 G * 8 )$ server. ", "bbox": [ 174, 386, 825, 441 ], "page_idx": 52 }, { "type": "text", "text": "Our first attempt at training the model was in January 2022, shortly after we received a small sponsor of GPUs for test running. However, we soon realized that we had significantly underestimated the technical difficulties of pre-training a model at such a scale $\\left( > 1 0 0 \\mathbf { B } \\right)$ . It seems that pre-training a highly accurate 100B-scale model is quite different from training a 10B-scale one. Due to frequent random hardware failures, model gradients exploding, unexpected excessive memory usage in the algorithm, debug for the 3D pipeline in the new Megatron and DeepSpeed frameworks, inability to recover from optimizer states, blocked TCP responses between processes, and many many unexpected “bugs”, the project was delayed for many times. The Tsinghua PACMAN team gave us a hand at this difficult time and together we successfully fixed most of the “bugs”. ", "bbox": [ 173, 448, 825, 574 ], "page_idx": 52 }, { "type": "text", "text": "By March, we were still short on computational resources, but fortunately got a chance to try test runs on several other platforms, including Ascend 910, Hygon DCU, NVIDIA, and Sunway. The immediate challenge was for us to adapt our training code to these different platforms, as the underlying operators are quite different. Also, it introduced many new issues: the element-wise operators not supporting fast computation for large-dimension vectors, various issues that hindered convergence—the large gradient norms of input embeddings, native Post-LN, Pre-LN, and Sandwich-LN, dataloader state seeds, and computation precision choices in Softmax and Attention — as well as numerous mistakes we ourselves made. With tremendous help from all of our generous partners, we finally succeeded in making our pre-training algorithms runnable across all the platforms—frankly, a surprising achievement for this project. The timeline of GLM-130B in Figure 21 covers most of the issues we have encountered and addressed as of this writing. ", "bbox": [ 174, 580, 825, 733 ], "page_idx": 52 }, { "type": "text", "text": "On April 26th, we received a generous computing sponsorship from Zhipu.AI — an AI startup that aims to teach machines to think like humans. After another week of testing, we finally kicked off the training of the GLM-130B model on its 96 A100 $( 4 0 G * 8 )$ servers on May 6th. Additionally, Zhipu.AI also sent a team to help evaluate the pre-trained model and build a demonstration website. ", "bbox": [ 174, 741, 825, 796 ], "page_idx": 52 }, { "type": "text", "text": "The training period spanned two months, during which we began developing a toolkit to allow GLM130B’s inference in low-resource setting with swapping technique and quantization. Though it is already the most accessible model of its scale, together with our partner from Tsinghua NLP, we have been exploring the limit of popularized hardware platforms, which would truly make the 100B-scale model accessible to as many people as possible. To date, we managed to reach the INT4 weight quantization for GLM-130B. Importantly, the INT4 version of GLM-130B without post training ", "bbox": [ 174, 803, 823, 887 ], "page_idx": 52 }, { "type": "text", "text": "Major Issues Encountered for Training GLM-130B ", "text_level": 1, "bbox": [ 261, 89, 815, 113 ], "page_idx": 53 }, { "type": "text", "text": "2021.12 ", "text_level": 1, "bbox": [ 232, 135, 279, 145 ], "page_idx": 53 }, { "type": "text", "text": "• The “千亿 ” (100B) project towards an open dense pre-trained GLM at 100B scale is conceived \n• Survey pre-training strategies of existing models of similar scale, such as GPT-3, Gopher $= >$ Limited public info about how they were trained and issues they met \n• Search for possible GPU clusters & sponsors ", "bbox": [ 232, 147, 803, 194 ], "page_idx": 53 }, { "type": "text", "text": "2022.1 ", "text_level": 1, "bbox": [ 232, 200, 271, 210 ], "page_idx": 53 }, { "type": "text", "text": "• Test the performance of FP16/FP32 at 100B scale on one testing cluster • Unexpected excessive memory usage in GLM $\\Rightarrow$ Torch is better with fixed length input sequences • Inability to converge and try tricks from CogView and ViT ${ \\Rightarrow U s e }$ Sandwich-LN • Frequent random hardware failures $= >$ Have to run HCPG test before each run ", "bbox": [ 230, 212, 738, 258 ], "page_idx": 53 }, { "type": "text", "text": "2022.2 ", "text_level": 1, "bbox": [ 232, 267, 272, 277 ], "page_idx": 53 }, { "type": "text", "text": "• Very slow training speed than previously calculated $\\Rightarrow$ Optimize kernels and fuse operators $= >$ Find the input \nshape is critical to kernel performance \n• Collect pre-training corpora and tokenize $= >$ Use icetk: the sentence piece is set to the unigram mode \n• Debug the 3D pipeline parallel in the newly-released Megatron and DeepSpeed ", "bbox": [ 232, 279, 799, 327 ], "page_idx": 53 }, { "type": "text", "text": "2022.3 ", "text_level": 1, "bbox": [ 232, 333, 272, 343 ], "page_idx": 53 }, { "type": "text", "text": "• It can’t recover perfectly from checkpoints $= >$ Our customized dataloader do not save its state seed properly in distributed training \n• The memory per processor is too small $\\Rightarrow$ Require too many pipeline stages $= >$ Batch size is too large (up to $1 2 , 0 0 0 ) \\Rightarrow H a r m$ the model’s convergency \n• It can’t launch more than 2,000 computing nodes $\\Rightarrow$ Overcome this and support 6,000-node training by tuning Linux kernel TCP parameters \n• Collect data for multi-task instruction pre-training \n• Receive opportunities to test trainings on several other clusters \n• Very slow training speed than expected $= >$ The underlying element-wise operators don’t support fast computation on large-dimension vectors. ", "bbox": [ 232, 344, 794, 460 ], "page_idx": 53 }, { "type": "text", "text": "2022.4 ", "text_level": 1, "bbox": [ 205, 468, 272, 479 ], "page_idx": 53 }, { "type": "text", "text": "• Optimize A100 kernel’s computing efficiency $= >$ A100 kernels prefer square-shaped inputs, and seq_len=2,048 is optimal for our hidden-state dimension (12,288) \n• Inability to converge due to large gradient norms $( 1 7 0 + )$ of input embeddings ${ \\Rightarrow T r y }$ embedding norm and \ngradient shrink, which turn out to be almost equivalent \n• Naïve post-LN or pre-LN disconverges after several thousands of steps $\\Rightarrow T r y$ Sandwich-LN with PB-Relax \n• It still disconverges after one week’s trial $\\Rightarrow$ The dataloader state seeds are not unified for different pipeline stages, resulting in a mismatch of input data and labels. \n• Test two positional encodings: RoPE and Alibi $= >$ Alibi can be slower as it requires element-wise manipulation on attention matrices---changing num_heads \\*2,048 $^ *$ 2,048 scalars per layer \n• Test GeGLU and ${ \\mathsf { G A U } } \\ { \\mathsf { \\Omega } } \\Rightarrow { \\mathsf { G A U } }$ converges faster with relatively poor performance on fine-tuned SuperGLUE \n• Abnormal GPU memory usage of newly-added functions and classes $= >$ DeepSpeed hardcodes the function names for checkpoint activation \n• Decide to train GLM with 130 billion parameters $\\Rightarrow$ allow inference on a DGX-A100 40G node ", "bbox": [ 232, 481, 792, 632 ], "page_idx": 53 }, { "type": "text", "text": "2022.5-6 ", "text_level": 1, "bbox": [ 232, 640, 282, 650 ], "page_idx": 53 }, { "type": "text", "text": "• Implement a RoPE cuda operator in ${ \\mathsf { C } } + + = >$ See unexpected precision errors and finally have it abandoned \n• Sandwich-LN still disconverges $\\Longrightarrow 1$ ) Reducing learning rate does not help; 2) Using Hinge cross-entropy becomes slower and harms performance; 3) Shifting to DeepNorm still disconverges \n• Use FP32 in softmax of attention $\\Rightarrow$ Success \n• Find PB-Relax unnecessary for FP32 softmax $\\Rightarrow$ It also slows down training as it needs to manipulate the whole attention score matrices \n• Experience few spikes in later training $\\mathbf { \\Phi } = > \\mathbf { \\Phi } .$ 1) Reduce gradient shrink factor from 1 to 0.1: useful; 2) Reduce the learning rate: sometimes useful; 3) Jump the noisy data batches: sometimes useful \n• Find a mistake in multi-task data after training for 20,000 steps $= >$ Use the correct data but it does not forget ", "bbox": [ 232, 651, 808, 757 ], "page_idx": 53 }, { "type": "text", "text": "2022.6-7 ", "text_level": 1, "bbox": [ 232, 763, 282, 773 ], "page_idx": 53 }, { "type": "text", "text": "• Adapt the pipeline parallel checkpoints to ordinary parallel checkpoints for efficient inference on a single A100 \n• Work on evaluation scripts on datasets: MMLU, Big-bench, CLUE, SuperCLUE, etc. \n• Implement P-Tuning and P-Tuning v2 for parameter-efficient tuning on GLM-130B for tuning on SuperGLUE \n• Work with BMInf on adapting GLM-130B to perform inference on a single V100 or 3090 $\\Rightarrow$ Use pipeline-style asynchronous swapping between main memory and GPU memory \n• Try to fine-tune GLM-130B with fewer A100 nodes (i.e., 12-16 nodes) $= >$ Pipeline-style fails due to too many pipeline stages $= >$ Find that data parallel can not be introduced for fine-tuning $\\Rightarrow$ Use 32-way model parallel for fine-tuning with reasonable performance https://github.com/THUDM/GLM-130B ", "bbox": [ 232, 776, 813, 883 ], "page_idx": 53 }, { "type": "text", "text": "Figure 21: The timeline of major issues that training GLM-130B encountered and addressed, as of July 31st, 2022. ", "bbox": [ 173, 898, 826, 926 ], "page_idx": 53 }, { "type": "text", "text": "faces negligible performance degradation compared to its uncompressed original, while it consumes only $2 5 \\%$ of the GPU memory required by the uncompressed version, thus supporting its effective inference on $4 \\times \\mathrm { R T X } 3 0 9 0 1$ i (24G) or $8 \\times \\mathrm { R T X } 2 0 8 0 \\mathrm { T i }$ (11G). We will attempt to further reduce the resource requirements and keep the community updated on this important working item. ", "bbox": [ 174, 103, 823, 160 ], "page_idx": 54 }, { "type": "text", "text": "G BROADER IMPACT ", "text_level": 1, "bbox": [ 176, 180, 361, 196 ], "page_idx": 54 }, { "type": "text", "text": "This paper introduces an open bilingual pre-trained language model with 130 billion parameters. Currently most pre-trained language models with over 100 billion parameters are privately owned by governments and large corporations (Brown et al., 2020; Thoppilan et al., 2022; Rae et al., 2021; Chowdhery et al., 2022; Wang et al., 2021). A few of them (Brown et al., 2020; Lieber et al., 2021) provide limited inference APIs with fees. In contrast, the weights and code of GLM-130B are open to anyone who is interested in LLMs. Moreover, we significantly lower the hardware requirements for inference by speed-up implementation and INT4 quantization. The paper can have a broader impact on the research community, individual developers and small companies, and society. ", "bbox": [ 174, 212, 825, 324 ], "page_idx": 54 }, { "type": "text", "text": "G.1 IMPACT ON AI RESEARCH ", "text_level": 1, "bbox": [ 176, 342, 400, 356 ], "page_idx": 54 }, { "type": "text", "text": "Most research institutions cannot afford the substantial cost of pretraining large language models. As a result, most researchers, except employees of governments and large corporations, only have access to the limited inference APIs with fees. With the inference APIs, researchers can only analyze the outputs of models as black boxes, which limits the scope of potential work. With GLM-130B, researchers can analyze the model parameters and internal states corresponding to specific inputs, leading to in-depth studies of LLMs’ theory, capacity, and flaws. Researchers can also modify the model architecture and weights, to validate the proposed algorithms to improve LLMs Zhu et al. (2020); Cao et al. (2021); Hase et al. (2021); Mitchell et al. (2022). ", "bbox": [ 174, 368, 825, 479 ], "page_idx": 54 }, { "type": "text", "text": "With INT4 quantization, GLM-130B can perform inference on popularized GPUs such as $4 \\times \\mathrm { R T X }$ 3090 or $8 \\times \\mathrm { R T X } 2 0 8 0 \\mathrm { T i }$ , which can be easily accessed from cloud service. As a result, researchers who cannot afford powerful data-center GPU servers like DGX-A100 can also utilize GLM-130B. ", "bbox": [ 176, 486, 825, 529 ], "page_idx": 54 }, { "type": "text", "text": "G.2 IMPACT ON INDIVIDUAL DEVELOPERS AND SMALL COMPANIES", "text_level": 1, "bbox": [ 176, 546, 660, 560 ], "page_idx": 54 }, { "type": "text", "text": "Currently, individual developers and small companies who want to integrate LLMs into their business can only choose paid inference APIs. The increased cost can hinder their attempts. Instead, GLM-130B can be deployed on popularized hardware that they own or can access via cloud service to reduce the cost. Furthermore, they can utilize distillation techniques Sanh et al. (2019); Jiao et al. (2020) to obtain smaller models that preserve comparable performance on their specific tasks. While some developers may lack the ability to complete deployment and distillation on their own, we believe with GLM-130B and more open LLMs in the future, the corresponding toolkits and service providers will become more available. ", "bbox": [ 174, 571, 825, 684 ], "page_idx": 54 }, { "type": "text", "text": "We also note that currently most applications of LLMs are based on prompt engineering, partly due to the limitation of inference APIs. In downstream scenarios such as online customer service, the companies accumulate huge amounts of human-generated data that contain domain knowledge. With the open-source weights and code, developers can finetune GLM-130B on their own data to mitigate the gap of domain knowledge. ", "bbox": [ 176, 690, 825, 761 ], "page_idx": 54 }, { "type": "text", "text": "G.3 SOCIAL IMPACT ", "text_level": 1, "bbox": [ 176, 779, 330, 792 ], "page_idx": 54 }, { "type": "text", "text": "Large language models, together with other machine learning models in different modalities (e.g., Image (Ramesh et al., 2021; Ding et al., 2021; Saharia et al.) and Video (Hong et al., 2022)), could be used to generate synthetic text for harmful applications, such as telemarketing fraud, political propaganda, and personal harassment as is discussed in (Weidinger et al., 2021; Sheng et al., 2021; Dev et al., 2021). We do not anticipate any hazardous outputs, especially towards vulnerable and historically disadvantaged groups of people, after using the model. ", "bbox": [ 174, 805, 823, 888 ], "page_idx": 54 }, { "type": "text", "text": "While some people think that restricting access to LLMs can prevent such harmful applications, we argue that promoting LLM inclusivity can lead to better defense against potential harm caused by ", "bbox": [ 174, 895, 821, 924 ], "page_idx": 54 }, { "type": "text", "text": "LLMs. Currently, only governments and large corporations can afford the considerable costs of pretraining LLMs. There is no guarantee that organizations having the substantial financial resources to pretrain an LLM will not do harm with it. Without access to such LLMs, individuals cannot even realize the role of LLMs in harm. Conversely, releasing an open LLM can provide access and transparency to all the researchers and promote the research to reduce the potential harm of LLMs, like algorithms to identify the synthetic text Gehrmann et al. (2019) or detect fake news Li et al. (2021). ", "bbox": [ 173, 103, 825, 200 ], "page_idx": 55 }, { "type": "text", "text": "Also, it is known that LLMs can suffer from problems in fairness, bias, privacy, and truthfulness Zhang et al. (2021); Lin et al. (2022); Liang et al. (2021); Bender et al. (2021). An open LLM can reveal the model parameters and internal states corresponding to specific inputs instead of providing APIs to black-box models. In conclusion, researchers can conduct analysis of LLMs’ flaws in depth and propose improved algorithms to solve the problems. ", "bbox": [ 174, 208, 823, 279 ], "page_idx": 55 }, { "type": "text", "text": "H ENVIRONMENTAL IMPACT ", "text_level": 1, "bbox": [ 176, 297, 426, 314 ], "page_idx": 55 }, { "type": "text", "text": "One of the major concerns about large language models is their huge energy usage and associated carbon emissions Strubell et al. (2019); Lacoste et al. (2019); Patterson et al. (2021); Bender et al. (2021). GPT-3 was estimated to use 500 tons of carbon emissions footprint (CO2eq) Patterson et al. (2021). We consumed a total of 442.4MWh of electricity over the 60-day course of training. Given the $0 . 5 8 1 0 \\mathrm { ~ k g / k W h }$ carbon efficiency of local power grid, the pre-training released 257.01 metric tons of $\\mathrm { C O _ { 2 } }$ . This is around half of GPT-3’s carbon footprint, probably due to the efficient parallel strategies and NVIDIA’s hardware improvements. The carbon emission is roughly the equivalent of the yearly emissions of 18 average Americans. However, we believe that with GLM-130B released, more carbon emissions for reproducing 100B-scale LLMs can be saved. ", "bbox": [ 174, 329, 825, 454 ], "page_idx": 55 } ]