TL;DR
Researchers have developed a Retrieval-Augmented Generation (RAG) framework that uses Large Language Models (LLMs) to navigate messy, non-standardized hospital price transparency data. By grounding LLM responses in actual hospital billing files, the system reduces price estimation errors from over 140% to under 20%, offering a path toward making healthcare costs truly transparent for patients.
What Problem Does This Paper Address?
In the United States, hospital pricing is notoriously opaque. To combat this, the Centers for Medicare and Medicaid Services (CMS) mandated in 2021 that hospitals publish "machine-readable" price transparency (PT) files. However, "machine-readable" does not mean "user-friendly." These files are often massive, inconsistently structured, and filled with cryptic medical shorthand (e.g., "elbow 2 vws" for a two-view X-ray).
For a patient, translating a symptom like "wrist pain" into a specific set of billable medical codes and their associated costs remains nearly impossible. This paper addresses the gap between raw, heterogeneous data and actionable financial information by using LLMs to interpret patient queries and retrieve relevant pricing from hospital-specific records.
Methods
The authors implemented a Retrieval-Augmented Generation (RAG) architecture. The pipeline consists of three main stages:
- Preprocessing: The team standardized PT files from three hospitals, filtering for records with Current Procedural Terminology (CPT) codes. They "enriched" the cryptic hospital descriptions by appending official long-form descriptions from the Unified Medical Language System (UMLS).
- Retrieval: They compared four strategies to find the right procedure:
- Okapi BM25: A traditional keyword-based (sparse) retrieval algorithm.
- OpenAI Embeddings (Small & Large): Dense vector retrieval to capture semantic meaning.
- Hybrid GPT-BM25: A novel approach where the LLM first predicts the most likely CPT codes, which are then used to query the database via BM25.
- Generation: The LLM (GPT-5.4) receives the top-$K$ retrieved records and the original user query to select the best match and report the price.
The system was tested against a "No-RAG" baseline, where the LLM was asked to estimate prices based solely on its internal training data (parametric knowledge).
Datasets
The study utilized real-world PT files from three major institutions in the Maryland/D.C. area:
- Johns Hopkins Hospital
- University of Maryland Medical Center
- MedStar Washington Hospital Center
To evaluate the system, they used:
- Individual Procedures: 277 services pulled from the Johns Hopkins online price estimator.
- Synthetic Patient Vignettes: To simulate realistic pre-visit interactions, the authors used clinical notes from MTSamples.com to generate synthetic patient personas and "billed" procedure sets using a separate LLM (GPT-4.1) to avoid data leakage.
Key Insights and Ideas
- Grounding is Non-Negotiable: LLMs are surprisingly good at identifying the type of medical procedure needed, but they are terrible at guessing the price. Without RAG, the models hallucinated prices that were wildly off-base.
- The Hybrid Advantage: The Hybrid GPT-BM25 retriever outperformed pure semantic search. This suggests that for specialized domains like medical billing, combining the LLM’s reasoning (to identify codes) with exact keyword matching (BM25) is more robust than relying on embeddings alone.
- The "Symptom-to-Code" Bottleneck: While the system was excellent at pricing specific procedures (99% recall), it struggled more with "pre-visit" estimation—predicting what a doctor will bill based on a patient's symptoms. In simulations, it correctly identified only about 50% of the reference procedures, highlighting the inherent complexity of medical coding.
Key Results
The quantitative improvements provided by the RAG framework were substantial:
- Individual Procedures: The RAG system (Hybrid GPT-BM25) achieved a Mean Absolute Percentage Error (MAPE) of 19.44%, compared to a staggering 147.98% for the LLM-only baseline.
- Procedure Groups: For bundles of services (like an annual physical with labs), the RAG system’s MAPE dropped to 4.90%, while the baseline remained high at 82.82%.
- Retrieval Performance: The hybrid retriever reached nearly 98% recall at $K=10$, meaning the correct procedure was almost always in the top 10 results shown to the LLM.
Limitations and Future Work
Despite the progress, several hurdles remain:
- Insurance Complexity: The current model focuses on "gross charges" or "cash prices." In reality, most patients pay "negotiated rates" determined by their specific insurance plan, which are much harder to extract and model.
- Data Quality: Hospital PT files are still plagued by unexplained duplicate entries and heterogeneous formats, requiring significant manual preprocessing.
- Clinical Uncertainty: Predicting exactly what a clinician will order during a visit based on a chat interface is inherently probabilistic. Future work needs to better account for the variability in clinical decision-making.
The authors are currently developing a web-based prototype to bring this technology directly to consumers, potentially turning "machine-readable" data into "patient-empowering" information.
Summary updated