Pith. sign in

REVIEW 3 major objections 5 minor 30 references

Retrieval augmented generation based dynamic prompting for few-shot biomedical named entity recognition using large language models

T0 review · 3 major / 5 minor · reviewed 2026-08-06 · deepseek-v4-flash

Pith's one-line read This paper claims that for few-shot biomedical named entity recognition, dynamically selecting in-context examples by similarity to the input text improves F1-score over random static prompts, with TF-IDF and SBERT retrieval giving the…

desk verdict Useful empirical comparison of retrieval methods for dynamic ICL in biomedical NER, but the few-shot framing overstates the annotation budget. read the letter →

arxiv 2508.06504 v1 pith:AW2VG3ZQ submitted 2025-07-25 cs.CL cs.AI

classification cs.CLcs.AI
keywords biomedicalnamedentityrecognitionfew-shotlearninglargelanguagemodelsretrieval-augmentedgenerationdynamicpromptingin-contextTF-IDFSentence-BERT
verification ladder T0 review T1 audit T2 compute T3 formal

The pith

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

The reading

The paper tries to establish that large language models do better at biomedical named entity recognition with limited supervision when the few-shot examples placed in the prompt are chosen per input by similarity to the test text rather than fixed and random. It builds a structured static prompt and then a dynamic retrieval-augmented prompt that selects the top similar annotated examples at inference, reporting consistent F1 gains across five biomedical datasets and multiple LLMs. The best retrieval methods improved average F1-scores by about 7.3% in the 5-shot setting and 5.6% in the 10-shot setting, and the structured static prompt alone improved average F1 by 11-12% over a basic prompt. If this holds, cheap similarity-based example selection would be a practical way to improve NER on clinical and social-health texts without additional manual annotation.

What carries the argument

The load-bearing mechanism is retrieval-augmented generation applied to in-context example selection. A retrieval index is built from the training sentences; for each test input, the top annotated examples are retrieved by a similarity engine and inserted into the prompt, so the prompt changes instance-by-instance. The paper compares TF-IDF, Sentence-BERT (sentence embeddings), ColBERT (late-interaction token matching), and DPR (dual-encoder dense retrieval), and uses a token-concatenated output format such as 'token-LABEL' to keep generated labels aligned with input tokens.

What would settle it

Recompute the reported F1 differences using retrieval indexes built only from the same k labeled examples available under each shot setting, with the static prompt components restricted to those same k examples; if the TF-IDF and SBERT gains over random selection fall to near zero or become negative, the few-shot transfer claim would be false.

Watch

Extended reading notes

Core claim

The central discovery, stated on the paper's own terms, is that retrieval-augmented dynamic prompting—replacing randomly selected in-context examples with examples retrieved by similarity to the input text—improves few-shot biomedical NER performance. Concretely, TF-IDF and SBERT retrieval produced the best average F1-scores, with about 7.3% and 5.6% average F1 improvements over random-example baselines in 5-shot and 10-shot settings, and GPT-4 consistently outperformed GPT-3.5 and LLaMA 3-70B. The same experiments show that a structured static prompt containing dataset descriptions, high-frequency entity words, UMLS background knowledge, error feedback, and token-level examples is worth roughly 11-12% average F1 over a basic prompt.

Load-bearing premise

The experiments are called few-shot, but the retrieval index and static prompt components are built from the full training set; with only five to twenty labeled examples, the index would be nearly empty and those components could not be derived, so the reported gains may not transfer to genuinely limited annotation.

Editorial extensions

