Sentence and Document Representation Learning

Ning Ding, Yankai Lin, Zhiyuan Liu, Maosong SunOpenalex Unknown 2023 · OpenAlex

Abstract

Sentence and document are high-level linguistic units of natural languages. Representation learning of sentences and documents remains a core and challenging task because many important applications of natural language processing (NLP) lie in understanding sentences and documents. This chapter first introduces symbolic methods to sentence and document representation learning. Then we extensively introduce neural network-based methods for the far-reaching language modeling task, including feed-forward neural networks, convolutional neural networks, recurrent neural networks, and Transformers. Regarding the characteristics of a document consisting of multiple sentences, we particularly introduce memory-based and hierarchical approaches to document representation learning. Finally, we present representative applications of sentence and document representation, including text classification, sequence labeling, reading comprehension, question answering, information retrieval, and sequence-to-sequence generation.

Introduction

While word-level embeddings like Word2Vec and GloVe revolutionized NLP by capturing semantic relationships between individual tokens, real-world communication relies on higher-level structures: sentences and documents. A sentence is not merely a collection of words; it possesses syntactic structure and sequential logic. Similarly, a document is a complex hierarchy of sentences that must maintain coherence and context over long spans. This paper explores the evolution of representation learning from simple symbolic counts to sophisticated neural architectures designed to capture these multi-level dependencies.

Methodology: From Symbolic to Neural Representations

Symbolic Foundations

Early methods for representing text relied on symbolic approaches. The Bag-of-Words (BoW) and TF-IDF models represent text as sparse, high-dimensional vectors. While effective for simple classification, they ignore word order and semantic similarity. N-gram models attempted to address this by capturing local context (e.g., predicting a word based on its immediate predecessors), but they still lacked the ability to generalize across similar meanings.

Neural Sentence Modeling

The transition to neural networks allowed for dense, continuous representations that could capture context more effectively than symbolic methods.

  • Feed-forward Neural Networks (FFNNs): These models process a fixed-size window of words to predict the next word, creating a basic latent representation of the context.
Feed-forward neural network architecture
  • Convolutional Neural Networks (CNNs): CNNs utilize sliding kernels to extract hierarchical features from sentences, effectively capturing local patterns regardless of their position.
Convolutional neural network architecture
  • Recurrent Neural Networks (RNNs): Architectures like LSTMs and GRUs were designed for sequential data, maintaining a hidden state to process dependencies. However, they often struggle with long-range information loss.
  • Transformers: The current state-of-the-art, Transformers use self-attention to process all tokens in a sentence simultaneously, allowing for the modeling of global dependencies without the sequential bottleneck of RNNs.

Document-Level Architectures

Documents present unique challenges, such as the need for long-term memory and hierarchical understanding.

  • Memory-Based Approaches: Models like Paragraph Vector (Doc2Vec) and Memory Networks use dedicated modules to store and retrieve context across long texts, mimicking human cognitive processes.
  • Hierarchical Modeling: The Hierarchical Attention Network (HAN) mirrors the structure of language by first encoding words into sentence representations and then encoding those sentences into a document representation, applying attention at both levels to identify the most salient information.

Key Insights

  1. The Hierarchy of Language: Documents should be treated as structured sequences of sentences, not just long strings of words. Hierarchical models are inherently better at capturing this logic.
  2. Dynamic Attention: The shift from fixed vectors to attention mechanisms allows models to focus on relevant parts of the input, filtering out noise in long documents.
  3. Semantic Matching: Neural representations have enabled a shift in Information Retrieval from lexical keyword matching to intent-based semantic matching.

Future Directions and Limitations

Despite significant progress, challenges remain. The quadratic complexity of standard Transformers makes them computationally expensive for very long documents. There is also a need for more robust evaluation metrics for generative tasks, as current metrics like ROUGE often fail to capture human-like coherence. Finally, the field is increasingly moving toward massive pre-trained models (e.g., BERT, GPT) as universal backbones for diverse NLP tasks.

Summary updated

Abstract

Abstract Sentence and document are high-level linguistic units of natural languages. Representation learning of sentences and documents remains a core and challenging task because many important applications of natural language processing (NLP) lie in understanding sentences and documents. This chapter first introduces symbolic methods to sentence and document representation learning. Then we extensively introduce neural network-based methods for the far-reaching language modeling task, including feed-forward neural networks, convolutional neural networks, recurrent neural networks, and Transformers. Regarding the characteristics of a document consisting of multiple sentences, we particularly introduce memory-based and hierarchical approaches to document representation learning. Finally, we present representative applications of sentence and document representation, including text classification, sequence labeling, reading comprehension, question answering, information retrieval, and sequence-to-sequence generation.
BibTeX
@inproceedings{ding2023sentence,
  author = {Ning Ding and Yankai Lin and Zhiyuan Liu and Maosong Sun},
  title = {{Sentence and Document Representation Learning}},
  booktitle = {Openalex Unknown},
  year = {2023},
  doi = {10.1007/978-981-99-1600-9\_4},
}
Figure