SlideShare a Scribd company logo
Grid Dynamics / Transforming Business Process Automation
Transforming Business Process
Automation with Retrieval-Augmented
Generation and LLMs
Đorđe Grozdić | November 2023
Grid Dynamics / Transforming Business Process Automation
About Myself
PhD in Machine Learning and Artificial Intelligence
10+ years of hands on experience in Data Science
Senior Staff Data Scientist
& Senior Specialization Lead
Đorđe Grozdić
Grid Dynamics / Transforming Business Process Automation
3
About Grid Dynamics
Grid Dynamics, a global digital engineering company, co-
innovates with the most respected brands in the world
to solve complex problems, optimize business operations
and better serve customers.
Grid Dynamics is a leading provider of technology consulting,
agile custom software development, and data analytics
for Fortune 1000 and Global 2000 enterprises undergoing
digital transformation.
3
Grid Dynamics / Transforming Business Process Automation
4
Grid Dynamics: Prepare to Grow
UK
Serbia
Poland
Ukraine
Armenia
Mexico India
Spain
USA
4,000
engineers, architects
and tech managers
GDYN
Nasdaq-listed since 2020
18
countries
ᐧ USA
ᐧ Mexico
ᐧ UK
ᐧ Netherlands
ᐧ Spain
ᐧ Poland
ᐧ Serbia
ᐧ Romania
ᐧ Moldova
ᐧ Ukraine
ᐧ Armenia
ᐧ Jamaica
ᐧ India
Yerevan
Guadalajara
Kyiv
Krakov
Amsterdam
London
Belgrad
New York
San Francisco
Bay Area (HQ)
Portland
Chicago
Dallas
Atlanta
Tampa
Lviv
Madrid
Grid Dynamics was founded in Silicon Valley in 2006 with the
mission to bring emerging technology to large enterprises.
With proven ability to scale globally, we became trusted tech
partner for tier-1 firms.
Netherlands
Areas of focused growth
Existing locations
Headquarters
Hyderabad
Jamaica
Grid Dynamics / Transforming Business Process Automation
5
Digital Innovation Partner
for Fortune 1000
and many more...
.Tech. .СPG.
.Finance. .Retail. .Other.
Grid Dynamics / Transforming Business Process Automation
Introduction
Business Process Automation (BPA) and the impact of AI
Grid Dynamics / Transforming Business Process Automation
・Necessity of automation in today's competitive business landscape.
・Limitations of traditional document processing:
・Inability to manage high volume and complexity.
・Slower processes with higher error rates.
・Emergence of Large Language Models (LLMs):
・Advancements in complex, human-like text generation.
・Challenges with domain-specific tasks.
・Introduction of Retrieval-Augmented Generation (RAG):
・Seamlessly integrates domain-specific data in real-time.
・Reduces the need for continuous model retraining.
・Advantages of RAG:
・Cost-effective and secure.
・Provides greater explainability.
・Minimizes errors and "hallucinations" compared to general-purpose LLMs.
Business Process Automation and LLMs
7
Grid Dynamics / Transforming Business Process Automation
What is Retrieval-Augmented
Generation?
Brief overview of how RAG works.
Grid Dynamics / Transforming Business Process Automation
Retrieval-Augmented Generation (RAG) is a machine learning approach that combines the
strengths of information retrieval methods with the generative capabilities of language models
Architecture of Retrieval-Augmented Generation
9
Grid Dynamics / Transforming Business Process Automation
RAG in Practice
High-level view of how RAG is applied across
different industries.
Grid Dynamics / Transforming Business Process Automation
RAG in Supply Chain
11
Grid Dynamics / Transforming Business Process Automation
RAG in Supply Chain
12
Grid Dynamics / Transforming Business Process Automation
RAG in Supply Chain
13
Grid Dynamics / Transforming Business Process Automation
Deep Dive: RFP Processing with
RAG
Case study with specifics on how RAG can optimize RFP processing.
Grid Dynamics / Transforming Business Process Automation
・RFP (Request For Proposal) is a document issued by a business or
organization when seeking proposals or bids from potential suppliers or
service providers.
・Intelligent Document Processing (IDP) tool:
・ Perform ad hoc analysis of large documents such as contracts and RFPs,
ask questions and summaries.
・ Automatically fill forms such as RFP responses by generating answers
based on your knowledge base.
・ Control the style of the generated answers and adjust details using natural
language instructions.
・ Automatically validate that generated or manually created documents are
consistent with your knowledge base.
・ Combine the above blocks into complex workflows.
RFP Processing - Use case
15
Grid Dynamics / Transforming Business Process Automation
Intelligent Document Processing - Workflow
16
Grid Dynamics / Transforming Business Process Automation
Intelligent Document Processing
17
Grid Dynamics / Transforming Business Process Automation
Architecture of RAG
Overview of the architecture with focus on the
Retriever, Generator, and Orchestrator.
Grid Dynamics / Transforming Business Process Automation
The Process Flow
19
Grid Dynamics / Transforming Business Process Automation
Building a RAG Pipeline
Key steps from document loading to answer
generation.
Grid Dynamics / Transforming Business Process Automation
・Diversity of Text Data Sources:
・Handles various document types: .txt, .pdf, .docx, .xlsx, .csv, .json, .html, .md, code files…
・Ensures compatibility across a wide range of data formats.
・Preparation and Loading Processes:
・Involves extraction, parsing, cleaning, formatting, and text conversion.
・Essential for feeding clean and structured data to LLMs.
・LangChain:
・A Tool for Data Loading: Recognized for its capability to process over 80 document types.
・Offers versatility in handling diverse data inputs.
1. Document Loading
21
Grid Dynamics / Transforming Business Process Automation
・Document Splitting
・Essential for managing extensive documents within LLM token limits.
・Process: Load → Parse → Convert → Chunk.
・Challenges in Context Preservation
・Example of context loss shown in figure on the right side.
・Importance of semantic consideration in splitting.
・Principles of Text Splitting
・Chunk Size: Based on character, word, or token count.
・Overlap: Ensures continuity of context between chunks (see figure below).
・Chunking Techniques
・Fixed-size with overlap: Simple but potentially context-disrupting.
・Sentence Splitting: Utilizes NLP tools for coherent segmentation.
・Recursive Chunking: Hierarchical and iterative approach.
・Specialized Techniques: Adapts to structured formats like Markdown.
・Optimizing Chunk Size
・Preprocess data for quality enhancement.
・Experiment with a range of chunk sizes for optimal balance.
・Iteratively evaluate performance to refine chunking strategy.
・Conclusion
・ Tailor document splitting approach to specific application needs.
2. Document Splitting
22
Grid Dynamics / Transforming Business Process Automation
・Text Embedding
・Post-splitting: Text chunks are transformed into vector representations.
・Purpose: Facilitate semantic similarity comparisons.
・Vector Embeddings Role
・Fundamental in ML for mapping complex data into vector space.
・Captures semantic information in text data.
・Semantic Relationships
・ Example: Different sentences with similar meanings
are close in vector space.
・ Visualization: Clustering in embeddings indicates semantic proximity.
・Evolution of Embedding Models
・Word2Vec and GloVe: Word-level embeddings from co-occurrence.
・Transformers (BERT, RoBERTa, GPT): Context-aware embeddings.
・Context-Aware Embedding
・Consider entire sentence context, enriching semantic capture.
・Critical for ambiguity resolution and NLP advances.
・Use Cases in NLP
・ Example: Distinct meanings of 'bank' in different contexts.
・ RAG (Retrieval and Generation): Utilizes transformer models for efficient document handling.
3. Text Embedding
23
Grid Dynamics / Transforming Business Process Automation
・Vector Stores Storage:
・Houses document chunk embeddings and associated IDs.
・Function: Facilitates efficient vector lookups for similar content.
・Notable Vector Stores
・FAISS: Specializes in handling massive vector collections.
・SPTAG: Offers customizable search algorithms for precision and speed.
・Milvus: Open-source database compatible with major ML frameworks.
・Chroma: In-memory database versatile for cloud and on-premise deployment.
・Weaviate: Stores both vectors and objects, supports various search methods.
・Elasticsearch: Scales well for large-scale vector data applications.
・Pinecone: Managed service, optimal for real-time analysis and ML applications.
・Considerations for Choice
・Scale of data and computational resources.
・Integration with existing frameworks and infrastructure.
・Balancing between precision, speed, and storage efficiency.
・Implications for RAG
・The correct pairing of text embedding and vector store is critical.
・Enables rapid retrieval of relevant document chunks.
4. Vector Store
24
Grid Dynamics / Transforming Business Process Automation
・Retrieval Process Overview
・Begins with query transformation into vector form.
・Comparison with document chunk vectors in vector store.
・Objective: Retrieve relevant document chunks corresponding to the query.
・Retrieval Mechanisms Similarity Search:
・Uses cosine similarity to find related documents.
・Maximum Marginal Relevance (MMR): Ensures diversity and
reduces redundancy.
・Similarity Score Threshold: Filters documents above a certain
similarity score.
・Top 'k' Documents: Retrieves a set number of documents
based on ranking.
・Advanced Retrieval Methods
・Self-Query/LLM-Aided Retrieval:
⎯ Splits the query into search and filter terms.
⎯ Utilizes metadata filters for more precise retrieval.
・Compression Retrieval:
⎯ Compression LLM condenses information to focus on key aspects.
⎯ Balances storage efficiency with retrieval speed.
・Traditional vs. Modern Techniques
・Vector-Based Retrieval: Preferred for RAG due to semantic matching capabilities.
・Traditional NLP Techniques: SVM, TF-IDF, etc., less common in RAG systems.
5. Document Retrieval
25
Grid Dynamics / Transforming Business Process Automation
・Answer Generation
・Involves creating a prompt from relevant document chunks and the user query.
・The prompt guides the LLM to generate relevant and insightful responses.
・Standard Method: The “Stuff” Approach
・Simplest form of generating answers.
・Direct processing of prompt for immediate answer generation.
・Limited by context window size - less effective for complex, multi-document queries.
・ Advanced Methods for Complex Queries
・Map-reduce Method:
⎯ Processes each document chunk individually.
⎯ Combines separate answers into one final response.
⎯ Advantage: Handles an arbitrary number of chunks; effective for comprehensive answers.
⎯ Drawback: Slower and may miss context spread across multiple chunks.
・Refine Method:
⎯ Iterative updating of prompt with relevant information.
⎯ Useful for dynamic contexts where initial answers can be refined.
・Map-rerank Method:
⎯ Ranks documents by relevance to the query.
⎯ Ideal for scenarios with multiple plausible answers.
・Choice of Method
・Dependent on the complexity of the query and desired answer abstraction level.
・Enhances the accuracy and relevance of LLM responses.
6. Answer Generation
26
Grid Dynamics / Transforming Business Process Automation
Benefits of RAG and Conclusions
Advantages of RAG over general-purpose LLMs.
Grid Dynamics / Transforming Business Process Automation
’Real-Time’ Data Integration:
・Immediate inclusion of new data into the system's
knowledge base.
・Eliminates the need for constant model retraining.
Reduced Costs:
・Indexing and retrieval reduce computational
expenses.
・Saves time by avoiding frequent retraining cycles.
Enhanced Security:
・Sensitive data remains in the document store,
not exposed to the model.
・Real-time access restrictions improve data
protection.
Advantages of RAG over General-Purpose LLMs
28
Greater Explainability:
・Responses can be traced back to source
documents.
・Increases transparency and accountability in
automated processes.
Reduction in Hallucination:
・Relies on actual documents to generate responses,
decreasing false information.
・Ensures information reliability by referencing the
existing knowledge base.
Overcoming Context Size Limitations:
・Retrieves only relevant documents, tackling the
token limitation of LLMs.
・Facilitates handling of extensive data sets beyond
the usual LLM capacity.
Grid Dynamics / Transforming Business Process Automation
5000 Executive Parkway,
Suite 520 / San Ramon, CA
650-523-5000
info@griddynamics.com
www.griddynamics.com
Grid Dynamics Holdings, Inc.
Thank you for your attention!

