SEGMENT+: Long Text Processing with Short-Context Language Models

Wei Shi,Shuang Li,Kerun Yu,Jinglei Chen,Zujie Liang,Xinhui Wu,Yuxi Qian,Feng Wei,Bo Zheng,Jiaqing Liang,Jiangjie Chen,Yanghua Xiao
2024-10-09
Abstract:There is a growing interest in expanding the input capacity of language models (LMs) across various domains. However, simply increasing the context window does not guarantee robust performance across diverse long-input processing tasks, such as understanding extensive documents and extracting detailed information from lengthy and noisy data. In response, we introduce SEGMENT+, a general framework that enables LMs to handle extended inputs within limited context windows efficiently. SEGMENT+ utilizes structured notes and a filtering module to manage information flow, resulting in a system that is both controllable and interpretable. Our extensive experiments across various model sizes, focusing on long-document question-answering and Needle-in-a-Haystack tasks, demonstrate the effectiveness of SEGMENT+ in improving performance.
Computation and Language
What problem does this paper attempt to address?
The problem that this paper attempts to solve is the challenges faced by language models (LMs) when processing long texts. Although the input capacity can be expanded to a certain extent by simply increasing the size of the context window, this does not guarantee robust performance in handling various long - input tasks. Specifically, these tasks include understanding long - form documents, extracting detailed information from long and noisy data, etc. Therefore, the paper proposes a general framework - **SEGMENT+**, aiming to enable language models to efficiently process extended inputs within a limited context window. ### Main Problems 1. **Challenges in Long - Text Processing**: - Simply increasing the context window size cannot guarantee robust performance in multiple long - input tasks. - Tasks such as long - document question - answering, long - term memory maintenance, and processing long and noisy contexts pose unique challenges to language models. 2. **Limitations of Existing Methods**: - **Traditional Retrieval Methods**: Although simple and fast, they are prone to missing details and introducing noise in tasks that require multiple pieces of information. - **Long - Context Language Models**: Although they attempt to expand the context window through techniques such as position interpolation and continuous pre - training, they are limited by data quality and the feasible window size, and perform poorly when handling queries where key information is scattered across a large amount of text. - **Memory Management Methods**: They process long texts step by step, but rely on the model's inherent ability to plan and make spontaneous decisions, resulting in an uncontrollable reasoning process and noisy free - form text expressions. ### Solutions The **SEGMENT+** framework solves the above problems in the following ways: 1. **Two - Stage Processing**: - **First Stage**: Gather information from different parts and generate structured notes consisting of two parts: "evidence" and "reasoning". - **Second Stage**: Filter out useless notes, merge the remaining notes in batches in order, and finally generate a context suitable for the final answer. 2. **Information Flow Control**: - **Evidence Component**: Used to collect original sentences, focusing on precision. - **Reasoning Component**: Helps the model compress the context into high - level semantic information, focusing on recall. - In this way, the entire process is both controllable and interpretable. 3. **Adaptation to Different Models and Tasks**: - **Small Models**: Significantly improve performance through structured information collection and control. - **Large Models**: Achieve significant performance improvements by combining carefully designed reasoning patterns and enhanced computing power. ### Experimental Verification The paper verifies the effectiveness of **SEGMENT+** through two main experiments: 1. **Long - Document Question - Answering**: - Use multiple benchmark datasets (such as Qasper, MSQ, HQA, NQA, QLTY) to evaluate the ability of **SEGMENT+** in compressing reading contexts and efficiently merging information. - The results show that **SEGMENT+** performs well on multiple models and datasets, especially when using GPT - 4 and ChatGPT, its performance is significantly better than the baseline models. 2. **Needle - in - a - Haystack Task**: - Adopt the Babilong benchmark to test the model's ability to process distributed facts and perform reasoning to obtain the final answer. - The results indicate that **SEGMENT+** can effectively cope with the challenges brought by the increase in input length and maintain stable performance. In conclusion, **SEGMENT+** significantly improves the performance and robustness of language models in long - text processing tasks through structured information collection and controllable information flow management.