DRetHTR: 一种线性时间解码器-only 保留网络用于手写文本识别
DRetHTR: Linear-Time Decoder-Only Retentive Network for Handwritten Text Recognition
AI总结:
DRetHTR通过保留网络实现手写文本识别的高精度与高效解码,比Transformer更快更省内存,同时保持准确率。
摘要:
最先进的手写文本识别(HTR)系统通常使用Transformer,其增长的键值(KV)缓存使解码变慢且内存消耗大。我们引入了DRetHTR,一种基于保留网络(RetNet)构建的解码器-only模型。与同等规模的解码器-only Transformer基线相比,DRetHTR在推理速度上提高了1.6-1.9倍,内存使用减少了38-42%,且不损失准确性。通过将softmax注意力替换为softmax-free保留,并注入多尺度序列先验,DRetHTR避免了增长的KV缓存:解码在时间和内存上都与输出长度成线性关系。为了恢复注意力的局部到全局归纳偏差,我们提出了层间gamma缩放,这使更深层的层逐步扩大有效的保留范围。这鼓励早期层建模短程依赖,后期层捕捉更广泛的上下文,缓解了去除softmax引入的灵活性差距。因此,DRetHTR在IAM-A(en)测试字符错误率为2.26%、RIMES(fr)为1.81%、Bentham(en)为3.46%,并在READ-2016(de)上具有竞争力,4.21%。这表明,解码器-only RetNet能够实现Transformer级的HTR准确性,同时显著提高了解码速度和内存效率。
英文摘要:
State-of-the-art handwritten text recognition (HTR) systems commonly use Transformers, whose growing key-value (KV) cache makes decoding slow and memory-intensive. We introduce DRetHTR, a decoder-only model built on Retentive Networks (RetNet). Compared to an equally sized decoder-only Transformer baseline, DRetHTR delivers 1.6-1.9x faster inference with 38-42% less memory usage, without loss of accuracy. By replacing softmax attention with softmax-free retention and injecting multi-scale sequential priors, DRetHTR avoids a growing KV cache: decoding is linear in output length in both time and memory. To recover the local-to-global inductive bias of attention, we propose layer-wise gamma scaling, which progressively enlarges the effective retention horizon in deeper layers. This encourages early layers to model short-range dependencies and later layers to capture broader context, mitigating the flexibility gap introduced by removing softmax. Consequently, DRetHTR achieves best reported test character error rates of 2.26% (IAM-A, en), 1.81% (RIMES, fr), and 3.46% (Bentham, en), and is competitive on READ-2016 (de) with 4.21%. This demonstrates that decoder-only RetNet enables Transformer-level HTR accuracy with substantially improved decoding speed and memory efficiency.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。