More Related Content

PPTX
LlamaIndex_HassGeek_Workshop_for_AI.pptx
PDF
Webinar: Faster Big Data Analytics with MongoDB
PDF
Deploying Enterprise Scale Deep Learning in Actuarial Modeling at Nationwide
PDF
Overcoming Today's Data Challenges with MongoDB
PPTX
La creación de una capa operacional con MongoDB
PPTX
Mark Simpson - UKOUG23 - Refactoring Monolithic Oracle Database Applications ...
PDF
MongoDB .local Chicago 2019: MongoDB – Powering the new age data demands
LlamaIndex_HassGeek_Workshop_for_AI.pptx
Webinar: Faster Big Data Analytics with MongoDB
Deploying Enterprise Scale Deep Learning in Actuarial Modeling at Nationwide
Overcoming Today's Data Challenges with MongoDB
La creación de una capa operacional con MongoDB
Mark Simpson - UKOUG23 - Refactoring Monolithic Oracle Database Applications ...
MongoDB .local Chicago 2019: MongoDB – Powering the new age data demands

Similar to [DSC Europe 23] Djordje Grozdic - Transforming Business Process Automation with Retrieval-Augmented Generation and LLMs (20)

PDF
MongoDB .local Toronto 2019: MongoDB – Powering the new age data demands
PDF
Enterprise deep learning lessons bodkin o reilly ai sf 2017
PPTX
Overcoming Today's Data Challenges with MongoDB
PDF
Orchestrating Multi-Agent Systems for Multi-Source Information Retrieval and ...
PDF
Orchestrating Multi-Agent Systems for Multi-Source Information Retrieval and ...
PDF
Orchestrating Multi-Agent Systems for Multi-Source Information Retrieval and ...
PPTX
AI presentation Genrative LLM for users.pptx
PPTX
Master Meta Data
PDF
Which Questions We Should Have
PDF
MongoDB Breakfast Milan - Mainframe Offloading Strategies
PPTX
Bitkom Cray presentation - on HPC affecting big data analytics in FS
PDF
Monish R_9163_b
PPTX
Data Treatment MongoDB
PDF
Introduction to Machine Learning - WeCloudData
PDF
Introduction to Machine Learning - WeCloudData
PPTX
RAG Scaling Cost Efficiency - Ansi ByteCode LLP
PDF
Data Services and the Modern Data Ecosystem (ASEAN)
PPTX
Webinar: What's New in MongoDB 3.2
PDF
Big Data: Its Characteristics And Architecture Capabilities
MongoDB .local Toronto 2019: MongoDB – Powering the new age data demands
Enterprise deep learning lessons bodkin o reilly ai sf 2017
Overcoming Today's Data Challenges with MongoDB
Orchestrating Multi-Agent Systems for Multi-Source Information Retrieval and ...
Orchestrating Multi-Agent Systems for Multi-Source Information Retrieval and ...
Orchestrating Multi-Agent Systems for Multi-Source Information Retrieval and ...
AI presentation Genrative LLM for users.pptx
Master Meta Data
Which Questions We Should Have
MongoDB Breakfast Milan - Mainframe Offloading Strategies
Bitkom Cray presentation - on HPC affecting big data analytics in FS
Monish R_9163_b
Data Treatment MongoDB
Introduction to Machine Learning - WeCloudData
Introduction to Machine Learning - WeCloudData
RAG Scaling Cost Efficiency - Ansi ByteCode LLP
Data Services and the Modern Data Ecosystem (ASEAN)
Webinar: What's New in MongoDB 3.2
Big Data: Its Characteristics And Architecture Capabilities
Ad

