Paper commentary
Bidirectional LSTM-CRF Models for Sequence Tagging
BI-LSTM-CRF tags sequences using past and future inputs
- Problem Sequence taggers need both surrounding inputs and tag structure, but strong results often relied on hand-built features or pretrained word vectors.
- Method BI-LSTM-CRF puts a bidirectional LSTM under a CRF layer. The LSTM scores each word from past and future inputs, and the CRF scores tag transitions over the sentence.
- Results It reaches state of the art or close to it on POS, chunking and NER, with 90.10 on NER against 89.59 for Conv-CRF.
Why tagging needs context and tag structure
Sequence tagging assigns one label to every word, and POS tagging, chunking and named entity recognition are all instances of it. The labels are useful downstream: a tagger trained on search queries can mark which spans are products, and tags can help a search engine find relevant pages.
Earlier taggers were mostly linear statistical models, including HMMs, MEMMs and CRFs. A convolutional network with a CRF output layer, called Conv-CRF here, later became a neural baseline that performed well on these tasks.
The study targets a tagger that uses past and future inputs and also the tag structure of a sentence. It also aims to work without relying heavily on word embeddings, which the authors contrast with the earlier Conv-CRF observations.
The authors compare LSTM, BI-LSTM, CRF, LSTM-CRF and BI-LSTM-CRF on the same tagging data. BI-LSTM-CRF is presented as the first application of this bidirectional LSTM with CRF combination to NLP benchmark sequence tagging data.
LSTM cells and their bidirectional form
A recurrent network keeps a hidden state that carries history forward, so a prediction can depend on earlier positions. The LSTM keeps this recurrence but replaces the plain hidden update with memory cells, so that long-range dependencies are easier to retain.
Each cell has an input gate, a forget gate, an output gate and a cell vector, all the same size as the hidden vector. The cell vector is updated as \\(c_t = f_t c_{t-1} + i_t \\tanh(W_{xc}x_t + W_{hc}h_{t-1} + b_c)\\), and the hidden state is \\(h_t = o_t \\tanh(c_t)\\). The input gate \\(i_t = \\sigma(W_{xi}x_t + W_{hi}h_{t-1} + W_{ci}c_{t-1} + b_i)\\) and the forget gate have the same form, and the output gate uses the current cell \\(c_t\\).
The weights from the cell to each gate are diagonal, so each gate element reads only the matching element of the cell vector.
A unidirectional LSTM uses only the past at each position, while a bidirectional LSTM runs a forward and a backward pass over the sentence. Each position then combines the forward state, which carries past features, with the backward state, which carries future features. The network is trained with backpropagation through time, and the hidden states are reset to 0 at the start of each sentence.
A CRF layer over the LSTM outputs
There are two ways to use neighbouring tags: scoring each position and decoding with beam-like search, as maximum entropy classifiers and MEMMs do, or scoring whole sentences, as CRFs do. The CRF route connects inputs and outputs directly, which differs from the memory-cell route taken by LSTM models.
The LSTM-CRF model feeds the network's per-tag, per-position scores into a CRF layer. The CRF layer adds a transition score for every pair of consecutive tags, taken from a state transition matrix that does not depend on position.
The score of a tag path is the sum over positions of a transition term and a network term: \\(s([x]_1^T,[i]_1^T,\\tilde{\\theta})=\\sum_{t=1}^{T}([A]_{[i]_{t-1},[i]_t}+[f_\\theta]_{[i]_t,t})\\). Here \\([f_\\theta]_{i,t}\\) is the score of tag \\(i\\) at word \\(t\\) from the network, and \\(\\tilde{\\theta}\\) adds the transition entries \\([A]_{i,j}\\) to the network parameters \\(\\theta\\).
Dynamic programming computes the transition quantities and the optimal tag sequence for inference. BI-LSTM-CRF swaps the unidirectional LSTM for the bidirectional one, so the network scores already include future inputs, while the transition layer still scores tag structure over the sentence.
How the joint model is trained
Training is generic SGD over batches, and each batch holds sentences whose total length does not exceed 100. The training set is split into batches, and each epoch processes one batch at a time.
A batch first runs the bidirectional network forward, giving a score for every tag at every position. The CRF layer then computes gradients for the network outputs and for the transition edges. The errors are backpropagated through the forward and the backward LSTM states. The update changes the state transition matrix and the bidirectional LSTM parameters.
The reported learning rate is 0.1, and the hidden layer size is 300. The authors say performance is not sensitive to hidden layer size and that the three tasks need fewer than 10 epochs to converge.
Inputs: embeddings and hand-built features
The POS training set has 39831 sentences, and the label sets have 45, 22 and 9 labels for POS, CoNLL2000 and CoNLL2003 respectively. Chunking has no validation split, so part of its training data is used for validation.
Spelling features cover capitalization, punctuation, letter prefixes and suffixes with window size 2 to 5, and word-shape patterns that map capital letters, lower-case letters and digits to A, a and 0. Context features use unigrams and bigrams, and trigrams for POS in CoNLL2000 and for POS and chunk features in CoNLL2003. The three data sets yield 401K, 76K and 341K features for POS, chunking and NER.
The Senna embedding has a 130K vocabulary and 50-dimensional vectors, and it replaces the one-hot word encoding. The random setting initializes word vectors randomly, and each category uses identical feature sets, so the differences come from the networks.
Spelling and context features can feed the network as ordinary inputs or connect directly to the outputs. The authors found that direct connections speed up training with very similar accuracy, and all reported results use them. Because the label sets are small, full connections from features to outputs avoid feature collisions.
Results with random word embeddings
The Conv-CRF row for the same setting reports 96.37, 90.33 and 81.47, taken from Collobert et al. (2011).
LSTM-CRF scores above CRF on all three tasks in this setting, and plain LSTM is the lowest model on all three. On POS, LSTM-CRF reaches 97.45 against 97.43 for BI-LSTM-CRF, so BI-LSTM-CRF is not the top model there. BI-LSTM is close to CRF on POS and chunking, but it is below CRF on NER, with 81.11 against 83.02.
The authors read the gain of LSTM-CRF over CRF as evidence for the forward LSTM component. With random vectors, BI-LSTM-CRF is above Conv-CRF on all three tasks in this table.
Results with Senna embeddings and the embedding gap
With the Senna embedding, BI-LSTM-CRF reaches 97.55 on POS and 94.46 on chunking, and 88.83 on NER, or 90.10 when Gazetteer features are added. The Senna Conv-CRF row lists 97.29, 94.32 and 88.67, with 89.59 on NER when Gazetteer features are added.
Between the random and Senna settings, BI-LSTM-CRF changes by 0.12%, 0.33% and 4.57% on POS, chunking and NER. Conv-CRF changes by 0.92%, 3.99% and 7.20% on the same three tasks. The authors use these differences to argue that BI-LSTM-CRF depends less on Senna than Conv-CRF does.
In the Senna and Gazetteer setting, BI-LSTM-CRF reaches 90.10 on NER against 89.59 for Conv-CRF. With random embeddings the NER gap is larger, 84.26 against 81.47, and the authors call it significant.
Dependence on hand-built features
To test reliance on engineered features, the authors train each model with word features only, keeping the Senna embedding and dropping spelling and context features. The parenthesized values in that table are the degradations against the same model with the full feature set.
CRF degrades most clearly: its chunking F1 falls from 93.83 to 85.34 when the features are removed. BI-LSTM-CRF on chunking reaches 94.40 with word features only, a change of -0.06 against the full-feature model.
In this table BI-LSTM-CRF has the highest score on all three tasks, with 96.11 on POS and 84.74 on NER. The authors read this as LSTM-based models being less affected by the removal of engineered features than CRF.
Standing against published systems
On POS, the model reaches 97.55 against the Senna-free rows and the semi-supervised tagger that uses extra data in the comparison table. The authors state that 97.55 is significantly better than the other systems at the 95% confidence level.
For chunking, Kudo and Matsumoto reached 93.48 and later 93.91, and Shen and Sarkar (2005) reached 95.23. BI-LSTM-CRF with Senna reaches 94.46, which exceeds the other listed chunking systems but not the 95.23 of Shen and Sarkar (2005).
On NER, Florian et al. (2003) reported 88.76, Chieu (2003) 88.31 and Ando and Zhang (2005) 89.31. Passos et al. (2014) reached 90.90 with lexicon-infused embeddings, above the 90.10 of BI-LSTM-CRF with Senna and Gazetteer features.
The discussion places the work near Collobert et al. (2011), since both use deep networks for tagging, while this work uses bidirectional LSTMs rather than convolutions. The authors also say BI-LSTM-CRF gave consistently better accuracy than a single CRF with identical feature sets.
Where the evidence stops
On NER with Senna and Gazetteer features, BI-LSTM-CRF reaches 90.10, below the 90.90 of Passos et al. (2014). The authors attribute the gap to different word embeddings, and that explanation is not tested in the excerpt.
Embedding dependence is reduced but not removed: the random-to-Senna NER change for BI-LSTM-CRF is 4.57 and the random NER score stays below the Senna score. On POS with random embeddings, BI-LSTM-CRF is not the best model, since LSTM-CRF scores 97.45.
The embedding comparison sets BI-LSTM-CRF against Conv-CRF numbers taken from Collobert et al. (2011), so it compares reported results rather than runs under shared conditions. Chunking also uses a validation part carved from the training data rather than a standard validation split.
Paper info
- Authors
- Zhiheng Huang, Wei Xu, Kai Yu
- Venue
- arXiv · Preprint
- First published
- 2015-8-9
- Added
- 2026-11-12
- Updated
- 2015-8-9
- Version
- v1
- arXiv
- 1508.01991
- Category
- cs.CL
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
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
Zhiheng Huang, Wei Xu, Kai Yu (2015). Bidirectional LSTM-CRF Models for Sequence Tagging. arXiv:1508.01991v1. https://arxiv.org/abs/1508.01991v1
BibTeX
@misc{huang2015bidirectional,
title = {{Bidirectional LSTM-CRF Models for Sequence Tagging}},
author = {Zhiheng Huang and Wei Xu and Kai Yu},
year = {2015},
eprint = {1508.01991},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1508.01991v1}
}