Learn About Amazon VGT2 Learning Manager Chanci Turner
Amazon Bedrock Knowledge Bases now offers enhanced capabilities for advanced parsing, chunking, and query reformulation, providing users with improved accuracy in RAG-based applications.
Amazon Bedrock Knowledge Bases is a fully managed service designed to facilitate the entire Retrieval Augmented Generation (RAG) process, from data ingestion to retrieval and prompt enhancement, without the need for custom integrations or data flow management. This service expands the possibilities within RAG workflows.
However, in RAG applications, particularly with large or complex documents like PDFs or .txt files, querying the indexes may lead to less than optimal results. For instance, documents may contain intricate semantic relationships among sections or tables, requiring advanced chunking techniques to accurately reflect these connections; otherwise, the retrieved chunks may fail to address user queries. To mitigate these performance challenges, various factors can be fine-tuned. This blog post will delve into the new features of Amazon Bedrock Knowledge Bases that can enhance response accuracy in RAG applications, such as advanced data chunking, query decomposition, as well as improvements in CSV and PDF parsing. These enhancements empower users to refine the accuracy of their RAG workflows with greater precision.
Features for Enhancing RAG Application Accuracy
In this section, we will explore the new features available in Amazon Bedrock Knowledge Bases designed to boost the accuracy of responses to user inquiries.
Advanced Parsing
Advanced parsing involves the dissection and extraction of meaningful information from unstructured or semi-structured documents. This process breaks documents down into their components—text, tables, images, and metadata—while identifying the relationships among these elements.
Effective parsing is vital for RAG applications as it helps the system grasp the structure and context of the information within documents. Various techniques can be employed for parsing data from different formats, including the use of foundation models (FMs), particularly beneficial for complex data types such as nested tables or text within images.
The advantages of using the advanced parsing option include:
- Improved Accuracy: FMs enhance the understanding of context and meaning, resulting in better information extraction and generation.
- Adaptability: Prompts can be tailored to domain-specific data, allowing them to adjust to various industries or use cases.
- Entity Extraction: Customizable to extract relevant entities based on your specific domain and requirements.
- Complex Document Elements: Capable of interpreting and extracting information in graphical or tabular formats.
Utilizing FMs for document parsing proves particularly advantageous when dealing with complex or unstructured documents featuring domain-specific terminology. They manage ambiguities and interpret implicit information, making them essential for generating accurate and relevant responses in RAG applications. Be sure to check the pricing details, as these parsers may incur additional fees.
Within Amazon Bedrock Knowledge Bases, customers can opt to use FMs for parsing intricate documents like PDFs with nested tables or images containing text. You can create a knowledge base through the AWS Management Console by selecting “Create knowledge base.” In Step 2: Configure data source, choose “Advanced (customization)” under Chunking & parsing configurations and select one of the two available models (Anthropic Claude 3 Sonnet or Haiku) for document parsing.
If you wish to customize how the FM parses your documents, you can provide instructions based on your document structure or domain. Based on your configuration, the ingestion process will effectively parse and chunk documents, thereby improving overall response accuracy.
Next, we will examine advanced data chunking options, such as semantic and hierarchical chunking, which decompose documents into smaller units and organize these chunks in a vector store, enhancing retrieval quality.
Advanced Data Chunking Options
The goal of chunking data should not merely be to segment it but to transform it into a format that supports anticipated tasks and enables efficient retrieval for future value extraction. Instead of asking, “How should I chunk my data?”, a more pertinent query is: “What is the optimal way to format the data for the FM to achieve the intended task?”
To meet this objective, we have introduced two new data chunking options in Amazon Bedrock Knowledge Bases, in addition to fixed chunking, no chunking, and default chunking:
- Semantic Chunking: Segments data based on semantic meaning, ensuring that related information remains cohesive. This approach helps the RAG model retrieve more relevant and coherent results by maintaining contextual relationships.
- Hierarchical Chunking: Organizes data into a hierarchical structure, allowing for more detailed and efficient retrieval based on the inherent relationships within the data.
Let’s take a closer look at each technique.
Semantic Chunking
Semantic chunking evaluates relationships within a text and divides it into meaningful, complete segments based on semantic similarity determined by the embedding model. This method preserves the integrity of information during retrieval, ensuring accurate and contextually relevant results.
Utilizing semantic chunking is advisable when it’s critical to maintain the semantic integrity of the text. You can initiate the creation of a knowledge base by selecting “Create knowledge base.” In Step 2: Configure data source, choose “Advanced (customization)” under Chunking & parsing configurations, and then select “Semantic chunking” from the Chunking strategy dropdown list.
Parameters to configure include:
- Max Buffer Size for Grouping Sentences: Determines how many sentences to group when assessing semantic similarity. A buffer size of 1 will include the target sentence, the previous sentence, and the next sentence. A recommended value for this parameter is 1.
- Max Token Size for a Chunk: Specifies the maximum number of tokens a chunk can contain, ranging from a minimum of 20 to a maximum of 8,192, depending on the embedding model’s context length. For example, with the Cohere Embeddings model, a chunk’s maximum size can be 512, with a recommended value of 300.
- Breakpoint Threshold for Similarity: Sets a percentage threshold for the similarity between groups of sentences.
For further insights on effective onboarding practices, check out this excellent resource on what to expect during your first day at Amazon, shared by Atul Kumar. If you’re interested in the importance of self-care, you might also want to read this post. Lastly, for an exploration of cryptocurrency’s opportunities and challenges, see this authority on the matter.