Abstract
This paper proposes a structure-aware decoding method based on large language models to address the difficulty of traditional approaches in maintaining both semantic integrity and structural consistency in nested and overlapping entity extraction tasks. The method introduces a candidate span generation mechanism and structured attention modeling to achieve unified modeling of entity boundaries, hierarchical relationships, and cross-dependencies. The model first uses a pretrained language model to obtain context-aware semantic representations, then captures multi-granular entity span features through candidate representation combinations, and introduces hierarchical structural constraints during decoding to ensure consistency between semantics and structure. To enhance stability in complex scenarios, the model jointly optimizes classification loss and structural consistency loss, maintaining high recognition accuracy under multi-entity co-occurrence and long-sentence dependency conditions. Experiments conducted on the ACE 2005 dataset demonstrate significant improvements in Accuracy, Precision, Recall, and F1-Score, particularly in nested and overlapping entity recognition, where the model shows stronger boundary localization and structural modeling capability. This study verifies the effectiveness of structure-aware decoding in complex semantic extraction tasks, provides a new perspective for developing language models with hierarchical understanding, and establishes a methodological foundation for high-precision information extraction.
Introduction
Named Entity Recognition (NER) is a foundational NLP task, but real-world text often presents complexities that challenge traditional sequence-labeling methods like BIO tagging. These traditional approaches typically assign a single label to each token, which fails when entities are nested (e.g., "California" within "University of Southern California") or overlapping.
While modern Large Language Models (LLMs) possess incredible semantic understanding, their standard decoding processes often lack "structural awareness," leading to boundary conflicts or missing entities in complex scenarios. This research aims to bridge this gap by forcing the LLM to explicitly perceive and respect multi-layered entity structures during the decoding phase.
Methodology
The authors propose a four-module architecture to inject structural awareness into LLM decoding:
- Semantic Encoding: A pre-trained LLM uses multi-layer attention to generate context-aware token embeddings, capturing both local and cross-sentence dependencies.
- Candidate Span Generation: Instead of tagging individual words, the model generates representations for text spans by combining contextual features of start and end positions, allowing for multi-granular evaluation.
- Structure-Aware Modeling: A query-key attention mechanism is applied across candidate spans rather than just tokens, allowing the network to explicitly learn hierarchical and overlapping relationships.
- Hierarchical Decoding & Joint Optimization: The model uses a joint loss function—combining classification loss with structural consistency loss—to enforce boundary constraints and penalize structural misalignments.
Experimental Setup and Results
The model was evaluated on the ACE 2005 (Automatic Content Extraction) dataset, a standard benchmark containing heterogeneous texts with significant entity co-occurrence, nesting, and semantic overlap.
The proposed model achieved state-of-the-art performance, significantly outperforming existing baselines such as PRCG, FiNER, and MEGCF. Notably, it reached an F1-Score of 90.33%, representing a substantial jump over the closest competing method.
Discussion: Key Insights
The success of this approach stems from shifting the attention mechanism from token-to-token to span-to-span, which allows the model to explicitly weigh dependencies between candidate entities and resolve boundary conflicts that typically trip up linear decoders.
Sensitivity analysis revealed critical hyperparameter dependencies for maintaining structural alignment:
- Model Capacity: An inverted-U relationship exists between hidden layer dimensions and recall. A dimension of 512 was found to be optimal; lower capacities lacked the ability to represent complex structures, while higher capacities introduced noise.
- Learning Rate: The model is highly sensitive to the learning rate, with $3 \times 10^{-5}$ identified as the optimal rate to balance semantic hierarchy consistency without causing gradient oscillation.
Conclusion
This study demonstrates that providing LLMs with explicit structural constraints is essential for high-fidelity information extraction in complex scenarios. Future work will explore multimodal structural decoding and semi-supervised learning strategies to enhance generalization across varied domains, such as financial and medical text analysis.
Summary updated