<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Greger Ottosson on Medium]]></title>
        <description><![CDATA[Stories by Greger Ottosson on Medium]]></description>
        <link>https://medium.com/@greger_ottosson?source=rss-682b3c6444b5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8390jbCE_7yd1tMwbT1xnw.jpeg</url>
            <title>Stories by Greger Ottosson on Medium</title>
            <link>https://medium.com/@greger_ottosson?source=rss-682b3c6444b5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 22:13:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@greger_ottosson/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Basic RAG is not so basic for Enterprise Data]]></title>
            <link>https://medium.com/@greger_ottosson/basic-rag-is-not-so-basic-for-enterprise-data-3ce2aa9a8c04?source=rss-682b3c6444b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ce2aa9a8c04</guid>
            <category><![CDATA[enterprise-ai]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[enterprise-ai-solutions]]></category>
            <category><![CDATA[chat-with-document]]></category>
            <dc:creator><![CDATA[Greger Ottosson]]></dc:creator>
            <pubDate>Thu, 22 Aug 2024 11:24:29 GMT</pubDate>
            <atom:updated>2024-10-27T08:37:11.748Z</atom:updated>
            <content:encoded><![CDATA[<h4>Why consumer-style LLM chatbots don’t work in the enterprise</h4><p>When it comes to LLM-powered chatbots and information retrieval, many demos and consumer-facing applications showcase the capabilities of Retrieval Augmented Generation (RAG) using a single or a few documents. With a simple drag-n-drop, you can upload a couple of documents and start asking questions about it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Noszim_quwkzYjYiE3NetA.png" /><figcaption>Attaching documents to a chat thread in Google Gemini</figcaption></figure><p>Conceptually, this is what RAG is all about: provide the LLM with some additional information related to the specific query you’re pursuing, allowing it to base its answer on the facts you’ve provided and rely less on the likely incomplete or outdated “world knowledge” from its training data.</p><p>While these “Chat with your documents” capabilities are impressive — and very helpful when doing research and writing articles — they often don’t tackle the challenges faced in enterprise use cases.</p><blockquote>When dealing with the large enterprise repositories of contracts, agreements, policies and documentation, manual upload of individual documents is not sufficient.</blockquote><p>It’s tempting to think that we’ll soon be able to just point our favorite consumer chatbot to our entire Dropbox, OneDrive or Google Drive file hierarchy, and the problem will be solved. But as you’ll see below, this unlikely to work reliable for enterprise data.</p><p>This article will highlight a few intricacies of implementing RAG in enterprise scenarios and explore some solutions, including how data management techniques combined with modern vector databases can help overcome these challenges. These are just examples, but will hopefully illustrate why RAG-based solutions most often require custom approaches for data management and AI.</p><h3>1. Multiple Versions of Documents</h3><p>In enterprise environments, documents such as contracts, agreements, and policies often exist multiple versions due to ongoing revisions, updates, and negotiations. Organizations dealing with higher volumes of such documents might have a proper Content Management System (CMS) with versioning in place. In other places, you might find these documents stored in regular file folders, with simple versioning of the file names indicating the history of revisions. Even more challenging, we sometimes find these documents spread out and duplicated over multiple directories, with potentially different versions, names and formats.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*596Wp9D7dxo5WjUa" /></figure><p>This creates a challenge for RAG systems, which need to identify and retrieve the most relevant or up-to-date version for a given query. Without proper version control or metadata, the system might inadvertently select or mix outdated document versions, most likely leading to inaccuracies or outright errors.</p><blockquote>These issues are not due to “hallucinations” we can blame on the LLM; they are issues we caused by feeding the LLM with the wrong information.</blockquote><p>In some cases, the solution might be as simple as selecting only the latest “final” version of each document, which is then fed to and indexed by the RAG system. However, managing multiple versions inside the RAG system is sometimes necessary if we want to be able to ask our AI to compare changes to documents over time.</p><p><strong>Solution:</strong> First, in the majority of cases custom data management is required in order to identify the “latest version” of a policy or the contract in effect at a certain date. Whether documents are stored in file folder, CMS systems or other enterprise applications, the business logic to extract the right documents will need to be defined based on the use cases at hand.</p><p>Second, inside the RAG application, modern vector databases offer functionalities that can significantly assist in managing chunks of multiple document versions. A good vector database can store metadata alongside vector embeddings, allowing for efficient version control of chunks with version numbers and timestamps.</p><blockquote>Effective use of metadata in vector databases enables the application to identify and retrieve only the chunks of a specific version of a document.</blockquote><p>For example, the <a href="https://www.pinecone.io/">Pinecone</a> vector database offers <a href="https://docs.pinecone.io/guides/data/manage-rag-documents">prefixes</a> to support versioning and more, whereas <a href="https://weaviate.io/">Weaviate</a> similarly offers metadata with <a href="https://weaviate.io/developers/weaviate/api/graphql/filters#special-cases">id and time stamps</a>. This metadata can then be used in filters (alongside vector similarity) to retrieve relevant chunks to feed the LLM.</p><h3>2. Similar Wording in Documents</h3><p>Contracts and agreements frequently use standardized language with generic terms like “Buyer” and “Seller.” This standardization can lead to challenges in distinguishing between different document chunks within a RAG system. Similar wording across multiple documents can result in indistinguishable chunks (even though they originate from completely different contract, e.g.), complicating the retrieval of the correct context for the LLM.</p><p>In the example below, we have three purchasing contracts, for three different clients, but the wording is identical except for the amounts and duration of this specific liability clause. If only a basic character-based chunking with overlap is done, the resulting chunks could become as shown in orange and green. Without any indication of <em>which</em> Buyer and <em>which</em> Seller each chunk is discussing, it’s virtually impossible for the LLM to generate an accurate answer if fed the 6 chunks shown (which might all match a question about “limited liability terms for partner ABC”).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F1fL0WwX65Lq7ycr" /><figcaption>Hypothetical example of how a basic chunking approach might produce chunks with have both very similar vector embeddings (likely to all be retrieved by RAG) and also generic language (which makes it hard for the LLM to distinguish).</figcaption></figure><p><strong>Solution:</strong> Central to any solution is to ensure each chunk is unique and references the actual relevant entities (Buyer and Seller, in the case above) . This can be achieved in a variety of ways, here are a few approaches:</p><ul><li>The title or name of the (contract) document can be infused as a pre-amble in each chunk (assuming that the document name or title accurately identifies the Buyer and Seller).</li><li>The clause itself can be modified by replacing generic references like “Buyer” and “Seller” with the actual names of the companies. This might be very effective, but it’s not always ideal to generate answers based on modified source documents.</li><li>Definitions such as “Buyer = Company ABC, Seller = Company XYZ” can be added as a prefix to the clause or stored as metadata associated with the chunks, similar to how versioning is handled.</li></ul><p>These approaches fall roughly in a category of methods called “contextual retrieval” in which context is added to chunks to make them easier to match up against a specific user query. For a more general overview of this, see this recent article on <a href="https://www.anthropic.com/news/contextual-retrieval">contextual retrieval from Anthropic</a>.</p><p>All these solutions have some pros and cons, and the best one will likely depend case-by-case. The key lesson here is that while vector databases are great at capturing semantic relationships and similarities between words and phrases, identical wordings often found in contracts and policies can cause problems.</p><h3>3. Data Synchronization</h3><p>Ensuring that the vector database reflects the latest version of documents is crucial in a RAG system. Inconsistent data can lead to discrepancies in information retrieval, affecting the reliability of the RAG system.</p><p>It is often necessary to continuously update the database as new documents are added, existing documents are modified, or documents are deleted. Maintaining consistent data can be challenging, particularly with frequent updates of large amounts of information, where batch processing is insufficient.</p><p><strong>Solution: </strong>Vector databases generally support solving these challenges by offering synchronization mechanisms based on metadata tagging. Each document chunk stored in the vector database is tagged with metadata that links it to its parent document, which in turn can be tagged with a reference to the external document.</p><p>By leveraging these capabilities, it’s possible to trigger updates upon modification to external document repositories, identifying the document (chunks) in the vector database that corresponds to the document that was modified. A typical resolution involves deleting a set of chunks, and adding fresh chunks from the updated document. This approach maintains data integrity and enables enterprises to effectively manage dynamic environments with frequent document changes.</p><h3>Conclusion</h3><p>In summary, while LLMs and Retrieval-Augmented Generation (RAG) offer impressive capabilities as demonstrated through consumer-facing applications like <a href="https://chatgpt.com/">ChatGPT</a>, <a href="https://claude.ai/">Claude</a> and <a href="https://gemini.google.com/">Gemini</a>, leveraging RAG in enterprise environments presents unique challenges.</p><p>These challenges include managing multiple document versions, handling similar wording across documents, and ensuring information is up-to-date through data synchronization. Enterprises need suitable data management strategies and leverage modern vector databases to address these complexities effectively.</p><p>Key solutions involve custom data management to identify the most relevant document versions and using metadata capabillity of vector databases to tag document chunks for efficient retrieval and dynamic refresh.</p><p><em>Greger is the founder of Cube5 AI, a consultancy that helps businesses harness the transformative power of Generative AI for Business Automation. Services include the entire LLM adoption journey — from strategic planning and roadmapping to proof-of-concept development and creation of bespoke AI solutions. More information at </em><a href="https://cube5.ai/"><em>https://cube5.ai/</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ce2aa9a8c04" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Chatbots for Enterprise GenAI]]></title>
            <link>https://medium.com/@greger_ottosson/beyond-chatbots-for-enterprise-genai-6646232c13b0?source=rss-682b3c6444b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/6646232c13b0</guid>
            <category><![CDATA[embedding-model]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[ai-for-business-processes]]></category>
            <category><![CDATA[generative-ai-use-cases]]></category>
            <category><![CDATA[enterprise-ai]]></category>
            <dc:creator><![CDATA[Greger Ottosson]]></dc:creator>
            <pubDate>Fri, 16 Aug 2024 09:36:35 GMT</pubDate>
            <atom:updated>2024-08-22T11:25:02.723Z</atom:updated>
            <content:encoded><![CDATA[<p>Large Language Models can do more than generate text</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0-LBIKIsUzejYfFT" /></figure><p><strong>The demo appeal of Chatbots</strong></p><p>Since the beginning of the Generative AI revolution, a considerable emphasis has been placed on chatbots as a means to demonstrate and highlight the capabilities of Large Language Models (LLMs).</p><p>While chatbots’ generative aspect can be both captivating and useful, less attention is given to other LLM capabilities and how they can enhance existing business processes. This is unfortunate since integrating LLMs into enterprise systems and processes can often provide business value with less risk and effort than developing a new chatbot.</p><p>This article explores alternative ways of integrating LLMs into enterprise systems and processes, showcasing their potential to transform business operations.</p><p><strong>Has there been too much focus on Chatbots?</strong></p><p>Certainly, chatbots hold great potential, but their implementation as a use case for LLMs comes with considerable costs and potential risks:</p><ul><li><strong>Cost: </strong>To deliver value and effectiveness, a chatbot often needs integration with (sometimes multiple) systems such as CRM, ERP, or HRM to access relevant information and provide meaningful answers. This can carry significant efforts around implementation, testing and roll-out.</li><li><strong>Risk: </strong>Hallucinations producing erroneous answers can have a significant impact on the business , particularly when conveying crucial information to external customers and partners.</li><li><strong>Complexity: </strong>Introducing a chatbot requires not only a comprehensive IT implementation cycle, but also launch, marketing, education, support, and more, as it constitutes a new service, whether internal or external.</li></ul><p>Are there alternative use cases that could serve as a starting point for businesses getting started with Generative AI?</p><p><strong>Non-generative capabilities of LLM</strong></p><p>Inherent in LLMs exist capabilities that aren’t directly about generation of text. Notably, specialized LLMs can produce “vector embeddings” for (snippets of) documents, where semantically similar documents are assigned vectors that are close to each other. This might sound simplistic, but turn out to be useful in a variety of ways, including for:</p><ul><li><strong>Semantic Search</strong>: LLMs can significantly improve upon existing “keyword” search by understanding context and meaning, allowing businesses to retrieve more relevant and contextually appropriate information to users. This can be used to enhance current business processes and enterprise services where search is a key component.</li><li><strong>Re-Ranking</strong>: Short of replacing classic keyword search entirely, LLMs can be employed (even less intrusively) to reorder current search results based on relevance, ensuring that users receive the most pertinent information first.</li><li><strong>Text Classification</strong>: LLMs can be used to classify customer service requests, messages, and other text documents. By automatically categorizing these communications (by sentiment, urgency or relevance), businesses can streamline workflows and improve response times (without major changes to existing systems and processes).</li></ul><p>These capabilities are useful in a wide range of situations where the text is the key content being operated on; let’s take a look at a few examples.</p><p><strong>Enterprise Use Cases for Non-generative LLMs</strong></p><ol><li><strong>Customer Service</strong>: Semantic search can enhance Customer Relationship Management (CRM) systems by enabling customer service representatives to quickly and accurately find relevant customer information, from past interactions, purchase history, or support tickets. For example, semantic search can help a sales representative find not only customers who have contacted support about a specific product or service, but those that did so with negative sentiment (text classification) or with specific needs (not captured through structured data).</li><li><strong>Enterprise Planning</strong>: Semantic search can improve Enterprise Resource Planning (ERP) systems by helping users find the information they need to make prioritizations, based on inventory levels, production schedules, and financial reports. For example, a supply chain manager could use a re-ranking model to order candidate suppliers based on past performance, contract status or previous communications.</li><li><strong>Knowledge Management</strong>: Semantic search can enhance organizational productivity by enabling users to quickly find the information they need to perform their jobs, such as company policies, procedures, and best practices. For example, an employee could use semantic search to find all the information they need to know about a new company policy.</li></ol><h3>Conclusion</h3><p>The world of enterprise use of LLMs extends far beyond chatbots. By leveraging the non-generative capabilities of LLMs, businesses can unlock significant value without entering into chatbot development. Semantic search, re-ranking, and text classification offer practical and effective solutions to enhance existing business processes and applications.</p><p>Embracing these capabilities empowers organizations to make more informed decisions, streamline operations, and deliver superior customer experiences. The integration of LLMs into enterprise systems marks a transformative step in the journey toward a more intelligent and efficient business.</p><p><em>Greger is the founder of Cube5 AI, a consultancy that helps businesses harness the transformative power of Generative AI for Business Automation. Services include the entire LLM adoption journey — from strategic planning and roadmapping to proof-of-concept development and creation of bespoke AI solutions. More information at </em><a href="https://cube5.ai/"><em>https://cube5.ai/</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6646232c13b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LLMs as Components for Enterprise AI]]></title>
            <link>https://medium.com/@greger_ottosson/llms-as-components-for-enterprise-ai-1a6fa832b36c?source=rss-682b3c6444b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a6fa832b36c</guid>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[enterprise-ai]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[small-language-model]]></category>
            <category><![CDATA[generative-ai-use-cases]]></category>
            <dc:creator><![CDATA[Greger Ottosson]]></dc:creator>
            <pubDate>Thu, 15 Aug 2024 12:42:41 GMT</pubDate>
            <atom:updated>2024-09-30T13:57:00.584Z</atom:updated>
            <content:encoded><![CDATA[<p>The separate quest for AGI is still useful for Enterprise AI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BVCDUi-xGCoTgOIQrKRCSw.png" /></figure><h3>Introduction</h3><p>The technology landscape for Generative AI and Large Language Models (LLMs) continues to evolve, with two distinct yet complementary goals emerging. On one hand, some companies are ambitiously pursuing Artificial General Intelligence (AGI), aiming to create highly versatile “foundation” models that can perform a wide array of tasks. This camp can be characterized as high-risk, high-gains.</p><p>On the other side, a perhaps less audacious and more pragmatic crowd of companies are looking for shorter-term gains by creating business value with today’s LLM capabilities. This set of companies focuses on building smaller and more specialized LLMs as components within enterprise solutions, optimizing them for specific tasks within existing business processes.</p><p>While these two paths could be portrayed as being divergent, they are interconnected, with advancements in frontier models often benefiting the specialized, smaller models used in enterprise applications. Vice versa, the tooling built around LLMs for enterprise adoption — vector DBs, model orchestration and RAG frameworks — is providing useful context for frontier models.</p><p>In this article we’ll first take a deeper look into both “camps” of the Generative AI landscape, and then zero in on how we can pragmatically use LLMs for enterprise use cases (while we’re waiting for AGI...).</p><h3>The Quest for AGI</h3><h4>Frontier Models and Their Ambitions</h4><p>The AGI camp is characterized by the development of large, versatile “frontier” models such as those embedded within <a href="https://chatgpt.com/">ChatGPT</a>, <a href="https://gemini.google.com/">Gemini</a>, and <a href="https://claude.ai/">Claude</a>. These models aim to revolutionize how work is done by serving as new, standalone, conversational user experiences. They leverage their inherent world knowledge (aka “parametric knowledge”) captured from their training data combined with dynamic internet searches and facts from user-uploaded data. The immediate goal is to be able to perform a wide array of tasks. The ultimate goal is to create AGI embedded in a new product paradigm that fundamentally changes how we interact with technology and information.</p><h4>Key Players in AGI</h4><p>Several companies are competing to be at the forefront of AGI development, including:</p><ul><li><a href="https://openai.com/">OpenAI</a>: Known for ChatGPT and GPT 3.5/4/4o, OpenAI is pushing the boundaries of AI capabilities with the goal of achieving AGI.</li><li><a href="https://ai.google/">Google</a> (incl DeepMind): Developers of the Gemini AI models, Google focuses on creating AI that can master complex tasks through advanced learning techniques. Beyond the stand-alone <a href="https://gemini.google.com/">Gemini</a> experience, these models are also integrated into the Google Workspace office productivity suite.</li><li><a href="https://www.anthropic.com/">Anthropic</a>: This company is dedicated to building reliable and understandable general AI, with a focus on safety and human feedback.</li></ul><h4>Challenges and Limitations</h4><p>Despite their impressive capabilities, frontier models are still facing several challenges:</p><ul><li>Hallucinations and Errors: These models can generate incorrect or nonsensical information, especially when asked questions around information occurring with low frequency in their training data.</li><li>Outdated Knowledge: The static nature of their training data means they can quickly become outdated, and even when coupled with dynamic data from (for example) internet search they can easily trip up.</li><li>High Costs: The computational and financial costs associated with training and deploying these massive models are substantial.</li></ul><h3>LLMs as Components for Enterprise AI</h3><h4>Specialized Small Language Models (SLMs)</h4><p>In contrast, the “LLMs as components” group of companies focuses on developing specialized Small Language Models (SLMs) designed for specific tasks such as translation, classification, code generation, mathematical computations, etc. These models aim to be efficient, fast, and cost-effective compared to generic models, making them ideal for embedding within enterprise solutions, or even for “AI on the edge” where the models are deployed on devices.</p><h4>Integration with Enterprise Data</h4><p>A prominent approach when using LLM/SLMs as components is the use of Retrieval-Augmented Generation (RAG), which dynamically infuses enterprise data into the prompts for the models. This integration ensures that the models are more working on processing current and relevant enterprise information, rather than resorting to their world knowledge, enhancing the accuracy and reliability of their outputs (in particular reducing the probability of hallucinations).</p><h4>Key Players in specialized SLMs</h4><p>Several companies are pioneering the use of SLMs:</p><ul><li><a href="https://cohere.com/">Cohere</a>: Focused on creating language models that are efficient and easy to deploy, especially within RAG approaches, Cohere’s focus is on enterprise use cases.</li><li><a href="https://ai.meta.com/meta-ai/">Meta</a>: Developers of LLaMA 3, an open-source language model designed for accessibility and versatility.</li><li><a href="https://www.microsoft.com/en-us/ai">Microsoft</a>: Known for <a href="https://news.microsoft.com/source/features/ai/the-phi-3-small-language-models-with-big-potential/">Phi-3</a>, a small language model optimized for performance and cost-effectiveness.</li><li><a href="https://mistral.ai/">Mistral AI</a>: Creators of Mistral, Mixtral, Mathstral models, they aim to balance advanced capabilities with reduced computational demands.</li></ul><h4>The Pragmatic Approach for Enterprise AI</h4><p>For enterprises focused on improving existing processes, the “LLMs as components” approach is (currently) the most effective strategy. By integrating specialized models with enterprise data (through e.g. RAG), businesses can enhance their operations, ensure data privacy, and achieve significant cost savings.</p><p>However, it’s important to recognize that this situation might change over time. As frontier models become increasingly powerful, there may be opportunities to not only improve existing business processes, but rather completely replace or reinvent those processes. In today’s methodology for business process modeling, complex tasks are broken down into sequential steps — each with specific roles and tasks. As LLMs (including LLMs within agentic flows) grow in capabilities, it’s possible that we’ll see a second phase where we collapse business processes into fewer but more complex tasks, relying increasingly on the judgments of these larger “frontier” models.</p><p>Until then, however, leveraging LLMs as components remains the best path for optimizing current workflows and driving incremental improvements in enterprise environments.</p><h4>Interconnected Benefits</h4><p>It’s essential to acknowledge that advancements in frontier models also benefit the specialized models used in enterprise solutions. It is not always easy to separate between frontier models and specialized models, which you can observe through the introduction of models at various sizes (Llama3 8b, 70b and 405b, for example), where the smaller ones are often deployed for specialized tasks.</p><p>The work towards AGI pushes the limits of what LLMs can achieve, showcasing capabilities that can both inspire ideas and spin off smaller models. These frontier models often serve as a proving ground for new techniques and architectures, which can then be adapted and optimized for enterprise applications. Furthermore, it is very common to use the best available frontier model when building POCs for enterprise use cases, and then switch in a smaller, more efficient model for production deployement.</p><p>In summary, the progress in AGI research indirectly supports the development of more efficient and effective LLM components for enterprise use.</p><h4>LLMs as Components in Agentic Workflows</h4><p>LLMs are increasingly being utilized as components within agentic flows, where specialized models are integrated to perform complex, multi-step tasks. This approach leverages frameworks like <a href="https://www.langchain.com/">LangChain</a> and <a href="https://www.llamaindex.ai/">LlamaIndex</a> to create sophisticated AI operations tailored to specific enterprise use cases.</p><p>In agentic flows, specialized LLMs perform distinct roles or functions. These models are equipped to handle tasks such as information retrieval, data analysis, and decision-making, all within a coordinated flow. By chaining together multiple specialized LLMs, businesses can achieve more nuanced and context-aware operations.</p><p>It’s intriguing to note that agentic flows, particularly the more prescriptive “sequential agentic flows,” often lead to models quite similar to traditional workflow solutions. Essentially, we build sequences of tasks and assign each task to a specific LLM (instead of only relying on humans for task completion). The other key difference is that instead of passing structured data between tasks, as in traditional workflow solutions, we’re more likely to pass fragments of natural language between LLMs in agentic flows.</p><h3>Conclusion</h3><p>As we stand in the middle of 2024, we’re observing two strands of investments in LLMs: large frontier models embedded in new standalone experiences (like ChatGPT) and then on the other hand specialized models that are designed and used as components to optimize existing business processes.</p><p>While the push towards AGI with frontier models face challenges, they indirectly support the development of more efficient and effective LLM components for enterprise use. The “LLMs as components” approach is currently the most effective strategy for enterprises, leveraging specialized models for specific tasks and integrating them with enterprise data. As LLMs advance, their capabilities enhance specialized models used in enterprise solutions, enabling complex, multi-step tasks within agentic workflows.</p><p><em>Greger is the founder of Cube5 AI, a consultancy that helps businesses harness the transformative power of Generative AI for Business Automation. Services include the entire LLM adoption journey — from strategic planning and roadmapping to proof-of-concept development and creation of bespoke AI solutions. More information at </em><a href="https://cube5.ai/"><em>https://cube5.ai/</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a6fa832b36c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Enterprise Solutions with LLMs]]></title>
            <link>https://blog.gopenai.com/building-enterprise-solutions-with-llms-936180b0c784?source=rss-682b3c6444b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/936180b0c784</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[low-code]]></category>
            <category><![CDATA[enterprise-software]]></category>
            <category><![CDATA[large-language-models]]></category>
            <dc:creator><![CDATA[Greger Ottosson]]></dc:creator>
            <pubDate>Thu, 25 Jul 2024 10:31:55 GMT</pubDate>
            <atom:updated>2024-10-25T10:05:46.682Z</atom:updated>
            <content:encoded><![CDATA[<h4>The emerging tech stack for bespoke RAG applications</h4><h4>Introduction</h4><p>While we’re seeing announcements of new Large Language Models (LLMs) almost daily, the landscape of tools used to develop LLM-based applications is also rapidly evolving. Depending on the specific use case — whether it’s a proof-of-concept (POC) or a full-fledged production application — developers now have a diverse range of tools at their disposal.</p><p>In this article, we will delve into some of the key tools and frameworks that can significantly accelerate the development of LLM-based solutions. We will pay particular attention to tools that facilitate the infusion of enterprise data into LLMs, an approach known as Retrieval Augmented Generation (RAG).</p><p>RAG is a powerful technique that enables LLMs to leverage proprietary or use-case specific data in addition to their vast pre-trained “world knowledge”. By finding and incorporating this data in the prompt, we can “ground” the LLM application in the most relevant and factual data required, resulting in much more accurate and detailed answers, and vastly reducing the risk of LLM “hallucinations”.</p><p>Before we dig into RAG for custom solutions, let’s quickly cover what’s happening on the packaged application side.</p><h4>LLMs in business applications</h4><p>Most of us were first introduced to LLMs through generic chatbots or answer engines like <a href="https://chat.openai.com/">ChatGPT</a>, <a href="https://gemini.google.com/">Gemini</a> or <a href="https://www.perplexity.ai/">Perplexity</a>. Increasingly we’re also seeing LLM-based features appearing in our traditional packaged applications, which tend to introduce LLMs to provide a natural language interface on top of existing functionality. This includes of course examples from the office productivity and collaboration side, such as <a href="https://www.microsoft.com/en-us/microsoft-365/microsoft-copilot">Copilot in Microsoft 365</a>, <a href="https://workspace.google.com/solutions/ai/">Gemini in Google Workspace</a>, <a href="https://slack.com/features/ai">Slack AI</a>, <a href="https://miro.com/assist/">Miro Assist</a>, but you will find similar AI-based features across ERP, CRM, SCM and HRM suites.</p><p>This is all great for day-to-day office productivity, but will not typically result in any competitive differentiation for our organization. To fully take advantage of the new generative AI capabilities, we need to look at what makes your business special, and how we can leverage our proprietary data in our business processes.</p><p>So let’s take a look at how we can build bespoke solutions with LLMs in order to build a competitive advantage.</p><h4>The Tech Stack for bespoke LLM applications</h4><p>Shown below (in shades of orange), the tools for building custom solutions include:</p><ul><li><strong>Large Language Models (LLMs):</strong> These are the foundational models like GPT-4, Gemini or Claude, either used directly or fine-tuned on specific data. Choosing the right model depends on your task, budget, and desired level of customization. Bigger is not always better, and certainly not cheaper. There’s currently a 10–100x difference in speed and cost between task-specific open source models and the largest proprietary “frontier” models.</li><li><strong>LLM Orchestration Layers:</strong> Frameworks like <a href="https://www.langchain.com/">LangChain</a> or <a href="https://www.llamaindex.ai/">LlamaIndex</a> simplify the management of complex LLM or agent workflows, allowing you to sequence model invocations, index and retrieve data, and overall implement RAG efficiently. While the APIs to use LLMs directly are getting more and more powerful, these intermediate abstraction layers are not only currently more powerful, but they also provide LLM-agnostic implementations, avoiding lock-in to specific vendors.</li><li><strong>Low-Code LLM Builders:</strong> Emerging tools like <a href="https://flowiseai.com/">Flowise</a>, <a href="https://www.langflow.org/">LangFlow</a>, <a href="https://www.stack-ai.com/">Stack AI</a>, <a href="https://vectorshift.ai/">VectorShift</a> and <a href="https://www.gumloop.com/">Gumloop</a> empower users to build LLM apps visually with minimal coding, making them accessible to a wider audience and perfect for quick development.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*efMnTGica36UuSN9" /><figcaption>The software stack for enterprise solutions based on LLMs</figcaption></figure><p>While these tools are not entirely focused on RAG implementations — also supporting simpler LLM invocations as well as more complex Agent orchestrations — RAG is at the heart of what makes these tools useful today, so we will in this article evaluate them from this perspective.</p><h4>Retrieval Augmented Generation (RAG)</h4><p>Retrieval Augmented Generation (RAG) is the currently dominating approach for integrating LLMs into business processes. It’s a paradigm shift that moves beyond relying solely on pre-trained knowledge and empowers LLMs to leverage dynamic, contextually relevant information from external sources. This approach brings numerous advantages and is essential for most enterprise LLM applications.</p><p><strong>RAG Amplifies LLM Capabilities by:</strong></p><ul><li><strong>Overcoming Limitations of Pre-Training:</strong> While LLMs possess vast knowledge, they’re limited to what they learned during training. RAG allows them to tap into the specific enterprise data required, whether it’s information about a customer, an order, a contract or any other required piece of information.</li><li><strong>Grounded Responses:</strong> By grounding responses in factual information, RAG significantly reduces the risk of LLMs producing inaccurate or nonsensical output (often referred to as “hallucinations”). This is crucial for enterprise applications: we do not want the LLM to invent information when generating responses.</li><li><strong>Personalized Results:</strong> RAG enables LLMs to tailor responses to specific user queries or user-specific knowledge. For instance, a customer service chatbot can access a company’s knowledge base to provide precise answers to customer questions.</li></ul><p><strong>Under the Hood: The RAG Workflow:</strong></p><p>The basic flow of a RAG implementation introduces an intermediate step where a “retriever” fetches additional data relevant to the user request:</p><ol><li><strong>Query Formulation:</strong> The user’s question or request is processed and transformed into a query optimized for searching within connected data sources.</li><li><strong>Document Retrieval:</strong> Using techniques like semantic search and vector embeddings, or just traditional database queries, the most relevant documents or data records are retrieved from one or more sources.</li><li><strong>Information Synthesis:</strong> The retrieved information is integrated into the LLM’s prompt, providing the model with the context it needs to generate an accurate, informative, and contextually relevant response.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5Ga1AOTu2oA4vCrx" /></figure><p><strong>Choosing the Right Data Sources:</strong></p><p>RAG’s effectiveness depends on selecting the right data sources for your application. These sources can include:</p><ul><li><strong>Internal Knowledge Bases:</strong> Company-specific data like wikis, product manuals, and internal documents.</li><li><strong>Private Databases:</strong> Use case-specific data central to your business, often directly sourced from the CRM, ERP and other systems you employ to run your business.</li><li><strong>Public Datasets:</strong> Research papers, government regulations, news articles, and other publicly available information.</li></ul><p>Orchestrating the flow between retrievers and LLMs — which can be quite a bit more involved than what’s shown here — is precisely what tools such as LangChain and LlamaIndex are designed to do. They offer a clean, effective and model-agnostic approach for RAG (and more).</p><p>Now that we have a grounding in LLMs and RAG, let’s move up one level in the stack and see how we can build solutions for specific enterprise use cases.</p><h4>Low-Code LLM Application Builders</h4><p>Low-code LLM application builders are an emerging segment of the LLM tech stack. The tools — prominent examples include <a href="https://flowiseai.com/">Flowise</a>, <a href="https://www.langflow.org/">LangFlow</a>, <a href="https://www.stack-ai.com/">Stack AI</a>, <a href="https://vectorshift.ai/">VectorShift</a> and <a href="https://www.gumloop.com/">Gumloop</a> — abstract away the complexity of coding and enable users to create LLM-powered applications using intuitive visual interfaces and drag-and-drop components.</p><p>If you’re familiar with low-code builders in the context of Business Process Management (BPM), Robotic Process Automation (RPA), or even integration platforms like <a href="https://zapier.com/">Zapier</a> and <a href="https://make.com/">Make</a>, then you’ll recognize the flow-based style in which the application is defined. Main novelty with these new tools is that they’re LLM-centric, i.e. the focus is on sequencing invocations of LLMs in order to build a chatbot or define a service endpoint that can be called from another application.</p><p><strong>Key Advantages of Low-Code LLM Builders:</strong></p><ul><li><strong>Accelerated Development:</strong> Significantly reduce the time it takes to build and deploy LLM applications, allowing for rapid prototyping and faster iteration. Pre-built connectors and application templates can significantly speed up initial phases of development.</li><li><strong>Increased Accessibility:</strong> Enable non-technical users, such as business analysts or domain experts, to actively participate in LLM application development. It’s easier to develop jointly and interactively with a visual view of the application flow.</li><li><strong>Model Agnostic:</strong> By basing themselves on LangChain/LlamaIndex, several of these low-code platforms are inherently model-agnostic, meaning you can easily switch between — or combine — different LLM providers or models without having to develop your own abstraction layers. This gives you flexibility and adaptability as the LLM landscape evolves, avoiding lock-in with specific LLM vendors.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZhSYWPoGItAhsJrR" /><figcaption>An example RAG-based agent flow defined in Flowise AI.</figcaption></figure><p>Low-code LLM builders are perfect for testing LLM application ideas, validating their feasibility, and demonstrating the value of LLM solutions to stakeholders without extensive custom development. They are also ideal for building internal tools for knowledge base search, data analysis, or process automation, as well as simpler LLM applications that don’t require complex workflows or extensive customization.</p><p><strong>Current Limitations:</strong></p><p>While low-code LLM builders offer many benefits, it’s important to consider their limitations:</p><ul><li><strong>Customization:</strong> Low-code platforms may not be the best choice for highly customized or complex applications that require a high degree of control. For example, if you have very specific ways in which textual information needs to be vectorized, or you need to employ sophisticated hybrid search — semantic and lexical — then you might currently need to complement with some custom coding.</li><li><strong>Scalability:</strong> For large-scale deployments with high traffic or large amounts of data, a custom-built solution might be more suitable. It’s hard to draw a line here, but if your documents are in the order of millions, it’s possible that you need more tailored tweaks than these low-code tools currently allow.</li><li><strong>Long-term Support Considerations:</strong> As low-code tools are a relatively new concept, primarily driven by startups, the longevity of these tools may be uncertain. Some of these tools may not survive long-term, making them potentially unsuitable for critical applications that require long-term maintenance and support.</li></ul><p>Overall, low-code LLM application builders are a valuable addition to the LLM software tack. They empower a wider range of users to leverage the power of LLMs and accelerate the development of innovative LLM-powered solutions.</p><h4>Conclusion: Embracing LLMs for a competitive edge</h4><p>The advent of Large Language Models (LLMs) has sparked a transformative technological revolution, presenting businesses with an unprecedented opportunity to gain a competitive edge. By embracing the potential of LLMs, organizations can harness unstructured data effectively, leading to significant advantages.</p><p>While packaged applications will deliver plenty of value from LLMs over time, businesses should also prioritize adopting LLMs for tailored solutions. This strategic investment allows organizations to differentiate themselves by integrating LLMs into their distinctive business processes, unlocking their full potential.</p><p>This article has provided a high-level overview of the key components in the LLM application development stack, highlighting the importance of techniques like Retrieval Augmented Generation (RAG) for building accurate and contextually relevant applications. We’ve also explored the emerging field of low-code LLM builders, which are democratizing LLM development and making it more accessible to a wider range of users.</p><p><em>Greger is Co-founder and CEO of Cube5 AI, a consultancy that helps businesses harness the transformative power of Generative AI for Business Automation. Services include the entire LLM adoption journey — from strategic planning and roadmapping to proof-of-concept development and creation of bespoke AI solutions. More information at </em><a href="https://cube5.ai/"><em>https://cube5.ai/</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=936180b0c784" width="1" height="1" alt=""><hr><p><a href="https://blog.gopenai.com/building-enterprise-solutions-with-llms-936180b0c784">Building Enterprise Solutions with LLMs</a> was originally published in <a href="https://blog.gopenai.com/">GoPenAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transparent ML for Enterprise Decisions — Score Cards]]></title>
            <link>https://medium.com/@greger_ottosson/transparent-ml-for-enterprise-decisions-score-cards-afe49e6eaf4b?source=rss-682b3c6444b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/afe49e6eaf4b</guid>
            <category><![CDATA[ml-explainability]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[scorecard]]></category>
            <dc:creator><![CDATA[Greger Ottosson]]></dc:creator>
            <pubDate>Mon, 10 Apr 2023 12:35:26 GMT</pubDate>
            <atom:updated>2023-04-16T16:47:36.794Z</atom:updated>
            <content:encoded><![CDATA[<h3>Transparent ML for Enterprise Decisions — Score Cards</h3><p><strong>Note: </strong>this is Part IV in a series of articles on transparent machine learning models, click here for <a href="https://medium.com/@greger_ottosson/transparent-ml-in-enterprise-decisions-intro-8c01438c11c5">Part I — Introduction</a>, <a href="https://medium.com/@greger_ottosson/transparent-ml-for-enterprise-decisions-linear-models-87a31a7209bc">Part II — Linear Models</a> and <a href="https://medium.com/@greger_ottosson/transparent-ml-for-enterprise-decisions-rule-sets-d8f55bee3a00">Part III — Rule Sets</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UdSUA7HBe7S-NHRS24GeOg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@crissyjarvis?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Crissy Jarvis</a> on <a href="https://unsplash.com/s/photos/addition?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p><strong>Introduction</strong></p><p>Scorecards have long been used as a valuable tool for making predictions in a variety of industries, in particular healthcare and finance. In healthcare, scorecards are used to diagnose patients and predict the likelihood that they have a particular medical condition, alongside other diagnostic tools such as lab tests or imaging studies. In finance, scorecards are often used to evaluate the risk of a mortgage applicant by predicting the likelihood that the applicant will default on their mortgage.</p><p>Here’s a very simplified example of what a risk assessment scorecard for lending might look like (higher score is better):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FhYIVwdXaABUFK4so-QDFg.png" /><figcaption>An example scorecards for risk assessment in lending. Higher score is better, i.e. represents lower risk.</figcaption></figure><p>This scorecard considers the value of three variables — Income, DTI and Late Payments — and computes a subscore for each. The ranges — also known as bins — can be generalised as any subsets of the variables domain. As indicated in bold, an example customer (with income of 30,000, DTI of 16% and 2 late payments) would score a total of 30 points.</p><p>Visually, each subscore can be illustrated as a x-y chart like this, showing the relationship with input variable (X axis) and the subscore (Y axis). As is visually clear, the relationship can be non-linear and more or less elaborate, only bounded by the number of bins used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CTkRIBwQYAbO1NtdvVcepQ.png" /><figcaption>The relationships between the variables and the subscores in the above scorecard.</figcaption></figure><p>In this article, we will delve deeper into the use of scorecards for predictions in healthcare and finance. We will explore the benefits and limitations of these tools and consider the potential for future developments in scorecard technology.</p><p><strong>Score Cards in Banking</strong></p><p>Scorecards are an important tool for banks and other financial institutions to assess risk and make informed decisions about lending and other financial transactions. They can be based on historical data and used to predict the likelihood that a borrower will default on a loan or other financial obligation.</p><p>To create a scorecard, banks typically collect a range of data about the borrower, including personal information, financial history, and and internal or external credit scores. This data is then used to evaluate the borrower’s risk profile and predict the likelihood that they will default on their loan.</p><p>There are a variety of data fields that banks might consider when creating a scorecard, including:</p><ul><li><strong>Credit score</strong>: A credit score is a numerical representation of a borrower’s creditworthiness, based on their credit history. A high credit score indicates a lower risk of default, while a low credit score indicates a higher risk.</li><li><strong>Employment history</strong>: Banks may consider a borrower’s employment history when evaluating their risk profile. A borrower with a stable job and a consistent work history may be considered a lower risk than a borrower with a history of job instability or frequent job changes.</li><li><strong>Income</strong>: Banks will typically consider a borrower’s income when evaluating their risk profile. Borrowers with higher incomes may be considered a lower risk than borrowers with lower incomes, as they are more likely to be able to afford their loan payments.</li><li><strong>Debt-to-income ratio</strong>: This ratio compares a borrower’s total debt to their total income. A high debt-to-income ratio indicates a higher risk of default, as the borrower may have difficulty paying their debts.</li><li><strong>Payment history</strong>: Banks may consider a borrower’s payment history when evaluating their risk profile. A borrower with a history of making on-time payments may be considered a lower risk than a borrower with a history of late or missed payments.</li></ul><p>Overall, banks use scorecards to assess the risk of a borrower and make informed decisions about lending and other financial transactions. By considering a range of data fields, banks can more accurately predict the likelihood of default and manage their risk.</p><p><strong>Score Cards in Medical Diagnosis</strong></p><p>In addition to their use in finance, scorecards are also used in the healthcare industry, for example in medical diagnosis. These tools are based on historical data and are used to predict the likelihood that a patient has a particular medical condition.</p><p>To create a scorecard for medical diagnosis, healthcare professionals typically collect a range of data about the patient, including personal information, medical history, and symptoms. This data is used to evaluate the patient’s risk profile and predict the likelihood that they have a particular medical condition.</p><p>There are a variety of data fields that healthcare professionals might consider when creating a scorecard for medical diagnosis, including:</p><ul><li><strong>Age</strong>: Age can be a factor in the likelihood of certain medical conditions. For example, older patients may be more at risk for certain conditions, such as heart disease or cancer, while younger patients may be more at risk for other conditions, such as infectious diseases.</li><li><strong>Sex</strong>: Some medical conditions are more common in one sex than the other. For example: stroke and diabetes are more common in men, while osteoporosis and Alzheimers are more common in women.</li><li><strong>Medical history</strong>: A patient’s medical history can provide important clues about their risk for certain conditions. For example, a patient with a history of heart disease may be at higher risk for a heart attack, while a patient with a history of allergies may be at higher risk for asthma.</li><li><strong>Symptoms</strong>: The symptoms a patient is experiencing can provide important clues about their medical condition. For example, a patient with chest pain and shortness of breath may be at higher risk for a heart attack, while a patient with a fever and cough may be at higher risk for an infectious disease.</li></ul><p>Overall, scorecards are an important tool for healthcare professionals to make informed decisions about medical diagnosis. By considering a range of data fields, healthcare professionals can more accurately predict the likelihood of certain medical conditions and guide treatment decisions.</p><p><strong>Score Cards in other industries</strong></p><p>Scorecards are a valuable tool for making predictions in a variety of industries beyond finance and healthcare. Basically any predictive task for which we want to generate a number or score (a.k.a “regression” models in Machine Learning) can be made transparently in the form of a scorecard. Here are a few examples:</p><ol><li>Marketing: Scorecards can be used by marketing professionals to predict the likelihood that a customer will respond to a particular marketing campaign. This can be based on data such as the customer’s previous purchasing history, demographics, and other relevant factors.</li><li>Fraud detection: Scorecards can be used to predict the likelihood that a particular transaction is fraudulent. This can be based on data such as the transaction amount, location, and other relevant factors.</li><li>Risk assessment: Scorecards can be used by insurance companies to predict the likelihood of a particular risk, such as a natural disaster or accident. This can be based on data such as the location, type of property, and other relevant factors.</li><li>Employment: Scorecards can be used by employers to predict the likelihood that a job applicant will be successful in a particular role. This can be based on data such as the applicant’s education, work experience, and other relevant factors.</li></ol><p>Overall, scorecards are a versatile tool that can be used for predictions in a variety of industries and contexts. By considering relevant data and applying statistical analysis, scorecards can help organizations make informed decisions and manage risk.</p><p><strong>The strong points of scorecards</strong></p><p>Scorecards have some nice properties that combines predictive power with interpretability:</p><ul><li><strong>Additive: </strong>the contribution of each variable is independent of the others, meaning that each subscore is computed independently, making it easy to understand how the scoring works.</li><li><strong>Non-linearities: </strong>the subscore for each bin can effectively capture any non-linear effect for a variable. For example, at lower incomes the risk of a mortgage applicant reduces quickly, whereas at higher income levels the risk reduction tapers off.</li></ul><p><strong>The weaknesses of scorecards</strong></p><p>The additive structure of scorecards also means they cannot provide high accuracy for all predictive tasks at good transparency. For example:</p><ul><li><strong>Interacting variables: </strong>Just like for linear models, scorecards cannot capture interactions between variables without specific feature enginereering or the addition of e.g. rules.</li><li><strong>Size:</strong> As we push for increased accuracy, scorecards will grow in size, i.e. there will need to be more and more bins to reach higher levels of performance. Without suitable visualization, search and filtering capabilities, more than 10–20 bins for a variable might reduce our ability to understand the relationship between the variable and the subscore.</li></ul><p><strong>Summary</strong></p><p>In the pursuit of transparent Machine Learning, scorecards provide a valuable tool for making predictions in a variety of industries, including healthcare and finance, as well as marketing, fraud detection, risk assessment, and employment. They are transparent and easy to understand due to their additive property and table-like structure.</p><p>However, scorecards also have some limitations, such as the inability to capture interactions between variables without specific feature engineering or rules. Furthermore, as the size of the scorecard increases, it can become harder to understand the relationship between the variable and the subscore, which can in practice reduce transparency.</p><p>All in all, scorecards are a great complement to linear models and rule sets, in particular for regression tasks such as scoring.</p><p>For the other articles in this series, see:</p><ul><li><a href="https://medium.com/@greger_ottosson/transparent-ml-in-enterprise-decisions-intro-8c01438c11c5">Part I — Introduction</a></li><li><a href="https://medium.com/@greger_ottosson/transparent-ml-for-enterprise-decisions-linear-models-87a31a7209bc">Part II — Linear Models</a></li><li><a href="https://medium.com/@greger_ottosson/transparent-ml-for-enterprise-decisions-rule-sets-d8f55bee3a00">Part III — Rule Sets</a></li><li>Part IV — Score Cards (this article)</li></ul><p>For more information on how ScoreCards (and Rule Sets) are supported in IBM Business Automation, see this other article on <a href="https://medium.com/ibm-data-ai/transparent-machine-learning-in-ibm-business-automation-b75cd8aed944">Transparent ML in Business Automation</a>.</p><p><em>Greger works for IBM and is based in France. The above article is personal and does not necessarily represent IBM’s positions, strategies or opinions.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afe49e6eaf4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transparent Machine Learning in IBM Business Automation]]></title>
            <link>https://medium.com/ibm-data-ai/transparent-machine-learning-in-ibm-business-automation-b75cd8aed944?source=rss-682b3c6444b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/b75cd8aed944</guid>
            <category><![CDATA[trustworthy-ai]]></category>
            <category><![CDATA[data-science-use-case]]></category>
            <category><![CDATA[rule-learning]]></category>
            <category><![CDATA[decision-management]]></category>
            <category><![CDATA[decision-intelligence]]></category>
            <dc:creator><![CDATA[Greger Ottosson]]></dc:creator>
            <pubDate>Thu, 28 Jul 2022 14:42:24 GMT</pubDate>
            <atom:updated>2023-04-10T12:58:38.584Z</atom:updated>
            <content:encoded><![CDATA[<p>How to use ML in critical and regulated business decisions.</p><p>It’s becoming increasingly common to use Machine Learning (ML)to make more precise and personalized B2C decisions. However, as we’ve <a href="https://medium.com/@greger_ottosson/transparent-ml-in-enterprise-decisions-intro-8c01438c11c5">explored in in this introduction </a>, the ability to explain and justify such decisions is becoming increasingly important. It’s driven both by customer expectations, business controls and government regulations.</p><p>In Automation Decision Services (ADS) — a component of <a href="https://www.ibm.com/cloud/cloud-pak-for-business-automation">Cloud Pak for Business Automation</a> — there’s been support for <a href="https://medium.com/ibm-data-ai/three-easy-steps-to-automate-decisions-using-models-from-watson-machine-learning-2d775b5737ac">invoking remote ML models for a couple of years</a>. This low-code capability supports flexible invocation of models, including models where an explanation is returned alongside the prediction.</p><p>That said, while we can to some degree explain individual predictions from black-box ML models, how about building and using ML models that are inherently transparent? In other words, an ML model that is readable by a business user?</p><p>In the latest releases of Automation Decision Services (ADS) it is now possible to import two types of transparent ML models — Rule Sets and ScoreCards. Using rule sets as a transparent model type to make predictions is very natural in ADS, since ADS is build around authoring and managing If-Then rules. Similarly, ScoreCards can be naturally represented in ADS as a table for each subscore.</p><p>The overall flow for learning and using rule sets/scorecards inside decisions is essentially the same as a regular ML training pipeline, with the main exception being the last step where we import the ML models as a set of rules/tables into ADS, instead of deploying the ML model behind a REST API and making a remote invocation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0t9YIRhh4m0N0jgREUaE_g.png" /><figcaption>Flow for producing and consuming transparent ML models</figcaption></figure><p>To facilitate this flow, a set of tools and industry standards are being chained together:</p><ul><li><strong>Rule Learning algorithms</strong> (developed by IBM Research and open-sourced in the <a href="https://github.com/Trusted-AI/AIX360">AI Explainability 360</a> toolkit with sample <a href="https://github.com/Trusted-AI/AIX360/tree/master/examples/rule_induction">Jupyter Notebooks</a>) and also the <a href="https://github.com/IBM/rulelearn">RuleLearn repository</a>.</li><li>As an alternative to using notebooks, there’s an <strong>interactive </strong><a href="https://proceedings.mlr.press/v176/cornec22a.html"><strong>Rule Learning UI called AIMEE</strong></a><strong> </strong>on top of the algorithms (not yet productized, but available to IBM sales/consultants for client engagements)</li><li>Ability to export rule sets in <a href="https://dmg.org/pmml/v4-4/RuleSet.html">PMML RuleSet</a> and <a href="https://dmg.org/pmml/v4-4/Scorecard.html">PMML ScoreCard</a> format (an industry standard managed by the <a href="https://dmg.org/">Data Mining Group</a> consortium)</li><li>Capability to <strong>import PMML RuleSets/ScoreCards into either IBM Automation Decision Services</strong> (native feature since <a href="https://community.ibm.com/community/user/automation/blogs/francesca-pagano/2022/06/24/whats-new-ibm-cloud-pak-for-business-automation-22">22.0.1 release</a>) or alternatively <strong>importing into </strong><a href="https://www.ibm.com/cloud/blog/announcements/ibm-expands-business-automation-portfolio-with-open-source-process-and-decision-automation"><strong>IBM Decision Manager Open Edition</strong></a> (formerly called RedHat Decision Manager, which now supports rule sets through <a href="https://github.com/kiegroup/drools/tree/main/kie-dmn/kie-dmn-ruleset2dmn-parent">new feature in Drools open source project</a> and ScoreCards with a native editor in <a href="https://sandbox.kie.org/#/">KIE Sandbox</a>)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HGvZvkkHseaNZIcr4kZHpw.png" /><figcaption>Tools and standards supporting end-to-end transparent rule learning</figcaption></figure><p>When should you use remote black-box ML models, and when is transparent rule sets preferable? Depends on the use case and the requirements. The comparison table below summarizes the pros and cons with each approach. As a summary, for critical decisions where business ownership and regulations are important, transparent ML models are clearly better. Conversely, for less-scrutinized predictions based on complex ML models owned by the data science team, go for remote ML models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m-MjjW85J2wgFgHHUn2V0g.png" /></figure><p><strong>Additional pointers:</strong></p><ul><li>Video <a href="https://www.youtube.com/watch?v=7ZJqt5bexS8">demoing and contrasting Remote- vs Transparent ML models in ADS</a></li><li><a href="https://www.ibm.com/cloud/decision-management">IBM Decision Management</a> solutions</li></ul><p><em>Greger works for IBM and is based in France. He’s a product manager and researcher, focusing on Machine Learning for Business Automation.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b75cd8aed944" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ibm-data-ai/transparent-machine-learning-in-ibm-business-automation-b75cd8aed944">Transparent Machine Learning in IBM Business Automation</a> was originally published in <a href="https://medium.com/ibm-data-ai">IBM Data Science in Practice</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transparent ML for Enterprise Decisions — Rule Sets]]></title>
            <link>https://medium.com/@greger_ottosson/transparent-ml-for-enterprise-decisions-rule-sets-d8f55bee3a00?source=rss-682b3c6444b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8f55bee3a00</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[rule-learning]]></category>
            <category><![CDATA[association-rule-learning]]></category>
            <category><![CDATA[trustworthy-ai]]></category>
            <dc:creator><![CDATA[Greger Ottosson]]></dc:creator>
            <pubDate>Thu, 28 Jul 2022 14:27:25 GMT</pubDate>
            <atom:updated>2023-04-10T12:39:33.566Z</atom:updated>
            <content:encoded><![CDATA[<h3>Transparent ML for Enterprise Decisions — Rule Sets</h3><p><strong>Note: </strong>this is Part III in a series of articles on transparent machine learning models, click here for <a href="https://medium.com/@greger_ottosson/transparent-ml-in-enterprise-decisions-intro-8c01438c11c5">Part I — Introduction</a>, <a href="https://medium.com/@greger_ottosson/transparent-ml-for-enterprise-decisions-linear-models-87a31a7209bc">Part II — Linear Models</a> and <a href="https://medium.com/@greger_ottosson/transparent-ml-for-enterprise-decisions-score-cards-afe49e6eaf4b">Part IV — Scorecards</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*78VzeGWzRNDLRrWIBZ_-0A.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@greg_rosenke?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Greg Rosenke</a> on <a href="https://unsplash.com/s/photos/natural-squares?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p><strong>Intro to rule sets</strong></p><p>Business rules for decision making has been used extensively for several decades. Historically they stem from pre-digital times, when policy manuals were used as guidance for how company representatives should conduct business. <em>Declarative rules</em> were — and still are — used to specify in detail how to perform anything from order validation, approvals, quoting, discounting and much more. Similarly, <em>predictive rules</em> have historically been crafted by hand — sometimes helped by statistical software — to assess risk, recommend products or detect fraud.</p><p>Within the Machine Learning community, learning rules from data — also known as Rule Learning or Rule Induction — has been studied since at least the 80s. Initially, most approaches were either based on extracting rules from decision trees, or by incrementally growing rule sets by generalizing directly from examples in the training data. In the last decade, newer methods have appeared that are based on mathematical optimization or neural networks.</p><p>To illustrate how rule sets can used for predictions, let’s consider the simple example of customer churn, which is a binary classification problem. We want to predict whether a customer will cancel their subscription, based on a set of variables:</p><ul><li>Age</li><li>Income</li><li>Payment method</li><li>Monthly usage</li><li>Gender</li></ul><p>There are two commonly used rule formats, <em>rule sets</em> and <em>decision lists</em>.</p><p><strong>Rule Sets: </strong>A rule set is a set of If-Then rules, which all predict the same class. For example:</p><ul><li><strong>IF</strong> Age ≤ 25 <strong>and</strong> Monthly Usage ≥ 100 <strong>and</strong> Gender = Male <br><strong>THEN</strong> Churn = “True”</li><li><strong>IF</strong> Age ≤ 50 <strong>and</strong> Monthly Usage ≥ 150 <strong>and</strong> Income ≥ 40,000 <br><strong>THEN</strong> Churn = “True”</li><li><strong>IF</strong> Monthly Usage ≤ 40 <strong>and</strong> Payment Method = Cheque<br><strong>THEN</strong> Churn = “True”</li><li>…<br><strong>By default</strong> Churn = “False”</li></ul><p>The rule set above is not ordered, i.e. since all rules predict the same outcome it doesn’t matter in what sequence the rules are checked. By custom, if none of the rules trigger, there’s a default rule at the end, predicting the opposing outcome (Churn = “False” in this example).</p><p><strong>Decision Lists: </strong>Also known as “rule lists”, this is an ordered set of If-Then-ElseIf-Else rules, where each condition can lead to a different prediction. For example:</p><ul><li><strong>IF</strong> Age ≤ 25 <strong>and</strong> Monthly Usage ≥ 100 <strong>and</strong> Gender = Male<br><strong>THEN</strong> Churn = “True”</li><li><strong>ELSE IF</strong> Age ≥ 40 <strong>and</strong> Monthly Usage ≤ 100<br><strong>THEN</strong> Churn = “False”</li><li><strong>ELSE IF</strong> Monthly Usage ≤ 40 <strong>and</strong> Payment Method = Cheque<br><strong>THEN</strong> Churn = “True”</li><li>…</li><li><strong>ELSE</strong> Churn = “False”</li></ul><p>Notice that the first rule predict Churn to be “True”, the second rule predicts “False”, while the third predicts “True” again. A decision list of this type is said to be “blended”, and this mixing is the reason why a decision list has to be evaluated in sequence from top to bottom.</p><p><strong>The (mathematical) format of rule conditions</strong></p><p>While in principle the condition of a rule could take any form, traditionally most rule learning algorithms have generated the type of conditions shown above, which more generally has the following form,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/135/1*7eJ1iPSemcuFXtXLfRK47g.png" /></figure><p>i.e. a conjunction of conditions, each on a single variable. For example, the condition “Age ≥ 40 and Monthly Usage ≤ 100” from above follows this format.</p><p><strong>ML lingo (optional): </strong>Mathematically, these types of rules with univariate conditions form n-dimensional hypercubes in the decision space. All boundaries formed by these cubes are orthogonal to the variable axes.</p><p><strong>Visualizing rule sets</strong></p><p>The ruleset example from above can be visualized in the following way, if we ignore all conditions except those on Age and Monthly Usage:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cJEL574uauut9LXXrhxjlg.png" /><figcaption>The rule set example from above, projected and visualized in the 2-dimensional space formed by Age and Monthly Usage. Areas in red classified as Churn.</figcaption></figure><p>You will have to imagine how these rectangles expand beyond your flat screen, forming multi-dimensional cubes that are constrained in space by the additional conditions imposed on other variables (not just Age and Monthly Usage shown here).</p><p><strong>The strong points of rule set models</strong></p><p>Rule set models are — if reasonable in number and complexity — easily interpretable, and natural for business analysts to read or even modify. They are also good in capturing certain types of patterns in the data:</p><ul><li><strong>Interacting variables:</strong> since the condition in each rule is a combination of constraints on different variables, there is good opportunity for the rule learning algorithms to identify rules that capture important interactions between variables. <br>Example: in the decision list above, the combination of young age and high monthly usage raises the risk for churn for men, whereas the combination of high age and low monthly usage does the inverse.</li><li><strong>Non-linearities: </strong>a set of rules can in combination be used to capture a non-linear effect for a variable. <br>Example: in the first rule set above, observe how every rule involves a condition on Monthly Usage; testing whether it’s &lt;40, &gt;100, or &gt;150 respectively. By “slicing up” the range for Monthly Usage this way — and defining different outcomes — we can capture a relationship that is not linear.</li></ul><p>It is worth noting that these strong points are exactly the weak points of linear models that we discussed in <a href="https://medium.com/@greger_ottosson/transparent-ml-for-enterprise-decisions-linear-models-87a31a7209bc">Part II</a> of this article series, and also that rule sets complement Score Cards (<a href="https://medium.com/@greger_ottosson/transparent-ml-for-enterprise-decisions-score-cards-afe49e6eaf4b">Part IV</a>) that can model non-linearities, but not interactions between variables.</p><p><strong>The weaknesses of rule set models</strong></p><p>While transparent and flexible, rule sets have some inherent limitations:</p><ul><li><strong>Size of rule sets: </strong>when the decision space doesn’t follow boundaries orthogonal to the axis, you can imagine that we would need more of these cubes depicted above to nicely follow the boundaries that separate cases of churn from cases of non-churn. Put differently, this is one reason that, if we strive for good model accuracy, we might end up with large rule sets.</li><li><strong>Complexity of conditions: </strong>while rules are good at capturing interactions between variables, doing so might result in conditions with constraints on many variables, which will increase complexity and reduce transparency.</li><li><strong>Regression: </strong>above we focused on classification examples, which include use cases such as churn risk and fraud detection. When learning rules to predict a number — such as estimating a house price or life-time value of a customer —a common approach is to take the (weighted) average value of the right-hand-side of all the rules that triggered. While this approach might work — with enough rules — it might provide a worse accuracy/transparency ration than e.g. scorecards or even linear regression. Often, Score Cards (<a href="https://medium.com/@greger_ottosson/transparent-ml-for-enterprise-decisions-score-cards-afe49e6eaf4b">Part IV</a>) will prove a better choice for transparent regression models.</li></ul><p><strong>Rule sets as Decision Tables</strong></p><p>Business rules can also be displayed and managed in the form of decision tables. As a concrete example, our rule set from above would be captured the following way as a decision table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*atKGfiubucTZRENfmQsfuw.png" /><figcaption>The example rule set represented as a decision table. Each row is a rule.</figcaption></figure><p>In a decision table, each row represents a rule, and each cell contains a condition on a single variable. Just like with If-Then rules, there’s a “hit policy” defining how the rules in the table should be evaluated. For a regular rule set, we use a“first hit” policy, which means the table will evaluated from top to bottom, and the rule in the last row will trigger if no other rule above did.</p><p>Whereas a list of rules is semantically equivalent to a decision table, visually there are cases where a table might be preferable (and vice versa).</p><ul><li><strong>Sparse rule sets</strong> occur when you have relatively few conditions compared to the number of variables. Displayed as a table, this means there will be a lot of columns and a lot of empty cells. Sparse rule sets might be better visualized and managed as individual If-Then rules.</li><li><strong>Dense rule sets</strong> is the name for the inverse situation, i.e. where there are a relatively small amount of variables and many variables are used in conditions, leading to a table where many cells are filled. In this case, a table format will not only be more compact, it will make analysis of the rules more feasible.</li></ul><p>Regardless of whether a rule set is dense or sparse, your rule management software might provide different ways of analyzing the rules when represented as a table or list of rules. For example, in a table you might be able to re-order columns or sort the rows (be careful if you have a “first hit” policy!), which might make understanding of the rules much easier.</p><p><strong>Summary</strong></p><p>As a conclusion, using machine learning to generate business rules from data is very compelling, because rules are very familiar for business analysts and can be managed and executed alongside other rules used to encode policy or business strategy. For classification tasks with lots of interactions between variables, they can perform relatively well with a reasonable amount of rule complexity.</p><p>For the other articles in this series, see:</p><ul><li><a href="https://medium.com/@greger_ottosson/transparent-ml-in-enterprise-decisions-intro-8c01438c11c5">Part I — Introduction</a></li><li><a href="https://medium.com/@greger_ottosson/transparent-ml-for-enterprise-decisions-linear-models-87a31a7209bc">Part II — Linear Models</a></li><li>Part III — Rule Sets (this article)</li><li><a href="https://medium.com/@greger_ottosson/transparent-ml-for-enterprise-decisions-score-cards-afe49e6eaf4b">Part IV — Score Cards</a></li></ul><p><em>Greger works for IBM and is based in France. The above article is personal and does not necessarily represent IBM’s positions, strategies or opinions.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8f55bee3a00" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transparent ML for Enterprise Decisions — Linear Models]]></title>
            <link>https://medium.com/@greger_ottosson/transparent-ml-for-enterprise-decisions-linear-models-87a31a7209bc?source=rss-682b3c6444b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/87a31a7209bc</guid>
            <category><![CDATA[trustworthy-ai]]></category>
            <category><![CDATA[regression-modeling]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Greger Ottosson]]></dc:creator>
            <pubDate>Thu, 28 Jul 2022 14:27:01 GMT</pubDate>
            <atom:updated>2023-04-10T12:43:17.227Z</atom:updated>
            <content:encoded><![CDATA[<h3>Transparent ML for Enterprise Decisions — Linear Models</h3><p><strong>Note: </strong>this is Part II in a series of articles on transparent machine learning models, click here for <a href="https://medium.com/@greger_ottosson/transparent-ml-in-enterprise-decisions-intro-8c01438c11c5">Part I — Introduction </a>, <a href="https://medium.com/@greger_ottosson/transparent-ml-for-enterprise-decisions-rule-sets-d8f55bee3a00">Part III — Rule Sets</a> and <a href="https://medium.com/@greger_ottosson/transparent-ml-for-enterprise-decisions-score-cards-afe49e6eaf4b">PartIV — ScoreCards</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qZGm4Gndh88uqVpRYJam9w.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@ronaldordeoliveira?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Ronaldo de Oliveira</a> on <a href="https://unsplash.com/s/photos/line?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p><strong>Intro to Linear Models</strong></p><p>Linear regression analysis has been used since 1805 when Legendre and Gausse invented the “least squares method”. A linear model makes a prediction <em>y </em>as a linear combination of input variables <em>x</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/195/1*phkIJAl-XkiVoqxMa7-iMw.png" /></figure><p>Let’s say you want to predict the price of a house. As input variables we might have:</p><ul><li>number_of_rooms,</li><li>livable_area,</li><li>garden_size,</li><li>years_since_renovation,</li><li>has_pool (boolean)</li><li>has_security (boolean).</li></ul><p>A linear model might look something like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*FdUIPovJyE8DbwMwZ2g4Rg.png" /></figure><p><strong>The strong points of linear models</strong></p><p>Linear models have some nice properties that makes them interpretable:</p><ul><li><strong>Linear effect:</strong> as a variable increases in value, so does the prediction (unless the coefficient <em>c</em> is negative, in which case the inverse is true). <br>Example: an increase in <em>livable_area</em> will always increase the predicted price of the house, whereas an increase in <em>years_since_renovation</em> will always decrease the predicted price.</li><li><strong>Additive: </strong>the contribution of each variable is independent of the others. <br>Example: If <em>number_of_rooms</em> increase, the price increase, regardless of other features.</li></ul><p><strong>The weaknesses of linear models</strong></p><p>The properties that make linear models easy to interpret also means they won’t work for all types predictions, because there are obvious limitations in what can be captured in additive, linear form.</p><ul><li><strong>Interacting variables: </strong>A house with <em>both </em>a big garden and a pool might be more valuable than indicated by separately adding up the values of the garden and the pool. In cases like these, additive models that weigh each variable separately will fail to capture these interactions.</li><li><strong>Non-linear effects:</strong> Going from a house with 2 rooms to 3 will typically have a bigger increase in house value in than going from a house with 4 rooms to 5. This effect of “diminishing returns” cannot be capture in a linear form with a single coefficient in front of <em>number_of_rooms.</em></li></ul><p><strong>Improving the accuracy of linear models</strong></p><p>While linear models have significant limitations, don’t discard them just yet! Modest amounts of variable interactions and non-linearities can be handled with a few tricks. For example:</p><ul><li>For the garden <em>and</em> pool interaction, we can introduce a new variable called <em>has_garden_and_pool</em>, which is <em>true</em> if garden is above a certain size and <em>has_pool=true.</em> Training the linear model will produce a suitably large coefficient for <em>has_garden_and_pool</em>, effectively capturing the the added value of this combination.</li><li>Similarly, to capture how larger houses increase less by each added room, a <em>large_house</em> variable can be added. Again, linear regression will leverage this variable by producing a (probably negative) coefficient to offset the diminishing effects of <em>number_of_rooms</em>.</li></ul><p><strong>ML Lingo (optional)</strong>: the tricks presented here are special cases of more generic ML techniques, namely feature engineering and piecewise functions/regression splines.</p><p>While it might seem complicated to create new features, it’s worth noticing that in many industry use cases, various metrics has evolved over time to capture non-linearities and variable interactions. Often you will find already established terms and metrics that can be leveraged for more accurate ML models. Here are a few examples:</p><ul><li>Debt/Income ratio (<a href="https://en.wikipedia.org/wiki/Debt-to-income_ratio">DTI</a>) for mortgage applications</li><li>Claims in last 12 months for insurance fraud detections</li><li>Usage Level (high, medium, low) for churn prediction (computed from monthly usage)</li></ul><p><strong>Visualizing linear models</strong></p><p>Conceptually, linear models are represented as “hyper planes” in n-dimensional space, i.e one dimension per variable. A simplified example for three dimensions is shown below. By selecting a number of rooms (x-axis) and garden size (z-axis), we can estimate the price of the house (y-axis).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3TkhEEaoHJGdUPFSZ_qAQA.png" /><figcaption>A simplified linear model predicting the price of a house based only on garden size and number of rooms.</figcaption></figure><p><strong>Linear models for classification</strong></p><p>Linear models aren’t restricted to predicting numerical values (regression), as they can also be used for classification tasks. For example, let’s say we want to predict the likelyhood that a customer might churn in the next year, i.e. choose not to renew their subscription for one of our products. Again, in a simplified model, using only Income and Monthly Usage as input variables, we can predict probability of churn as a number between 0 and 1. Typically, we then interpret this through one or more “threshold rules”, taking different actions depending on the risk of churn we’re facing with this particular customer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-AUE-DEy96uQULiUjti4gg.png" /><figcaption>A simplified linear model predicting the likely hood of churn for a customer, based only on Income and Monthly Usage. In this case, 0.5 is considered the threshold for a positive churn classification.</figcaption></figure><p><strong>Summary</strong></p><p>As a conclusion, while linear models aren’t exactly novel and have some inherent limitations when it comes to expressing non-linearities and interactions between variables, they can still be useful for certain tasks; both for predicting a numerical value (regression), or for classification (answering yes/no).</p><p>For the other articles in this series, see:</p><ul><li><a href="https://medium.com/@greger_ottosson/transparent-ml-in-enterprise-decisions-intro-8c01438c11c5">Part I — Introduction</a></li><li>Part II — Linear Models (this article)</li><li><a href="https://medium.com/@greger_ottosson/transparent-ml-for-enterprise-decisions-rule-sets-d8f55bee3a00">Part III — Rule Sets</a></li><li><a href="https://medium.com/@greger_ottosson/transparent-ml-for-enterprise-decisions-score-cards-afe49e6eaf4b">Part IV — ScoreCards</a></li></ul><p><em>Greger works for IBM and is based in France. The above article is personal and does not necessarily represent IBM’s positions, strategies or opinions.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87a31a7209bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transparent ML in Enterprise Decisions — Intro]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@greger_ottosson/transparent-ml-in-enterprise-decisions-intro-8c01438c11c5?source=rss-682b3c6444b5------2"><img src="https://cdn-images-1.medium.com/max/2400/1*IPadnjA8fekChRcBnrQd5g.jpeg" width="2400"></a></p><p class="medium-feed-snippet">The Case for Transparency in Enterprise Decisioning</p><p class="medium-feed-link"><a href="https://medium.com/@greger_ottosson/transparent-ml-in-enterprise-decisions-intro-8c01438c11c5?source=rss-682b3c6444b5------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@greger_ottosson/transparent-ml-in-enterprise-decisions-intro-8c01438c11c5?source=rss-682b3c6444b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c01438c11c5</guid>
            <category><![CDATA[transparency]]></category>
            <category><![CDATA[machine-learning-ai]]></category>
            <category><![CDATA[trustworthy-ai]]></category>
            <dc:creator><![CDATA[Greger Ottosson]]></dc:creator>
            <pubDate>Thu, 28 Jul 2022 14:25:58 GMT</pubDate>
            <atom:updated>2023-04-10T12:37:25.180Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Beyond ML Ops: Governance for enterprise decisioning]]></title>
            <link>https://medium.com/data-science/beyond-ml-ops-governance-for-enterprise-decisioning-6efc69622e4e?source=rss-682b3c6444b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/6efc69622e4e</guid>
            <category><![CDATA[business-automation]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[decision-management]]></category>
            <category><![CDATA[business-rules]]></category>
            <category><![CDATA[digital-decisions]]></category>
            <dc:creator><![CDATA[Greger Ottosson]]></dc:creator>
            <pubDate>Fri, 22 Jan 2021 14:39:10 GMT</pubDate>
            <atom:updated>2021-01-22T14:39:10.920Z</atom:updated>
            <content:encoded><![CDATA[<h3>Beyond ML Ops: Governance for Business Automation</h3><h4>How to operationalize Machine Learning with business policy and IT systems</h4><p>For enterprise applications and business automation, Machine Learning (ML) is rarely used in isolation. The deployed ML model is almost always surrounded by a “policy layer” or set of business rules to govern how it’s invoked and how to interpret the results. For details on why these rules are needed see <a href="https://towardsdatascience.com/solving-machine-learnings-last-mile-problem-for-operational-decisions-65e9f44d82b">this previous article</a>.</p><p>As a result, we’re left with three largely independent life-cycles, each producing new versions for different reasons:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SR650ChkeYwE_8CtvEc5ww.png" /><figcaption>Three independent life-cycles requiring coordination</figcaption></figure><p>New ML models are created when we have new data to train on, when data scientists refine their models or apply new algorithms. Meanwhile, business analysts refine the business policies, manage introduction of new offerings or marketing promotions. On the IT side, upgrades happen when new systems are introduced, new technology is applied or new application versions are developed.</p><p>As expected, since Data Science, Business and IT are separate departments and separately roles, our industry has arrived at largely independent solutions for governance:</p><ul><li><strong>DATA SCIENCE: MLOps</strong> is focused at governance of ML models, include re-training, versioning and monitoring for drift and fairness.</li><li><strong>BUSINESS: Digital Decisioning</strong>, or Decision Management- or Automation Platforms occupy themselves with versioning of business rules, workflows or other forms of business policy.</li><li><strong>IT: CI/CD</strong> and <strong>Data Governance</strong> is focused on supporting applications development and governance of data, respectively.</li></ul><p>In effect, we now have three semi-independent life-cycles that need to be coordinated. We can either allow them to spin autonomously, using “latest and greatest” from each, or we can lock them together, forcing a “global versioning” of sorts.</p><p>Which one you should choose depends on the context, which is what we’ll explore in this article. We’ll use three classic ML use cases to make this more concrete:</p><ul><li>Customer Churn — managing customer retention in retail or telco</li><li>Product Recommendations — ranking offers based on propensity-to-buy</li><li>Loan Risk Scoring — assessing risk of default for loan underwriting</li></ul><p><strong>“All at once”: End-to-end Upgrades</strong></p><p>As a first example, we’ll explore a case where we need to coordinate across:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YFiTLjr1mAIWbZGhm4xMtQ.png" /></figure><p>Let’s say we have a prediction of churn risk — the probability that a customer will cancel their subscription for a product — and that this prediction is currently using an ML model trained on <em>CustomerSegment, ProductsSubscribed, TimeAsClient</em> and <em>MonthlyUsage</em>.</p><p>These four pieces of data captures the type of client, how many products they subscribe to, and how much they use them. However, to also capture how recently the customer made an active decision to continue their business with us, we could also include a new field, say, <em>TimeOfLastSubscription.</em></p><p>Adding this new data fields triggers changes across the board:</p><ol><li>The ML training needs to find and pick up the new data field from some operational data store (provided by some IT system). When invoked, the re-trained ML model now requires the new <em>TimeOfLastSubscription</em> field in addition to the original four parameters.</li><li>On the business side, we now need to provide the new field when asking for an ML-based prediction. In addition, since our predictions are now better, we might be able to remove existing policy rules (e.g. “if customer subscribed to a product less than 3 months ago, never offer retention offers”).</li><li>The ripple effect continues into the IT systems, that now also need to provide <em>TimeOfLastSubscription</em> when asking for a retention offer decision. The IT system responsible for tracking subscriptions also needs to make this data available to the ML training, closing the loop.</li></ol><p>In summary, when you’re adding data to the entire loop, you normally need make all changes in a coordinated fashion across Data Science, Business and IT. Think of this as a “major upgrade”.</p><p><strong>“ML + Rules”: Coordinated Upgrades of Prediction and Policy</strong></p><p>As a second example, we’ll look at a case where ML and Policy versions need coordination, but not IT systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R025x3gCci-p7N483kIteA.png" /></figure><p>Consider a basic product recommendation system, where we use ML to deliver a “Propensity to buy” prediction. For a certain customer and product pair, this predicts the likely hood that the customer will purchase the product if offered. This prediction allows us to create a ranked list of product to promote to each customer. Surrounding that prediction we typically have a set of rules to filter our products the customer is not eligible for, that are not available in customer’s geography or that the customer already owns.</p><p>Now consider the introduction of a new product in our product catalog. Initially, we have very few customers who own the product, so the ML model is unlikely to recommend it accurately. Result is we don’t recommend it to enough customers, or to the wrong ones, and therefore adoption of the new product is slow.</p><p>This “chicken and the egg” problem needs to be resolved through active intervention, for example by overriding the ML-based predictions in order to recommend the new products and bootstrap the adoption. In this approach, we add a rule that “steals” a percentage of recommendations for older products that are similar in target audience to the new product, and redirects those recommendations towards the new product. Over time, as the ML model catches up and starts to recommend the new product sufficiently often, this redirection rule can be phased out.</p><p>From a practical governance perspective, this requires us to coordinate the upgrade to the new ML model with a new version of the business polices (which include the redirection rule).</p><p>This use case is an example of a general situation, where new or re-trained ML models need to be introduced gradually into operational systems. When predictions are not (yet) reliable —for whatever reason —there’s a period of time where we ignore or adjust predictions to achieve desired business outcomes.</p><p><strong>“Use Latest” : Independent ML Upgrades</strong></p><p>In many situations, the predictions from ML models evolve much slower than is the case with the previous two examples. In these periods of stability, between disruptions, we can re-train and upgrade the ML models frequently and automatically without need for coordination with policy rules or review of IT systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kKTd-mSxF4bodT-bdSe6eQ.png" /></figure><p>Consider for example a risk score in a loan approval scenario. An ML model is used to assess the risk of a customer defaulting on a loan, given the customer’s information and history, combined with the size and type of loan requested. This risk model can be retrained frequently to make scoring more precise, but the parameters required to invoke the model remains the same and the returned predictions will only change gradually over time.</p><p>In these cases, when a prediction is required we can always invoke the latest ML model version, and no adjustments to policy rules is required. However, this requires that the pipelines used for re-training the model is robust and able to detect data errors, e.g., and that the ML model is monitored for drift over time.</p><p>In addition, even with these safe-guards, a cautious business team would nonetheless monthly or quarterly perform a business simulation — across policy rules and predictions — to ensure that loan decisions generated provide expected business outcomes and complies with regulations around fairness, etc.</p><p><strong>Summary</strong></p><p>Applying Machine Learning to business automation isn’t necessarily difficult because of the sophisticated ML techniques required. It can often be based mostly on structured data, and “classic” ML approaches such as regression or decision trees are often sufficient for scoring, risk assessments and classification of business transactions.</p><p>What can be tricky is the “operational” aspect of business automation (decisions are made at scale) and ever-shifting business goals and policy rules. Improving ML-based predictions — while policies are changing —requires approaches that vary based on the use case and business context.</p><p>In this article we looked at three scenarios:</p><ul><li>End-to-end release across Data Science, Business and IT</li><li>Coordination of just Data Science and Business versions</li><li>Independent ML re-training</li></ul><p><em>Greger works for IBM and is based in France. The above article is personal and does not necessarily represent IBM’s positions, strategies or opinions.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6efc69622e4e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/beyond-ml-ops-governance-for-enterprise-decisioning-6efc69622e4e">Beyond ML Ops: Governance for enterprise decisioning</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>