If this is right

  • Similarity-based example selection is a low-cost drop-in change: it requires only a retrieval index over existing annotations and changes each prompt during inference, so it can be layered on top of any fixed prompt template.
  • In formal, entity-rich biomedical texts such as PubMed abstracts, a simple lexical retriever (TF-IDF) can match or beat dense neural retrieval, whereas on noisy social-media data (the Reddit dataset) sentence-embedding retrieval (SBERT) tends to win.
  • Static prompt components matter as much as retrieval: adding dataset descriptions, high-frequency entity terms, and error feedback raised average F1 by 11-12%, so dynamic retrieval should be evaluated on top of an already-structured static prompt.
  • The advantage of dynamic over random selection shrinks as the number of in-context examples grows from 5-shot to 20-shot, because random draws become more diverse and longer prompts may dilute the model's attention.
  • LLM choice interacts with retrieval: GPT-4 consistently outperforms GPT-3.5 and LLaMA 3-70B, and retrieval helps most on datasets with sparse or noisy entity annotations.

Reading between the lines

Editorial extensions of the paper, not claims the author makes directly.

  • The reported 'few-shot' gains are measured with a retrieval index built from the full training set; a genuinely few-shot deployment with only five to twenty annotated examples would leave the retrieval pool nearly empty, so the 5-shot/10-shot/20-shot numbers should be read as dynamic prompting with access to a large annotated pool rather than as small-data performance.
  • If the retrieval index could be built from unlabeled text through pseudo-labeling or self-retrieval, the same mechanism might extend to settings with very little gold annotation; the paper does not test this.
  • The dataset-dependent winner between TF-IDF and SBERT suggests a cheap selection rule: use lexical TF-IDF on formal entity-dense text and semantic embeddings on informal or paraphrase-heavy text; this could be tested by a per-dataset retriever selector without retraining the LLM.
  • The token-level output format solves an alignment problem that plagues generative NER, and replicating that format in other generative pipelines may independently improve performance regardless of prompt selection.
Share X Bluesky LinkedIn Reddit HN

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, and a circularity audit.

Referee Report

3 major / 5 minor

Summary. This paper studies prompt engineering for few-shot biomedical NER with LLMs. It designs a static prompt with task descriptions, dataset descriptions, high-frequency entity terms, UMLS knowledge, error-analysis feedback, and k-shot examples, and evaluates GPT-3.5, GPT-4, and LLaMA 3-70B on five biomedical NER datasets. It then compares dynamic prompting, where k in-context examples are retrieved per test instance by TF-IDF, SBERT, ColBERT, or DPR, against random selection. The main reported results are that static prompting improves average F1 by 11-12% over a basic prompt, and dynamic TF-IDF/SBERT retrieval improves average F1 by 7.3% (5-shot) and 5.6% (10-shot) over random examples. The paper concludes that RAG-based dynamic prompting is useful for few-shot biomedical NER.

Significance. If the results held at face value, the paper would provide a practical recipe: retrieve similar examples with TF-IDF/SBERT and improve LLM NER without fine-tuning. Strengths include evaluation across five datasets, three LLMs, four retrieval mechanisms, public code, bootstrap confidence intervals, and a fair baseline (random selection averaged over four runs). The token-level input/output format is a sensible response to LLM tokenization mismatches. However, the headline 'few-shot' claim is scoped to a setting where the retrieval index and static prompt components are built from the full training set, and many reported differences have overlapping confidence intervals; these limits reduce the significance unless addressed.

