Abstract
Document classification has traditionally relied on word-level representations, which often struggle with statistical inefficiency and out-of-vocabulary (OOV) words. Character-level models address these issues but often require extremely deep convolutional architectures to capture long-range dependencies, leading to high parameter counts. We propose a hybrid architecture that combines convolutional layers for local feature extraction with a recurrent layer for global context. Validated on eight large-scale datasets, our model achieves comparable or superior performance to state-of-the-art deep CNNs while using significantly fewer parameters.
Introduction
Most document classification systems operate at the word level. However, this approach faces two major hurdles: statistical inefficiency, where morphologically related words (e.g., "compute" and "computation") are treated as distinct, and the "unknown" word problem, where models fail on typos or rare tokens.
Character-level models solve these issues by treating text as a sequence of characters. While effective, previous state-of-the-art character-level models relied on very deep convolutional networks (6+ layers) to capture long-range context. These deep CNNs are parameter-heavy and can lose detailed local information through repeated pooling. This research explores a more efficient hybrid approach.
Methodology: The ConvRec Architecture
The proposed architecture, referred to as ConvRec, processes text in four distinct stages to balance local feature extraction with global sequence modeling.
- Embedding Layer: Maps each character into a low-dimensional continuous vector space.
- Convolutional Layers: A small number of CNN layers (2 to 5) extract local features, effectively acting as character n-gram detectors. Max-pooling is used to reduce the sequence length.
- Recurrent Layer: A single bidirectional LSTM (Long Short-Term Memory) layer processes the downsampled sequence. By placing the RNN after the CNN has "compressed" the text, it can efficiently capture global dependencies across the entire document without the computational burden of processing raw character sequences.
- Classification Layer: The final hidden states of the RNN are concatenated and fed into a softmax layer for category prediction.
This synergy allows CNNs to handle parallelizable local feature extraction while the RNN manages the sequential understanding of the document's overall structure.
Datasets and Evaluation
The model was evaluated on eight large-scale datasets covering news categorization, ontology classification, sentiment analysis, and question-type classification.
These datasets provide a robust benchmark, with training sizes reaching up to 3.6 million samples and varying numbers of classes (from 2 to 14).
Key Insights and Results
The hybrid model demonstrates that "less is more" regarding parameter efficiency.
- Massive Parameter Reduction: On the DBPedia task, the hybrid model uses only 0.3M parameters, compared to the 27M parameters required by a CNN-only baseline, while achieving better accuracy.
- Information Preservation: Deep CNNs with many pooling layers can "wash away" fine-grained local information. The hybrid model requires fewer pooling stages, which appears to improve performance on tasks with many classes (like DBPedia’s 14 categories).
- Optimal Depth: Performance typically peaks at 2 or 3 convolutional layers. Adding more layers often decreases accuracy, suggesting an optimal level of abstraction for the subsequent recurrent layer.
- Generalization: The compact architecture is less prone to overfitting, allowing it to generalize better even when training data is relatively limited.
Conclusion
By combining the strengths of convolutional and recurrent layers, the ConvRec architecture provides a highly efficient alternative to deep CNNs for character-level text classification. It achieves state-of-the-art results with a fraction of the parameters (often less than 2%), making it suitable for large-scale applications where computational efficiency is paramount. Future work may extend this hybrid approach to other domains such as machine translation or image segmentation.
Summary updated