LLM Finetuning Dataset Creation Using Chunk Retrieval Augmentation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Large Language Models (LLMs) often produce hallucinations, especially general LLMs, which generate coherent but technically incorrect or absurd outputs, and training domain-specific LLMs is challenging due to the lack of sufficient training data.
Innovation Solution
A method for finetuning LLMs involves processing domain-specific source documents into chunks, generating questions and answers, expanding context through adjacent chunks, and using retrieval augmentation to refine answers, resulting in a domain-specific LLM with reduced hallucinations.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If a general LLM is used to process questions, then the model can handle a variety of tasks and domains, but the model produces hallucinations and generates technically incorrect outputs
Solution Approach 1:
The system segments the general LLM's knowledge into domain-specific components by creating specialized LLMs for different domains (medical, legal, technical). Each domain-specific LLM is trained on curated high-quality data from its respective field, allowing the system to maintain versatility through multiple specialized models rather than relying on a single general model.
Solution Approach 2:
The patent introduces an intermediary layer between the user query and the LLM response. This includes a domain identification module that routes queries to appropriate domain-specific LLMs, and a response verification mechanism that checks outputs against domain knowledge bases, thereby improving reliability without sacrificing the general system's ability to handle diverse tasks.
2Reliability
If domain-specific training data is collected to train a domain specific LLM, then the likelihood of hallucinations is reduced, but the amount of training data required is massive and generally not available
Solution Approach 1:
The system extracts high-quality training data from existing domain-specific sources such as academic papers, professional documents, and verified knowledge bases. Rather than collecting massive amounts of raw domain data, the methodology selectively extracts and curates the most relevant and accurate information, significantly reducing the data volume requirement while maintaining training effectiveness.
Solution Approach 2:
The patent changes the parameters of data quality rather than data quantity. By implementing sophisticated data filtering, verification, and curation processes, the system transforms large volumes of potentially noisy domain data into smaller sets of high-quality training examples. This parameter shift from quantity to quality allows domain-specific LLMs to be trained effectively with limited data.
3Loss of information
If the current region is expanded to incorporate adjacent chunks, then the context for answer generation is improved, but the processing complexity and time increase
Solution Approach 1:
The system performs preliminary actions by pre-processing and indexing domain-specific source documents into structured chunks with metadata before actual query processing. This pre-organization allows the system to quickly identify and retrieve relevant adjacent chunks when needed, rather than processing entire documents from scratch, thus reducing processing time while maintaining context completeness.
Solution Approach 2:
The patent implements a dynamic region expansion strategy where the scope of adjacent chunks to incorporate is adjusted based on the specific query requirements. Rather than always expanding to a fixed size, the system dynamically determines the appropriate region size based on query complexity, domain specificity, and available context, optimizing the balance between context completeness and processing efficiency.
Data Source
AI summary
A general large language model (LLM) processes a prompt on a current region including a set of chunks of a domain specific source document to generate a question for the current region and an answer for the question. The current region is expanded by incorporating adjacent chunks to the set of chunks. The general LLM processes the question and the current region to revise the answer and identify a set of second answer chunks in the current region used to revise the answer. The operations include generating a question vector embedding for the question and performing retrieval augmentation matching with the question vector embedding and chunk vector embeddings of the chunks. The general LLM processes the question and the current region to revise the answer and identify a set of third answer chunks used to revise the answer. The domain specific LLM is updated with the question and answer.


