Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Filter by Categories
Abstracts
Book Review
Case Report
Case Series
CMAS‡ - Pancreas - EUS-FNA Cytopathology (PSC guidelines) S1:1 of 5
CMAS‡ - Pancreas - EUS-FNA Cytopathology (PSC guidelines) S1:3 of 5
CMAS‡ - Pancreas - EUS-FNA Cytopathology (PSC guidelines) S1:4 of 5
CMAS‡ - Pancreas -Sampling Techniques for Cytopathology (PSC guidelines) S1:2 of 5
CMAS‡ - Pancreas- EUS-FNA Cytopathology (PSC guidelines) S1:5 of 5
Commentary
Correction
CytoJournal Monograph Related Review Series
CytoJournal Monograph Related Review Series (CMAS), Editorial
CytoJournal Monograph Related Review Series: Editorial
Cytojournal Quiz Case
Editorial
Erratum
Letter to Editor
Letter to the Editor
Letters to Editor
Methodology
Methodology Article
Methodology Articles
Original Article
Pap Smear Collection and Preparation: Key Points
Quiz Case
Research
Research Article
Review
Review Article
Systematic Review and Meta Analysis
View Point
View/Download PDF

Translate this page into:

Research Article
2026
:23;
47
doi:
10.25259/Cytojournal_192_2025

Automating fine needle aspiration and non-gynecologic quality control using a large language model: A real-world evaluation of diagnostic accuracy and efficiency

Department of Pathology and Laboratory Medicine, Penn State Health Milton S. Hershey Medical Center, Hershey, United States.
Author image
Corresponding author: Christopher Jackson, Department of Pathology and Laboratory Medicine, Penn State Health Milton S. Hershey Medical Center, Hershey, United States. cjackson18@pennstatehealth.psu.edu
Licence
This is an open-access article distributed under the terms of the Creative Commons Attribution-Non Commercial-Share Alike 4.0 License, which allows others to remix, transform, and build upon the work non-commercially, as long as the author is credited and the new creations are licensed under the identical terms.

How to cite this article: Naik S, Nishadham V, Jackson C. Automating fine needle aspiration and non-gynecologic quality control using a large language model: A real-world evaluation of diagnostic accuracy and efficiency. CytoJournal. 2026;23:47. doi: 10.25259/Cytojournal_192_2025

Abstract

Objectives:

Cytopathology laboratories are required to track diagnostic category distributions as part of quality control (QC) under Clinical Laboratory Improvement Amendments regulations. This process is typically manual, time-consuming, and prone to inconsistency. We evaluated whether a large language model (LLM) could accurately and efficiently categorize cytopathology reports to support regulatory QC processes.

Material and Methods:

A total of 472 fine needle aspiration and non-gynecologic (NG) cytology reports from 1–31 January 2024 were processed using DeepSeek-R1:32B, a locally deployed open-source LLM. GYN cytology reports were excluded because their diagnostic categories are already captured as discrete data in our laboratory information system, eliminating the need for natural language processing. The model extracted the final diagnosis, diagnostic category, and confidence score from each report. A board-certified cytopathologist independently reviewed all cases to serve as the ground truth. Cases were categorized as correct or incorrect. Time required for manual versus artificial intelligence (AI)-assisted review was also measured.

Results:

The model achieved 98.5% categorization agreement (95% confidence interval: 97.0–99.3%; Cohen’s Kappa = 0.973) with expert review (465/472 cases were classified as correct), with only 1.5% (7/472) raw misclassifications. Most misclassifications were due to semantic ambiguity, missing context, or institutional interpretation conventions. The pipeline implemented a human-in-the-loop mechanism by flagging low-confidence or non-standard outputs for manual review, enhancing safety. The AI-assisted workflow reduced total review time by 98.5%, from 279 to 4.15 min.

Conclusion:

This study demonstrates that LLMs can accurately and safely support cytopathology QC tasks, significantly reducing workload while maintaining reporting consistency. With further development and validation, LLM-powered tools may become integral to pathology workflows across specialties.

Keywords

Artificial intelligence
Clinical natural language processing
Cytopathology
Diagnostic automation
Fine needle aspiration
Large language model
Quality control

INTRODUCTION

Cytopathology laboratories in the United States are required under the Clinical Laboratory Improvement Amendments (CLIA) to track and report specific quality control (QC) metrics. Among these is the distribution of diagnostic categories assigned to specimens, which serves as a measure of consistency across cytotechnologists, cytopathologists, and the laboratory as a whole.[1,2] At our laboratory, this categorization is performed manually on a monthly basis. A designated cytotechnologist retrospectively reviews each final report, extracts the diagnostic category (Non-diagnostic, Benign, Atypical, Suspicious, or Malignant), and enters the tally into a spreadsheet. This aggregate data is then used to generate a monthly QC report that is reviewed by the Laboratory Director. The statistics are essential for CLIA compliance, allowing us to monitor for diagnostic drift over time, identify potential areas for staff education, and calculate individual cytopathologist/cytotechnologist rates of diagnoses.

