Abstract
Chinese words often exhibit a parallel structural relationship within sentences, while individual characters are sequentially connected. To capture this structural distinction, we extract the head and tail positions of characters within words and incorporate them into a relative positional encoding scheme. Building upon this design, we introduce Word Boundary Attention (WBA), a mechanism that assigns dynamic attention weights to characters and enhances their representations with contextual information derived from the word lattice. By explicitly modeling word boundaries, WBA effectively suppresses noise, improves word recognition, and leverages richer lexicon-based context during training. Extensive experiments across multiple datasets demonstrate that WBA consistently outperforms existing approaches, achieving, for instance, a 2.51% improvement over the base model on the Weibo dataset with YJ lexicon encoding. Furthermore, visualizations of the learned attention weights reveal the interactive relationships between words and characters, providing interpretable insights into the process of word discovery. The source code of the proposed method is publicly available at https://github.com/na978292231/WBA/tree/main/WBA4NER-main.