From CRM to Fine-Tuning and RAG

By Roy F Rada, MD, PhD
Placed on LinkedIn: May 11, 2024
Keywords CRM, Salesforce, Neural Nets, Fine-Tuning, Retrieval Augmented Generation, RAG

CRM
Customer Relationship Management

Introduction

A friend asked me about AI and CRM. His startup offers AI-driven CRM via SaaS and wants to augment its LLM features. This essay reflects my preliminary response.

I created from scratch an ecommerce storefront forty years ago with Microsoft Visual Studio. Today, SaaS for complete ecommerce solutions is available from many vendors. When I examined creating an novel online organization two years ago, I looked for an open source, free software package that emphasized workflow and liked Odoo. Odoo has a CRM package and AI add-ins, as do many other vendors. What approach and tools would one use to craft a new CRM + AI service?

Table of Contents

  1. CRM and AI
  2. Market Offerings
  3. Fine-Turning and RAG
  4. Fine-Turning
  5. RAG
  6. Conclusion

CRM and AI

CRM manages customers. Information from current and potential customers is collected and analyzed and actions are taken to keep current customers buying and to capture new customers. Within each market niche these customers are different, such as patients of a hospital versus subscribers to a cellular phone network, and CRM approaches must be tailored.

The term AI describes any artifact whose input-output function reflects intelligence. With the discovery in 2022 that large neural networks operating on large document databases could manifest artificial general intelligence, the interest in AI has skyrocketed. CRM+AI means (www.sciencedirect.com/science/article/pii/S0268401224000318) that:

To successfully market a new CRM product, it should be CRM+AI.
CRM+AI
CRM plus AI helps business and customers.

Market Offerings

Small companies providing CRM+AI include: The CRM of the large company Zoho.com includes an AI assistant that provides contextual information, identifies anomalies, and suggests next steps.

Salesforce is the world’s biggest provider of enterprise software, including CRM, and states (www.salesforce.com/artificial-intelligence/cloud/):

You need real-time access to all your customer data, powerful analytics, and automation across your business to make AI work for you.
Salesforce has its own enterprise-focused LLM but also supports any LLM that the client wants to use. In 2023 Salesforce purchased airkit.ai which provides AI agents that resolve customer questions instantly.

Fine-Turning and RAG

My colleague from the Introduction is exploring various ways to tailor a LLM for CRM. Two popular techniques are fine-tuning and Retrieval Augmented Generation (RAG): The LLM response incorporates information from the document. For fine-tuning or RAG many parameters need to be adjusted whose appropriate values are discovered by trial-and-error.
LLM training
Initial training of LLM.

Fine-Turning

Fine-tuning is the process of taking the network learned by the foundational training, and further training the model. Often an added neural net classifier takes the top layer of the network as input to perform some downstream task, such as question answering. The foundation model learns a language model that instantiates word meaning that enables the model to be fine-tuned to the requirements of a downstream language understanding task.

The power of pretrained language models lies in their ability to extract generalizations from large amounts of text—generalizations that are useful for downstream applications. To make practical use of these generalizations, an interface connects these models to downstream applications through fine-tuning. Fine-tuning adds a small set of application-specific parameters buy using labeled data from the application to train these additional parameters. Typically, this training will freeze the pretrained language model parameters.

fine tuning
The foundation LLM is further trained with documents from the application to be addressed.

RAG

"RAG" stands for "Retrieval Augmented Generation," which is a technique that enhances the capabilities of a large language model by allowing it to access and incorporate relevant information from external knowledge bases before generating responses, essentially making its answers more accurate and contextually appropriate by pulling in fresh, specific data when needed, rather than relying solely on its pre-trained knowledge.

When a user asks a question, RAG first searches through a designated knowledge base (like a database or collection of documents) to retrieve the most relevant information related to the query. This retrieved data is then combined with the original prompt and fed into the LLM to generate a response that is grounded in the specific context. RAG is particularly useful in scenarios where a system needs to provide detailed and accurate information based on current data, such as customer service chatbots, knowledge-based question answering systems, and enterprise information retrieval applications.

RAG
In retrieval augmented generation a library of documents relevant to the application are accessed as appropriate to support the generation of responses.

Conclusion

This essay reviews the marketplace and potential of AI+CRM. Multiple AI tools that precede LLMs are useful in CRM, and a robust AI+CRM system will map each CRM problem to its appropriate tool in a multi-agent architecture. The most recent and revolutionary tool is the LLM, and to use that tool the crucial step for a company is to tailor the LLM via fine-tuning or RAG. The opportunities and challenges are many!

Return Home