major comments (3)
  1. [Methods: Dynamic Prompt Engineering; Experimental Setup] The central few-shot claim is not evaluated under limited annotation. The retrieval engine is 'indexed with the annotated examples from the training set' (Dynamic Prompt Engineering), and the static base prompt's high-frequency instances are computed from the full training set (Static Prompt Engineering, component 3), while error-analysis feedback is generated from LLM predictions on training instances (component 5). Thus '5-shot/10-shot/20-shot' refers only to the number of in-context examples, not the size of the annotated pool. In a deployment with only 5-20 annotated examples, the retrieval pool would contain exactly those examples, so TF-IDF/SBERT would only reorder the same k candidates and the reported 7.3%/5.6% gains over random selection would not necessarily transfer. Please either reframe the claim as 'dynamic prompting with a pre-existing annotated corpus' or add experiments with the retrieval index and prompt components restricted to k-shot subsets.
  2. [Supplementary Table 10; Results: Dynamic Prompting with RAG] The abstract's 'improving average F1-scores by 7.3% and 5.6%' hides that many dataset-specific confidence intervals overlap with the Base condition. For example, GPT-4 5-shot on Med-Mentions, TF-IDF 37.96 [35.90, 39.84] vs Base 37.95 [35.88, 39.90]; and GPT-4 5-shot Reddit_Impacts TF-IDF 28.47 [21.78, 35.47] vs Base 27.60 [19.43, 33.80]. Conversely, some comparisons such as GPT-4 5-shot NCBI TF-IDF 60.08 [56.70, 63.32] vs Base 46.93 [44.85, 51.58] are clearly separated. Please report per-comparison significance or effect sizes, and revise claims of 'significant improvements' accordingly.
  3. [Methods: Static Prompt Engineering, component 5] The error-analysis feedback component is derived from the model's own predictions on 'unseen training set instances' and then used in the same model's test prompt. Please clarify whether these instances are part of the training set (i.e., seen during retrieval indexing or high-frequency computation) or a separate development set, and whether the test set was used at any stage. As written, this component constitutes a dataset-specific fitted prompt; its contribution to the static gains (and to the dynamic base) may not generalize to a new annotation budget, especially a small one.
minor comments (5)
  1. [Table 3] The table header says 'eight standardized biomedical datasets' but only five datasets are listed and the text says 'five distinct medical text datasets'; please correct the count.
  2. [Table 2] In Table 2, the shot labels (5-shot, 10-shot, 20-shot) appear as entries in a column shared with model names; moving them to row-group headers would improve readability.
  3. [Throughout] Dataset spellings are inconsistent: REDDIT-IMPACTS, REDDIT -IMPACTS, and Reddit_Impacts are all used; please standardize.
  4. [Methods: Static Prompt Engineering] The example output contains 'addict.I-Clinical_Impacts' with a period instead of a hyphen; check the formatting consistency of the token-label separator.
  5. [Results: Dynamic Prompting with RAG] The 5-shot paragraph lists both TF-IDF (7.28%) and SBERT (7.46%) average gains, while the abstract's '7.3% and 5.6%' refers to 5-shot and 10-shot gains; clarify the mapping to avoid confusion.

Circularity Check

0 steps flagged · score 2.0 of 10

No significant circularity: the retrieval comparison is self-contained, and the self-citations and training-derived prompt components are not load-bearing.

full rationale

This is an empirical benchmarking paper, not a derivation. The central claim—that retrieval-based selection of in-context examples outperforms random selection—is supported by direct measurements on five external biomedical NER benchmarks, with random-selection baselines averaged over four runs (Methods, Experimental Setup). None of the reported improvements is forced by construction: TF-IDF/SBERT similarities are computed from the training set independently of the LLM's test predictions, and the comparison against random selection is a genuine intervention. The only training-derived prompt components (error analysis and feedback, high-frequency instances) are fitted on training data and then evaluated on held-out test sets; this is prompt tuning, not a prediction that reduces to its input. The retrieval index is built from the full training set while the paper calls the setting 'few-shot' (Methods, Dynamic Prompt Engineering: 'a retrieval engine is first indexed with the annotated examples from the training set'). This is a scope limitation—the gains may not transfer to genuinely limited annotation budgets—but it is not circular. The two self-citations (Ref. 1, a review of few-shot learning for medical text; Ref. 30, the REDDIT-IMPACTS dataset) are used for motivation and as one benchmark among five, respectively, and are not load-bearing for the central comparison. No uniqueness theorem, ansatz-by-citation, or renaming of a known result carries the argument. Overall circularity score: 2 based on the presence of minor non-load-bearing self-citations, not on any reduction of the central claim.

Assumptions & free parameters 4 free parameters · 4 assumptions · 0 invented entities

