# Convolutional Neural Networks for Sentence Classification

Pre-trained word vectors let a simple CNN classify sentences well

Yoon Kim · arXiv · 2014-8-25

- **Problem** Randomly initialized word vectors leave a CNN weak on small labelled sentence datasets. Learning good vectors from so little labelled text is hard.
- **Method** CNN-static is a simple CNN with one-layer convolutions over word2vec vectors that stay fixed. Max-over-time pooling and dropout feed a softmax layer, and a second variant fine-tunes the vectors.
- **Results** CNN-static scored 86.8 on SST-2, compared with 82.7 for the randomly initialized CNN-rand.

## Why random word vectors fall short

Sentence classifiers begin with word vectors, which are dense representations in which semantically close words sit close together. Learning those vectors from a small labelled set is hard, which is why borrowing vectors from an unsupervised model is attractive when a large supervised set is missing. The baseline shows the cost: with every word randomly initialized and tuned only on the task, the CNN does not perform well on its own.

The authors had expected gains from pre-trained vectors but were surprised by how large they turned out to be.

So the open question is whether vectors from an unsupervised model can carry one simple CNN across different sentence tasks.

## A one-layer CNN over word vectors

The core idea is to treat a sentence as a stack of word vectors and slide small filters over it, so that each filter responds to one short run of words wherever that run appears. A sentence of length n becomes a matrix with one row per word, where each row is a k-dimensional vector, and each filter covers a window of h consecutive words. Each window yields one feature, \\(c\_i = f(w \\cdot x\_{i:i+h-1} + b)\\), where w is the filter, b is a bias and f is a non-linear function.

The paper gives the hyperbolic tangent as its example of f, but its experiments use rectified linear units.

Applying one filter to every window yields a feature map, and max-over-time pooling keeps only its largest value as that filter's feature. Because each filter contributes a single value whatever the sentence length, sentences of different lengths fit the same model. The pooled features from all filters form the penultimate layer, and a fully connected softmax layer turns them into a probability distribution over labels.

The experiments use 100 feature maps for each window size of 3, 4 and 5.

The multichannel variant places the word vectors in two channels, and each filter is applied to both channels with the results added before the bias. Gradients flow back through only one channel, so one set of vectors is fine-tuned while the other stays static, and both start from word2vec.

## Regularization and training settings

Dropout is applied to the penultimate layer, where each unit is kept with probability \\(p\\) during training and the rest are masked out. The masked output is \\\[ y = w \\cdot (z \\circ r) + b \\\] where r is a vector of Bernoulli variables, so gradients pass only through the units that are kept. At test time the learned weights are scaled by \\(p\\) and used without dropout, and the setting is \\(p = 0.5\\) on all datasets.

The model also caps the weight vectors: after each gradient step, a weight vector is rescaled to l2-norm \\(s\\) whenever its norm exceeds \\(s\\). Here \\(s = 3\\) on every dataset, which limits how large the weights can grow while leaving smaller vectors untouched.

Training runs stochastic gradient descent over shuffled mini-batches of 50, with Adadelta as the update rule. Early stopping on dev sets is the only per-dataset tuning, and a grid search on the SST-2 dev set chose the shared values. Datasets without a standard dev set hold out a random 10% of their training data for development.

## Static versus fine-tuned vectors on seven benchmarks

Switching from random to pre-trained vectors raised the score on MR from 76.1 for CNN-rand to 81.0 for CNN-static. On SST-2 the same switch moved the score from 82.7 to 86.8, while SST-1 barely changed, from 45.0 to 45.5.

CNN-static also holds up against methods that need more machinery, such as complex pooling or parse trees. On SST-2 it scored 86.8, the same as DCNN and above the 85.4 of RNTN. The authors read this as evidence that the pre-trained vectors work as general features across datasets.

Fine-tuning helped on most datasets: on SST-1 the score moved from 45.5 to 48.0, and on TREC it went from 92.8 to 93.6. It did not help everywhere, since CR fell from 84.7 for CNN-static to 84.3 for CNN-non-static. Each cell gives a single score with no spread, so gaps of a few tenths are hard to read.

The multichannel model scored 88.1 on SST-2 and 85.0 on CR, the highest of the CNN variants in those columns. On SST-1 it scored 47.4, below the 48.0 of CNN-non-static, so the two-channel design did not win on every dataset.

## Capacity and dropout effects

Kalchbrenner et al. report 37.4% on SST-1 for Max-TDNN with randomly initialized words, compared to 45.0 for CNN-rand here. The 37.4% is the cited figure, not a rerun under this paper's settings. The authors attribute the gap to their CNN having more capacity, with multiple filter widths and feature maps. The paper reports no controlled run that isolates that capacity effect.

Dropout was a strong regularizer in the authors' experiments, adding 2%–4% relative performance. Because of this, they were comfortable using a larger than necessary network and letting dropout regularize it.

## What fine-tuning changes in the vectors

Table 3 lists nearest neighbours by cosine similarity for the static channel and the fine-tuned non-static channel of the multichannel model on SST-2. In word2vec good is most similar to bad, presumably because the two are nearly syntactically equivalent. After fine-tuning on SST-2, good is no longer most similar to bad. The authors argue that good is closer to nice than to great for expressing sentiment, and say the learned vectors reflect this.