The free text in the reports may or may not explicitly include the diagnostic categories, depending on the case and the professional judgment of the cytopathologist. Numerous laboratory information systems (LIS) allow for these categories to be entered discretely at the time of sign-out; however, this feature is not universally implemented or available. In our laboratory, we utilize the Cerner PathNet LIS (Oracle Corporation, Austin, Texas, USA), which technically allows for discrete data entry of the diagnostic category. However, this feature is often bypassed. Many fine needle aspiration (FNA) and some non-gynecologic (NG) cases involve multiple specimens, such as passes from different sites or organs that warrant different diagnostic categories. The LIS forces entry of a single category for the case, which often results in a non-specific “mixed” designation that negates the utility of the discrete category capture. Although this limitation reflects our local institutional LIS configuration, other laboratories face similar barriers to consistent discrete capture, such as free-text amendments and uncommon case scenarios. The relatively straightforward development and implementation of this large language model (LLM)-based system suggest that this approach could be easily adapted by other institutions to address their own informatics limitations. Accurate categorization is essential for maintaining diagnostic standards, yet this process can be time-consuming when it is performed manually. In addition to the substantial time demands, it introduces the potential for human error and inconsistency.

The increasing shortage of pathologists and cytotechnologists further compounds these challenges. In the United States, there are approximately 6.4 pathologists per 100,000 individuals, and <10.5% of them are aged <40.[3] Meanwhile, the number of graduating cytotechnologists has decreased from 246 per year in 2007 to 109 per year in 2022.[4] As workloads increase and staffing challenges grow, there is a critical need to explore automation tools that can support existing personnel in meeting their regulatory and clinical responsibilities.

While cytopathology features several highly standardized reporting systems (e.g., Bethesda for thyroid, Paris System for urine), the diagnostic ambiguity remaining in many other specimen types (e.g., effusions, lymph nodes, soft tissue) still necessitates the interpretation of highly variable free-text. Furthermore, the categories within these standardized systems (e.g., “Neoplastic: Other” or “Salivary Gland Neoplasm of Undetermined Malignant Potential”) do not always map cleanly to the five regulatory QC categories required by CLIA. Traditional text automation approaches, such as regular-expression-based string searching, are notoriously brittle and often fail in the presence of semantic nuance. For example, they may misclassify a report stating “Negative for high-grade carcinoma” simply because it contains the phrase “high-grade carcinoma.” Conversely, training a classical machine learning model requires massive, manually annotated datasets, which are time-consuming and expensive. We chose an LLM approach because its zero-shot learning capability allows it to interpret the subtle, context-dependent language of pathology reports without the need for extensive, task-specific data annotation, thus offering a robust, cost-effective, and semantically sensitive solution for this regulatory task.

LLMs represent a promising class of artificial intelligence (AI) tools that have demonstrated robust capabilities in understanding and generating human language. Trained on vast quantities of text data, LLMs can extract structured information from unstructured documents, perform text classification, and summarize clinical content without requiring task-specific training.[5,6] Several recent studies have shown that LLMs can match or outperform traditional natural language processing (NLP) pipelines for extracting structured data from pathology reports.[7,8] Some tools have even been deployed within hospital firewalls to protect patient privacy while enabling rapid and accurate data processing.[9]

However, most prior work has focused on extracting clinical or research data from pathology reports and not on assisting with operational laboratory tasks such as regulatory QC monitoring. Our study addresses this gap by evaluating whether a modern LLM can be used to automate a real-world cytopathology QC task: Categorizing pathology reports by diagnostic category in a CLIA-compliant format. Importantly, our aim was not to replace manual workflows. Instead, we evaluated whether LLMs are capable of performing this narrowly defined and legally required function with sufficient reliability to support human experts. Crucially, the LLM’s performance is evaluated strictly on its NLP accuracy in interpreting the finalized diagnostic text, not on diagnostic accuracy or correlation with subsequent histopathologic gold standards. This demonstration of reliable, efficient automation of a mandated regulatory task represents a significant step toward improving laboratory efficiency and mitigating the impact of ongoing workforce shortages.

MATERIAL AND METHODS

Human subjects and ethical approval

This study was conducted in accordance with the Code of Ethics of the World Medical Association (Declaration of Helsinki) for experiments involving humans. All procedures were performed in compliance with relevant laws and institutional guidelines.

The proposed activity, as described in this manuscript, was reviewed by the Human Research Protection Program (Institutional Review Board [IRB] Study ID: STUDY00026725, Submission ID: STUDY00026725). The program determined that this activity does not meet the definition of human subject research as defined in 45 CFR 46.102(e) and/or (l). Therefore, IRB review and approval were not required.

All patient reports were de-identified at the time of data collection to ensure patient privacy. Given the de-identified nature of the data and the determination that the activity does not constitute human subject research, informed consent was not required. The privacy rights of human subjects were observed throughout the study.

Study design and dataset

This study evaluated the performance of an LLM in automating diagnostic categorization of cytopathology reports as part of a CLIA QC workflow. The current manual QC process in our laboratory serves as the operational baseline for this study, against which we compared the LLM-assisted workflow’s accuracy and efficiency.

