# 双向门控循环单元网络

双向门控循环单元网络（BiGRU）是一种循环神经网络架构，它在同一输入序列上以相反方向运行两个门控循环单元（GRU）层，并在每个时间步将它们的输出拼接起来，从而得到包含过去与未来上下文的逐序列位置表示。<sup>[1](https://www.isca-archive.org/interspeech_2016/nussbaumthom16_interspeech.pdf)</sup> 它用于编码序列，以及在命名实体识别、词性标注、情感分类和语音声学建模等任务中标注词元。<sup>[2](https://d2l.ai/chapter_recurrent-modern/bi-rnn.html)</sup> 双向原理由 M. Schuster 和 K.K. Paliwal 于 1997 年为循环网络确立，GRU 则为两个方向层提供所运行的门控单元。<sup>[3](https://doi.org/10.1109/78.650093)</sup>

| 关键事实 | 值 |
|---|---|
| 第 \( t \) 步的输出 | 前向与后向状态的逐步拼接，\( h_t := (\overrightarrow{h}_t, \overleftarrow{h}_t) \)<sup>[1](https://www.isca-archive.org/interspeech_2016/nussbaumthom16_interspeech.pdf)</sup> |
| 与单向 GRU 的参数对比 | 自由参数数量翻倍，因为两个方向各自拥有权重集<sup>[1](https://www.isca-archive.org/interspeech_2016/nussbaumthom16_interspeech.pdf)</sup> |
| GRU 参数数量 | 隐藏层大小为 \( d_h \)、输入大小为 \( d_x \) 时为 \( O(3 \cdot d_h \cdot (d_x + d_h)) \)<sup>[4](https://arxiv.org/abs/2410.01201)</sup> |
| 门 | 两个门（更新门和重置门）和一个隐藏状态，而 LSTM 有三个门和两个状态<sup>[4](https://arxiv.org/abs/2410.01201)</sup> |
| 双向原理 | 将状态神经元拆分为前向（正时间方向）和后向（负时间方向）两部分<sup>[3](https://doi.org/10.1109/78.650093)</sup> |
| 流式使用 | 不适用：后向传递必须等到整个序列可用后才能开始<sup>[2](https://d2l.ai/chapter_recurrent-modern/bi-rnn.html)</sup> |
| 典型应用 | 命名实体识别、联合分词与词性标注、情感分类、语音声学建模<sup>[5](https://ar5iv.labs.arxiv.org/html/1807.01882)</sup> |

## 工作原理

GRU 是一种循环单元，其门控调节信息流动，而不像 LSTM 单元那样携带独立的记忆单元。<sup>[6](https://arxiv.org/abs/1412.3555)</sup> 在 Chung 及其同事的表述中，第 \( t \) 步单元 \( j \) 的激活是前一状态与候选激活之间的线性插值，

\[ h_t^j = (1 - z_t^j)\, h_{t-1}^j + z_t^j\, \tilde{h}_t^j, \]

其中更新门 \( z_t^j = \sigma(W_z \cdot x_t + U_z \cdot h_{t-1})^j \) 决定单元更新其激活的程度，重置门 \( r_t^j = \sigma(W_r \cdot x_t + U_r \cdot h_{t-1})^j \) 控制有多少过去信息进入候选激活，而 \( \tilde{h}_t^j = \tanh(W \cdot x_t + U \cdot (r_t \odot h_{t-1}))^j \)。<sup>[6](https://arxiv.org/abs/1412.3555)</sup> 与 LSTM 不同，GRU 没有控制其状态暴露程度的机制，而是在每个时间步暴露整个状态。<sup>[6](https://arxiv.org/abs/1412.3555)</sup>

双向性是一种通用技术，通过在同一输入上以相反方向串联两个单向层，将任意单向 RNN 转变为双向 RNN。<sup>[2](https://d2l.ai/chapter_recurrent-modern/bi-rnn.html)</sup> 前向隐藏状态从序列起点开始递归，\( \overrightarrow{H}_t = \phi(X_t \cdot W_{xh}^{(f)} + \overrightarrow{H}_{t-1} \cdot W_{hh}^{(f)} + b_h^{(f)}) \)，而后向状态从末尾开始递归，\( \overleftarrow{H}_t = \phi(X_t \cdot W_{xh}^{(b)} + \overleftarrow{H}_{t+1} \cdot W_{hh}^{(b)} + b_h^{(b)}) \)；两者拼接为 \( 2h \) 维状态送入输出层。<sup>[2](https://d2l.ai/chapter_recurrent-modern/bi-rnn.html)</sup> 后向层通过 \( t = T, \ldots, 1 \) 反向处理输入，BGRU 的输出是逐步拼接 \( h_t := (\overrightarrow{h}_t, \overleftarrow{h}_t) \)。<sup>[1](https://www.isca-archive.org/interspeech_2016/nussbaumthom16_interspeech.pdf)</sup> 与单向情形相比，自由参数数量翻倍。<sup>[1](https://www.isca-archive.org/interspeech_2016/nussbaumthom16_interspeech.pdf)</sup>

## 实现方式

BiGRU 按固定顺序构建和运行。首先，输入向量 \( x_t \)（嵌入、声学特征或传感器值）被送入前向 GRU 层，产生 \( t = 1, \ldots, T \) 的状态 \( \overrightarrow{h}_t \)。其次，相同输入被送入后向 GRU 层，在从 \( T \) 到 1 读取序列的同时产生 \( \overleftarrow{h}_t \)。第三，两个状态序列逐步拼接，可直接用作序列编码，或传递给任务层，如条件随机场（用于序列标注的统计模型，用作输出层）或注意力机制。<sup>[5](https://ar5iv.labs.arxiv.org/html/1807.01882)</sup><sup> • </sup><sup>[7](https://dl.acm.org/doi/10.1145/3357254.3357262)</sup> 双向 RNN 原则上可以用标准训练方法训练，即对两个递归都应用时间反向传播。<sup>[3](https://doi.org/10.1109/78.650093)</sup> 由于后向递归依赖于最终输入，在计算单个输出之前必须获得整个序列。<sup>[2](https://d2l.ai/chapter_recurrent-modern/bi-rnn.html)</sup>

## 起源

[双向循环神经网络](https://www.edgepedia.org/zh/bidirectional-recurrent-neural-network)由 M. Schuster 和 K.K. Paliwal 于 1997 年在《双向循环神经网络》（IEEE 信号处理汇刊 45(11), 2673-2681）中提出；其思想是将状态神经元拆分为正时间方向部分（前向状态）和负时间方向部分（后向状态），克服了常规 RNN 只能利用过去上下文的局限。<sup>[3](https://doi.org/10.1109/78.650093)</sup> 在 BiGRU 之前，有两条后续工作路线建立在这一原理之上：带 LSTM 单元的双向网络于 2002 年被应用于语音音素分类，其中同时观察目标帧之后和之前的帧尤其有助于词或段末尾附近的情况，<sup>[8](http://www.cs.toronto.edu/~graves/icann_2005.pdf)</sup> 双向模型于 EMNLP 2014 被应用于翻译建模，其中与正向层并行添加的反向隐藏层提供了无界未来上下文，且无需调整延迟。<sup>[9](https://aclanthology.org/D14-1003.pdf)</sup> GRU 本身是 LSTM 的两门、单状态简化，能够实现更快的训练和推理。<sup>[4](https://arxiv.org/abs/2410.01201)</sup> 近期一条相关路线是 Adel Moumen 和 Titouan Parcollet 关于为自动语音识别稳定和加速轻量门控循环单元的工作（arXiv，2023）。<sup>[10](https://doi.org/10.48550/arxiv.2302.10144)</sup>

## 变体

若干命名变体在双向 GRU 之上附加任务特定层。在中文词汇分析中，深度 Bi-GRU-CRF 网络堆叠两个 Bi-GRU 层与一个条件随机场（CRF）层，联合解码标签序列，使用硬性 IOB2 转移约束拒绝无效标签序列；在该工作的实验中，GRU 表现优于 LSTM。<sup>[5](https://ar5iv.labs.arxiv.org/html/1807.01882)</sup> 一种基于字符的 BGRU-CRF 模型结合预训练词典和注意力机制，用于中文命名实体识别。<sup>[11](https://www.jsjkx.com/EN/10.11896/j.issn.1002-137X.2019.09.035)</sup> 在情感分析中，Attention-BGRU 将 GRU 网络与添加到双向 GRU 上的注意力机制相结合。<sup>[7](https://dl.acm.org/doi/10.1145/3357254.3357262)</sup> 对于多语言 NER，BiGRU-CNN-CRF 混合模型以拼接的词缀、词性和词向量作为输入，由 CRF 层产生全局最优标注序列。<sup>[12](https://www.inderscience.com/info/inarticle.php?artid=102996)</sup> 在语音领域，双向门控循环卷积层与堆叠双向 GRU 相结合，在 50 小时英语广播新闻任务上优于普通 BGRU、DNN 和频域 CNN。<sup>[1](https://www.isca-archive.org/interspeech_2016/nussbaumthom16_interspeech.pdf)</sup> 在效率方面，minGRU 变体仅需 \( O(2 \cdot d_h \cdot d_x) \) 个参数，当隐藏状态扩展因子 \( \alpha = 1, 2, 3, 4 \) 时，分别约为 GRU 参数量的 33%、22%、17% 和 13%。<sup>[4](https://arxiv.org/abs/2410.01201)</sup>

## 应用

基于 BiGRU 的模型最常被报道为序列标注器。联合建模分词、词性标注和命名实体识别的深度 Bi-GRU-CRF 网络在其测试集上达到 95.5% 的准确率，相比作者此前最佳的中文词汇分析工具相对错误率降低约 13%，单线程速度为每秒 2.3K 字符。<sup>[5](https://ar5iv.labs.arxiv.org/html/1807.01882)</sup> 在 CoNLL 2003 英语 NER 语料库上，使用 GloVe、词性和字符嵌入的 LSTM、Bi-LSTM、GRU 和 Bi-GRU 模型获得了 86.04% 的 F1 分数。<sup>[13](https://www.hippocampus.si/ISBN/978-961-7055-27-6/files/downloads/pages/Page63.pdf)</sup> 基于字符的 BGRU-CRF 模型在 MSRA 和 OntoNotes 上分别以总体 F1 超出最先进对比模型 3.08% 和 0.16%，且不受分词错误影响。<sup>[11](https://www.jsjkx.com/EN/10.11896/j.issn.1002-137X.2019.09.035)</sup> 在情感分类中，具有 64 个 GRU 单元的 BiGRU 在基于方面的情感分类上达到 83.4% 的准确率和 0.813 的 F1 分数，超过了包括朴素贝叶斯在内的基线。<sup>[14](https://jurnal.uinsu.ac.id/index.php/zero/article/view/25754)</sup> BiGRU-CRF 混合模型在 NER 基准上仍被积极使用：BERT-Mogrifier-BiGRU-CRF 模型在中文 NER 上达到 85.42% 的 F1，比传统方法高 7%。<sup>[15](https://www.mdpi.com/2076-3417/14/15/6481)</sup> BiGRU 也继续应用于非正式文本的情感分类，而 transformer 模型通常需要更大的数据集和计算量。<sup>[14](https://jurnal.uinsu.ac.id/index.php/zero/article/view/25754)</sup> 在语音领域，双向门控循环卷积层与堆叠双向 GRU 已在广播新闻声学建模上得到评估。<sup>[1](https://www.isca-archive.org/interspeech_2016/nussbaumthom16_interspeech.pdf)</sup>

## 局限与替代方案

主要局限是双向 RNN 必须等到整个序列可用后才能开始后向传递，因此在测试时只有过去数据的流式环境中直接使用会给出较差的准确率；在未来的词元未知时无法使用。<sup>[2](https://d2l.ai/chapter_recurrent-modern/bi-rnn.html)</sup> 双向 RNN 也很慢：前向传播需要两个递归，反向传播依赖于前向结果，结果是极长的梯度依赖链。<sup>[2](https://d2l.ai/chapter_recurrent-modern/bi-rnn.html)</sup> 与 LSTM 一样，GRU 是只能按序列顺序计算的模型，需要时间反向传播，这给出线性训练时间并限制了对长上下文的扩展。<sup>[4](https://arxiv.org/abs/2410.01201)</sup> 与 LSTM 的比较尚无定论：在参数量匹配的情况下，GRU 在某些数据集上可能在按 CPU 时间衡量的收敛速度、参数更新和泛化方面优于 LSTM，但总体结果并无定论。<sup>[6](https://arxiv.org/abs/1412.3555)</sup> 在实践中，双向层被谨慎使用，用于填充缺失词、标注命名实体等词元以及整体编码序列，例如用于机器翻译。<sup>[2](https://d2l.ai/chapter_recurrent-modern/bi-rnn.html)</sup> 对于资源受限环境，BiGRU 往往比 BiLSTM 更受青睐，因为 GRU 的两门架构产生更少参数，同时往往能与 BiLSTM 的准确率相媲美。<sup>[16](https://kuriko-iwai.com/research/bidirectional-recurrent-neural-network)</sup>

## References

1. [Acoustic Modeling Using Bidirectional Gated Recurrent Convolutional Units (Interspeech 2016)](https://www.isca-archive.org/interspeech_2016/nussbaumthom16_interspeech.pdf)
2. [Bidirectional Recurrent Neural Networks, Dive into Deep Learning](https://d2l.ai/chapter_recurrent-modern/bi-rnn.html)
3. [M. Schuster, K.K. Paliwal (1997). Bidirectional recurrent neural networks. IEEE Transactions on Signal Processing.](https://doi.org/10.1109/78.650093)
4. [Were RNNs All We Needed? (minGRU paper, 2024)](https://arxiv.org/abs/2410.01201)
5. [Chinese Lexical Analysis with Deep Bi-GRU-CRF Network (2018)](https://ar5iv.labs.arxiv.org/html/1807.01882)
6. [Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling (Chung et al., 2014)](https://arxiv.org/abs/1412.3555)
7. [Attention-based bidirectional gated recurrent unit neural networks for sentiment analysis (ACM, 2019)](https://dl.acm.org/doi/10.1145/3357254.3357262)
8. [Bidirectional LSTM Networks for Improved Phoneme Classification and Recognition (Graves & Schmidhuber, ICANN 2005)](http://www.cs.toronto.edu/~graves/icann_2005.pdf)
9. [Translation Modeling with Bidirectional Recurrent Neural Networks (EMNLP 2014)](https://aclanthology.org/D14-1003.pdf)
10. [Moumen, Adel, Parcollet, Titouan (2023). Stabilising and accelerating light gated recurrent units for automatic speech recognition. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2302.10144)
11. [Chinese Named Entity Recognition Method Based on BGRU-CRF (Chinese Journal of Computers)](https://www.jsjkx.com/EN/10.11896/j.issn.1002-137X.2019.09.035)
12. [Multilingual named entity recognition based on the BiGRU-CNN-CRF hybrid model (IJICT 2019)](https://www.inderscience.com/info/inarticle.php?artid=102996)
13. [Named Entity Recognition and Classification using LSTM/GRU variants](https://www.hippocampus.si/ISBN/978-961-7055-27-6/files/downloads/pages/Page63.pdf)
14. [Bidirectional GRU for Aspect-Based Sentiment Classification in Multi-Dimensional Review Analysis](https://jurnal.uinsu.ac.id/index.php/zero/article/view/25754)
15. [Research on Named Entity Recognition Based on Gated Interaction Mechanisms (Mogrifier-BiGRU, Applied Sciences, 2024)](https://www.mdpi.com/2076-3417/14/15/6481)
16. [Bidirectional RNNs: Architecture, Math, and BiLSTM vs. BiGRU](https://kuriko-iwai.com/research/bidirectional-recurrent-neural-network)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › 机器学习与神经计算 › 神经网络与深度学习 › 标题：A至H

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/bidirectional-gated-recurrent-unit-network

English original: https://www.edgepedia.org/bidirectional-gated-recurrent-unit-network
