{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/ernie-doc-the-retrospective-long-document","title":"ERNIE-Doc: A Retrospective Long-Document Modeling Transformer","arxiv_id":"2012.15688","date":"2020-12-31","proceeding":"ACL 2021 5","authors":["Siyu Ding","Junyuan Shang","Shuohuan Wang","Yu Sun","Hao Tian","Hua Wu","Haifeng Wang"],"abstract":"Transformers are not suited for processing long documents, due to their quadratically increasing memory and time consumption. Simply truncating a long document or applying the sparse attention mechanism will incur the context fragmentation problem or lead to an inferior modeling capability against comparable model sizes. In this paper, we propose ERNIE-Doc, a document-level language pretraining model based on Recurrence Transformers. Two well-designed techniques, namely the retrospective feed mechanism and the enhanced recurrence mechanism, enable ERNIE-Doc, which has a much longer effective context length, to capture the contextual information of a complete document. We pretrain ERNIE-Doc to explicitly learn the relationships among segments with an additional document-aware segment-reordering objective. Various experiments were conducted on both English and Chinese document-level tasks. ERNIE-Doc improved the state-of-the-art language modeling result of perplexity to 16.8 on WikiText-103. Moreover, it outperformed competitive pretraining models by a large margin on most language understanding tasks, such as text classification and question answering.","url_abs":"https://arxiv.org/abs/2012.15688v2","url_pdf":"https://arxiv.org/pdf/2012.15688v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"ernie-doc-the-retrospective-long-document","repo_url":"https://github.com/PaddlePaddle/PaddleNLP/tree/develop/paddlenlp/transformers/ernie_doc","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"paddle","reach":null},{"paper_slug":"ernie-doc-the-retrospective-long-document","repo_url":"https://github.com/JunnYu/x-transformers-paddle","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"sentiment-analysis","task_name":"Sentiment Analysis"},{"task_slug":"text-classification","task_name":"Text Classification"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/text-classification-on-imdb","task":"Text Classification","dataset":"IMDb","model":"ERNIE-Doc","rank_in_archive_order":10,"of":13,"metrics":{},"uses_additional_data":false},{"leaderboard":"/sota/text-classification-on-imdb","task":"Text Classification","dataset":"IMDb","model":"ERNIE-Doc-Large","rank_in_archive_order":11,"of":13,"metrics":{},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2012.15688","mcp":null,"developers":"https://syntology.ai/developers"},"arxiv_metadata":null,"syntology_extracted_results":null}