Reports were retrieved from the Cerner Oracle LIS and represented all FNA and NG cytology cases accessioned between January 1st and 31st, 2024. Gynecologic (GYN) cytology reports were intentionally excluded from this analysis because their diagnostic categories are consistently captured in our LIS as discrete, categorical data (structured fields). Including these cases would have measured the extraction of pre-structured data rather than the interpretation of unstructured free text. We therefore focused on FNA and NG cases where NLP is operationally required in our workflow.

In total, 472 reports were included, comprising 149 FNA and 323 NG cases. All cases were included, and to simulate real-world conditions, there were no exclusion criteria.

Each report contained unstructured free-text fields authored by cytopathologists, including final diagnoses and cytologic findings. These text-based reports served as the input for the LLM pipeline.

Reports were de-identified at the time of data collection, and a local version of the model described below was deployed to ensure patient privacy.

LLM model and prompt design

We developed and tested an AI-assisted QC pipeline using the DeepSeek-R1:32B LLM for all experiments.[10] This open-source LLM was locally deployed to process cytopathology reports and generate structured output. All inference and data processing were performed on a dedicated local workstation (Lenovo Legion 5 Pro) equipped with an AMD Ryzen 7 6800H (3.2 GHz), 32 GB RAM, and an NVIDIA GeForce RTX 3070 Ti Laptop GPU (NVIDIA, Santa Clara, California, USA), ensuring a consistent and controlled inference environment for all reports.

Each cytopathology report was submitted individually using a standardized prompt template that instructed the model to extract the following elements into JavaScript Object Notation (JSON) format:

  • Final diagnosis.

  • Diagnostic category (one of the five CLIA-mandated categories: Non-diagnostic, Benign, Atypical, Suspicious, or Malignant). Cases that do not fit these categories based on institutional convention were designated “Other” by the expert reviewer.

  • Confidence score (see below).

For simplicity, we will abbreviate “Suspicious for Malignancy” as “Suspicious” for the remainder of the manuscript. Reports with ambiguous or low-confidence predictions were flagged for manual review to ensure diagnostic safety.

Model selection rationale

DeepSeek-R1:32B was selected because it provided a practical balance of performance and deployability for our study setting. At the time this project was initiated, it was among the strongest locally deployable open-weight models in its size class for instruction following, and it consistently adhered to a constrained output format, including reliable generation of valid JSON fields required by our pipeline. Local deployment was an explicit design requirement to support privacy adherence. The 32B parameter scale was compatible with our available workstation memory constraints, whereas larger models were not practical to run reliably in our environment. We note that the model landscape is evolving rapidly, and future work should evaluate newer lightweight models, including models with medical domain tuning, to assess whether comparable or improved accuracy and structured output reliability can be achieved with lower computational requirements.

Confidence score

The model was prompted to generate a self-assigned confidence score to quantify the certainty of its diagnostic category prediction. This was implemented through a structured JSON field within the prompt template: “diagnostic_category_confidence”: int

//This should be an integer between 0 and 10, where 10 denotes absolute certainty.

//Use this to indicate how certain you are that the diagnostic category is what is mentioned above.

The model’s confidence score was therefore self-reported, based on its internal language understanding rather than a probabilistic output. Scores ranged from 0 (no confidence) to 10 (complete confidence).

Predictions were considered low-confidence if the returned value was ≤4, and such cases were automatically flagged for manual review. Reports were also flagged if the model failed to output a valid diagnostic category (e.g., returned “Other” or “Not sure”), which indicated potential ambiguity or incompleteness in the source report.

This approach is consistent with previously published work using prompt-based confidence scoring for LLMs in clinical information extraction,[7,11] where self-reported confidence values were used to triage uncertain cases for expert validation.

Pipeline implementation

A custom Python 3.11.5 (Python Software Foundation, Wilmington, Delaware, USA) script was created to automate the processing of cytopathology reports and generate a structured QC summary as shown in Figure 1. The pipeline performed the following steps:

Quality control report generation artificial intelligence pipeline. LLM: Large language model, JSON: JavaScript Object Notation.
Figure 1: Quality control report generation artificial intelligence pipeline. LLM: Large language model, JSON: JavaScript Object Notation.

  1. Loaded each de-identified cytology report individually.

  2. Submitted the report text, along with a standardized prompt, to the DeepSeek-R1:32B model.

  3. Parsed the model’s JSON-formatted output, extracting the predicted final diagnosis, diagnostic category, and confidence score.

  4. Compiled all structured results into a centralized CSV file.

  5. Aggregated diagnostic data across all cases to generate a summary QC report for human review.

Reports that yielded incomplete, ambiguous, or low-confidence predictions (defined as a confidence score ≤4) were automatically flagged for manual review.

The final QC report included a table summarizing the predicted distribution of diagnostic categories across all cases. In addition to the AI-generated tallies, the table featured a column for cytotechnologists to manually record tallies from the flagged cases that they reviewed, and a final column that combined both the manual and AI-derived counts for submission as part of the official QC documentation.

