Sentence Representation

Zhiyuan Liu, Yankai Lin, Maosong SunOpenalex Unknown 2020 · OpenAlex

Abstract

Sentence representation is a core task in natural language processing (NLP), as it serves as the foundation for applications such as summarization, machine translation, sentiment analysis, and dialogue systems. The goal is to encode semantic information into a real-valued representation vector for downstream classification or matching. This chapter explores the evolution of these techniques, from traditional one-hot and n-gram models to modern deep neural networks, including Convolutional Neural Networks (CNNs), Recurrent Neural Networks (RNNs), Transformers, and pre-trained language models (PLMs).

Introduction

While representing individual words is a foundational task, sentences present a unique challenge: they are not merely "bags of words." They possess complex sequential and hierarchical structures where word order and inter-word relationships significantly alter meaning.

Early methods like One-Hot encoding and TF-IDF suffered from the "curse of dimensionality," resulting in vectors millions of dimensions long with extreme sparsity. More critically, these statistical approaches ignored word order entirely. Modern deep learning addresses these gaps by creating low-dimensional, dense "embeddings" that capture nuanced semantic relationships within a sentence.

Evolution of Representation Methods

The transition from statistical to neural models can be categorized into four primary stages:

1. Statistical Models

These include one-hot representations and n-gram probabilistic models. These rely on the Markov assumption—that the probability of the next word depends only on the preceding $n-1$ words—which limits their ability to capture long-range dependencies.

2. Basic Neural Architectures

  • Convolutional Neural Networks (CNNs): CNNs utilize sliding filters to extract local features, such as n-gram phrases, from the input representation. As shown in the architecture below, these features are then aggregated via max-pooling to form a fixed-length sentence vector.
The architecture of a CNN for sentence representation, featuring convolution and max-pooling layers.
  • Recurrent Neural Networks (RNNs): RNNs, including variants like Long Short-Term Memory (LSTM) and Gated Recurrent Units (GRU), process sentences word-by-word. This sequential processing allows the model to maintain a "hidden state" or memory of the sequence, making them naturally suited for arbitrary sentence lengths.
Architectures of RNNs, including unrolled units and detailed LSTM/GRU cell structures.

3. The Transformer Era

The field has largely moved away from recurrence toward Attention mechanisms. The Transformer architecture allows for parallel processing of text and better captures long-range dependencies between words, regardless of their distance in a sentence, by calculating attention scores across all word pairs simultaneously.

4. Pre-trained Language Models (PLMs)

Models like GPT (generative/unidirectional) and BERT (bidirectional/masked) learn general linguistic knowledge from massive unlabeled datasets. These models are then "fine-tuned" for specific tasks, providing a significant performance boost over training from scratch.

Key Insights and Benchmarks

A major breakthrough in the field was the shift from static to contextual representations. In a PLM, the representation of a word like "bank" changes dynamically depending on whether the surrounding context refers to a river or a financial institution.

Researchers evaluate these models using several key benchmarks:

  • GLUE & SQuAD: These benchmarks demonstrated the massive performance leaps enabled by BERT, which achieved state-of-the-art results on 17 different NLP tasks upon release.
  • DocRED: A large-scale dataset for Document-level Relation Extraction, highlighting that roughly 40.7% of relational facts in documents like Wikipedia require reasoning across multiple sentences.
  • FewRel: A specialized dataset for Few-shot Relation Extraction, testing a model's ability to generalize from very few examples.

Key Results and Comparative Analysis

  • RNN vs. CNN: Generally, RNN-based models outperform CNNs for language modeling because they are better suited for the sequential nature of text and handle varying sentence lengths more gracefully.
  • Efficiency Trade-offs: While hierarchical neural networks (which model the tree-like structure of grammar) offer theoretical speedups, they often underperform compared to standard models because rigid hierarchical architectures can negatively influence word classification.

Limitations and Future Directions

Despite recent progress, three critical frontiers remain:

  1. Computational Efficiency: Current Transformer-based PLMs are resource-intensive. Future research focuses on model compression techniques like knowledge distillation and parameter pruning.
  2. Long-Document Modeling: Standard Transformers have a fixed-length context window. New architectures like Transformer-XL are being developed to handle long-form text without information loss.
  3. Cognitive Plausibility: There is growing interest in incorporating human-like cognitive mechanisms into neural models to improve robustness and interpretability.

Summary updated

Abstract

Abstract Sentence is an important linguistic unit of natural language. Sentence Representation has remained as a core task in natural language processing, because many important applications in related fields lie on understanding sentences, for example, summarization, machine translation, sentiment analysis, and dialogue system. Sentence representation aims to encode the semantic information into a real-valued representation vector, which will be utilized in further sentence classification or matching tasks. With large-scale text data available on the Internet and recent advances on deep neural networks, researchers tend to employ neural networks (e.g., convolutional neural networks and recurrent neural networks) to learn low-dimensional sentence representations and achieve great progress on relevant tasks. In this chapter, we first introduce the one-hot representation for sentences and the n -gram sentence representation (i.e., probabilistic language model). Then we extensively introduce neural-based models for sentence modeling, including feedforward neural network, convolutional neural network, recurrent neural network, and the latest Transformer, and pre-trained language models. Finally, we introduce several typical applications of sentence representations.
BibTeX
@inproceedings{liu2020sentence,
  author = {Zhiyuan Liu and Yankai Lin and Maosong Sun},
  title = {{Sentence Representation}},
  booktitle = {Openalex Unknown},
  year = {2020},
  doi = {10.1007/978-981-15-5573-2\_4},
}
Figure