LRCH (Language Reasoning for Clinical Help) is a healthcare-focused large language model pipeline that intelligently switches between Cache-Augmented Generation (CAG) and Retrieval-Augmented Generation (RAG) based on the confidence of domain classification. It combines curated domain knowledge and dynamic retrieval for producing reliable, semantically accurate answers in medical contexts.
-
🗂️ Domain Specialization via CAG
- Curated Q&A pairs across 10 medical specialties are fed into the
LLaMA 3.1 3Bmodel. Precomputed KV cachesare stored offline for each specialty to support faster, context-rich generation.- On receiving a query, if confidently classified into a domain, the corresponding static cache is loaded into the model for answer generation (Cache-Augmented Generation).
- Curated Q&A pairs across 10 medical specialties are fed into the
-
📚 Fallback with RAG
- If a query cannot be confidently mapped to a known specialty,
RAGis triggered. - Relevant medical documents are retrieved from a domain-specific database.
- The retrieved context is appended to the prompt for Retrieval-Augmented Generation.
- If a query cannot be confidently mapped to a known specialty,
-
🧪 Domain Classification
- A lightweight
DistilBERTclassifier maps each query to one of the 10 medical domains. - Low-confidence classifications trigger the RAG pathway instead of CAG.
- A lightweight
-
⚡ Model & Optimization
- All generations are powered by an
quantized LLaMA-3.1 3Bmodel for efficient performance on edge devices or resource-constrained environments.
- All generations are powered by an
-
🔎 Answer Evaluation
- Each generated answer is evaluated using semantic similarity against reference answers using
MiniLM-L6-v2embeddings.
- Each generated answer is evaluated using semantic similarity against reference answers using
A method where a model retrieves external documents relevant to a query and then generates a response using both the query and the retrieved content. It boosts factual accuracy by grounding answers in real data sources.
Instead of always relying on dynamic retrieval, CAG leverages precomputed Key-Value caches of domain-specific knowledge. When a query falls under a known domain, cached memory is used, making responses faster and more domain-aware.
A state-of-the-art open LLM developed by Meta. In this project, it's quantized to int 4 format to ensure low memory usage and faster inference without compromising quality.
- Add support for multi-domain fusion queries.
- Incorporate user feedback loop for continuous learning.
- Explore on-device deployment for offline clinical use-cases.
With LRCH, we move one step closer to intelligent, context-aware, and resource-efficient AI that can support real-world healthcare professionals and systems. 🌐💊
📫 Contact
Satyam Solanki | satyamsolanki.official@gmail.com | https://www.linkedin.com/in/satyam-solanki/