Flagged cases were clearly identified within the QC report, and the full text of each flagged report was reprinted directly in the document. This allowed cytotechnologists or cytopathologists to quickly review these cases without needing to manually retrieve them from the LIS, streamlining the follow-up process and ensuring efficiency in manual validation.

Ground truth comparison and expert review

To evaluate diagnostic performance, all 472 LLM-processed reports were independently reviewed by a board-certified cytopathologist, who was blinded to the model’s outputs during initial review. The expert assigned a diagnostic category to each case based on the original text, which served as the ground truth for accuracy comparison.

After the initial review, a second validation step was conducted in which the same cytopathologist was presented with a custom report generated by the pipeline. This included the LLM’s predicted diagnostic category, associated confidence score, and metadata for each case. The goal of this second review was to assess the model’s output in context and flag any clinically concerning discrepancies.

Each LLM output was categorized into one of two performance classes based on the expert cytopathologist’s judgment:

  • Correct: The model’s predicted diagnostic category was a direct match to the expert-assigned ground truth.

  • Incorrect: The model’s predicted diagnostic category did not match the expert-assigned ground truth (raw misclassification).

The AI model was deemed to be ambiguous if it reported a confidence score ≤4 or if the returned category was anything other than the 5 standard diagnostic categories. These cases were flagged for manual review by the cytotechnologist.

Statistical analysis

Statistical analysis was performed using Python 3.11.5 (Python Software Foundation, Wilmington, Delaware, USA) with the following libraries: Pandas, numpy, scikit-learn (for confusion matrices), seaborn, and matplotlib. The AI system’s structured output was compared against the cytopathologist-reviewed ground truth to calculate diagnostic accuracy, which was reported overall and separately for FNA and NG cases. Confusion matrices were constructed to visualize misclassification patterns. Inter-rater agreement between the LLM and the expert ground truth was quantified using Cohen’s Kappa. The 95% confidence interval (CI) for the overall accuracy rate was calculated using the Wilson score interval method. In addition, technical time was measured for both manual and AI-assisted workflows to quantify the time savings of the automated workflow. The technical time for the AI-assisted workflow (LLM-pipeline) was calculated to be the sum of the time required for technical staff to manually review all flagged (low-confidence and ambiguous) cases and compute the final tallies.

RESULTS

The ground truth labels for the FNA cases consisted of 4 Non-diagnostic cases, 61 Benign cases, 19 Atypical cases, 7 Suspicious cases, 57 Malignant cases, and 1 case designated “other,” totaling 149 cases. The “Other” designation applied to cases that did not fit any of the five standard CLIA categories. In practice, this occurred only once, in a case with an addendum that lacked a conventional final diagnosis. The ground truth labels for the NG cases consisted of 4 Non-diagnostic cases, 233 Benign cases, 33 Atypical cases, 25 Suspicious cases, and 28 Malignant cases, totaling 323 NG cases. FNA sites included thyroid, lymph node, lung, liver, salivary gland, pancreas, and soft tissue, while NG specimens included urine and bladder washings, pleural fluid, bronchial brushings, bronchoalveolar lavages, pericardial fluid, ascitic and peritoneal fluids, bile duct brushings, and cerebrospinal fluids.

The DeepSeek-R1:32B model achieved a 98.5% raw categorization agreement rate (95% CI: 97.0–99.3%) with expert review, with 465 direct matches to the ground truth (Cohen’s Kappa = 0.973). Seven cases (six FNA and 1 NG) were raw misclassifications, meaning that the LLM’s prediction did not match the expert-assigned category. Seven cases were flagged for manual review due to low confidence scores (six FNA cases and one NG case). Among the flagged cases, the LLM’s initial categorization was correct in six of seven instances, all falling into the Atypical, Suspicious, or Other categories. Two of the low-confidence FNA cases were also flagged because they were classified as “other.” One of these reports contained only an addendum and lacked a standard final diagnosis field; this case was likewise classified as “Other” by the ground truth pathologist. The second case was a mucinous cyst that should have been classified as Atypical under our internal laboratory workflow.

Only seven cases, representing 1.5% of the total, were raw misclassifications [Table 1], including one NG case and six FNA cases. It is important to note that one of these seven misclassifications was correctly intercepted by the pipeline as it was flagged for manual review. NG cases had a 99.7% raw correct rate, while FNA cases had a 96.0% raw correct rate. Specific misclassifications included a three-part specimen with two insufficient parts and one that was Benign [Figure 2]. The model labeled the case as Benign, whereas the cytopathologist classified it as Non-diagnostic. One case with a mucinous cyst was classified as Benign by the model but Atypical by the cytopathologist. A case of thymic cortical tissue where “lymphocyte-rich thymoma cannot be excluded” was labeled Suspicious by the model but Atypical by the cytopathologist. An oncocytic follicular neoplasm was classified as Benign by the model and Atypical or Suspicious by the cytopathologist. A urine cytology case that was diagnosed as “Negative for High Grade Urothelial Carcinoma with squamous atypia” and labeled as Benign by the model but Atypical by the cytopathologist. A case of “atypical adipose tissue” was labeled Non-diagnostic by the model but Atypical by the cytopathologist. Notably, all misclassifications in this study occurred outside the most critical distinction between “Benign” and “Malignant.” Furthermore, the low-confidence flagging mechanism successfully intercepted one of these errors. This suggests that the risk of high-stakes misclassification within the current human-in-the-loop framework is minimal. Manual review of all 472 reports required 279 min, whereas AI-assisted review took 4.15 min. The AI-assisted review included the manual review of all the flagged cases and tallying of the categories, representing a 98.5% reduction in technical time.