More from DataScienceConferenc1 (20)

PPTX
[DSC Europe 24] Anastasia Shapedko - How Alice, our intelligent personal assi...
PPTX
[DSC Europe 24] Joy Chatterjee - Balancing Personalization and Experimentatio...
PPTX
[DSC Europe 24] Pratul Chakravarty - Personalized Insights and Engagements us...
PPTX
[DSC Europe 24] Domagoj Maric - Modern Web Data Extraction: Techniques, Tools...
PPTX
[DSC Europe 24] Marcin Szymaniuk - The path to Effective Data Migration - Ove...
PPTX
[DSC Europe 24] Fran Mikulicic - Building a Data-Driven Culture: What the C-S...
PPTX
[DSC Europe 24] Sofija Pervulov - Building up the Bosch Semantic Data Lake
PDF
[DSC Europe 24] Dani Ei-Ayyas - Overcoming Loneliness with LLM Dating Assistant
PDF
[DSC Europe 24] Ewelina Kucal & Maciej Dziezyc - How to Encourage Children to...
PPTX
[DSC Europe 24] Nikola Milosevic - VerifAI: Biomedical Generative Question-An...
PPTX
[DSC Europe 24] Josip Saban - Buidling cloud data platforms in enterprises
PPTX
[DSC Europe 24] Sray Agarwal - 2025: year of Ai dilemma - ethics, regulations...
PDF
[DSC Europe 24] Peter Kertys & Maros Buban - Application of AI technologies i...
PPTX
[DSC Europe 24] Orsalia Andreou - Fostering Trust in AI-Driven Finance
PPTX
[DSC Europe 24] Arnault Ioualalen - AI Trustworthiness – A Path Toward Mass A...
PDF
[DSC Europe 24] Nathan Coyle - Open Data for Everybody: Social Action, Peace ...
PPTX
[DSC Europe 24] Miodrag Vladic - Revolutionizing Information Access: All Worl...
PPTX
[DSC Europe 24] Katherine Munro - Where there’s a will, there’s a way: The ma...
PPTX
[DSC Europe 24] Ana Stojkovic Knezevic - How to effectively manage AI/ML proj...
PPTX
[DSC Europe 24] Simun Sunjic & Lovro Matosevic - Empowering Sales with Intell...
[DSC Europe 24] Anastasia Shapedko - How Alice, our intelligent personal assi...
[DSC Europe 24] Joy Chatterjee - Balancing Personalization and Experimentatio...
[DSC Europe 24] Pratul Chakravarty - Personalized Insights and Engagements us...
[DSC Europe 24] Domagoj Maric - Modern Web Data Extraction: Techniques, Tools...
[DSC Europe 24] Marcin Szymaniuk - The path to Effective Data Migration - Ove...
[DSC Europe 24] Fran Mikulicic - Building a Data-Driven Culture: What the C-S...
[DSC Europe 24] Sofija Pervulov - Building up the Bosch Semantic Data Lake
[DSC Europe 24] Dani Ei-Ayyas - Overcoming Loneliness with LLM Dating Assistant
[DSC Europe 24] Ewelina Kucal & Maciej Dziezyc - How to Encourage Children to...
[DSC Europe 24] Nikola Milosevic - VerifAI: Biomedical Generative Question-An...
[DSC Europe 24] Josip Saban - Buidling cloud data platforms in enterprises
[DSC Europe 24] Sray Agarwal - 2025: year of Ai dilemma - ethics, regulations...
[DSC Europe 24] Peter Kertys & Maros Buban - Application of AI technologies i...
[DSC Europe 24] Orsalia Andreou - Fostering Trust in AI-Driven Finance
[DSC Europe 24] Arnault Ioualalen - AI Trustworthiness – A Path Toward Mass A...
[DSC Europe 24] Nathan Coyle - Open Data for Everybody: Social Action, Peace ...
[DSC Europe 24] Miodrag Vladic - Revolutionizing Information Access: All Worl...
[DSC Europe 24] Katherine Munro - Where there’s a will, there’s a way: The ma...
[DSC Europe 24] Ana Stojkovic Knezevic - How to effectively manage AI/ML proj...
[DSC Europe 24] Simun Sunjic & Lovro Matosevic - Empowering Sales with Intell...
Ad

