Injecting Domain-Specific Knowledge into Large Language Models: A Comprehensive Survey
To address this, researchers have explored diverse methods to enhance LLMs by integrating domain-specific knowledge. In this survey, we provide a comprehensive overview of these methods, which we categorize into four key approaches: dynamic knowledge injection, static knowledge embedding, modular adapters, and prompt optimization. Each approach offers unique mechanisms to equip LLMs with domain expertise, balancing trade-offs between flexibility, scalability, and efficiency. We discuss how these methods enable LLMs to tackle specialized tasks, compare their advantages and disadvantages, evaluate domain-specific LLMs against general LLMs, and highlight the challenges and opportunities in this emerging field.
Table 2: Guidance on selecting knowledge injection paradigms based on training cost, inference speed, and limitations. Dynamic knowledge injection integrates external knowledge at runtime, offering flexibility and adaptability to new information without increasing training cost. However, it requires an effective retrieval module, and the inference speed depends heavily on retrieval performance, which can slow down the overall process. Static knowledge embedding embeds domain expertise during pretraining or fine-tuning, requiring large-scale domain-specific data and significant training resources, including GPUs and time. While it incurs no additional inference cost, its limitations lie in the potential risks of catastrophic forgetting and its inability to adapt to evolving information. Modular adapters serve as a middle ground, allowing plug-and-play components to enhance domain-specific capabilities with minimal training data. Only a small subset of parameters needs to be trained, which reduces training costs, and inference speed is largely unaffected. However, the quality of training data significantly impacts the performance of this method. Prompt Optimization, on the other hand, avoids retraining entirely by leveraging carefully crafted inputs. It has no impact on inference speed but relies on extensive human effort to find optimal prompts. This method is limited in its ability to utilize new knowledge and primarily activates pre-existing knowledge.
3.4 Prompt Optimization Unlike previous approaches, prompt optimization does not retrieve knowledge from external sources. Instead, it focuses on fully leveraging or guiding the LLM to utilize its internal, pre-existing knowledge. The process can be formalized as: y = M [p, x]; θ , where p represents a textual prompt containing implicit domain knowledge or specific instructions. Prompt optimization offers significant advantages, including eliminating dependency on external domain knowledge bases and avoiding training. However, it also presents challenges, as designing effective prompts can be both complex and time-consuming. Additionally, long prompts may reduce the available context window, potentially affecting model efficiency and performance.
Lines of inquiry this paper opens 24
Research framings built by reading the notes related to this paper — the questions it feeds into.
How does decomposing complex reasoning into subtasks affect performance and safety? Can prompting alone inject genuinely new knowledge into trained models?- What techniques work best for injecting domain knowledge at training time?
- How do training-time and inference-time knowledge injection techniques compare?
- Can prompt optimization alone inject knowledge models don't already have?
- What role does knowledge injection play in adapting RAG to industry taxonomies?
- How does prompt context activation differ from parameter-based knowledge injection?
- How should rapidly evolving domains choose knowledge injection methods?
- Can prompt optimization or fine-tuning inject knowledge models do not already contain?
- What training cost tradeoffs exist between fine-tuning and other knowledge injection methods?
- How much knowledge can prompt optimization inject without retraining?
- Which domains need knowledge injection versus reasoning-focused training?
- Does medical domain competency require knowledge injection or better prompting?
- What knowledge injection routes trade flexibility against training cost?
- What production costs does personalization infrastructure impose on AI systems?
- What mechanisms enable some firms to adopt AI more cheaply than others?
- How should evaluation frameworks account for the computational cost of frontier AI capability?
- Do data collection costs erode the value of AI training investments?