Table 1: Detailed breakdown of large language model (LLM) misclassification (n =7 cases).
Case No. Specimen type Expert ground truth LLM prediction Reason for discrepancy/comment
1 NG (Urine) Atypical Benign Although the case was signed out as negative for high-grade urothelial carcinoma, the report comment indicated that atypical squamous cells were present.
2 FNA (Parotid gland) Non- diagnostic Benign The parotid gland aspirate contained only histiocytes, which would have been considered Non-diagnostic.
3 FNA (Pancreas) Atypical Benign The lesion was a mucinous cyst, which the expert believed should have been considered Atypical given that a neoplastic process could not be ruled out.
4 FNA (Mediastinal mass) Atypical Suspicious The tissue was called “Thymic cortical tissue” with a comment describing “although there was no evidence of malignancy, a thymoma could not be excluded.”
5 FNA (Parotid gland) Atypical or Suspicious Benign The diagnosis was an oncocytic lesion of the parotid gland. Given that the differential diagnosis includes Benign and low-grade neoplasms, the expert reviewer felt that Atypical or Suspicious would have been appropriate.
6 FNA (Abdominal nodule) Atypical Non- diagnostic The tissue was described as having atypical adipose tissue, which the expert reviewer would have categorized as Atypical.
7 FNA (Pancreas) Atypical Non- diagnostic The lesion was a mucinous cyst, which the expert believed should have been considered Atypical given that a neoplastic process could not be ruled out.

FNA: Fine needle aspiration. NG: Non-gynecologic cytology

Confusion matrices comparing LLM prediction against expert ground truth. (a) Nongynecologic cases (n = 323). (b) Fine needle aspiration Cases (n = 149). Cells represent the absolute number of cases classified into each category. The “Other” category represents non-standard cases (e.g., reports lacking a conventional diagnosis field) that do not fit the five CLIA-mandated diagnostic categories. The matrices demonstrate high accuracy with misclassifications concentrated in the Atypical, Suspicious, and Non-diagnostic categories, illustrating the semantic ambiguity present in these indeterminate classes. LLM: Large language model, CLIA: Clinical Laboratory Improvement Amendments.
Figure 2: Confusion matrices comparing LLM prediction against expert ground truth. (a) Nongynecologic cases (n = 323). (b) Fine needle aspiration Cases (n = 149). Cells represent the absolute number of cases classified into each category. The “Other” category represents non-standard cases (e.g., reports lacking a conventional diagnosis field) that do not fit the five CLIA-mandated diagnostic categories. The matrices demonstrate high accuracy with misclassifications concentrated in the Atypical, Suspicious, and Non-diagnostic categories, illustrating the semantic ambiguity present in these indeterminate classes. LLM: Large language model, CLIA: Clinical Laboratory Improvement Amendments.

DISCUSSION

This study demonstrates that integrating an LLM into the cytopathology QC workflow can be both highly accurate and operationally efficient. The AI-assisted QC pipeline achieved 98.5% raw category agreement with expert review while simultaneously reducing review time by 98.5%. Notably, only one NG and six FNA cases were misclassified. This high level of performance is particularly significant for a QC task, as human inter-observer variability in microscopic interpretation of cytopathology slides is well-documented to vary substantially. Although previous studies have evaluated variability in the microscopic interpretation of specimens rather than in the textual interpretation of finalized reports, they nonetheless illustrate the intrinsic subjectivity of diagnostic classification. Reported inter-observer agreement rates vary enormously, falling as low as 65%, depending on specimen type and reporting system, with lower concordance often observed in indeterminate categories such as Atypical and Suspicious.[12-14] Given that our model’s agreement rate was measured against a single expert’s “ground truth,” the observed 98.5% performance, combined with a human-in-the-loop mechanism to review all low-confidence or ambiguous cases, provides a level of reliability that exceeds typical human consistency and is sufficient for its intended use of monitoring diagnostic category drift under CLIA QC requirements.

The results suggest that LLMs can serve as a valuable decision-support tool, capable of parsing nuanced, free-text reporting language and correctly categorizing cytology cases with minimal oversight. This is particularly relevant for free-text cytology reports, in which rule-based NLP approaches often require extensive maintenance and may fail in the setting of negation and context-dependent phrasing. Importantly, the model’s output included a confidence score, and cases with low or ambiguous confidence were flagged for expert review, preserving clinical safety. This approach aligns with broader findings in the literature showing that AI-based clinical decision support tools can achieve high accuracy while supporting safe and efficient integration into diagnostic workflows.[15]

