# Advancing Few-Shot Named Entity Recognition with Large Language Model
## 3 Methodology
### Limit the Scope of the Labels to Be Predicted  
In prompt construction, a common practice is to concatenate all entity types from the dataset before supplying them to the LLM for prediction. However, study shows that the LLM struggle with fine-grained NER tasks [27]. This limitation arises mainly from the large number of label categories and their fine granularity, making it challenging for the LLM to accurately differentiate labels given limited instructions and examples.  
Figure 1: The overview of our method. The different numbers correspond to the different stages described in the Method Overview.  
Furthermore, including explanations for all entity type definitions increases both input length and computational cost. To alleviate the LLM's cognitive burden and minimize input length, we propose several strategies to limit the scope of the labels to be predicted. These strategies are designed to enhance the efficiency and accuracy of fine-grained NER tasks by reducing the complexity of label prediction.  
1. Retain Top-\(N\) Labels As shown on the left side of Figure 2, we propose a way to retain only the top \(N\) labels with high similarity from few-shot NER predictions. This approach ensures that the most relevant entity types are considered while keeping the size of label set manageable. The steps in this process are outlined as follows: * First, we collect all label predictions for a given query \(x_{i}^{\text{test}}\). * These labels are then ranked based on the cosine similarity between the support set and the query. * The top \(N\) labels are selected from this ranked list. * To ensure completeness, the \"None\" label is always included if it is not already in the selected list. * To avoid redundancy, any duplicate labels are eliminated from the final selection. Formally, we define the label filtering process as follows: \[\mathcal{Y}_{\text{filtered}}(x_{i}^{\text{test}})=\text{unique}\big{(}\text{ Top}_{N}\big{(}\mathcal{Y}_{\text{sorted}}(x_{i}^{\text{test}})\big{)}\cup\{ \text{None}\}\big{)},\] (6) where \(\text{Top}_{N}(\mathcal{Y}_{\text{sorted}}(x_{i}^{\text{test}}))\) selects the top \(N\) labels from the ranked label set, \(\text{unique}(\cdot)\) removes duplicate labels, and the inclusion of \"None\" ensures that non-entity predictions are always considered.
2. Retain the Top-\(N\) Unique Labels As illustrated on the right side of Figure 2, this way focuses on ensuring diversity within the selected labels. The primary steps are as follows: * Start with the ranked label predictions for a given query \(x_{i}^{\text{test}}\). * Iterate through the ranked labels and select unique ones until \(N\) unique labels are collected. * If the \"None\" label is not already included, append it to the final set. * Exclude any duplicate labels from the final selections. Mathematically, this process is expressed as follows: \[\mathcal{Y}_{\text{filtered}}(x_{i}^{\text{test}})=\{y_{k}^{\text{sup}}|y_{k}^{ \text{sup}}\in\mathcal{Y}_{\text{sorted}}(x_{i}^{\text{test}})\}_{k=1}^{N} \cup\{\text{None}\},\] (7) where \(\left\{y_{k}^{\text{sup}}\right\}_{k=1}^{N}\) represents the first \(N\) unique labels selected from the ranked label set. 3. Retain All Entity Labels In this setting, no label filtering is applied, meaning that the model has access to the entire set of possible entity labels. The process can be summarized as follows: * All entity labels appearing in the dataset are provided to the model during inference. * There is no restriction on the number of labels. * The \"None\" label is included by default to represent cases without named entities.