Recently uploaded (20)

PPTX
Computer network topology notes for revision
PDF
Mega Projects Data Mega Projects Data
PDF
Lecture1 pattern recognition............
PPTX
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
PPT
Quality review (1)_presentation of this 21
PPTX
Business Ppt On Nestle.pptx huunnnhhgfvu
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
PDF
.pdf is not working space design for the following data for the following dat...
PDF
Fluorescence-microscope_Botany_detailed content
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PPTX
Data_Analytics_and_PowerBI_Presentation.pptx
PDF
Clinical guidelines as a resource for EBP(1).pdf
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
PDF
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPTX
oil_refinery_comprehensive_20250804084928 (1).pptx
Computer network topology notes for revision
Mega Projects Data Mega Projects Data
Lecture1 pattern recognition............
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
Quality review (1)_presentation of this 21
Business Ppt On Nestle.pptx huunnnhhgfvu
STUDY DESIGN details- Lt Col Maksud (21).pptx
.pdf is not working space design for the following data for the following dat...
Fluorescence-microscope_Botany_detailed content
Galatica Smart Energy Infrastructure Startup Pitch Deck
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
Data_Analytics_and_PowerBI_Presentation.pptx
Clinical guidelines as a resource for EBP(1).pdf
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
Acceptance and paychological effects of mandatory extra coach I classes.pptx
oil_refinery_comprehensive_20250804084928 (1).pptx