The overall model accuracy was similar to that reported in prior studies, with newer models often achieving higher performances, likely because of larger model sizes and improved architecture. For example, an early study that extracted breast cancer data using ChatGPT 3 reported accuracies that varied (63.8–98.2%) depending on the specific data extracted.[16] In contrast, more recent studies using Generative Pretrained Transformer 4 LLM, Llama 3.1, and GPT-4o achieved average accuracies that ranged from 94.7% to 99.8% when extracting data from prostate and breast cancer pathology reports.[17,18] These trends confirm that the high accuracy achieved in our study is consistent with the current capabilities of modern, high-performance LLMs.

Addressing diagnostic ambiguity

Most misclassified cases involved semantic ambiguity or missing clinical context, rather than purely syntactic complexity. For example, the model classified a multi-part specimen as Benign instead of Non-diagnostic due to institution-specific rules for handling insufficient parts, and a mucinous cyst as Benign instead of Atypical, missing an implied diagnostic concern. Other errors, such as labeling thymic cortical tissue as Suspicious instead of Atypical or a urine cytology case with squamous atypia as Benign instead of Atypical, reflect challenges in parsing nuanced diagnostic phrases or applying context-specific knowledge. Ambiguous cases often involve nuanced diagnostic phrases or implied intent, which can also pose difficulties for human reviewers, as seen in prior NLP studies.[18] Further improvements could likely be achieved by refining the prompt to better flag ambiguous cases for review and to ensure that diagnostic classification is performed at the specimen-part level rather than the case level.

Operational benefits and workflow enhancement

Manual cytopathology QC is time-intensive and demands skilled personnel. This study shows that an LLM-based pipeline can substantially alleviate the workload by automating initial categorization and prioritizing ambiguous reports for expert review. Rather than replacing human reviewers, the model enhances their effectiveness by ensuring that attention is focused where it is most needed.

The model also provides structured outputs (e.g., CSV [comma-separated value]-formatted tables) that are compatible with existing QC workflows, potentially increasing consistency and reducing data-entry errors. Further, this approach could be extended to other data-driven QC tasks in cytopathology, such as tracking diagnostic category distributions by provider, identifying cases for retrospective review, or correlating cytology results with surgical pathology follow-up. This aligns with prior studies showing that AI-based tools can reduce review time, prioritize high-risk cases, and support more efficient pathology workflows.[19,20]

The alternative to using LLMs for report categorization is to employ traditional NLP methods such as regular expression searches, keyword rules, or handcrafted decision trees. While these approaches can perform well when report language is highly standardized, they are brittle in the presence of negation, hedging language, multi-specimen structure, and stylistic variation across pathologists. For example, if not designed carefully, simple keyword matching can misclassify phrases such as “negative for high-grade carcinoma” because it contains a malignant keyword. Even carefully crafted rule sets require ongoing maintenance to adequately handle new data. In contrast, the LLM used in this study performed semantic interpretation of the report text and produced structured outputs in a fixed JSON schema, enabling robust downstream parsing with minimal rule engineering. For this QC task, the key operational advantage is that a single prompt-based pipeline can generalize across heterogeneous free text patterns without the need to construct and continuously update an extensive set of institution-specific rules.

Indirect educational and diagnostic improvement value

While the primary objective of this study was to demonstrate efficiency and accuracy for CLIA compliance, the resulting AI-assisted QC pipeline establishes a robust infrastructure for continuous performance improvement. By automatically and reliably categorizing every case, the system provides the fundamental data required to track and benchmark the diagnostic categorical distributions of individual cytopathologists and cytotechnologists. More importantly, the system can be adapted to systematically track inter-observer disagreements between the initial cytotechnologist screening and the final cytopathologist sign-out. This capability would allow the laboratory to easily identify and flag cases exhibiting significant diagnostic category changes (e.g., Benign to Malignant). These flagged, high-impact discrepancy cases can then be prioritized for retrospective review, which serves as a powerful, targeted tool for staff education and quality assurance, thereby indirectly leading to long-term improvements in diagnostic performance and consistency within the laboratory.

Deployment consistency and safety guardrails

To ensure reliable performance within our operational environment, we controlled for potential sources of LLM variability. Specifically, deploying a single, open-source model (DeepSeek-R1:32B) locally with a fixed prompt template provided a consistent, verifiable inference environment. This controlled design ensures that the model’s performance is stable within our environment, though continuous monitoring for drift will be essential upon deployment. Crucially, the model was designed with a builtin safety mechanism: The self-assigned confidence score. Cases that yielded low confidence or ambiguous output were automatically flagged for human intervention. This human-in-the-loop strategy acts as a critical guardrail, ensuring that any rare, non-reproducible misclassification by the LLM is intercepted and corrected by an expert, thereby maintaining diagnostic integrity while achieving operational efficiency.

