REVIEW 4 major objections 6 minor 37 references
Comparing Lexical and Semantic Vector Search Methods When Classifying Medical Documents
T0 review · 4 major / 6 minor · reviewed 2026-08-15 · deepseek-v4-flash
Pith's one-line read For rigidly structured medical documents, a bespoke lexical BM25 vector search matches or beats off-the-shelf semantic neural embeddings in accuracy, and does it far faster.
desk verdict Honest but confounded benchmark: the lexical-vs-semantic conclusion holds for the paper's preprocessing pipeline, not as a general claim about the methods. read the letter →
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
The reading
What carries the argument
The machinery is a controlled comparison of seven embedding methods inside one vector-search classifier. Lexical methods produce sparse vectors from term statistics, such as TF counts, TF-IDF weights, and BM25+ scores with saturation and document-length normalisation, while semantic methods produce dense vectors from neural models (word2vec, med2vec, MiniLM, mxbai). The same pipeline feeds every method: transcribed text is lowercased, stripped of punctuation, numbers, dates, parentheses, and unicode, stemmed, and filtered for stopwords; a vocabulary is built from the training set; embeddings are stored in a vector database; and each test document's class is the majority of its 5 nearest stored embeddings under Euclidean distance. The identity that carries the comparison is therefore the embedding itself: if the best sparse term-statistic embedding beats the best dense neural embedding on this data, the win is attributed to the representation rather than to any model-specific training, since the downstream classifier is identical.
What would settle it
Run the same 75:25 k-nearest-neighbour classification on an equivalent set of rigidly structured medical documents, changing only the preprocessing from the paper's aggressive pipeline to lowercasing alone; if MiniLM or mxbai then exceeds BM25 in accuracy, the paper's central conclusion is an artifact of the shared preprocessing rather than a property of the methods.
Extended reading notes
Core claim
On the authors' own terms, the discovery is that the choice between lexical and semantic representation can be reversed by task structure. Using the same preprocessing, the same k-nearest-neighbour classifier (k of 5, Euclidean distance), and the same 75:25 data split, BM25 achieved the highest average predictive accuracy of the seven methods, edging out MiniLM; word2vec, med2vec, and mxbai trailed, and TF and TF-IDF were at the bottom. The detail that carried the argument was speed: BM25's embedding and search times were near negligible, while the neural models, especially mxbai, took substantially longer. The paper interprets this as evidence that off-the-shelf semantic vector search is not always the best solution and that lexical methods deserve to be contenders, particularly when execution time or hardware constraints matter. It also reports that med2vec, trained on medical text, did not perform particularly well, suggesting document structure mattered more than medical vocabulary in this dataset.
Load-bearing premise
The load-bearing premise is that one aggressive preprocessing pipeline, removing punctuation, numbers, dates, parentheses, and unicode, then stemming and removing stopwords, treats lexical and semantic methods fairly, even though the neural models are normally used with raw or lightly cleaned text.
Editorial extensions
If this is right
- Traditional lexical search should be included as a baseline in any document-classification benchmark; on rigidly structured corpora it can beat state-of-the-art neural embeddings.
- For tasks where document template and layout matter more than vocabulary, expensive domain-specific language models may add little, and structure-aware simple models may be the better investment.
- Class imbalance distorts k-nearest-neighbour accuracy even when embeddings are good, so per-class precision and recall reporting and balancing are necessary for meaningful comparisons.
- When execution time is a constraint, such as high-throughput or on-premise processing of sensitive medical records, BM25's speed advantage makes it a practical choice over semantic search.
- Increasing the amount of stored or training data raises accuracy across methods, so data collection may improve results more than adopting a more sophisticated embedding model.
Reading between the lines
- Editorial inference: the aggressive preprocessing pipeline, especially stemming and deleting numbers and dates, likely harms dense neural embeddings disproportionately; rerunning with method-appropriate cleaning could shrink or reverse the accuracy gap.
- Editorial inference: because classes F and G, the most rigidly structured classes, were nearly perfectly classified by every method, this corpus may be an easy case for lexical methods, and free-form clinical notes would probably shift the balance toward semantic models.
- Editorial inference: the memory comparison overstates the practical cost of lexical embeddings, since sparse vectors can be stored by non-zero entries alone; a sparse-storage implementation could remove the main resource advantage the paper grants to semantic methods.
- Editorial inference: a direct test of the class-imbalance claim would be to re-run all methods on a balanced subsample or with class weights, and the paper's own results predict that the majority class's advantage would shrink and the ranking could shift.
Signed reviews
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. This manuscript compares seven embedding methods (TF, TF-IDF, BM25+, word2vec, med2vec, MiniLLM/MiniLM, and mxbai) for classifying 1,472 rigidly structured medical documents into seven classes using k-nearest-neighbour vector search. The main empirical claims are that lexical vector search, especially BM25, achieves slightly higher predictive accuracy than off-the-shelf semantic vector search while requiring less execution time, that an unbalanced class distribution biases accuracy, and that larger stored sets improve accuracy. The evaluation uses held-out splits with 10 shuffled replicates, per-class precision/recall/F1, and transparent variation of the data-split ratio and the number of neighbours.
Significance. If the central comparison were fully supported, the paper would be a useful empirical counterpoint to the default use of neural embeddings: it demonstrates on a real, rigidly structured medical corpus that a simple lexical method with corpus-specific preprocessing can match or beat off-the-shelf sentence transformers while being much faster. The held-out evaluation, repeated seeds, explicit default hyperparameters, and per-class figures are strengths. However, the headline claim is currently threatened by the use of a single aggressive preprocessing pipeline tailored to lexical matching and applied unchanged to transformer models, and by the absence of variance reporting or significance tests for the small accuracy differences. The contribution is a single-domain observational benchmark with no released code or data, so its generalizability and reproducibility are limited.
major comments (4)
- [Sec. III-D, Table I, Fig. 4] The single preprocessing pipeline is a confound for the headline lexical-vs-semantic comparison. Lowercasing, removing all punctuation, numbers, dates, parentheses, and unicode, then stemming and removing stopwords, is standard for BM25 and TF-IDF, but it is not how off-the-shelf transformer embedding models such as MiniLM and mxbai are normally used. Stemmed forms are unnatural inputs to subword tokenizers, and removing numbers and dates can strip discriminative content such as dosages, reference numbers, and appointment dates from the rigidly structured classes F and G. The abstract therefore overstates the finding: the experiment demonstrates that BM25 under this preprocessing pipeline beats MiniLM/mxbai under the same pipeline, not that lexical search in general beats off-the-shelf semantic search. Please add a condition in which the semantic models are run on raw or lightly cleaned text, or otherwise justify that the preprocessing does not disproportionately handicap the neural models.
- [Fig. 4, Sec. V-A] The claim that BM25 is 'slightly' more accurate than MiniLM is based on mean accuracy over 10 seeds, but Fig. 4 shows no standard deviations, confidence intervals, or significance tests for those means. The differences across data splits appear small, and with only 10 seeds the gap could plausibly be within seed variance. Please report the per-seed distributions (or confidence intervals) and a paired significance test across the 10 seeds for the BM25-vs-MiniLM comparison at each split, or weaken the claim accordingly.
- [Sec. IV, Table I, Fig. 4] Because the default class E contains 803 of 1,472 documents (about 55%), the overall accuracy values in Fig. 4 are strongly influenced by how well class E is predicted. The paper discusses this class-imbalance bias in Sec. V-B but never reports the trivial majority-class baseline (always predicting E) or a macro-averaged accuracy. Without that baseline, the reader cannot determine how much of the reported accuracy reflects genuine discrimination rather than the class prior. Please add the majority-class baseline and macro-averaged metrics to Fig. 4 and the associated discussion.
- [Sec. II-E2, Sec. III-E, Figs. 2-5] The model is referred to inconsistently as 'MiniLLM' in the text and reference [19], and as 'minilm' in the figures and Sec. II-E2. Reference [19] describes a knowledge-distillation method for autoregressive language models, not an off-the-shelf sentence-embedding model, while MiniLM is a different architecture. Please specify the exact model and checkpoint used (for example, the specific ollama model or Hugging Face identifier), the parameter variant, and any quantization, and correct the terminology and reference. The comparison depends on which semantic model is actually being evaluated.
minor comments (6)
- [Eq. (5)] The BM25+ formula has unbalanced parentheses in the denominator; please rewrite it so that the term-frequency normalisation is unambiguous.
- [Fig. 3 caption] The caption says the timing process was repeated 25 times, while the methodology in Sec. III-G says experiments were repeated 10 times with different random seeds; please clarify which number is correct.
- [Sec. II-D vs Sec. III-E] The text says BM25+ with a delta term was used, but Sec. III-E says the 'default BM25 algorithm' from bm25s was used; please reconcile whether the experiments used BM25+ or plain BM25.
- [Fig. 4 caption] There is a typo in 'Stored:T est Data Split'; it should read 'Stored:Test Data Split'.
- [Sec. III-G] The phrase 'under the initial assumption that more is better' conflicts with the later result that accuracy decreases as k increases; rephrase to describe the choice neutrally.
- [Sec. V-A] The colour descriptions for the lexical and semantic methods overlap ('brown' appears in both groups); please make the colour references unambiguous or add patterns to the figures for accessibility.
Circularity Check
No circularity: the paper is an empirical benchmark with held-out test splits, and the preprocessing fairness concern is a validity issue rather than a circular derivation.
full rationale
The paper reports a direct empirical comparison: 1472 medical documents are transcribed, preprocessed with one pipeline, embedded by seven methods (TF, TF-IDF, BM25, word2vec, med2vec, MiniLM, mxbai), stored on a 75% split, and evaluated on the held-out 25% split with multiple random seeds. Predictive accuracy is measured on test documents that were not used to fit or tune the lexical vocabularies or the nearest-neighbour parameters. There is no equation that defines a method in terms of its own accuracy, no fitted parameter that is later renamed as a prediction, and no load-bearing self-citation: the cited external libraries and prior results are background context, not premises from which the conclusion is derived. The reader's concern that the aggressive preprocessing in Sec. III-D (lowercase, remove punctuation/numbers/dates/parentheses/unicode, stem, remove stopwords) may disadvantage off-the-shelf transformer embeddings is a legitimate threat to the fairness or generalizability of the comparison, but it is not circularity: the paper does not define 'lexical search' as 'the method that wins after this pipeline' and does not define 'semantic search' as 'the method that loses.' The conclusion is an empirical observation about this dataset, preprocessing pipeline, and model set, not a derivation that reduces to its own inputs. No circular step can be exhibited with a specific equation or self-citation chain, so the appropriate score is 0.
Assumptions & free parameters
free parameters (4)
- BM25 k1 =
1
- BM25 b =
0.75
- BM25 delta =
1
- kNN k (number of neighbours) =
5
assumptions (4)
- domain assumption Ground truth class labels assigned from filename content and visual artefacts are correct.
- domain assumption Aggressive preprocessing (lowercase, strip punctuation/numbers/dates, stem, remove stopwords) does not bias the comparison against semantic models.
- domain assumption Euclidean distance is an appropriate similarity measure for all embedding types.
- domain assumption The sample of 100 medical cases collected over a 4-month window is representative of the document classification task.
Cite this review
Pith. "Pith review of Comparing Lexical and Semantic Vector Search Methods When Classifying Medical Documents." pith.science (2026). https://pith.science/paper/PPSW4AZN
@misc{pith2026250511582,
author = {Pith},
title = {Pith review of: Comparing Lexical and Semantic Vector Search Methods When Classifying Medical Documents},
year = {2026},
howpublished = {\url{https://pith.science/paper/PPSW4AZN}},
note = {Machine review of arXiv:2505.11582}
}
read the original abstract
Classification is a common AI problem, and vector search is a typical solution. This transforms a given body of text into a numerical representation, known as an embedding, and modern improvements to vector search focus on optimising speed and predictive accuracy. This is often achieved through neural methods that aim to learn language semantics. However, our results suggest that these are not always the best solution. Our task was to classify rigidly-structured medical documents according to their content, and we found that using off-the-shelf semantic vector search produced slightly worse predictive accuracy than creating a bespoke lexical vector search model, and that it required significantly more time to execute. These findings suggest that traditional methods deserve to be contenders in the information retrieval toolkit, despite the prevalence and success of neural models.
Figures
Reference graph
Works this paper leans on
-
[21]
Rapid Biomedical Research Classification: The Pandemic PACT Advanced Categorisation Engine
O. Rohanian, M. Nouriborji, O. Seminog, R. Furst, T. Mendy, S. Lev- anita, Z. Kadri-Alabi, N. Jabin, D. Toale, G. Humphreyset al., “Rapid biomedical research classification: The pandemic pact advanced cate- gorisation engine,”arXiv preprint arXiv:2407.10086, 2024
work page Pith review arXiv 2024
-
[19]
Minillm: Knowledge distillation of large language models,
Y . Gu, L. Dong, F. Wei, and M. Huang, “Minillm: Knowledge distillation of large language models,” inThe Twelfth International Conference on Learning Representations, 2024
2024
-
[1]
Summarization from medical documents: a survey,
S. Afantenos, V . Karkaletsis, and P. Stamatopoulos, “Summarization from medical documents: a survey,”Artificial intelligence in medicine, vol. 33, no. 2, pp. 157–177, 2005
work page 2005
-
[2]
Automatic indexing: an experimental inquiry,
M. E. Maron, “Automatic indexing: an experimental inquiry,”Journal of the ACM (JACM), vol. 8, no. 3, pp. 404–417, 1961
work page 1961
-
[3]
A tutorial on automated text categorisation,
F. Sebastianiet al., “A tutorial on automated text categorisation,” inProceedings of ASAI-99, 1st Argentinian Symposium on Artificial Intelligence. Buenos Aires, AR, 1999, pp. 7–35
work page 1999
-
[4]
Historical overview of ai adoption in libraries,
R. Jayavadivel, M. Arunachalam, G. Nagarajan, B. P. Shankar, C. Viji, N. Rajkumar, and K. Senthilkumar, “Historical overview of ai adoption in libraries,” inAI-Assisted Library Reconstruction. IGI Global, 2024, pp. 267–289
work page 2024
-
[5]
Between words and charac- ters: A brief history of open-vocabulary modeling and tokenization in nlp,
S. J. Mielke, Z. Alyafeai, E. Salesky, C. Raffel, M. Dey, M. Gall ´e, A. Raja, C. Si, W. Y . Lee, B. Sagotet al., “Between words and charac- ters: A brief history of open-vocabulary modeling and tokenization in nlp,”arXiv preprint arXiv:2112.10508, 2021
arXiv 2021
-
[6]
What are you token about? dense retrieval as distributions over the vocabulary,
O. Ram, L. Bezalel, A. Zicher, Y . Belinkov, J. Berant, and A. Globerson, “What are you token about? dense retrieval as distributions over the vocabulary,”arXiv preprint arXiv:2212.10380, 2022
arXiv 2022
Show all 37 references
-
[7]
Recurrent convolutional neural networks for text classification,
S. Lai, L. Xu, K. Liu, and J. Zhao, “Recurrent convolutional neural networks for text classification,” inProceedings of the AAAI conference on artificial intelligence, vol. 29, no. 1, 2015
2015
-
[8]
Fake review detection using transformer-based enhanced lstm and roberta,
R. Mohawesh, H. B. Salameh, Y . Jararweh, M. Alkhalaileh, and S. Maq- sood, “Fake review detection using transformer-based enhanced lstm and roberta,”International Journal of Cognitive Computing in Engineering, vol. 5, pp. 250–258, 2024
2024
-
[9]
Bert: Pre-training of deep bidirectional transformers for language understanding,
J. Devlin, “Bert: Pre-training of deep bidirectional transformers for language understanding,”arXiv preprint arXiv:1810.04805, 2018
2018 arXiv
-
[10]
Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead,
C. Rudin, “Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead,”Nature machine intelligence, vol. 1, no. 5, pp. 206–215, 2019
2019
-
[11]
Gormley and Z
C. Gormley and Z. Tong,Elasticsearch: the definitive guide: a dis- tributed real-time search and analytics engine. ” O’Reilly Media, Inc.”, 2015
2015
-
[12]
Retrieval- augmented generation for knowledge-intensive nlp tasks,
P. Lewis, E. Perez, A. Piktus, F. Petroni, V . Karpukhin, N. Goyal, H. K ¨uttler, M. Lewis, W.-t. Yih, T. Rockt ¨aschelet al., “Retrieval- augmented generation for knowledge-intensive nlp tasks,”Advances in Neural Information Processing Systems, vol. 33, pp. 9459–9474, 2020
2020
-
[13]
Deep learning with gpus,
W. Jeon, G. Ko, J. Lee, H. Lee, D. Ha, and W. W. Ro, “Deep learning with gpus,” inAdvances in Computers. Elsevier, 2021, vol. 122, pp. 167–215
2021
-
[14]
Rethinking simd vectorization for in-memory databases,
O. Polychroniou, A. Raghavan, and K. A. Ross, “Rethinking simd vectorization for in-memory databases,” inProceedings of the 2015 ACM SIGMOD International Conference on Management of Data, 2015, pp. 1493–1508
2015
-
[15]
ANNOY library,
“ANNOY library,” https://github.com/spotify/annoy, accessed: 2024-11- 01
2024
-
[16]
Efficient and robust approxi- mate nearest neighbor search using hierarchical navigable small world graphs,
Y . A. Malkov and D. A. Yashunin, “Efficient and robust approxi- mate nearest neighbor search using hierarchical navigable small world graphs,”IEEE transactions on pattern analysis and machine intelligence, vol. 42, no. 4, pp. 824–836, 2018
2018
-
[17]
Efficient estimation of word representations in vector space,
T. Mikolov, K. Chen, G. Corrado, and J. Dean, “Efficient estimation of word representations in vector space,”arXiv preprint arXiv:1301.3781, 2013
2013 arXiv
-
[18]
Launching into clinical space with medspacy: a new clinical text processing toolkit in python,
H. Eyre, A. B. Chapman, K. S. Peterson, J. Shi, P. R. Alba, M. M. Jones, T. L. Box, S. L. DuVall, and O. V . Patterson, “Launching into clinical space with medspacy: a new clinical text processing toolkit in python,” inAMIA Annual Symposium Proceedings, vol. 2021, 2022, p. 438
2021
-
[20]
S. Lee, A. Shakir, D. Koenig, and J. Lipp. (2024) Open source strikes bread - new fluffy embedding model. [Online]. Available: https://www.mixedbread.ai/blog/mxbai-embed-large-v1
2024
-
[22]
A brief survey of vector databases,
X. Xie, H. Liu, W. Hou, and H. Huang, “A brief survey of vector databases,” in2023 9th International Conference on Big Data and Information Analytics (BigDIA). IEEE, 2023, pp. 364–371
2023
-
[23]
Improving lexical embeddings with semantic knowledge,
M. Yu and M. Dredze, “Improving lexical embeddings with semantic knowledge,” inProceedings of the 52nd Annual Meeting of the Asso- ciation for Computational Linguistics (Volume 2: Short Papers), 2014, pp. 545–550
2014
-
[24]
Hallucinations in llms: Understanding and addressing challenges,
G. Perkovi ´c, A. Drobnjak, and I. Boti ˇcki, “Hallucinations in llms: Understanding and addressing challenges,” in2024 47th MIPRO ICT and Electronics Convention (MIPRO). IEEE, 2024, pp. 2084–2088
2024
-
[25]
Glove: Global vectors for word representation,
J. Pennington, R. Socher, and C. D. Manning, “Glove: Global vectors for word representation,” inProceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), 2014, pp. 1532–1543
2014
-
[26]
Measuring disentanglement: A review of metrics,
M.-A. Carbonneau, J. Zaidi, J. Boilard, and G. Gagnon, “Measuring disentanglement: A review of metrics,”IEEE transactions on neural networks and learning systems, 2022
2022
-
[27]
Toy models of superposition,
N. Elhage, T. Hume, C. Olsson, N. Schiefer, T. Henighan, S. Kravec, Z. Hatfield-Dodds, R. Lasenby, D. Drain, C. Chenet al., “Toy models of superposition,”arXiv preprint arXiv:2209.10652, 2022
2022 arXiv
-
[28]
Lower-bounding term frequency normalization,
Y . Lv and C. Zhai, “Lower-bounding term frequency normalization,” in Proceedings of the 20th ACM international conference on Information and knowledge management, 2011, pp. 7–16
2011
-
[29]
Comparison of term frequency and document frequency based feature selection metrics in text categorization,
N. Azam and J. Yao, “Comparison of term frequency and document frequency based feature selection metrics in text categorization,”Expert Systems with Applications, vol. 39, no. 5, pp. 4760–4768, 2012
2012
-
[30]
Okapi at trec-3,
S. E. Robertson, S. Walker, S. Jones, M. M. Hancock-Beaulieu, M. Gat- fordet al., “Okapi at trec-3,”Nist Special Publication Sp, vol. 109, p. 109, 1995
1995
-
[31]
A review of recurrent neural networks: Lstm cells and network architectures,
Y . Yu, X. Si, C. Hu, and J. Zhang, “A review of recurrent neural networks: Lstm cells and network architectures,”Neural computation, vol. 31, no. 7, pp. 1235–1270, 2019
2019
-
[32]
Summary of chatgpt-related research and perspective towards the future of large language models,
Y . Liu, T. Han, S. Ma, J. Zhang, Y . Yang, J. Tian, H. He, A. Li, M. He, Z. Liuet al., “Summary of chatgpt-related research and perspective towards the future of large language models,”Meta-Radiology, p. 100017, 2023
2023
-
[33]
It’s not just size that matters: Small language models are also few-shot learners,
T. Schick and H. Sch ¨utze, “It’s not just size that matters: Small language models are also few-shot learners,”arXiv preprint arXiv:2009.07118, 2020
2009 arXiv
-
[34]
An overview of the tesseract ocr engine,
R. Smith, “An overview of the tesseract ocr engine,” inNinth interna- tional conference on document analysis and recognition (ICDAR 2007), vol. 2. IEEE, 2007, pp. 629–633
2007
-
[35]
The impact of preprocessing on word embedding quality: A comparative study,
Z. Rahimi and M. M. Homayounpour, “The impact of preprocessing on word embedding quality: A comparative study,”Language Resources and Evaluation, vol. 57, no. 1, pp. 257–291, 2023
2023
-
[36]
Bm25s: Orders of magnitude faster lexical search via eager sparse scoring,
X. H. L `u, “Bm25s: Orders of magnitude faster lexical search via eager sparse scoring,”arXiv preprint arXiv:2407.03618, 2024
2024 arXiv
-
[37]
The llama 3 herd of models,
A. Dubey, A. Jauhri, A. Pandey, A. Kadian, A. Al-Dahle, A. Letman, A. Mathur, A. Schelten, A. Yang, A. Fanet al., “The llama 3 herd of models,”arXiv preprint arXiv:2407.21783, 2024
2024 arXiv
Reviewed August 15, 2026 · model on record in the stance chip above.
Discussion (0). Continue with ORCID to comment.