A retrieval-augmented and distribution-imbalance-aware contrastive framework for low-resource agricultural pest and disease named entity recognition with large language models
Abstract
Amid the rapid advancement of smart agriculture, a substantial volume of unstructured knowledge embedded in agricultural pest and disease texts urgently necessitates structured representation through high-quality named entity recognition. However, Chinese agricultural domain entities exhibit pronounced long-tail distributions, coupled with scarce annotated samples and semantic boundaries heavily reliant on implicit domain-specific knowledge structures. These challenges lead to performance degradation and insufficient generalization capabilities of traditional sequence labeling models and general pre-trained models under low-resource scenarios. To address these issues, this paper proposes a parameter-efficient large model adaptation framework that integrates retrieval-augmented semantic conditioning modeling with distribution-imbalance-aware contrastive representation learning for agricultural pest and disease text entity recognition. The proposed method reframes agricultural named entity recognition as a structured prediction problem conditioned on semantic neighborhood variables. By constructing query-relevant semantic neighborhoods and organizing the retrieved examples as contextual demonstrations, the proposed method provides retrieval-conditioned references for more stable entity boundary determination. At the representation learning level, a category-aware contrastive optimization mechanism is introduced, prioritizing the construction of semantically similar hard negative samples to reshape the geometric structure of the embedding space and mitigate frequency-dominated optimization biases induced by long-tail distributions. For model adaptation, a low-rank parameter-efficient fine-tuning strategy is employed to enable controlled transfer of large language models to the agricultural domain, reducing training costs while preserving general semantic capabilities. Extensive experiments under multi-gradient low-resource settings are conducted on two Chinese agricultural pest and disease datasets, AgCNER and CropDiseaseNER. Experimental results demonstrate that the proposed framework significantly outperforms both traditional sequence labeling methods and conventional large model fine-tuning strategies across varying data scales. Specifically, compared with the BERT-BiLSTM baseline, the proposed framework achieves F1-score improvements of 6.75 percentage points in the AgCNER-3k low-resource scenario and 15.30 percentage points in the CropDiseaseNER-0.4k extreme low-resource scenario. These findings indicate that retrieval-augmented semantic conditioning modeling and distribution-imbalance-aware contrastive representation optimization collaboratively mitigate structural instability arising from low resources and long-tail distributions, offering an efficient and scalable pathway for adapting large models to agricultural knowledge graph construction and intelligent decision-making in smart agriculture.