Scalability and future directions

As pathology laboratories face increasing case volumes and workforce shortages,[3] tools like this AI QC pipeline offer a scalable solution to maintain quality while improving efficiency. Although this study focused on cytopathology, similar approaches could be adapted for other subspecialties such as histopathology, surgical pathology, hematopathology, and in medical practice outside of the laboratory, where structured extraction from unstructured text is similarly valuable. In all such settings, careful attention must be made to ensure that the pipeline remains compliant with the Health Insurance Portability and Accountability Act or other local information security regulatory requirements. Possible solutions include employing local AI infrastructure or obtaining a business associate agreement to use a compliant cloud provider. The use of DeepSeek-R1:32B, an open-source model, was specifically identified to facilitate local deployment; however, other open-source LLMs could be considered.

To prepare this system for broader clinical deployment, further validation across diverse datasets, institution-specific prompt refinement, and ongoing performance monitoring will be essential. Future studies comparing model performance with human inter-observer consistency would provide additional context for interpreting model accuracy. Incorporating a human-in-the-loop approach, where technical staff, pathologists, and other physicians remain in control but are supported by AI, strikes the right balance between safety and efficiency.

Although this was a single institution evaluation, the pipeline is designed to be portable. It operates on report text alone, and the task is defined entirely in the prompt template, which can be adjusted to match local reporting conventions or category mappings without changing the core codebase. We did not have access to external multi-institution datasets and therefore did not directly assess cross-site generalizability. However, the validation approach used here, including expert adjudication, structured output checks, and manual review of low confidence or non-standard outputs, can be applied by other laboratories to evaluate performance on their own data before use.

Limitations

This study has several limitations that should be considered. First, it represents a single-center evaluation with ground truth established by a single board-certified cytopathologist. While this is consistent with internal laboratory QC practices, future multi-center studies involving multiple expert reviewers are needed to further establish the generalizability and reproducibility of the model’s performance. We further acknowledge that pathological diagnosis inherently involves subjectivity, as does the interpretation of pathology notes in cases where the diagnostic category is not explicitly stated. Inclusion of multiple expert reviewers would provide a more comprehensive assessment of model performance. Furthermore, because model performance relies on prompt engineering, its effectiveness at other sites may vary due to differences in terminology and report structure. However, the core framework presented, including local deployment, confidence-based filtering, and a human-in-the-loop pipeline, is highly portable. Other laboratories can adapt this method by validating and fine-tuning prompts using their local data before deployment. Second, the study’s scope was intentionally restricted to FNA and NG cytology reports for which manual NLP is currently required. The model’s performance on GYN specimens was not assessed. Finally, this evaluation focused strictly on the model’s NLP accuracy in correctly categorizing the finalized report text. We did not evaluate correlation with subsequent surgical pathology results, as our objective was to support CLIA regulatory QC requirements.

SUMMARY

This study provides strong evidence that LLMs can play a meaningful and practical role in cytopathology QC. By combining high diagnostic accuracy, low error rates, and dramatic time savings, LLMs represent a promising tool for augmenting laboratory operations. With continued refinement, AI systems such as this could soon become an integral part of the pathology workflow, enhancing both QC consistency and operational efficiency.

ACKNOWLEDGMENT

We extend our thanks to Dr. Catherine Abendroth (Cytopathology Laboratory Director) for kindly allowing us to consult with her on how best to categorize the model performance under specific circumstances. The authors are additionally grateful to Lia Vazquez (Cytopathologist and Cytopathology Laboratory Manager), who helped in performing the time studies for the project.

DECLARATION OF GENERATIVE AI AND AI-ASSISTED TECHNOLOGIES IN THE WRITING PROCESS

During the preparation of this work, the author(s) used DeepSeek-R1:32B to process cytopathology reports and generate structured output containing diagnostic categories and model confidence. After initially drafting the manuscript, the authors further used ChatGPT and Google Gemini to help edit the manuscript and ensure compatibility with the Author Guidelines. After using these tools/services, the authors reviewed and edited the content as needed and take full responsibility for the content of the publication.

AVAILABILITY OF DATA AND MATERIALS

The model weights for the open-weight large language model used in this study, DeepSeek-R1:32B, are publicly available from the model developer. The cytopathology report text used for model evaluation is not publicly available, even in de-identified form, because it consists of institutional clinical report data and remains subject to institutional privacy and data-use restrictions. Aggregate results necessary to support the findings of this study are included within the article.

ABBREVIATIONS

AI: Artificial intelligence

BAA: Business associate agreement

CI: Confidence interval

CLIA: Clinical Laboratory Improvement Amendments

CSV: Comma-separated value

FNA: Fine needle aspiration

GYN: Gynecologic

HIPAA: Health insurance portability and accountability act

IRB: Institutional review board

JSON: JavaScript object notation

LIS: Laboratory information systems

LLM: Large language model

NG: Non-gynecologic

NLP: Natural language processing

QC: Quality control

AUTHOR CONTRIBUTIONS