The main design choices are the number of in-context examples, the number of high-frequency terms in prompts, and decoding settings. The key assumptions are that LLMs can perform NER from token-level examples, that retrieval by similarity selects helpful examples, and that the five datasets are representative. The error analysis prompt component is ad hoc and derived from the model's own errors.

free parameters (4)
  • high_frequency_instances_per_class = 6
    The static prompt includes the top 6 most frequent words per entity type, computed from training data. The choice of k=6 is arbitrary and dataset-specific.
  • number_of_shot_examples = 5, 10, 20
    Dynamic prompting experiments use 5, 10, or 20 retrieved examples. The paper does not justify these counts.
  • LLM_decoding_settings = temperature 0.2, top_p 0.1 (GPT); temperature 0.5, top_p 0.95 (LLaMA)
    Decoding hyperparameters chosen by hand for each model.
  • random_run_count = 4
    Results are averaged over four random selections of in-context examples; no power analysis is given.
assumptions (4)
  • domain assumption In-context learning with LLMs can perform NER from token-level examples
    The method relies on GPT and LLaMA following the token-label format; stated in Methods.
  • domain assumption Similarity-based retrieval selects useful in-context examples
    The central hypothesis; tested but not proven.
  • domain assumption The five datasets are representative of biomedical NER
    Used as benchmarks; one is the authors' own Reddit dataset.
  • ad hoc to paper Error analysis feedback is generalizable
    The prompt includes manually curated feedback derived from the model's own errors on training data; may overfit to these datasets.

how reviews work

0 comments
Cite this review

Pith. "Pith review of Retrieval augmented generation based dynamic prompting for few-shot biomedical named entity recognition using large language models." pith.science (2026). https://pith.science/paper/AW2VG3ZQ