[DSC Europe 23] Djordje Grozdic - Transforming Business Process Automation with Retrieval-Augmented Generation and LLMs

  • 1. Grid Dynamics / Transforming Business Process Automation Transforming Business Process Automation with Retrieval-Augmented Generation and LLMs Đorđe Grozdić | November 2023
  • 2. Grid Dynamics / Transforming Business Process Automation About Myself PhD in Machine Learning and Artificial Intelligence 10+ years of hands on experience in Data Science Senior Staff Data Scientist & Senior Specialization Lead Đorđe Grozdić
  • 3. Grid Dynamics / Transforming Business Process Automation 3 About Grid Dynamics Grid Dynamics, a global digital engineering company, co- innovates with the most respected brands in the world to solve complex problems, optimize business operations and better serve customers. Grid Dynamics is a leading provider of technology consulting, agile custom software development, and data analytics for Fortune 1000 and Global 2000 enterprises undergoing digital transformation. 3
  • 4. Grid Dynamics / Transforming Business Process Automation 4 Grid Dynamics: Prepare to Grow UK Serbia Poland Ukraine Armenia Mexico India Spain USA 4,000 engineers, architects and tech managers GDYN Nasdaq-listed since 2020 18 countries ᐧ USA ᐧ Mexico ᐧ UK ᐧ Netherlands ᐧ Spain ᐧ Poland ᐧ Serbia ᐧ Romania ᐧ Moldova ᐧ Ukraine ᐧ Armenia ᐧ Jamaica ᐧ India Yerevan Guadalajara Kyiv Krakov Amsterdam London Belgrad New York San Francisco Bay Area (HQ) Portland Chicago Dallas Atlanta Tampa Lviv Madrid Grid Dynamics was founded in Silicon Valley in 2006 with the mission to bring emerging technology to large enterprises. With proven ability to scale globally, we became trusted tech partner for tier-1 firms. Netherlands Areas of focused growth Existing locations Headquarters Hyderabad Jamaica
  • 5. Grid Dynamics / Transforming Business Process Automation 5 Digital Innovation Partner for Fortune 1000 and many more... .Tech. .СPG. .Finance. .Retail. .Other.
  • 6. Grid Dynamics / Transforming Business Process Automation Introduction Business Process Automation (BPA) and the impact of AI
  • 7. Grid Dynamics / Transforming Business Process Automation ・Necessity of automation in today's competitive business landscape. ・Limitations of traditional document processing: ・Inability to manage high volume and complexity. ・Slower processes with higher error rates. ・Emergence of Large Language Models (LLMs): ・Advancements in complex, human-like text generation. ・Challenges with domain-specific tasks. ・Introduction of Retrieval-Augmented Generation (RAG): ・Seamlessly integrates domain-specific data in real-time. ・Reduces the need for continuous model retraining. ・Advantages of RAG: ・Cost-effective and secure. ・Provides greater explainability. ・Minimizes errors and "hallucinations" compared to general-purpose LLMs. Business Process Automation and LLMs 7
  • 8. Grid Dynamics / Transforming Business Process Automation What is Retrieval-Augmented Generation? Brief overview of how RAG works.
  • 9. Grid Dynamics / Transforming Business Process Automation Retrieval-Augmented Generation (RAG) is a machine learning approach that combines the strengths of information retrieval methods with the generative capabilities of language models Architecture of Retrieval-Augmented Generation 9
  • 10. Grid Dynamics / Transforming Business Process Automation RAG in Practice High-level view of how RAG is applied across different industries.
  • 11. Grid Dynamics / Transforming Business Process Automation RAG in Supply Chain 11
  • 12. Grid Dynamics / Transforming Business Process Automation RAG in Supply Chain 12
  • 13. Grid Dynamics / Transforming Business Process Automation RAG in Supply Chain 13
  • 14. Grid Dynamics / Transforming Business Process Automation Deep Dive: RFP Processing with RAG Case study with specifics on how RAG can optimize RFP processing.
  • 15. Grid Dynamics / Transforming Business Process Automation ・RFP (Request For Proposal) is a document issued by a business or organization when seeking proposals or bids from potential suppliers or service providers. ・Intelligent Document Processing (IDP) tool: ・ Perform ad hoc analysis of large documents such as contracts and RFPs, ask questions and summaries. ・ Automatically fill forms such as RFP responses by generating answers based on your knowledge base. ・ Control the style of the generated answers and adjust details using natural language instructions. ・ Automatically validate that generated or manually created documents are consistent with your knowledge base. ・ Combine the above blocks into complex workflows. RFP Processing - Use case 15
  • 16. Grid Dynamics / Transforming Business Process Automation Intelligent Document Processing - Workflow 16
  • 17. Grid Dynamics / Transforming Business Process Automation Intelligent Document Processing 17
  • 18. Grid Dynamics / Transforming Business Process Automation Architecture of RAG Overview of the architecture with focus on the Retriever, Generator, and Orchestrator.
  • 19. Grid Dynamics / Transforming Business Process Automation The Process Flow 19
  • 20. Grid Dynamics / Transforming Business Process Automation Building a RAG Pipeline Key steps from document loading to answer generation.
  • 21. Grid Dynamics / Transforming Business Process Automation ・Diversity of Text Data Sources: ・Handles various document types: .txt, .pdf, .docx, .xlsx, .csv, .json, .html, .md, code files… ・Ensures compatibility across a wide range of data formats. ・Preparation and Loading Processes: ・Involves extraction, parsing, cleaning, formatting, and text conversion. ・Essential for feeding clean and structured data to LLMs. ・LangChain: ・A Tool for Data Loading: Recognized for its capability to process over 80 document types. ・Offers versatility in handling diverse data inputs. 1. Document Loading 21
  • 22. Grid Dynamics / Transforming Business Process Automation ・Document Splitting ・Essential for managing extensive documents within LLM token limits. ・Process: Load → Parse → Convert → Chunk. ・Challenges in Context Preservation ・Example of context loss shown in figure on the right side. ・Importance of semantic consideration in splitting. ・Principles of Text Splitting ・Chunk Size: Based on character, word, or token count. ・Overlap: Ensures continuity of context between chunks (see figure below). ・Chunking Techniques ・Fixed-size with overlap: Simple but potentially context-disrupting. ・Sentence Splitting: Utilizes NLP tools for coherent segmentation. ・Recursive Chunking: Hierarchical and iterative approach. ・Specialized Techniques: Adapts to structured formats like Markdown. ・Optimizing Chunk Size ・Preprocess data for quality enhancement. ・Experiment with a range of chunk sizes for optimal balance. ・Iteratively evaluate performance to refine chunking strategy. ・Conclusion ・ Tailor document splitting approach to specific application needs. 2. Document Splitting 22
  • 23. Grid Dynamics / Transforming Business Process Automation ・Text Embedding ・Post-splitting: Text chunks are transformed into vector representations. ・Purpose: Facilitate semantic similarity comparisons. ・Vector Embeddings Role ・Fundamental in ML for mapping complex data into vector space. ・Captures semantic information in text data. ・Semantic Relationships ・ Example: Different sentences with similar meanings are close in vector space. ・ Visualization: Clustering in embeddings indicates semantic proximity. ・Evolution of Embedding Models ・Word2Vec and GloVe: Word-level embeddings from co-occurrence. ・Transformers (BERT, RoBERTa, GPT): Context-aware embeddings. ・Context-Aware Embedding ・Consider entire sentence context, enriching semantic capture. ・Critical for ambiguity resolution and NLP advances. ・Use Cases in NLP ・ Example: Distinct meanings of 'bank' in different contexts. ・ RAG (Retrieval and Generation): Utilizes transformer models for efficient document handling. 3. Text Embedding 23
  • 24. Grid Dynamics / Transforming Business Process Automation ・Vector Stores Storage: ・Houses document chunk embeddings and associated IDs. ・Function: Facilitates efficient vector lookups for similar content. ・Notable Vector Stores ・FAISS: Specializes in handling massive vector collections. ・SPTAG: Offers customizable search algorithms for precision and speed. ・Milvus: Open-source database compatible with major ML frameworks. ・Chroma: In-memory database versatile for cloud and on-premise deployment. ・Weaviate: Stores both vectors and objects, supports various search methods. ・Elasticsearch: Scales well for large-scale vector data applications. ・Pinecone: Managed service, optimal for real-time analysis and ML applications. ・Considerations for Choice ・Scale of data and computational resources. ・Integration with existing frameworks and infrastructure. ・Balancing between precision, speed, and storage efficiency. ・Implications for RAG ・The correct pairing of text embedding and vector store is critical. ・Enables rapid retrieval of relevant document chunks. 4. Vector Store 24
  • 25. Grid Dynamics / Transforming Business Process Automation ・Retrieval Process Overview ・Begins with query transformation into vector form. ・Comparison with document chunk vectors in vector store. ・Objective: Retrieve relevant document chunks corresponding to the query. ・Retrieval Mechanisms Similarity Search: ・Uses cosine similarity to find related documents. ・Maximum Marginal Relevance (MMR): Ensures diversity and reduces redundancy. ・Similarity Score Threshold: Filters documents above a certain similarity score. ・Top 'k' Documents: Retrieves a set number of documents based on ranking. ・Advanced Retrieval Methods ・Self-Query/LLM-Aided Retrieval: ⎯ Splits the query into search and filter terms. ⎯ Utilizes metadata filters for more precise retrieval. ・Compression Retrieval: ⎯ Compression LLM condenses information to focus on key aspects. ⎯ Balances storage efficiency with retrieval speed. ・Traditional vs. Modern Techniques ・Vector-Based Retrieval: Preferred for RAG due to semantic matching capabilities. ・Traditional NLP Techniques: SVM, TF-IDF, etc., less common in RAG systems. 5. Document Retrieval 25
  • 26. Grid Dynamics / Transforming Business Process Automation ・Answer Generation ・Involves creating a prompt from relevant document chunks and the user query. ・The prompt guides the LLM to generate relevant and insightful responses. ・Standard Method: The “Stuff” Approach ・Simplest form of generating answers. ・Direct processing of prompt for immediate answer generation. ・Limited by context window size - less effective for complex, multi-document queries. ・ Advanced Methods for Complex Queries ・Map-reduce Method: ⎯ Processes each document chunk individually. ⎯ Combines separate answers into one final response. ⎯ Advantage: Handles an arbitrary number of chunks; effective for comprehensive answers. ⎯ Drawback: Slower and may miss context spread across multiple chunks. ・Refine Method: ⎯ Iterative updating of prompt with relevant information. ⎯ Useful for dynamic contexts where initial answers can be refined. ・Map-rerank Method: ⎯ Ranks documents by relevance to the query. ⎯ Ideal for scenarios with multiple plausible answers. ・Choice of Method ・Dependent on the complexity of the query and desired answer abstraction level. ・Enhances the accuracy and relevance of LLM responses. 6. Answer Generation 26
  • 27. Grid Dynamics / Transforming Business Process Automation Benefits of RAG and Conclusions Advantages of RAG over general-purpose LLMs.
  • 28. Grid Dynamics / Transforming Business Process Automation ’Real-Time’ Data Integration: ・Immediate inclusion of new data into the system's knowledge base. ・Eliminates the need for constant model retraining. Reduced Costs: ・Indexing and retrieval reduce computational expenses. ・Saves time by avoiding frequent retraining cycles. Enhanced Security: ・Sensitive data remains in the document store, not exposed to the model. ・Real-time access restrictions improve data protection. Advantages of RAG over General-Purpose LLMs 28 Greater Explainability: ・Responses can be traced back to source documents. ・Increases transparency and accountability in automated processes. Reduction in Hallucination: ・Relies on actual documents to generate responses, decreasing false information. ・Ensures information reliability by referencing the existing knowledge base. Overcoming Context Size Limitations: ・Retrieves only relevant documents, tackling the token limitation of LLMs. ・Facilitates handling of extensive data sets beyond the usual LLM capacity.
  • 29. Grid Dynamics / Transforming Business Process Automation 5000 Executive Parkway, Suite 520 / San Ramon, CA 650-523-5000 info@griddynamics.com www.griddynamics.com Grid Dynamics Holdings, Inc. Thank you for your attention!