SN: Investigation, resources, writing – original draft, review, and editing; VN: Investigation, writing – review and editing; CJ: Conceptualization, data curation, formal analysis, investigation, methodology, project administration, resources, software, supervision, validation, writing – review and editing, guarantor. All authors read and approved the final manuscript. All authors are accountable for all aspects of the research, ensuring that issues related to the accuracy or completeness of any part of the research are properly investigated and resolved. All authors meet ICMJE authorship requirements.

ETHICS APPROVAL AND CONSENT TO PARTICIPATE

The Human Research Protection Program/Institutional Review Board at Penn State Health Milton S. Hershey Medical Center reviewed this activity (Study ID: STUDY00026725; Submission ID: STUDY00026725) and determined that it did not meet the definition of human subject research under 45 CFR 46.102(e) and/or (l). Accordingly, IRB approval and informed consent were not required. All reports were de-identified at the time of data collection to protect patient privacy.

CONFLICTS OF INTEREST

The authors declare no conflicts of interest.

EDITORIAL/PEER REVIEW

To ensure the integrity and highest quality of CytoJournal publications, the review process of this manuscript was conducted under a double-blind model (authors are blinded for reviewers and vice versa) through an automatic online system.

FUNDING: This work was supported by a research initiation grant from the Department of Pathology, Penn State College of Medicine.

References

  1. , . Cytopathology comes of age. Acta Cytol. 2020;64:5-6.
    [CrossRef] [PubMed] [Google Scholar]
  2. . Quality control in cytopathology. Clin Lab Med. 1986;6:707-13.
    [CrossRef] [PubMed] [Google Scholar]
  3. , . The current troubled state of the global pathology workforce: A concise review. Diagn Pathol. 2024;19:163.
    [CrossRef] [PubMed] [Google Scholar]
  4. . Cytotechnology schools: Future outlook. Diagn Cytopathol. 2024;52:407-12.
    [CrossRef] [PubMed] [Google Scholar]
  5. , , , . ChatGPT and large language model (LLM) chatbots: The current state of acceptability and a proposal for guidelines on utilization in academic medicine. J Pediatr Urol. 2023;19:598-604.
    [CrossRef] [Google Scholar]
  6. . ChatGPT utility in healthcare education, research, and practice: Systematic review on the promising perspectives and valid concerns. Healthcare (Basel). 2023;11:887.
    [CrossRef] [PubMed] [Google Scholar]
  7. , , , , , , et al. A critical assessment of using ChatGPT for extracting structured data from clinical notes. NPJ Digit Med. 2024;7:106.
    [CrossRef] [PubMed] [Google Scholar]
  8. , , , , , , et al. LLM-AIx: An Open Source Pipeline for Information Extraction from Unstructured Medical Text Based on Privacy Preserving Large Language Models. medRxiv [Preprint]; 2024
    [CrossRef] [Google Scholar]
  9. , , , , , , et al. Using large language models to automate data extraction from surgical pathology reports: Retrospective cohort study. JMIR Form Res. 2025;9:e64544.
    [CrossRef] [PubMed] [Google Scholar]
  10. , , , , , , et al. DeepSeek-R1 incentivizes reasoning in LLMs through reinforcement learning. Nature. 2025;645:633-8.
    [CrossRef] [PubMed] [Google Scholar]
  11. , , . On Verbalized Confidence Scores for llms. arXiv [Preprint].
    [Google Scholar]
  12. , , , , , , et al. Interobserver variability in cytopathology: How much do we agree? Cytopathology. 2024;35:444-53.
    [CrossRef] [PubMed] [Google Scholar]
  13. , , , , , . The international system for serous fluid cytopathology: Interobserver agreement. Diagn Cytopathol. 2021;50:3-7.
    [CrossRef] [PubMed] [Google Scholar]
  14. , , , , , . Interobserver reproducibility of the paris system for reporting urinary cytology. Cytojournal. 2017;14:17.
    [CrossRef] [PubMed] [Google Scholar]
  15. , . Effectiveness of artificial intelligence (AI) in clinical decision support systems and care delivery. J Med Syst. 2024;48:74.
    [CrossRef] [PubMed] [Google Scholar]
  16. , , , , . Developing prompts from large language model for extracting clinical information from pathology and ultrasound reports in breast cancer. Radiat Oncol J. 2023;41:209-16.
    [CrossRef] [PubMed] [Google Scholar]
  17. , , , , , , et al. LLM-mediated data extraction from patient records after radical prostatectomy. NEJM AI. 2025;2:AIcs2400943.
    [CrossRef] [Google Scholar]
  18. , , , , , , et al. Leveraging large language models for structured information extraction from pathology reports. J Pathol Inform. 2025;19:100521.
    [CrossRef] [PubMed] [Google Scholar]
  19. , , , . Extracting information from textual documents in the electronic health record: A review of recent research. Yearb Med Inform. 2008;17:128-44.
    [CrossRef] [Google Scholar]
  20. , , , . AI in health and medicine. Nat Med. 2022;28:31-8.
    [CrossRef] [PubMed] [Google Scholar]
Show Sections