Tokens absent from word2vec start random and become more meaningful through fine-tuning. The authors read the neighbour lists as showing exclamation marks linked to effusive expressions and commas linked to conjunctive use.

## Open problems in the multichannel design

The multichannel results are mixed, so the authors treat regularizing the fine-tuning step as an open problem. They suggest keeping one channel and adding extra dimensions that can be modified during training as one route forward.

In brief tests, Wikipedia vectors from Collobert et al. did worse than word2vec. It isn't clear whether that gap comes from the architecture or from the Google News corpus. Four datasets, MR, Subj, CR and MPQA, have no standard split and use 10-fold cross-validation.

## Paper info

- **Authors**: Yoon Kim
- **Venue**: arXiv · Preprint
- **First published**: 2014-8-25
- **Added**: 2026-11-11
- **Updated**: 2014-9-3
- **Version**: v2
- **arXiv**: 1408.5882
- **Category**: cs.CL · cs.NE
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1408.5882v2) · [PDF ↗](https://arxiv.org/pdf/1408.5882v2)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Yoon Kim (2014). Convolutional Neural Networks for Sentence Classification. arXiv:1408.5882v2. https://arxiv.org/abs/1408.5882v2

**BibTeX**

```
@misc{kim2014convolutional,
  title = {{Convolutional Neural Networks for Sentence Classification}},
  author = {Yoon Kim},
  year = {2014},
  eprint = {1408.5882},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1408.5882v2}
}
```

## Other paper commentary

- [Deep Learning in Neural Networks: An Overview](https://refivu.com/en/papers/fc7c2f1e-9030-4a55-892b-82a89ff398b7-deep-learning-in-neural-networks-an-overview.md)
- [Two-Stream Convolutional Networks for Action Recognition in Videos](https://refivu.com/en/papers/d621dee0-0b2a-45a8-b152-6260b98f0db4-two-stream-convolutional-networks-for-action-recognition-in.md)
- [Glow: Generative Flow with Invertible 1x1 Convolutions](https://refivu.com/en/papers/fb9c5b80-a221-4385-8910-2ae4413b604b-glow-generative-flow-with-invertible-1x1-convolutions.md)
- [Density estimation using Real NVP](https://refivu.com/en/papers/6e98cc2c-51ae-4105-a052-60a312be9b3d-density-estimation-using-real-nvp.md)
- [Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks](https://refivu.com/en/papers/f9c68dd2-7de8-40fa-9eb6-ea62d8856b71-model-agnostic-meta-learning-for-fast-adaptation-of.md)
- [BEHRT: Transformer for Electronic Health Records](https://refivu.com/en/papers/cadb146f-6d4d-4255-8058-89ac62ed2dc8-behrt-transformer-for-electronic-health-records.md)
- [A Survey on Deep Learning in Medical Image Analysis](https://refivu.com/en/papers/4d173b56-9ea6-4644-98f2-af1794e63965-a-survey-on-deep-learning-in-medical-image.md)
- [The Unreasonable Effectiveness of Deep Features as a Perceptual Metric](https://refivu.com/en/papers/7a2a39ad-a72d-46f5-b96c-8392e55b66ee-the-unreasonable-effectiveness-of-deep-features-as-a.md)
- [Qwen3 Technical Report](https://refivu.com/en/papers/efd0e142-cc80-4bf8-b7fa-33c525cf374d-qwen3-technical-report.md)
- [YOLOv4: Optimal Speed and Accuracy of Object Detection](https://refivu.com/en/papers/3320d624-7e40-4d1e-b251-49a39602a21c-yolov4-optimal-speed-and-accuracy-of-object-detection.md)
- [Explaining and Harnessing Adversarial Examples](https://refivu.com/en/papers/37bc09da-a299-4ed8-8384-7f87f7409fd4-explaining-and-harnessing-adversarial-examples.md)
- [Encoder-Decoder with Atrous Separable Convolution for Semantic Image Segmentation](https://refivu.com/en/papers/c3292ceb-d0f0-4799-82a9-423146b8a1ba-encoder-decoder-with-atrous-separable-convolution-for.md)

## Terms in this paper

- [dropout](https://refivu.com/en/terms/db73f75bbdd3-dropout)
- [CNN](https://refivu.com/en/terms/06880f5198e6-cnn)
- [cosine similarity](https://refivu.com/en/terms/3baa01a8760d-cosine-similarity)
- [word2vec](https://refivu.com/en/terms/aa6ca7ebd6f5-word2vec)
- [Adadelta](https://refivu.com/en/terms/f8ccffb7eddb-adadelta)
- [SST-2](https://refivu.com/en/terms/8904146eae2e-sst-2)
- [TREC](https://refivu.com/en/terms/aaff5299ce84-trec)
- [MR](https://refivu.com/en/terms/8b735ad0001e-mr)
- [MPQA](https://refivu.com/en/terms/ddd62f0b54b9-mpqa)
- [CNN-non-static](https://refivu.com/en/terms/54675d6d1476-cnn-non-static)
- [CR](https://refivu.com/en/terms/5d1111786aa1-cr)
- [Max-TDNN](https://refivu.com/en/terms/6dcc81ec524f-max-tdnn)
- [Subj](https://refivu.com/en/terms/f2635b9fd713-subj)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/e03eeb97-8544-4ef6-a8e6-47276e072373-convolutional-neural-networks-for-sentence-classification)