@misc{pith2026250806504,
  author       = {Pith},
  title        = {Pith review of: Retrieval augmented generation based dynamic prompting for few-shot biomedical named entity recognition using large language models},
  year         = {2026},
  howpublished = {\url{https://pith.science/paper/AW2VG3ZQ}},
  note         = {Machine review of arXiv:2508.06504}
}
read the original abstract

Biomedical named entity recognition (NER) is a high-utility natural language processing (NLP) task, and large language models (LLMs) show promise particularly in few-shot settings (i.e., limited training data). In this article, we address the performance challenges of LLMs for few-shot biomedical NER by investigating a dynamic prompting strategy involving retrieval-augmented generation (RAG). In our approach, the annotated in-context learning examples are selected based on their similarities with the input texts, and the prompt is dynamically updated for each instance during inference. We implemented and optimized static and dynamic prompt engineering techniques and evaluated them on five biomedical NER datasets. Static prompting with structured components increased average F1-scores by 12% for GPT-4, and 11% for GPT-3.5 and LLaMA 3-70B, relative to basic static prompting. Dynamic prompting further improved performance, with TF-IDF and SBERT retrieval methods yielding the best results, improving average F1-scores by 7.3% and 5.6% in 5-shot and 10-shot settings, respectively. These findings highlight the utility of contextually adaptive prompts via RAG for biomedical NER.

Figures

Figures reproduced from arXiv: 2508.06504 by the authors.

Figure 1
Figure 1. Performance distribution of prompting strategies across datasets (F1-score). The box plots depict the performance of various prompting strategies applied to five biomedical datasets, highlighting the range, median, and distribution of F1-scores for each strategy. 5/31 [PITH_FULL_IMAGE:figures/full_fig_p005_1.png] view at source ↗
Figure 2
Figure 2. Comparison of average F1-scores for GPT-4 and LLaMA 3 models across different datasets under varying shot settings. 8/31 [PITH_FULL_IMAGE:figures/full_fig_p008_2.png] view at source ↗
Figure 3
Figure 3. An overview of the NER strategy based on static prompting on three LLMs. Static prompts containing different information are provided to the LLMs, which, in turn, generate predictions for evaluation [PITH_FULL_IMAGE:figures/full_fig_p012_3.png] view at source ↗
Figures from the paper (1 more)
Figure 4
Figure 4. Figure 4: Overview of Retrieval-based Dynamic Prompting model. First the training data are provided to the retrieval engine for indexing. During inference, the system first ranks all training examples based on contextual similarity with the input text. Finally, the top n retriev…

Discussion (0). Sign in to comment.

Reference graph

Works this paper leans on

30 extracted references · 14 canonical work pages

  1. [1]

    Ge, Y ., Guo, Y ., Das, S., Al-Garadi, M. A. & Sarker, A. Few-shot learning for medical text: A review of advances, trends, and opportunities. J. Biomed. Informatics 104458 (2023)

  2. [2]

    & Dufour, R

    Labrak, Y ., Rouvier, M. & Dufour, R. A zero-shot and few-shot study of instruction-finetuned large language models applied to clinical and biomedical tasks. In Calzolari, N. et al. (eds.) Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024), 2049–2066 (ELRA and ICCL, Tor...

  3. [3]

    Brown, T. et al. Language models are few-shot learners. Adv. neural information processing systems 33, 1877–1901 (2020)

  4. [4]

    Zaghir, J. et al. Prompt engineering paradigms for medical applications: Scoping review. J. Med. Internet Res. 26, e60501 (2024)

  5. [5]

    & Zweigenbaum, P

    Yeh, H.-S., Lavergne, T. & Zweigenbaum, P. Decorate the examples: A simple method of prompt design for biomedical relation extraction. In Calzolari, N. et al. (eds.) Proceedings of the Thirteenth Language Resources and Evaluation Conference, 3780–3787 (European Language Resources Association, Marseille, France, 2022)

  6. [6]

    & Khani, F

    Ye, Q., Axmed, M., Pryzant, R. & Khani, F. Prompt engineering a prompt engineer. arXiv preprint arXiv:2311.05661 (2023)

  7. [7]

    & Jia, R

    Chang, T.-Y . & Jia, R. Data curation alone can stabilize in-context learning. In Rogers, A., Boyd-Graber, J. & Okazaki, N. (eds.) Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (V olume 1: Long Papers), 8123–8144, DOI: 10.18653/v1/2023.acl-long.452 (Association for Computational Linguistics, Toronto, Canada, 2023)

  8. [8]

    & Zhang, R

    Li, M., Zhou, H., Yang, H. & Zhang, R. Rt: a retrieving and chain-of-thought framework for few-shot medical named entity recognition. J. Am. Med. Informatics Assoc. ocae095 (2024)

Show all 30 references
  1. [9]

    Wei, J. et al. Chain-of-thought prompting elicits reasoning in large language models. Adv. neural information processing systems 35, 24824–24837 (2022)

  2. [10]

    Lewis, P. et al. Retrieval-augmented generation for knowledge-intensive nlp tasks. Adv. Neural Inf. Process. Syst. 33, 9459–9474 (2020)

  3. [11]

    W., Zhang, Z

    Liao, T. W., Zhang, Z. & Mount, C. R. Similarity measures for retrieval in case-based reasoning systems. Appl. Artif. Intell. 12, 267–288 (1998). 20/31

  4. [12]

    Gao, Y . et al. Retrieval-augmented generation for large language models: A survey. arXiv preprint arXiv:2312.10997 (2023)

  5. [13]

    Jin, Q., Yang, Y ., Chen, Q. & Lu, Z. Genegpt: Augmenting large language models with domain tools for improved access to biomedical information. Bioinformatics 40, btae075 (2024)

  6. [14]

    & Zhang, A

    Xiong, G., Jin, Q., Lu, Z. & Zhang, A. Benchmarking retrieval-augmented generation for medicine. arXiv preprint arXiv:2402.13178 (2024)

  7. [15]

    Jeong, S., Baek, J., Cho, S., Hwang, S. J. & Park, J. C. Adaptive-rag: Learning to adapt retrieval-augmented large language models through question complexity. arXiv preprint arXiv:2403.14403 (2024)

  8. [16]

    Sahoo, P. et al. A systematic survey of prompt engineering in large language models: Techniques and applications. arXiv preprint arXiv:2402.07927 (2024)

  9. [17]

    & Goldberg, Y

    Levy, M., Jacoby, A. & Goldberg, Y . Same task, more tokens: the impact of input length on the reasoning performance of large language models. arXiv preprint arXiv:2402.14848 (2024)

  10. [18]

    Xie, T. et al. Empirical study of zero-shot NER with ChatGPT. In Bouamor, H., Pino, J. & Bali, K. (eds.) Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing , 7935–7956, DOI: 10.18653/v1/2023.emnlp-main.493 (Association for Computational Ling...

  11. [19]

    Improving large language models for clinical named entity recognition via prompt engineering

    Hu, Y .et al. Improving large language models for clinical named entity recognition via prompt engineering. J. Am. Med. Informatics Assoc. ocad259, DOI: 10.1093/jamia/ocad259 (2024). https://academic.oup.com/jamia/ advance-article-pdf/doi/10.1093/jamia/ocad259/56437671/ocad259.pdf

  12. [20]

    A statistical interpretation of term specificity and its application in retrieval

    Sparck Jones, K. A statistical interpretation of term specificity and its application in retrieval. J. documentation 28, 11–21 (1972)

  13. [21]

    Sentence-bert: Sentence embeddings using siamese bert-networks.arXiv preprint arXiv:1908.10084 (2019)

    Reimers, N. Sentence-bert: Sentence embeddings using siamese bert-networks.arXiv preprint arXiv:1908.10084 (2019)

  14. [22]

    & Zaharia, M

    Khattab, O. & Zaharia, M. Colbert: Efficient and effective passage search via contextualized late interaction over bert. In Proceedings of the 43rd International ACM SIGIR conference on research and development in Information Retrieval, 39–48 (2020)

  15. [23]

    Karpukhin, V . et al. Dense passage retrieval for open-domain question answering. arXiv preprint arXiv:2004.04906 (2020). 21/31

  16. [24]

    Morey, R. D. et al. Confidence intervals from normalized data: A correction to cousineau (2005). Tutorials quantitative methods for psychology 4, 61–64 (2008)

  17. [25]

    Bootstrap methods: another look at the jackknife

    Efron, B. Bootstrap methods: another look at the jackknife. In Breakthroughs in statistics: Methodology and distribution, 569–593 (Springer, 1992)

  18. [26]

    Johnson, A. E. et al. Mimic-iii, a freely accessible critical care database. Sci. data 3, 1–9, DOI: 10.1038/sdata. 2016.35 (2016)

  19. [27]

    Li, J. et al. BioCreative V CDR task corpus: a resource for chemical disease relation extraction. Database 2016, baw068, DOI: 10.1093/database/baw068 (2016). https://academic.oup.com/database/article-pdf/doi/10.1093/ database/baw068/8224483/baw068.pdf

  20. [28]

    Mohan, S. & Li, D. Medmentions: A large biomedical corpus annotated with {umls} concepts. In Automated Knowledge Base Construction (AKBC) (2019)

  21. [29]

    I., Leaman, R

    Do˘gan, R. I., Leaman, R. & Lu, Z. Ncbi disease corpus: A resource for disease name recognition and concept normalization. J. Biomed. Informatics 47, 1–10, DOI: https://doi.org/10.1016/j.jbi.2013.12.006 (2014)

  22. [30]

    receptor

    Ge, Y .et al. Reddit-impacts: A named entity recognition dataset for analyzing clinical and social effects of substance use derived from social media. arXiv preprint arXiv:2405.06145 (2024). 22/31 A Averaged Performance of the Baseline Dynamic Prompt Model Precision Recall F 1...

Pith tools

Reviewed August 6, 2026 · model on record in the stance chip above.