Injecting Domain-Specific Knowledge into Large Language Models: A Comprehensive Survey

Zirui Song, Bin Yan, Yuhan Liu, Miao Fang, Mingzhe Li, Rui Yan, Xiuying Chen

TL;DR

Large Language Models (LLMs) are powerful but often lack the specialized knowledge needed for domains like healthcare or finance. This paper surveys four key methods for injecting this domain-specific knowledge – dynamic injection, static embedding, modular adapters, and prompt optimization – providing a roadmap for researchers and practitioners.

What Problem Does This Paper Address?

General-purpose LLMs, while impressive, struggle in specialized fields that demand deep, nuanced understanding. Think of a doctor needing to interpret complex medical literature or a financial analyst needing to understand intricate market regulations. These tasks require more than just broad language comprehension; they need specific, often technical, knowledge. This paper addresses the challenge of equipping LLMs with this domain expertise to improve their accuracy and reliability in these critical applications.

Methods

The authors categorize knowledge injection into LLMs into four main paradigms:

  • Dynamic Knowledge Injection: This approach retrieves relevant information from external knowledge bases (like databases or knowledge graphs) at inference time. The LLM then uses this retrieved information along with the input to generate an output. The key advantage is flexibility – knowledge can be updated without retraining the model.
  • Static Knowledge Embedding: Here, domain-specific knowledge is integrated directly into the LLM's parameters. This is typically done during pre-training or fine-tuning. While it leads to fast inference, updating this knowledge requires retraining, and there's a risk of "catastrophic forgetting" of general knowledge.
  • Modular Knowledge Adapters: This method introduces small, trainable modules (adapters) that are inserted into or alongside the LLM. The core LLM parameters are usually kept frozen, preserving general capabilities. Adapters learn domain-specific knowledge, offering a parameter-efficient way to adapt LLMs without modifying the base model.
  • Prompt Optimization: This technique focuses on crafting highly effective textual prompts to guide the LLM. It leverages the LLM's existing internal knowledge and doesn't require external data or model parameter updates. It's efficient but relies heavily on the quality of prompt engineering.

Datasets

The paper mentions various datasets used across different domains, including:

  • Biomedicine: PubMed, MedQA, MedMCQA, USMLE, HealthSearchQA.
  • Finance: Financial Phrase Bank, FiQA 2018 Task-1, News Headline Classification, Named Entity Recognition, Structure Boundary Detection, Question Answering, FinEval, FinanceIQ, qEQA, FinC, KQA, MRC, CMRC.
  • Materials Science: USPTO, Enzymes, PubChem, ARC, USPTO, Materials Project, OQMD, NOMAD.
  • Human-Centered Science: PsyQA, SmileChat, EduChat, SocraTeach.

The paper also highlights the need for broader curation of benchmarks in underrepresented domains.

Key Insights and Ideas

  • No One-Size-Fits-All: The choice of knowledge injection method depends heavily on the specific domain, available resources, and desired trade-offs between flexibility, scalability, and efficiency.
  • Dynamic vs. Static Trade-offs: Dynamic injection offers adaptability but can be slower at inference due to retrieval. Static embedding is fast but rigid and prone to forgetting. Adapters offer a middle ground, while prompt optimization is efficient but requires expert crafting.
  • Domain-Specific Challenges: Different domains present unique challenges. For instance, biomedical applications require handling complex medical terminologies and diagnoses, while finance needs to process real-time market data and sentiment.
  • The Rise of Hybrid Approaches: In specialized fields like biomedicine, there's a trend towards combining static pretraining, instruction tuning, and tool integration for more robust reasoning.
  • The Importance of Alignment: For static knowledge embedding, the alignment between pretraining corpora and downstream objectives is crucial for performance.

Key Results

The paper doesn't present a single set of quantitative results but rather synthesizes findings from numerous studies. Table 4, for example, shows performance comparisons in the biomedical domain, indicating that:

  • GPT-4 with prompt optimization (Medprompt) achieves strong performance even without domain-specific training, highlighting the power of prompt engineering for closed-source models.
  • Full fine-tuning (like PMC-LLaMA) often outperforms adapter-based methods (like MedAdapter) for certain tasks, suggesting that deeper integration can be more effective.
  • Static knowledge models (e.g., MedBERT) show significant variance, emphasizing the critical role of corpus-task alignment.

Table 5 shows similar trends in the finance domain, with fine-tuned GPT-4 outperforming others and static models exhibiting variability.

Limitations and Future Work

The authors acknowledge several limitations:

  • Limited Domain Coverage: The survey focuses on prominent domains like finance, biomedicine, and materials science, with less attention given to under-studied or emerging areas (e.g., low-resource languages, cross-cultural education).
  • Methodological Comparisons: While the survey summarizes principles, a broad-based empirical evaluation across all methods and domains is challenging due to variations in architectures, data, and protocols.

Future work directions include:

  • Integrated Knowledge Consistency: Developing methods to detect and resolve conflicts between injected knowledge and the LLM's existing knowledge or other retrieved facts.
  • Cross-Domain Knowledge Transfer: Enabling LLMs to generalize knowledge across diverse fields by managing incompatible ontologies and reasoning structures.
  • Scalability and Efficiency: Addressing the computational and memory costs of integrating large-scale external knowledge, exploring techniques like sparse retrieval, memory compression, and modular architectures.
  • Evaluation and Hallucination Detection: Creating standardized benchmarks and metrics for factual consistency, coverage, and reasoning depth, and developing internal modules for hallucination detection.
  • Adaptive Reasoning: Exploring retrieval-augmented transfer for dynamic selection of domain-relevant knowledge and domain-invariant embedding learning for generalization.

Summary updated

BibTeX
@inproceedings{song2025injecting,
  author = {Zirui Song and Bin Yan and Yuhan Liu and Miao Fang and Mingzhe Li and Rui Yan and Xiuying Chen},
  title = {{Injecting Domain-Specific Knowledge into Large Language Models: A Comprehensive Survey}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
  url = {https://openreview.net/forum?id=n7UFihXqET},
}
Figure