Text Understanding from Scratch

Xiang Zhang, Yann LeCunarXiv 2015

Introduction

Traditional Natural Language Processing (NLP) has long relied on engineered features at the word, phrase, or sentence level. Whether using Bag-of-Words (BoW) models or modern word embeddings like word2vec, the standard pipeline necessitates a predefined vocabulary and language-specific preprocessing. This paper challenges that paradigm by demonstrating that deep temporal Convolutional Networks (ConvNets) can achieve state-of-the-art performance by learning directly from raw character sequences. By treating text as a signal similar to pixels in an image, the model learns hierarchical linguistic structures without any prior knowledge of words, syntax, or semantics.

Model Architecture

The core of the proposed system is a deep 1D Convolutional Neural Network designed to process quantized character sequences.

Character Quantization

Input text is first converted into a sequence of characters from a fixed alphabet of 70 characters, including letters, digits, and punctuation. Each character is represented via a 1-of-$m$ (one-hot) encoding. To facilitate the association of correlations in the final fully connected layers, the input sequence is processed in reverse order.

Temporal ConvNets and Max-Pooling

The architecture consists of nine layers: six convolutional layers followed by three fully connected layers. To enable the training of such deep networks on text, the authors employ 1D max-pooling, a technique borrowed from computer vision that allows the network to capture increasingly abstract features across different temporal scales.

Overview of the character-level temporal Convolutional Network architecture, showing the pipeline from quantization to fully-connected layers.

Large-Scale Datasets

A key finding of the study is that learning "from scratch" requires significant amounts of data. To this end, the authors introduced several large-scale datasets that have since become benchmarks:

  • DBpedia Ontology: 560,000 samples for classification.
  • Amazon Reviews: Over 3 million samples for sentiment analysis (both 5-star and binary polarity).
  • Yahoo! Answers: 1.4 million samples across 10 topic categories.
  • Sogou News: A Chinese dataset processed via Pinyin to demonstrate the model's language-agnostic nature.

Results and Discussion

The character-level ConvNets consistently outperformed traditional baselines like BoW and word2vec on large-scale datasets. For instance, on the Amazon Polarity dataset, the ConvNet achieved 95.07% accuracy, significantly higher than the 89.86% achieved by BoW.

Language Agnosticism and Feature Learning

The model's success on Pinyin-encoded Chinese news (95.12% accuracy) proves that the architecture is not tied to English grammar. Visualizations of the first-layer weights suggest that the network naturally learns to distinguish between various character types, effectively "discovering" the concept of words and their statistical relationships.

Confusion matrices for the training and testing phases on the Yahoo! Answers topic classification dataset, illustrating the model's ability to distinguish between 10 distinct categories.

Data Augmentation

To improve generalization, the authors introduced a novel augmentation technique: replacing words with their synonyms using a thesaurus. This method provided a consistent performance boost, helping the model overcome the lack of inherent spatial transformations available in text data.

Conclusion

This research demonstrates that deep ConvNets can master text understanding from the ground up. By bypassing traditional word-level engineering, these models offer a flexible, language-agnostic approach to NLP. While they require massive datasets to avoid overfitting, their ability to learn hierarchical features directly from characters marks a significant shift toward end-to-end learning in text processing.

Summary updated

BibTeX
@misc{zhang2015text,
  author = {Xiang Zhang and Yann LeCun},
  title = {{Text Understanding from Scratch}},
  year = {2015},
  eprint = {1502.01710},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1502.01710},
}
Figure