<?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 Peilun Li on Medium]]></title>
        <description><![CDATA[Stories by Peilun Li on Medium]]></description>
        <link>https://medium.com/@peilunl?source=rss-efe81354a52c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EorfCveb0IgW0rsCl1Q8BQ.jpeg</url>
            <title>Stories by Peilun Li on Medium</title>
            <link>https://medium.com/@peilunl?source=rss-efe81354a52c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 14:45:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@peilunl/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[MCP: The Flip Side of the USB-C Analogy]]></title>
            <link>https://pub.towardsai.net/mcp-the-flip-side-of-the-usb-c-analogy-af98e07bdb30?source=rss-efe81354a52c------2</link>
            <guid isPermaLink="false">https://medium.com/p/af98e07bdb30</guid>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <dc:creator><![CDATA[Peilun Li]]></dc:creator>
            <pubDate>Sun, 27 Jul 2025 15:01:59 GMT</pubDate>
            <atom:updated>2025-07-27T15:01:59.215Z</atom:updated>
            <content:encoded><![CDATA[<h4>The M-by-N Pitfall: Why the promise of a universal protocol can be a trap for specialized systems</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e2mjWIjmJwo2NehC.png" /><figcaption>The USB-C Analogy of MCP (<a href="https://norahsakal.com/blog/mcp-vs-api-model-context-protocol-explained/">Image: Norah Sakal</a>)</figcaption></figure><p>The tech industry has widely embraced the analogy of MCP as the “USB-C for AI agents,” and for good reason. As <strong>consumers</strong>, we can seamlessly connect disparate products and have them communicate without needing to understand their internal implementation. This unlocks undeniable convenience and value.</p><p>This consumer-centric view of MCP is now influencing decisions within the enterprise. Companies offering general-purpose agents (like chatbots and coding assistants) are rushing to add MCP support. Inevitably, the question is now bubbling up for teams building more specialized vertical agents:</p><blockquote>“My team is building a specialized vertical agent — an AI for a specific domain. We own the agent’s implementation and its internal tools. Should we define these tools as MCPs so they can be reused across the company later?”</blockquote><p>The immediate answer might seem like an obvious “why not?” — and that’s precisely what worries me. At this point, I find the USB-C analogy for MCP to be painfully accurate, but from the <strong>manufacturer</strong>’s perspective, on the flip side. Let’s reframe that question using our USB-C analogy:</p><blockquote>“My team is engineering a highly-specialized, next-generation device. Internally, we control all the core components — the CPU, display, storage, etc. Should we connect these components to the motherboard using USB-C, just so they can be potentially reused in other products across the company?”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QrpFEoB0DupIZHP5vKU5LA.jpeg" /><figcaption>An imagined next-gen device with internal USB-C connections (Image: Gemini)</figcaption></figure><p>I hope your engineering sense is screaming “absolutely not!” here. Just as there are excellent reasons for modern devices to have external USB-C ports, there are just as many compelling reasons <strong>not</strong> to use them for all internal connections. Compared to USB-C, specialized connections on a System-on-Chip (SoC) are vastly more efficient in power, space, and performance, free from protocol and controller overhead.</p><p>One might argue there’s a difference: MCP promises reusability, a feature not prioritized by internal hardware buses. To address that, let’s dive deeper into MCP’s reusability claim.</p><h3>The M-by-N Pitfall</h3><p>The “M-by-N” value proposition is central to the MCP pitch. The idea is that instead of building M x N unique integrations between M applications and N tools, you introduce a standard protocol. This reduces the complexity to M + N connections. A foundational assumption here is that a single tool can provide direct value to a wide range of applications.</p><p>Let’s examine this assumption by categorizing tools:</p><ol><li><strong>API-level tools:</strong> These simply wrap existing APIs. A tool that fetches a website&#39;s content, for instance, can be used by chatbots, coding agents, and more. For these, the M-by-N value proposition holds true.</li><li><strong>Skill-level tools:</strong> Moving beyond simple API wrappers, “skill-level” tools are customized for a specific <em>type</em> of task or agent. The excellent “<a href="https://build.microsoft.com/en-US/sessions/DEMFP786">Your API is not an MCP</a>” talk showcases this, giving an example of a skill-level tool for database migration. Such a tool can be heavily optimized for coding agents and would be of little use to a generic-purpose conversational chatbot. Here, the tool is already specialized, and the M-by-N value diminishes.</li><li><strong>Vertical Agent Tools:</strong> Further into the domain of specialized agents, the tools must be even more skill-oriented, often embedding specific product logic for a high-quality experience. Ultimately, for these vertical agents, the tools become just as specialized as the agent itself, leaving little room for reusability.</li></ol><p>Consider this hypothetical example from a real estate company. You are working on the Transaction Team, which helps facilitate the down-funnel transaction process after a client (home buyer) wins an offer, including loan applications, inspections, title, insurance, etc. As this process can be complex, your team wants to leverage Gen AI to build a client-facing chatbot to improve user experience. The chatbot has to be equipped with a few tools, to name just one:</p><blockquote><strong>Inspection Scheduler:</strong> schedule a two-party appointment between a buyer or buyer’s agent, and an inspector with time availability at the winning property. The inspection needs to meet a certain deadline.</blockquote><p>You wonder if you can reuse an existing appointment scheduling MCP available in your company. After a brief search, you find the Tour Team has a touring chatbot that includes this MCP tool:</p><blockquote><strong>Tour Scheduler:</strong> schedule a two-party appointment between a buyer and a buyer’s agent, at a certain on-market home, subject to the time availability of both parties. The buyer may provide a desired timeline, and if the preferred buyer agent does not have time availability and the buyer hasn’t signed an exclusive buyer’s agreement yet, it can recommend an alternative agent with availability for the tour.</blockquote><p>You arrange a meeting with the Tour Team to discuss the potential to expand and reuse their Tour Scheduler MCP. After the discussion, you realize it’s not feasible.</p><p><strong>Tour Scheduler vs. </strong><strong>Inspection Scheduler</strong></p><ul><li><strong>Systems:</strong> The Tour Scheduler uses buyer and agent calendars. Yours needs additional access to a separate, third-party inspector calendar system.</li><li><strong>Business Logic:</strong> Touring is a “best-effort” activity, whereas an inspection has a hard, contractual deadline, requiring different error handling and escalation logic.</li><li><strong>Roadmap:</strong> The Tour Team plans to add multi-home scheduling, a feature irrelevant to your inspection tool that would add unnecessary complexity.</li></ul><p>You build a new Inspection Scheduler MCP. Later, your team decides to build another lender-facing chatbot, which requires a new Lender Appraisal Scheduler tool.</p><blockquote><strong>Lender Appraisal Scheduler:</strong> schedule a two-party appointment between a seller or seller’s agent and an appraiser with time availability at the winning property. The appraisal needs to meet a certain deadline.</blockquote><p>It seems similar to your team’s existing Inspection Scheduler MCP, but again, the details get in the way.</p><p><strong>Inspection Scheduler vs. </strong><strong>Lender Appraisal Scheduler</strong></p><ul><li><strong>Legal &amp; Compliance:</strong> Appraiser selection is legally-bound and must be logged in an audit system. Inspector selection is flexible. Mixing these flows in one tool is a compliance risk.</li><li><strong>Implementation Nuance:</strong> The logic for when parties are optional (e.g., buyer at inspection vs. seller at appraisal) is subtly different, leading to messy, conditional code if combined.</li></ul><p>You end up creating a separate Lender Appraisal Scheduler. Later, you learn the Tour Team also had to create a new Open House Tour Scheduler instead of reusing their original tool. The two teams now have four scheduler MCPs for four seemingly similar use cases. Each MCP is used by only one product.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QLyFNk_tHqALNAqXZ9MIEA.png" /><figcaption>Source: Image by the author</figcaption></figure><p>You realize the M-by-N problem was a red herring. For specialized vertical agents, you don’t have M applications trying to use N tools. You have a <em>single</em> application (M=1) that needs a set of N highly-customized tools.</p><p>The challenge isn’t discoverability or reusability; it’s tight, efficient, and reliable integration. In these cases, the answer can be a direct connection — by defining tools as part of the agent’s implementation directly, a simple N-tool integration is all that is needed (instead of MCP’s M+N). Forcing these specialized tools into a generic MCP format is like using a bulky USB-C adapter to connect a CPU directly to a memory chip. It doesn’t solve a problem; it <em>creates</em> overhead.</p><h3>A Classic Dilemma: Buy vs. Build</h3><p>You may be wondering: if MCP isn’t the ultimate solution, what is? The answer is both yes and no, because a single, unified solution rarely works for every use case. Specialized scenarios require specialized solutions. This brings our discussion of both USB-C and MCP into the frame of a classic engineering debate: Buy vs. Build.</p><ul><li><strong>MCP and USB-C represent the “Buy” solution.</strong> They are straightforward to adopt, cover the majority of needs with minimal friction, and work out-of-the-box for the common 80% of use cases that fit the standard.</li><li><strong>A specialized approach is the “Build” route.</strong> This is for when a general solution won’t cut it and you need superior performance, control, or features. This “Build” route requires more investment and clear ROI justification, but it’s precisely where true differentiation and competitive advantage originate.</li></ul><h3>The Bottom Line</h3><p>To be clear, the purpose of this post isn’t to diminish the foundational value of MCP. Its power to transform M x N complexity into M + N simplicity holds true in many scenarios, especially for consumer-facing products. Furthermore, the ecosystem of registries and standards that MCPs foster helps democratize AI, contributing to a more dynamic and innovative field.</p><p>The goal, however, is to challenge the cargo-cult thinking and blanket assumptions that can arise during any technology hype cycle, such as:</p><ul><li>“MCP will solve every integration problem.”</li><li>“We should apply MCP everywhere we can.”</li><li>“Let’s use MCP because it’s the industry standard.”</li><li>…</li></ul><p>Just like USB-C handles a lot of connections but not all, so does MCP. The flip side of the USB-C analogy isn’t a warning to avoid the standard, but a reminder to understand its limits. A USB-C port can unite your devices, but not the heart of your computer. A tool can speak the protocol, but not the language of your specific problem. Innovation begins where the standard ends.</p><h3>Acknowledgement</h3><p>Edited and refined with assistance from Gemini and ChatGPT.</p><h3>Disclaimer</h3><p><a href="https://peilunl.medium.com/disclaimer-7f02bf6a7a7a">Disclaimer</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af98e07bdb30" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/mcp-the-flip-side-of-the-usb-c-analogy-af98e07bdb30">MCP: The Flip Side of the USB-C Analogy</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Architecting Gen AI Systems #3: Rethinking RAG and Vector Embeddings]]></title>
            <link>https://generativeai.pub/architecting-gen-ai-systems-3-rethinking-rag-and-vector-embeddings-ba23d0de1049?source=rss-efe81354a52c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba23d0de1049</guid>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[retrieval-augmented]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Peilun Li]]></dc:creator>
            <pubDate>Sat, 18 May 2024 06:25:43 GMT</pubDate>
            <atom:updated>2024-05-18T08:38:21.991Z</atom:updated>
            <content:encoded><![CDATA[<h4>Contemplating the Essence and Relevance of RAG</h4><p>In our previous installment, <a href="https://medium.com/generative-ai/architecting-gen-ai-systems-2-the-expansion-of-model-and-a-study-in-analogy-8e7b7f3005d8">Architecting Gen AI Systems #2: The Expansion of Model and a Study In Analogy</a>, we explored the abstraction and democratization of Gen AI, through an analogy between computer systems and Gen AI systems. We left an open question regarding retrieval mechanisms: which is more effective, vector-embedding-based retrieval or graph-connection-based retrieval? While it is beyond our authority to provide a definitive answer — a responsibility that rests with the broader industry — let’s explore this topic together to unveil insights and nuance the retrieval systems in Gen AI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KCingMQSiyVc-Uol" /><figcaption>Illustrated by DALL·E 3: Contemplating the Essence and Relevance of RAG. At its heart, the fundamental concept of “information and knowledge retrieval” persists, regardless of the variations.</figcaption></figure><h3>What is RAG, indeed?</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2F9pe3w%2F1%2F&amp;display_name=Datawrapper&amp;url=https%3A%2F%2Fdatawrapper.dwcdn.net%2F9pe3w%2F1%2F&amp;image=https%3A%2F%2Fdatawrapper.dwcdn.net%2F9pe3w%2Fplain-s.png%3Fv%3D1&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=dwcdn" width="600" height="396" frameborder="0" scrolling="no"><a href="https://medium.com/media/25445aef170f30bd96d46caaffc39cfe/href">https://medium.com/media/25445aef170f30bd96d46caaffc39cfe/href</a></iframe><p>Understanding RAG — Retrieval Augmented Generation — might seem straightforward to anyone who has spent even a brief amount of time exploring Gen AI applications. Yet, the more I contemplate the concept of RAG, the more I feel I don’t know. Since the surge in popularity of RAG in mid-2023, I’ve often found myself pondering a question: the term “retrieval augmented generation” doesn’t explicitly mention vector embedding, and it seems to broadly refer to using retrieved information to enhance or guide a generative process. So why do almost all RAG tutorials from that time — and many even now — presume an implementation involving vector embeddings, effectively equating RAG with vector embeddings and vector databases?</p><p>Using this blog as an opportunity, I engaged in a thought-provoking discussion with our digital companion, GPT-4-Turbo. Let’s dive into this interactive dialogue where I pose questions (indicated by &gt;) and GPT-4-Turbo responds (indicated by &lt;). Internal thoughts and notes on the conversation are included in block quotes.</p><p>— — — — — — — — — Enter Conversation — — — — — — — — —</p><blockquote>TL;DR? — Skip to the “Reasons for Broader Categorization” section at the end of this part for a concise summary provided by GPT-4-Turbo.</blockquote><p>&gt; When was Retrieval-Augmented Generation proposed?</p><p>&lt; The concept of Retrieval-Augmented Generation (RAG) was proposed in a paper titled “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks” by Patrick Lewis et al., which was published in 2020.</p><blockquote>Interestingly, RAG was proposed even before the wave of ChatGPT, yet it only gained significant attention years later.</blockquote><p>&gt; Does RAG always involve using vector embeddings for retrieval?</p><p>&lt; No, Retrieval-Augmented Generation (RAG) does not always mean using vector embeddings for retrieval. The retrieval component in RAG can be implemented using various techniques, depending on the specific requirements and constraints of the application.</p><p>The original implementation of RAG, as described in the seminal paper, often utilizes a dense vector space for retrieval, where documents and queries are embedded into vectors using models like BERT or other transformer-based architectures. This method, known as dense retrieval, allows for capturing semantic similarities more effectively than traditional keyword-based approaches. However, other retrieval methods can also be used in a RAG framework, including:</p><ol><li>Sparse Retrieval: This method uses traditional information retrieval techniques like TF-IDF or BM25, which rely on keyword matching. Sparse retrieval can be more interpretable and less computationally intensive compared to dense retrieval.</li><li>Hybrid Retrieval: Some implementations combine both dense and sparse retrieval methods to leverage the strengths of both approaches. This can help in improving the overall retrieval performance by capturing both exact keyword matches and semantic similarities.</li><li>Custom Retrieval Mechanisms: Depending on the domain or specific application, custom retrieval mechanisms that are neither purely sparse nor purely dense might be used. These could involve domain-specific heuristics or other specialized techniques.</li></ol><p>Thus, while vector embeddings (dense retrieval) are a common choice for RAG due to their effectiveness in capturing semantic meanings, they are not the only retrieval method that can be used within the RAG framework.</p><p>&gt; Did the original paper suggest that RAG could be implemented without vector embeddings?</p><p>&lt; The original paper on Retrieval-Augmented Generation (RAG) primarily focuses on using dense vector embeddings for the retrieval component. This approach involves encoding both the query and the documents into a dense vector space using transformer-based models, which allows for capturing semantic similarities effectively.</p><p>The paper does not explicitly discuss implementing RAG without using vector embeddings. The emphasis is largely on leveraging the power of neural networks and embeddings to enhance the generative model’s performance by retrieving relevant documents based on semantic content rather than keyword matching.</p><p>However, the concept of RAG is flexible and can theoretically be adapted to use other types of retrieval mechanisms, such as sparse retrieval (e.g., using TF-IDF or BM25), although these are not the focus of the original paper. The key idea behind RAG is the integration of a retrieval step into the generative process, regardless of the specific retrieval technology used.</p><blockquote>Now we get a bit confused. The term RAG is coined by the paper, yet the concept of RAG seems to hint at something even broader and may even exist before the RAG paper?</blockquote><p>&gt; So, was the concept of RAG already in existence before the paper?</p><p>&lt; The concept of integrating retrieval mechanisms with generative models, which is central to Retrieval-Augmented Generation (RAG), has indeed been explored in various forms before the publication of the original RAG paper in 2020. However, the specific formulation and implementation of RAG as described in the paper by Patrick Lewis et al. brought a novel and systematic approach to this idea, particularly for knowledge-intensive NLP tasks.</p><p>Prior to the RAG paper, there were other approaches that combined elements of retrieval and generation, such as using retrieved information to inform or guide a generative process in dialogue systems, question answering, and other applications. These methods often involved retrieving relevant documents or facts and then using them to generate responses or complete tasks.</p><p>What the RAG paper introduced was a more integrated and scalable approach, leveraging recent advances in transformer-based models and neural retrieval methods. This allowed for a more seamless and effective combination of retrieval and generation, directly influencing the generative model’s outputs with the content of the retrieved documents.</p><p>In summary, while the idea of combining retrieval with generation existed in various forms, the RAG framework provided a novel, effective, and specific methodology for implementing this concept using state-of-the-art machine learning techniques.</p><blockquote>It seems we are getting close to the core innovation of RAG. Let’s reveal it further.</blockquote><p>&gt; By “a more integrated and scalable approach”, do you mean that the retriever and generator models can be trained or fine-tuned together as a unified pipeline end-to-end?</p><p>&lt; Yes, exactly. One of the key innovations of the Retrieval-Augmented Generation (RAG) framework is the ability to fine-tune or train both the retriever and the generator models in an end-to-end manner. This integrated training approach allows the retriever and the generator to learn from each other and improve jointly, which enhances the overall effectiveness of the system.</p><p>In traditional setups, the retrieval and generation components are often trained separately. The retriever might be trained to fetch relevant documents based on similarity metrics, and the generator would then work independently to produce outputs based on the retrieved information. However, this disjointed approach can lead to suboptimal performance since the retriever and generator are not optimized to work together.</p><p>The RAG framework addresses this by allowing for joint training:</p><ul><li>Retriever: The retriever in RAG is typically a dense encoder that transforms both the query and the documents into a shared vector space. During training, the retriever learns to bring the embeddings of the query closer to relevant documents, which are determined based on the feedback from the generator’s performance.</li><li>Generator: The generator, often a sequence-to-sequence model, produces outputs based on the context provided by the retrieved documents. Its performance influences how the retriever is trained, as the entire system is optimized to maximize the quality of the final generated text.</li></ul><p>By training these two components together, the system can better align the retrieval process with the generation needs, leading to more relevant retrievals and more coherent and contextually appropriate outputs. This end-to-end training capability is a significant advancement over previous methods and is a central feature of the RAG approach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gIG-FsJhJ5HzQ7yA9Y9nHA.png" /><figcaption>The original RAG paper emphasizes the advantages of end-to-end training that incorporates the retriever model (<a href="https://arxiv.org/abs/2005.11401">source</a>)</figcaption></figure><blockquote>Interestingly, it appears that the concept of RAG as originally proposed — emphasizing the end-to-end fine-tuning of both the retriever and generator — is quite different from the current industry’s interpretation, where the retriever is often seen as a fixed vector embedding model. Let’s delve deeper into this discrepancy to better understand the nuances.</blockquote><p>&gt; However, recent trends in the industry lean towards employing a fixed embedding model for RAG. Does this approach truly adhere to the original principles of RAG, or does it represent a more traditional method that merely combines elements of retrieval and generation?</p><p>&lt; Using a fixed embedding model for the retrieval component in a Retrieval-Augmented Generation (RAG) system represents a variation on the original RAG concept, which emphasizes end-to-end training. This approach, where the embedding model is fixed and not fine-tuned jointly with the generator, can be seen as a hybrid between the fully integrated RAG concept and more traditional methods that separate retrieval and generation.</p><p><strong>Key Differences and Considerations:</strong></p><ol><li>Fixed vs. Trainable Embeddings:</li></ol><ul><li>Fixed Embeddings: Using a fixed embedding model means the embeddings for the documents and queries are precomputed and not updated during the training of the generator. This approach can be advantageous in terms of computational efficiency and simplicity, especially when dealing with very large document corpora where re-training embeddings could be prohibitively expensive.</li><li>Trainable Embeddings: The original RAG concept involves updating the embeddings as part of the training process, allowing the retriever and generator to better adapt to each other. This can lead to more relevant retrievals and better overall performance on the generation tasks.</li></ul><p>2. Alignment with RAG Principles:</p><ul><li>While using fixed embeddings might seem like a step back towards traditional methods, it still aligns with the core RAG principle of using retrieved information to inform and enhance the generation process. The key aspect of RAG — integrating retrieval into the generative model — is maintained.</li><li>The choice between fixed and trainable embeddings can depend on specific use cases, resource availability, and performance requirements. Fixed embeddings can be particularly useful in scenarios where the retrieval needs are relatively stable, or where the computational cost of training embeddings is a concern.</li></ul><p>3. Flexibility and Performance:</p><ul><li>Fixed embeddings might limit the system’s ability to adapt to new types of queries or evolving data. In contrast, trainable embeddings offer more flexibility and potential for higher performance, as they can evolve with the training data and objectives.</li></ul><p><strong>Conclusion:</strong></p><p>Using a fixed embedding model in a RAG setup does honor the fundamental concept of RAG by integrating retrieval with generation. However, it does so with a compromise on the full potential of adaptability and joint optimization that end-to-end trainable systems offer. Whether this approach is sufficient or even preferable depends on the specific requirements and constraints of the application at hand.</p><p>&gt; But “the fundamental concept of RAG by integrating retrieval with generation” is actually also a fundamental concept of information retrieval I guess?</p><p>&lt; Indeed, the fundamental concept of integrating retrieval with generation is not exclusive to Retrieval-Augmented Generation (RAG) and does overlap significantly with broader themes in information retrieval and natural language processing. Historically, the integration of retrieval mechanisms with subsequent processing or generation tasks has been a common approach in various applications, such as question answering systems, dialogue systems, and document summarization.</p><p><strong>Historical Context and Evolution:</strong></p><ol><li>Information Retrieval (IR): Traditional IR focuses on retrieving relevant documents or information from a large dataset based on a user query. The primary goal is to find and return the most relevant information efficiently.</li><li>Early Integrations: Early systems, particularly in question answering and dialogue systems, often used retrieved information as a basis for generating responses. For example, a system might retrieve relevant documents based on a query and then extract or synthesize answers from those documents.</li><li>Advancements in NLP: With advancements in natural language processing, especially with the advent of deep learning and transformer models, the integration of retrieval and generation has become more sophisticated. Systems can now understand and generate human-like text based on the context provided by retrieved information.</li></ol><p><strong>RAG’s Unique Contributions:</strong></p><p>While the integration of retrieval and generation is a broader concept in IR and NLP, RAG introduces specific innovations that distinguish it from traditional approaches:</p><ol><li>End-to-End Training: RAG promotes the idea of training the retrieval and generation components together in an end-to-end manner. This joint training allows the components to better adapt to each other, improving the relevance of the retrieved information and the coherence of the generated text.</li><li>Neural Approaches: RAG leverages modern neural network architectures, particularly transformer-based models, for both retrieval and generation. This allows for handling complex, nuanced queries and generating sophisticated responses.</li><li>Dynamic Interaction: In RAG, the interaction between the retrieved documents and the generation process is dynamic and contextually driven, which is more advanced than static retrieval followed by independent generation.</li></ol><p><strong>Conclusion:</strong></p><p>While the integration of retrieval and generation is a foundational concept in information retrieval, RAG refines and extends this concept by incorporating modern machine learning techniques and promoting a more seamless, dynamic interaction between retrieval and generation. This makes RAG a distinct and innovative approach within the broader landscape of NLP and IR technologies.</p><p>&gt;With this understanding, do you believe that the recent industry trend towards a RAG variant, which employs a static embedding model and no longer adheres to end-to-end training, still aligns with the original concept of RAG? Or should it be more accurately described as fitting within the broader concept of integrating retrieval with generation?</p><p>&lt; Given the discussion and the distinctions made between the original concept of Retrieval-Augmented Generation (RAG) and the variant using a static embedding model without end-to-end training, it seems more accurate to categorize this variant within the general concept of integrating retrieval with generation rather than strictly within the RAG framework as originally proposed.</p><p><strong>Reasons for Broader Categorization:</strong></p><ol><li>End-to-End Training: A defining feature of RAG is the end-to-end training of both the retrieval and generation components. This joint optimization is crucial for allowing the system to adaptively improve based on the interaction between retrieval and generation. A variant that uses static embeddings and does not support this joint training diverges from one of the core innovations of RAG.</li><li>Static vs. Dynamic Components: Using static embeddings means the retrieval component does not dynamically evolve based on the feedback from the generation process. This setup more closely resembles traditional systems where retrieval and generation are more decoupled, even if they are used in conjunction within the same pipeline.</li><li>Flexibility and Adaptation: The original RAG framework is designed to adapt and improve continuously as it is trained on more data and different types of queries. A static model loses this adaptability, which is a significant shift away from the dynamic nature of RAG.</li></ol><p><strong>Appropriate Terminology:</strong></p><ul><li>Within General Concept: The variant fits well within the broader concept of integrating retrieval with generation, a longstanding theme in information retrieval and natural language processing. This broader category encompasses a range of systems that use retrieved information to inform or enhance text generation, regardless of whether the components are trained separately or together.</li><li>Terminology Clarification: It might be more precise to refer to systems using static embeddings and separate training as using “<strong>retrieval-enhanced generation</strong>” or “<strong>retrieval-informed generation</strong>” rather than strictly calling them RAG, to distinguish them from the specific innovations introduced in the original RAG framework.</li></ul><p><strong>Conclusion:</strong></p><p>While the variant still leverages the principle of using retrieval to augment generation, the lack of end-to-end training and the use of static embeddings suggest that it should be considered more as a part of the general concept of integrating retrieval with generation. This distinction helps maintain clarity about what differentiates RAG from other similar approaches and highlights the specific contributions of the RAG framework to the field of natural language processing.</p><p>— — — — — — — — — End Conversation — — — — — — — — —</p><p>The discussion above may carry inherent biases, as language models like GPT-4-Turbo can develop opinions influenced by user interactions. Nevertheless, I present this as a thoughtful reflection on the term “RAG,” which has almost become a buzzword in discussions about Gen AI:</p><ol><li>The term “RAG” as it is currently used in the industry has deviated from its original concept. Following GPT-4-Turbo’s advice, it might be more accurate to refer to our current practices as “REG” (retrieval-enhanced generation) or “RIG” (retrieval-informed generation). Phonetically, “RIG” is more distinct from “RAG”. Alternatively, a broader interpretation of RAG could be “Retrieve And Generate”, inspired by an eponymous <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html">API</a> from AWS Bedrock.</li><li>RAG (or RIG) does not necessarily imply the use of vector embeddings and vector databases. In my view, the original paper favored vector embeddings to facilitate end-to-end training. However, with the industry’s current trend of using fixed embedding models for RAG, we are not confined to this approach. Recent advancements have seen a decoupling of RAG from vector embeddings, exemplified by graph connection-based <a href="https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/">GraphRAG</a> and hybrid approaches like <a href="https://arxiv.org/abs/2404.07220">Blended RAG</a>.</li><li>The concept of RIG extends beyond Gen AI and is a fundamental pattern throughout human civilization. Our educational system, for instance, can be viewed as a RIG process where each generation of learners and educators builds upon the knowledge retrieved from previous generations. This pattern is similarly evident in various fields such as literature, music composition, patent research, culinary arts, and archaeology. By emphasizing the importance of RAG/RIG for Gen AI, we are implicitly highlighting the significance of high-quality information retrieval, rather than specific techniques like vector embeddings.</li><li>As RAG/RIG evolves to meet <a href="https://www.rungalileo.io/blog/mastering-rag-how-to-architect-an-enterprise-rag-system">complex enterprise needs</a>, incorporating techniques like HyDE, query routing, and rerankers, the concept and complexity of these systems begin to mirror traditional enterprise search solutions. Therefore, besides developing a RAG system from scratch, there is an opportunity to leverage existing enterprise search technologies such as <a href="https://learn.microsoft.com/en-us/azure/search/search-what-is-azure-search">Azure AI Search</a>, <a href="https://aws.amazon.com/kendra/">Amazon Kendra</a>, <a href="https://cloud.google.com/enterprise-search">Vertex AI Search</a>, <a href="https://opensearch.org/">OpenSearch</a>, and others. This approach allows Gen AI applications to stand on the shoulders of giants, benefiting from the robust capabilities of established search solutions. Moreover, the development of RAG systems should not be viewed solely as progress within the RAG framework but also as advancements contributing to the broader field of information retrieval.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*1AYAhfqWqDZr1d1X" /><figcaption>Vector Database vs Graph Database for RAG (<a href="https://www.linkedin.com/posts/damienbenveniste_machinelearning-datascience-artificialintelligence-activity-7119708674868051969-5HA1/">source</a>)</figcaption></figure><h3>Vector Embedding — It’s Effective, but at What Cost?</h3><p>My curiosity about the relationship between RAG and vector embeddings, prompting our deep dive into the essence of RAG in the previous section, originates from a topic we explored in <a href="https://medium.com/generative-ai/architecting-gen-ai-systems-1-the-time-dimension-and-model-evolutions-5bdeb789c634">Architecting Gen AI Systems #1: The Time Dimension and Model Evolutions</a>. Specifically, I’ve been intrigued by the challenges associated with evolving vector embedding models over time. The process of updating/backfilling all existing data, previously embedded with an outdated model, to align with a new embedding model often seems daunting. It’s an active research area if forward/backward compatibility could be achieved for embedding models, with studies like <a href="https://arxiv.org/abs/2112.02805">Forward Compatible Training for Large-Scale Embedding Retrieval Systems</a> and <a href="https://arxiv.org/abs/2206.03040">Learning Backward Compatible Embeddings</a> exploring potential solutions. However, the practical application of these advancements in state-of-the-art embedding models and their effectiveness in real-world enterprise scenarios remains to be seen.</p><p>Beyond concerns about model evolution, embedding approaches also raise questions in areas such as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GWk2GDRjtPBXd0FyPbA0WA.png" /><figcaption>Example t-SNE illustration of embedding model (source: <a href="https://cookbook.openai.com/examples/clustering">OpenAI Cookbook</a>)</figcaption></figure><ul><li>Explainability and customizability: While vector embeddings are often visualized in 2D or 3D spaces using techniques like t-SNE to demonstrate clustering based on shared properties, these visualizations can also reveal overlapping clusters. This overlap complicates matters when embeddings fail to retrieve expected data points. In such cases, it’s challenging to diagnose why the failure occurred and even more difficult to adjust the model to address these issues. Any significant modification typically requires developing a new embedding model, leading us back to the cumbersome process of backfilling all previous embeddings.</li><li>Embedding/Storage Overhead: State-of-the-art embedding models, which may have high dimensions such as 768, 1024, or even 4096, can result in substantial data expansion. For instance, a simple text like “Hello world” occupies only 11 bytes as plain text (or even less if tokenized), but its embedding in a 1024-dimensional space using float64 format (8 bytes per dimension) would require 8KB — nearly a thousand times larger. This increase in data size can lead to inefficiencies and bottlenecks in storage, transmission, and processing, especially at scale.</li><li>Loss of information: While small raw data might lead to storage inefficiencies due to the overhead of embedding models, larger raw data can suffer from low information density. This occurs because the process of embedding compresses the original data into a lower-dimensional space, potentially omitting critical details. Balancing the trade-offs between embedding dimensionality (and thus information density) and the associated overhead is a common challenge in designing systems that utilize embeddings.</li></ul><p>This is not to suggest that embeddings are ineffective. On the contrary, their utility in retrieval processes is well-documented across many modern information retrieval systems, including those employing the RAG pattern. However, the key point I wish to emphasize is that embeddings should not be overly glorified as the sole mechanism for information retrieval. While embeddings play a crucial role, the broader information retrieval system encompasses much more complexity, incorporating extensive engineering and scientific considerations.</p><p>Let’s expand this further and resume the comparison we initiated in our last session <a href="https://medium.com/generative-ai/architecting-gen-ai-systems-2-the-expansion-of-model-and-a-study-in-analogy-8e7b7f3005d8">Architecting Gen AI Systems #2: The Expansion of Model and a Study In Analogy</a> — between vector-embedding-based retrieval mechanisms and graph-connection-based retrieval mechanisms, which might be more effective? To answer this, let’s consider the previously discussed limitations of embedding approaches and contrast them with graph-connection-based approaches:</p><ul><li>Model evolutions: In practices such as biological taxonomy and bibliographic classification, graph-connection-based approaches demonstrate resilience over time. A graph structure can easily integrate new categories or species without disrupting the existing framework, showcasing its adaptability to model evolution.</li><li>Explainability and customizability: Graphs offer a visual representation that can intuitively convey complex relationships and hierarchies, making them easier to understand and customize. Adjustments can be made to individual nodes and edges without impacting the broader structure, enhancing both user understanding and system flexibility.</li><li>Embedding/Storage overhead: Unlike systems that require storing high-dimensional vectors for each item, graph-based systems use nodes and edges to represent data. This method is often more space-efficient, especially when depicting complex relationships and interconnected data.</li><li>Loss of Information: Graph-based systems can preserve and utilize the relationships between data points more effectively than traditional embedding approaches, which might abstract away or lose these connections. This capability allows for richer, more context-aware retrieval.</li></ul><p>While graph-connection-based approaches exhibit advantages in these areas, it is not straightforward to declare them the definitive winner. Just as vector embeddings cannot serve as the sole proxy for information retrieval systems, graphs also have their limitations, including scalability issues at large scales and challenges with cold starts. Therefore, an optimal information retrieval system might benefit from a hybrid approach that leverages both graphs and embeddings to overcome the limitations of each method.</p><h3>Is RAG Dead?</h3><p>So far, we’ve explored the essence of RAG, but there’s another equally important question regarding its relevance — do we still need RAG, now that techniques exist to extend LLMs’ context windows potentially to infinity?</p><p>Firstly, as previously discussed, the contemporary interpretation of RAG has diverged from its original concept, which may suggest a waning relevance of the original framework. However, for the purposes of this discussion let’s use “RAG” to broadly denote general information retrieval. Numerous blogs, such as <a href="https://cohere.com/blog/rag-is-here-to-stay">RAG Is Here to Stay: Four Reasons Why Large Context Windows Can’t Replace It</a>, and webinars like <a href="https://youtu.be/zgP6aWRQBb0?si=07I3WKf29pn1AtHd">Is RAG (Really) Dead?</a> argue in favor of RAG’s continued relevance. In this context, I aim to offer an additional perspective to enrich this dialogue, employing our established method of studying through analogy.</p><p>Recall the analogy from our last session, <a href="https://medium.com/generative-ai/architecting-gen-ai-systems-2-the-expansion-of-model-and-a-study-in-analogy-8e7b7f3005d8">Architecting Gen AI Systems #2: The Expansion of Model and a Study In Analogy</a>, where we compared the relationship between context window and RAG in a Gen AI system to the relationship between memory (RAM) and disk in an operating system. By examining their characteristics, we can see the ongoing validity of this analogy:</p><ul><li>Cost and Capacity: Memory (context window) remains significantly more expensive compared to disk (RAG). Additionally, disk offers much larger capacities at lower prices, making it ideal for large-scale storage needs.</li><li>Volatility: RAM is inherently volatile, losing all stored information when power is lost. Similarly, LLM’s context window is transient, holding only the immediate data necessary for current processing tasks. Once the task is complete, the context window is updated or replaced with new data relevant to the next task. In contrast, the data retrieved by RAG can be seen as non-volatile, as the external knowledge base or corpus is persistent and does not lose information after the model’s processing task is completed. This corpus can be continually updated and expanded, much like how data can be written to and read from a disk.</li><li>Performance: For applications requiring high-speed computation and data access, the superior speed of RAM is crucial. Similarly, a pure context window-based solution may offer better end-to-end latency in real-time. However, an overly large context window might also slow down processing.</li></ul><p>This analogy prompts us to consider the proxy question: are disks still necessary if memory becomes sufficiently large? This question echoes a longstanding debate in computing, dating back to the development of early forms of RAM and the evolution of computing architectures in the mid-20th century. A seminal paper discussing the concept of replacing disks with memory is <a href="https://web.stanford.edu/~ouster/cgi-bin/papers/ramcloud.pdf">The Case for RAMClouds: Scalable High-Performance Storage Entirely in DRAM</a>. Although the RAMCloud project <a href="https://datanibbles.medium.com/what-happened-to-stanfords-ramcloud-516542efb15e">met its academic goals and concluded around 2017</a>, the same concerns that drove interest in technologies like RAMCloud are now being addressed by in-memory database technologies such as Redis.</p><p>Despite being an in-memory solution, Redis provides options for data persistence using disk. In practice, Redis is often used alongside disk-based databases, handling real-time data interactions with high throughput and low latency, while disk-based databases manage long-term storage of less frequently accessed data.</p><p>In the ongoing debate about memory versus disk, Redis serves as a practical example of how both can be effectively utilized to meet different application needs, ensuring that systems are both fast and cost-effective. This balanced approach is likely to continue as technologies evolve, with new innovations in memory and storage further influencing their combined use in future computing environments. Similarly, in the debate about context window versus RAG, a balanced approach is likely to prevail.</p><h3>Takeaways</h3><p>As we conclude our exploration of RAG, it becomes clear that although the term has evolved from its original concept, its core — information and knowledge retrieval — remains crucial in the AI landscape. Throughout our discussions, we’ve uncovered both the limitations of vector embeddings and the potential of graph-based approaches, highlighting the enduring importance of retrieval techniques despite advances in LLMs. As innovation continues, there is a valuable opportunity to explore hybrid models that merge the best of both worlds — combining vector embeddings with graph-based approaches and integrating robust retrieval methods with expanded context windows. This approach ensures that information and knowledge retrieval continues to be a dynamic and effective tool in our AI toolkit. May this journey inspire new ideas and perspectives on the evolving role of retrieval in AI.</p><h3>Acknowledgment</h3><p>I extend my gratitude to GPT-4-Turbo for its indispensable assistance in brainstorming and refining the content of this blog. In terms of sheer word count, it may well have contributed more than I have. Collaborating with this digital companion has been instrumental in developing the ideas presented and enhancing the overall quality of our discussions.</p><h3>Disclaimer</h3><p><a href="https://peilunl.medium.com/disclaimer-7f02bf6a7a7a">Disclaimer</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*NyK5py1VUB-LjeFK.png" /></figure><p>This story is published on <a href="https://generativeai.pub/">Generative AI</a>. Connect with us on <a href="https://www.linkedin.com/company/generative-ai-publication">LinkedIn</a> and follow <a href="https://www.zeniteq.com/">Zeniteq</a> to stay in the loop with the latest AI stories.</p><p>Subscribe to our <a href="https://www.generativeaipub.com/">newsletter</a> to stay updated with the latest news and updates on generative AI. Let’s shape the future of AI together!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*5ySHj0qVb8POSrJ_.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba23d0de1049" width="1" height="1" alt=""><hr><p><a href="https://generativeai.pub/architecting-gen-ai-systems-3-rethinking-rag-and-vector-embeddings-ba23d0de1049">Architecting Gen AI Systems #3: Rethinking RAG and Vector Embeddings</a> was originally published in <a href="https://generativeai.pub/">Generative AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Architecting Gen AI Systems #2: The Expansion of Model and a Study In Analogy]]></title>
            <link>https://generativeai.pub/architecting-gen-ai-systems-2-the-expansion-of-model-and-a-study-in-analogy-8e7b7f3005d8?source=rss-efe81354a52c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e7b7f3005d8</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[large-language-models]]></category>
            <dc:creator><![CDATA[Peilun Li]]></dc:creator>
            <pubDate>Sat, 20 Apr 2024 23:37:21 GMT</pubDate>
            <atom:updated>2024-05-03T05:39:06.128Z</atom:updated>
            <content:encoded><![CDATA[<h4>Mission Towards Abstraction and Democratization</h4><p>In our last session <a href="https://peilunl.medium.com/architecting-gen-ai-systems-1-the-time-dimension-and-model-evolutions-5bdeb789c634">Architecting Gen AI Systems #1: The Time Dimension and Model Evolutions</a>, we delved into the dynamic landscape of model evolution, examining its profound implications on the philosophy of crafting Gen AI applications and architecting Gen AI systems. We concluded with an open question: How could potential abstractions and analogies guide our understanding of General AI systems as we progress through the time dimension? As we embark on the second installment of our exploration, we will delve deeper into this intriguing question, unraveling the layers of abstraction and drawing parallels that may help illuminate our path forward in the realm of Gen AI system design.</p><h3>The Expansion of Machine Learning Model</h3><p>My foray into the Machine Learning (ML) universe commenced approximately a decade ago, fueled by sheer enthusiasm. This passion eventually crystallized into a professional trajectory as a Machine Learning Engineer (MLE) — a vocation that was just beginning to emerge as a distinct role within the tech sector. Retrospectively, my career’s inception dovetailed with the formal establishment of the MLE designation. Throughout the years, I’ve witnessed the MLE role undergo a significant evolution, transcending its origins as a specialized subset of software engineering and data/applied science to become an indispensable, cross-disciplinary nexus that orchestrates the integration of ML research with pragmatic production engineering. The Gen AI revolution has sparked yet another metamorphosis in the field of ML engineering, this time targeting the foundational element of our craft — the Machine Learning model itself.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2FeebtD%2F1%2F&amp;display_name=Datawrapper&amp;url=https%3A%2F%2Fdatawrapper.dwcdn.net%2FeebtD%2F1%2F&amp;image=https%3A%2F%2Fdatawrapper.dwcdn.net%2FeebtD%2Fplain-s.png%3Fv%3D1&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=dwcdn" width="600" height="396" frameborder="0" scrolling="no"><a href="https://medium.com/media/b30a0a463f4834ef1d53d2af1cc616a7/href">https://medium.com/media/b30a0a463f4834ef1d53d2af1cc616a7/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fZUE0VWcaTjuZbbZsLiWNA.png" /><figcaption>Machine learning engineering covers the complex surrounding infrastructure around ML code (and model). Source: <a href="https://proceedings.neurips.cc/paper_files/paper/2015/file/86df7dcfd896fcaf2674f757a2463eba-Paper.pdf">Hidden Technical Debt in Machine Learning Systems</a></figcaption></figure><p>Prior to the Gen AI paradigm shift, traditional ML engineering, as characterized by <a href="https://proceedings.neurips.cc/paper_files/paper/2015/file/86df7dcfd896fcaf2674f757a2463eba-Paper.pdf">Hidden Technical Debt in Machine Learning Systems</a>, involves tackling the complex surrounding infrastructure that supports the comparatively modest ML codebase and model architecture. The same idea is also often represented as a cyclic process termed “ML development lifecycle”, which can be segmented into:</p><ul><li>An inner loop of data &amp; model exploration</li><li>A middle loop dedicated to the iterative refinement of candidate models, and</li><li>An outer loop focused on the deployment, scaling, and monitoring of models in production environments.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pO4erN-LHMMp0023MWZWlw.png" /><figcaption>Machine learning development lifecycle in the form of inner, middle, and outer loop. Source: <a href="https://www.zillow.com/tech/serving-machine-learning-models-efficiently-at-scale-at-zillow/">Serving Machine Learning Models Efficiently at Scale at Zillow</a></figcaption></figure><p>While the Gen AI era upholds these foundational processes, it concurrently heralds an expansion of the modeling concepts. Historically, model development was a science-driven process, where the construction of the model artifact was achieved through data curation and algorithmic training. Upon the creation of the model artifact packaged with inference logic, the ML development lifecycle transitioned into an engineering-centric phase, emphasizing the integration and deployment of the model into production systems.</p><p>However, Gen AI introduces a novel modeling landscape that demands a hybridized approach, blending engineering precision with scientific excellence. This paradigm shift also calls for a heightened level of scientific scrutiny throughout the later phases of product integration and deployment. At the heart of this transformation is an array of new components that are redefining the realms of ML engineering and science disciplines:</p><ul><li>Foundation Model Customization (PEFT, LoRA, etc.)</li><li>Foundation Model Hosting (continuous batching, speculative decoding, quantization, Multi-LoRA, etc.)</li><li>Evaluation &amp; Guardrail (model-graded eval, ethical AI, etc.)</li><li>Prompt Engineering</li><li>Knowledge Retrieval (RAG, etc.)</li><li>Tools Usage</li><li>Agent Orchestration</li><li>…</li></ul><p>These emerging modeling concepts represent a thrilling yet formidable frontier. It stretches the traditional confines of the Machine Learning Engineer (MLE) and Scientist roles, propelling both disciplines toward an expansion of their technical and conceptual purviews. Such an expansion is not only widening the professional landscape but also necessitates the abstraction and (hence) democratization of these emerging modeling concepts — making them more accessible and intuitive aligns with one of the core objectives of our Gen AI systems. Our aim is to reduce the barriers to entry, akin to how traditional ML frameworks through the lineage of Caffe, TensorFlow, PyTorch, and Hugging Face have revolutionized access to conventional modeling techniques, empowering a broader spectrum of developers and researchers to contribute and drive innovation in the field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ZTzN21XKbfQta9FVF7xdA.png" /><figcaption>Illustration: how Emerging Gen AI Modeling Concepts impact the way we work</figcaption></figure><blockquote>The intersection of engineering precision and scientific inquiry required to master these emerging modeling concepts has ignited intense debates within the tech community. At the heart of these discussions is the question of whether an engineering-centric approach or a science-led methodology should be the primary driver of Gen AI’s evolution. This debate is not without precedent; it echoes the historical discourse that has accompanied major technological shifts since the Industrial Revolution. We’ll delve deeper into this discourse separately in future discussions, as it is a topic that merits its own dedicated analysis.</blockquote><p>This concept of expanding modeling paradigms is echoed by <a href="https://bair.berkeley.edu/blog/2024/02/18/compound-ai-systems/">The Shift from Models to Compound AI Systems</a>. It delineates the transition from “Model”, which represents traditional modeling concepts, to “Compound AI Systems”, which are indicative of the emerging Gen AI modeling concepts. At this juncture, it’s opportune to crystallize the terminologies we’ve been employing, albeit without formal definitions until now:</p><ul><li>(Core) Model: This refers to the actual model weights — the numerical parameters that have been trained to recognize patterns — and the fundamental inference logic that drives predictions. An example of this would be the plethora of models available on the Hugging Face Model Hub.</li><li>Gen AI App: This encompasses the core model along with all the emerging Gen AI modeling concepts. The Gen AI App is synonymous with the “Compound AI Systems” concept proposed in <a href="https://bair.berkeley.edu/blog/2024/02/18/compound-ai-systems/">The Shift from Models to Compound AI Systems</a>. However, in this series, we opt to eschew the term “System” to avoid confusion with the subsequent “Gen AI System” concept.</li><li>Gen AI System: This refers to the supportive infrastructure and frameworks that enable the development and deployment of Gen AI Apps. Gen AI system is the bedrock upon which Gen AI Apps are constructed and operationalized. The Gen AI System’s relationship to Gen AI Apps is akin to the relationship between an Operating System (OS) and the applications that operate on it. Although our interaction is often with the applications themselves, the indispensable role of the OS, which functions unobtrusively in the background, is undeniable.</li></ul><p>Having established the key terminologies, we present a diagram that illustrates our initial effort to clarify the interplay between modeling concepts, the ML Dev lifecycle, and the paradigm of Gen AI App. It’s important to observe the extent to which the emerging modeling concepts are exposed directly up through the outer loop. Without adequate abstraction and democratization, there would be a need for ongoing scientific oversight to ensure continuous production support — this requirement for persistent scrutiny could prove to be a bottleneck, potentially hindering scalability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CTiF6foNv0prSLkRIQSdZA.png" /><figcaption>Illustration: the relationship between modeling concepts, ML Dev Lifecycle, and the paradigm of Gen AI App</figcaption></figure><h3>The Analogy of Systems and Their Abstractions</h3><p>Recognizing the importance of abstraction and democratization, we naturally turn our attention to how these objectives can be better realized within the Gen AI System. We’ve previously hinted at the analogy between the Gen AI System and the computer Operating System (OS), but a deeper exploration reveals that the broader architecture of computer systems offers valuable insights into our path forward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rITQ-nm8i4EBfuOU" /><figcaption>LLM OS (Source: <a href="https://youtu.be/zjkBMFhNj_g?t=2545">Intro to Large Language Models</a>)</figcaption></figure><p>The comparison of the Gen AI System to a Computer Operating System is not a novel concept; it has been explored in works like <a href="https://youtu.be/zjkBMFhNj_g?t=2545">Intro to Large Language Models</a> and <a href="https://arxiv.org/abs/2312.03815">LLM as OS, Agents as Apps: Envisioning AIOS, Agents and the AIOS-Agent Ecosystem</a>. To summarize the key parallels drawn between a Computer OS and the Gen AI System:</p><ul><li>CPU: Analogous to LLMs</li><li>Memory: Equated with the context window of LLMs</li><li>Disk: Represented by retrievable offline knowledge</li><li>Network: Corresponds to real-time/online knowledge and interaction with other Gen AI Apps</li><li>Additional analogies: Include peripheral devices as multi-modal interfaces, libraries as tools/plugins, and so on.</li></ul><p>Rather than reiterating these analogies, let’s consider them within the dynamic context of time and space:</p><ul><li>Time dimension: The technical specifications of computer hardware evolve over time.</li><li>Space dimension: At any given moment, different computers possess various hardware configurations.</li></ul><p>A computer OS is not a monolithic entity; it is deployed across a multitude of computers with diverse and evolving hardware setups. A hallmark of an exceptional computer OS is its ability to offer a user-friendly and consistent interface that supports users and applications, irrespective of the underlying hardware differences. This is the essence of abstraction and democratization and we aim to emulate.</p><p>By revisiting the historical development and internal mechanisms of computer OS, we can glean valuable lessons on how it has successfully provided such an interface. This retrospective journey could illuminate strategies for achieving similar outcomes in the context of the Gen AI System, ensuring that it too can adapt and serve a wide range of evolving requirements.</p><h4>Abstraction of CPU — Prompt Engineering</h4><p>Tracing the evolution of programming languages, which serve as the foundation for both running programs on operating systems and developing the operating systems themselves, could provide valuable insights into how CPU abstraction has progressed over time.</p><p>A brief exploration into the <a href="https://en.wikipedia.org/wiki/Programming_language#History">history of programming languages</a> uncovers a progression through at least three generations:</p><ol><li>First-generation: Machine language, consisting of binary code, is the most fundamental form of programming, directly executed by the CPU.</li><li>Second-generation: Assembly language introduces a layer of abstraction above machine language. An “assembler” translates assembly code into machine language, enhancing readability while still being machine-specific — requiring programs to be rewritten for each unique machine architecture.</li><li>Third-generation: The advent of high-level programming languages, such as C, C++, and Java, marked a significant leap forward. These languages abstract away hardware specifics, allowing programs to be written once and then compiled or interpreted into machine language for various hardware configurations.</li></ol><p>Reflecting on this historical context, we can draw parallels to the current evolution of prompt engineering in the realm of LLMs:</p><ol><li>First-generation Machine Language: This stage is analogous to the tokenization process in LLMs, where human language is converted into numerical tokens that the model can interpret.</li><li>Second-generation Assembly Language: typical prompt engineering we experience nowadays often resembles this stage. While prompts are more readable and user-friendly, they tend to be highly specific to a particular LLM version and require re-tuning for each new iteration of the model.</li><li>Third-generation High-Level Programming: We stand on the cusp of a transformative era. Initiatives like <a href="https://github.com/stanfordnlp/dspy">DSPy</a> represent an initial foray into this domain, introducing a “compiler” concept that translates the same high-level instructions into different prompts tailored for specific LLMs. However, a more advanced future beckons — one where enhanced compiler logic and the ability to support more complex applications will further revolutionize our interaction with LLMs.</li></ol><h4>Abstraction of Memory — Context Management</h4><p>Entering the realm of memory, let’s explore the internal mechanisms and some of the key responsibilities that an operating system, aided by the CPU and programming languages, manages in terms of memory:</p><ol><li>Memory Allocation: Operating systems ensure that applications are allocated the memory they request without exceeding this limit.</li><li>Address Translation: Operating systems provide an abstraction layer that allows each process to believe it is using a contiguous block of addresses starting at zero, regardless of the actual physical memory location, which may be scattered due to paging and fragmentation.</li><li>Virtual Memory: Operating systems enable handling of workloads that surpass physical memory capacity by using disk space as an extension. This system also prioritizes which data should remain in fast, physical memory and which can be relegated to slower disk storage, optimizing the use of limited and expensive RAM.</li><li>Garbage Collection: Operating systems, aided by programming languages, reclaim memory that is no longer being used by programs.</li></ol><p>When we apply these principles to Gen AI, we often witness attempts to expand LLMs’ “physical” context windows, which is comparable to increasing memory capacity. Yet, the efficient utilization of the existing memory is just as crucial. Here’s how these concepts might translate in the context of LLMs:</p><ol><li>Memory allocation: At the LLM request level, each request typically has access to the entire context window, with errors occurring if the limit is exceeded. However, when we consider the allocation of context space within each request — for basic instructions, few-shot examples, retrieved knowledge, and conversation history — there is still much to learn about optimizing this delicate balance.</li><li>Address Translation: One way to interpret this dimension is, in LLMs, the data we believe is placed in the model’s context window may not be what the model actually processes. There’s potential in optimizing this translation and abstraction. For instance, <a href="https://arxiv.org/abs/2401.03462">Soaring from 4K to 400K: Extending LLM’s Context with Activation Beacon</a> demonstrates how compacting information allows a model to perceive a longer context without changing the physical context window size.</li><li>Virtual Memory: This concept is akin to knowledge retrieval systems like RAG in LLMs but extends further. While knowledge retrieval focuses more on what data to bring into memory initially, a complete virtual memory cycle also involves deciding what data to swap out as the conversation progresses and memory usage increases. Examples include <a href="https://python.langchain.com/docs/modules/memory/types/vectorstore_retriever_memory/">retrievable memory using vector stores</a> and <a href="https://python.langchain.com/docs/modules/memory/types/kg/">knowledge graphs</a>.</li><li>Garbage Collection: This is related to the “swap out” concept in virtual memory, but focuses on permanently removing information that will no longer be used. In LLMs, this could involve <a href="https://python.langchain.com/docs/modules/memory/types/summary/">summarizing conversation memory</a> to condense the conversation and retain only the essential information.</li></ol><p>It is encouraging to observe that numerous memory management techniques have found their parallels in the development of Gen AI. Meanwhile, there is an equivalent wealth of opportunity for further advancements across all these categories. Furthermore, if a Gen AI System could integrate these techniques cohesively and offer a comprehensive memory interface to LLM application developers, it would mirror the way an operating system abstracts memory complexities. Such a system would not only streamline the development process but also unlock new possibilities for innovation, enabling developers to focus on creating more complex and intelligent applications without being encumbered by the intricacies of memory management.</p><h4>Abstraction of Disk — Knowledge Retrieval</h4><p>Concluding our exploration of system analogies, let’s turn our attention to the disk. In an operating system, disk management is typically handled through a file system. There are various file systems, such as NTFS, FAT32, and exFAT, and operating systems often support multiple types to ensure compatibility with different storage devices and user requirements.</p><p>The fundamental components of a file system concerning data storage are:</p><ul><li>Data Blocks: These are the fundamental units of storage that hold the actual file data. Files are typically broken down into chunks and stored across one or more of these blocks. The size of a block is defined by the file system and can influence performance and storage efficiency.</li><li>Metadata Structure: This refers to the data structures that represent the properties and attributes of files and directories. Metadata includes information such as file size, creation and modification timestamps, permissions, and reference pointers to the data blocks where the file’s content is stored — these pointers are essential for the file system to locate and assemble the file’s content when it is accessed.</li></ul><p>Additionally, file systems employ various file allocation algorithms to manage data block allocation and file layout on the storage medium, influencing performance, reliability, and efficiency.</p><p>Reflecting on the LLM domain of knowledge retrieval, we can draw parallels to these file system components. Here are two perspectives:</p><ol><li>Vector Embedding-based Knowledge Retrieval: Analogous to files in a file system, pieces of knowledge are segmented into chunks (data blocks) constrained by the context length of the embedding model. The “physical disk location” of each chunk is determined by the embedding model based on the chunk’s content. To retrieve specific knowledge, we use algorithms like nearest neighbor searches, focusing on the content’s “physical location” rather than metadata structures.</li><li>Graph Connection-based Knowledge Retrieval: Similar to directories in a file system that represent knowledge domains with many files, this approach uses metadata structures with pointers to relevant files. Retrieval involves navigating through the graph structure, with the actual “physical disk location” of each file’s data blocks being irrelevant to the application.</li></ol><blockquote>Opinions may vary on which approach is more effective, and there are ongoing debates about the necessity of knowledge retrieval (disk) if we could have sufficiently large context windows (memory). These discussions are worth further exploration, which we will reserve for the next blog post in this series.</blockquote><p>In modern operating systems, when we search for files or content, we are unconcerned with the internal mechanisms of the file system or the specifics of the search algorithm — we trust the operating system to handle these details. Similarly, an ideal Gen AI System should provide a user experience that abstracts away the low-level concerns, allowing end users and application developers to focus on the retrieval of desired information without delving into the intricacies of embedding models, chunk sizes, chunk overlap, retrieval algorithms, and so forth.</p><p>OpenAI’s <a href="https://openai.com/blog/new-models-and-developer-products-announced-at-devday">GPTs and Assistants API</a> are examples that embody this concept by offering a file-based interface that abstracts the complexities of indexing and retrieval. While these APIs mark significant progress, there remains ample opportunity for enhancement, particularly in retrieval performance for complex applications. Additionally, the ongoing discussions around open-source versus closed-source solutions add another layer to the conversation about the future of knowledge retrieval systems.</p><p>Ultimately, the goal is to create a Gen AI System that simplifies knowledge retrieval in a way that is as transparent and efficient as using a file system in a traditional operating system. By doing so, we can empower developers to build more advanced and intelligent applications, leveraging a vast repository of knowledge without being hindered by the underlying technical challenges. As we continue to refine these systems, we can anticipate a future where the interaction with vast knowledge bases is as seamless and intuitive as interacting with the files and folders on our personal computers.</p><h3>Takeaways</h3><p>I hope that the discussions presented in this blog post will act as a catalyst, sparking innovative ideas and reflections on how we can collaboratively construct a Gen AI System that embodies the principles of abstraction and democratization. While I have endeavored to draw comprehensive system analogies, it’s important to recognize that these only scratch the surface of the rich history and evolution of modern computing. There is a vast expanse of knowledge to explore and draw inspiration from, such as the ways in which application development has transformed both before and after the advent of operating systems. I trust that your ingenuity will lead to even greater insights and breakthroughs.</p><p>With this, we conclude our current exploration, but the journey is far from over. I look forward to continuing our adventure as we delve deeper into the intricacies of knowledge retrieval. Until then, may your curiosity and creativity guide you to new horizons.</p><h3>Acknowledgment</h3><p>I extend my heartfelt gratitude to GPT-4-Turbo for its invaluable assistance in crafting this blog post. Its contributions went far beyond mere proofreading and polishing — though you might have noticed its penchant for words like “delve” and “intricacies.” More significantly, GPT-4-Turbo played a pivotal role in brainstorming the development and drawing parallels between computer systems and Gen AI. This collaboration has been instrumental in shaping the insights and narratives shared here, and for that, I am truly appreciative.</p><blockquote><em>This above paragraph is also polished by GPT 4 Turbo :)</em></blockquote><h3>Disclaimer</h3><p><a href="https://peilunl.medium.com/disclaimer-7f02bf6a7a7a">Disclaimer</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*TCSTZAgW1N1Qb3Jp.png" /></figure><p>This story is published under <a href="https://generativeai.pub/">Generative AI Publication</a>.</p><p>Connect with us on <a href="https://www.generativeaipub.com/">Substack</a>, <a href="https://www.linkedin.com/company/generative-ai-publication">LinkedIn</a>, and <a href="https://www.zeniteq.com/">Zeniteq</a> to stay in the loop with the latest AI stories. Let’s shape the future of AI together!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*-oZc6RfxkFgU566Z.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e7b7f3005d8" width="1" height="1" alt=""><hr><p><a href="https://generativeai.pub/architecting-gen-ai-systems-2-the-expansion-of-model-and-a-study-in-analogy-8e7b7f3005d8">Architecting Gen AI Systems #2: The Expansion of Model and a Study In Analogy</a> was originally published in <a href="https://generativeai.pub/">Generative AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Architecting Gen AI Systems #1: The Time Dimension and Model Evolutions]]></title>
            <link>https://generativeai.pub/architecting-gen-ai-systems-1-the-time-dimension-and-model-evolutions-5bdeb789c634?source=rss-efe81354a52c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bdeb789c634</guid>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[large-language-models]]></category>
            <dc:creator><![CDATA[Peilun Li]]></dc:creator>
            <pubDate>Fri, 29 Mar 2024 06:26:14 GMT</pubDate>
            <atom:updated>2024-04-01T08:23:01.989Z</atom:updated>
            <content:encoded><![CDATA[<h4>Designing for Tomorrow: Contemplating the Rapid Evolution of AI Landscapes</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FTXBd2znXyMg2zZz" /><figcaption>Illustrated by DALL·E 3: Architecting Gen AI Systems — The Time Dimension and Model Evolutions</figcaption></figure><h3>Preface</h3><p>Welcome to “Architecting Gen AI Systems,” a blog series where we embark on a thought-provoking journey into the design and strategy behind the Artificial Intelligence systems of the future. This collection of writings is intended to serve as a beacon for those navigating the complex seas of Gen AI Systems architecture, offering insights and perspectives that I hope will resonate with engineers, architects, and tech enthusiasts alike.</p><p>My goal in authoring this series is to present a tapestry of high-level concepts and considerations that might be essential for anyone involved in the creation of next-generation AI Systems. We will explore the philosophical underpinnings, the strategic frameworks, and the visionary approaches that are shaping the way we think about and build intelligent systems.</p><p>The world of AI is expanding, and with it, the role of the architect is evolving. We find ourselves at a unique inflection point where the decisions we make today will ripple through the fabric of tomorrow’s digital landscape. It is a time of great responsibility and even greater opportunity. It is imperative that we approach these challenges with a blend of rigor, creativity, and foresight. Through this series, I aim to share the lessons I’ve learned and the ideas that have inspired me, with the hope that they will spark further innovation and reflection in the field. This series is not a prescriptive guide but rather a collection of thought pieces meant to inspire and challenge, to imagine the possibilities that lie on the horizon.</p><p>As the industry shifts and new paradigms emerge, so too will the content of this series. This blog series is not a static repository of knowledge but a living chronicle of my journey through the landscape of (Gen) AI system design. As the industry continues to transform and new technologies emerge, the content here will adapt, capturing the essence of these shifts and offering a forward-looking perspective.</p><p>I invite you to join me on this exploration of what it means to architect (Gen) AI systems that are not only intelligent but also adaptable, sustainable, and aligned with the values we hold dear. While this platform may not be a forum for direct conversation, I encourage you to reflect on the ideas presented, to challenge them, and to carry these discussions into your own circles.</p><p>Together, through this blog series, we will delve into the architecture of Gen AI systems, contemplating the future of technology with each step. Whether you’re here to gain new insights or to question established paradigms; whether you are an experienced architect, an aspiring designer, a Machine Learning engineer, or simply an enthusiast of AI technology, your engagement can be a valuable part of the journey. Welcome aboard and let’s begin.</p><h3>The Time Dimension</h3><p>The time dimension is not only a topic of Physics and Philosophy but also one of the key considerations and principles in architecting complex systems. In its essence, it calls for a forward-thinking mindset, demanding that the systems built should be scalable and adaptable <strong>as situations permit</strong>, ready to accommodate and leverage the inevitable advancements of the future. This principle is not confined to the domain of computer software and hardware; it is a universal thread woven through the fabric of system design across the entire spectrum of human civilization. Here are some illustrative examples:</p><ul><li>Urban Development and Civil Systems: Cities must be planned with an eye toward future growth, changes in demographics, and potential natural disasters, requiring resilient and adaptable infrastructure.</li><li>Transportation Systems: Urban planners and engineers must consider future population growth, technological advancements (like autonomous vehicles), and changes in transportation habits when designing roads, public transit, and other infrastructure.</li><li>Educational Systems: The evolution of learning tools, pedagogical methods, and technology means that educational infrastructure must be flexible enough to incorporate new ways of learning and a changing job market.</li><li>Space Systems: When designing spacecraft or space missions, engineers must account for the long durations and harsh conditions of space travel, as well as the potential for future missions to build upon current technology.</li></ul><p>While the examples are endless, this blog will hone in on Gen AI systems, as indicated by the title. When contemplating the architecture of Gen AI systems, what future advancements should we anticipate? Mirroring the duality of computer systems, we can categorize these considerations into two distinct yet interconnected realms: hardware and software.</p><h4>Hardware Evolutions</h4><p>More powerful GPUs and next-generation computing will continue evolving, possibly following Moore’s Law or <a href="https://en.wikipedia.org/wiki/Huang%27s_law">Huang’s Law</a> — the performance of GPUs will more than double every two years. Assuming these laws hold, compare the computing power of the iPhone 15 Pro’s Apple A17 Pro (<a href="https://www.cpu-monkey.com/en/igpu-apple_a17_pro_6_gpu_cores">4.29 TFLOPS for FP16</a>) and NVIDIA A100 (<a href="https://www.nvidia.com/content/dam/en-zz/Solutions/Data-Center/a100/pdf/nvidia-a100-datasheet-us-nvidia-1758950-r4-web.pdf">312 TFLOPS for the FP16 Tensor Core</a>). In roughly log2(312/4.29) * 2 = 12 years, and potentially even sooner considering software evolutions, it might no longer be a distant fantasy to run some of the most powerful Gen AI models efficiently on our local edge devices.</p><p>Yet, this projection might be on the optimistic side. The true challenge in serving LLMs often isn’t the raw power of compute cores but the speed at which data can be shuttled between memory and those cores — a critical factor known as “memory/interconnect bandwidth.” For those keen on exploring the nuances, <a href="https://kipp.ly/transformer-inference-arithmetic/">Transformer Inference Arithmetic</a> provides a comprehensive examination of the interplay between FLOPS and memory constraints within the transformer architecture, which underpins all contemporary LLMs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/0*xt9OeiunEFbnody8.png" /><figcaption>When batch size is small (which is the typical case in LLM Serving), LLM inference is usually bounded by memory bandwidth rather than compute FLOPS (source: <a href="https://kipp.ly/transformer-inference-arithmetic/">Transformer Inference Arithmetic</a>)</figcaption></figure><p>The paper <a href="https://arxiv.org/abs/2403.14123">AI and Memory Wall</a> further revives the idea of “Memory Wall” —</p><blockquote>“The first hardware-related issue is memory bandwidth: the benchmarks suggest that it is not keeping up with CPU speed … If memory bandwidth does not improve dramatically in future machines, some classes of applications may be limited by memory performance.”</blockquote><p>This observation largely still holds after 30 years, but this time for GPU.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZYJ65J1NK_d7ZQRmWfG1Yg.png" /><figcaption>The scaling of bandwidth grows much slower than that of compute FLOPS (source: <a href="https://arxiv.org/abs/2403.14123">AI and Memory Wall</a>)</figcaption></figure><p>If using an estimate of (1.5x/2yrs) growth of bandwidth, comparing the bandwidth of iPhone 15 Pro’s Apple A17 Pro (<a href="https://www.cpu-monkey.com/en/cpu-apple_a17_pro">51.2 GB/s</a>) and NVIDIA A100 (<a href="https://www.nvidia.com/content/dam/en-zz/Solutions/Data-Center/a100/pdf/nvidia-a100-datasheet-us-nvidia-1758950-r4-web.pdf">2TB/s</a>), the time we may have to wait for efficient edge Gen AI deployments may become math.log(2TB/51.2GB, 1.5) * 2 = 18 years.</p><p>Fortunately, this timeframe is within reach. Consider this: it has been 18 years since the debut of the first MacBook Pro in 2006 — a mere blink in the grand tapestry of technological progress — and today, in 2024, we find ourselves in an era where many are equipped with MacBooks powered by Apple’s own cutting-edge silicon. This reflection on the rapid evolution of technology underscores the exciting potential for similarly swift advancements in the realm of Gen AI systems.</p><h4>Software Evolutions</h4><p>The suite of tools we employ in the construction of Gen AI systems and applications is in a state of perpetual evolution. Yet, it is the relentless advancement of Gen AI models that spearheads this march of progress — each new iteration unlocks a trove of untapped potential and possibilities, paving the way for innovations we have yet to imagine.</p><p>The last sixteen months have arguably been the most tumultuous and transformative in the realm of AI that we’ve seen in decades. The market has been flooded with a deluge of new LLMs, each day bringing its own batch of innovations. The metaphorical LLM Evolutionary Tree is not just growing; it’s proliferating at a pace that outstrips any biological counterpart in the natural world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/0*Il6gOrNJRwtntmZ2" /><figcaption>LLM Evolutionary Tree till mid-2023 (source: <a href="https://github.com/Mooler0410/LLMsPracticalGuide">Harnessing the Power of LLMs in Practice: A Survey on ChatGPT and Beyond</a>)</figcaption></figure><p>As we enter 2024, the frenetic pace of AI development has moderated somewhat, as evidenced by the analysis in <a href="https://huyenchip.com/2024/03/14/ai-oss.html">What I learned from looking at 900 most popular open source AI tools</a>. Yet, the industry continues to evolve at a speed unprecedented before the advent of GPT. High-profile missteps, such as <a href="https://www.forbes.com/sites/mollybohannon/2023/06/08/lawyer-used-chatgpt-in-court-and-cited-fake-cases-a-judge-is-considering-sanctions/?sh=5a667f437c7f">a lawyer citing fictitious cases generated by ChatGPT</a>, <a href="https://arstechnica.com/tech-policy/2024/02/air-canada-must-honor-refund-policy-invented-by-airlines-chatbot/">Air Canada’s chatbot creating non-existent refund policies</a>, and the <a href="https://stratechery.com/2024/gemini-and-googles-culture/">mishap with Google’s Gemini</a>, have prompted a paradigm shift. Companies are transitioning from a “build it fast” mentality to a “build it right” philosophy. This period of introspection underscores the critical importance of sound architecture in Gen AI systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-3vIPaAI3PD9Es_P.png" /><figcaption>Count of Gen AI-related repos with &gt;500 stars on GitHub (source: <a href="https://huyenchip.com/2024/03/14/ai-oss.html">What I learned from looking at 900 most popular open source AI tools</a>)</figcaption></figure><p>Predicting the future may be a challenge, yet one certainty prevails: the evolution of Gen AI models and their accompanying tools is inexorable. It is essential to delve into the dynamics of this evolution, as it holds the power to fundamentally reshape our approach to the conceptualization and architecture of Gen AI systems.</p><h3>Model Evolutions</h3><p>A glance at the authoritative <a href="https://huggingface.co/spaces/lmsys/chatbot-arena-leaderboard">LMSYS Chatbot Arena Leaderboard</a>, a crowdsourced benchmark for LLM “intelligence”, reveals the astonishing velocity of model evolution in the past year. Consider the meteoric rise and fall of Vicuna-13B: a model that held a <a href="https://lmsys.org/blog/2023-05-25-leaderboard/">top-five position</a> in May 2023, only to plummet from the <a href="https://lmsys.org/blog/2023-12-07-leaderboard/">top twenty</a> just seven months later. This rapid turnover is a testament to the relentless pace of innovation in the field of Gen AI.</p><p>The introduction of new, powerful models heralds progress, but the other side of the coin reveals a less noticed, or at least less discussed, issue: the <strong>rapid deprecation</strong> of their once state-of-the-art predecessors. For example, OpenAI <a href="https://platform.openai.com/docs/deprecations">announced</a> that the gpt-3.5-turbo-0613 model (released in Jun 2023) would be deprecated merely five months post-launch, with a scheduled shutdown on its one-year anniversary. The term “shutdown” in this context means the model will be completely decommissioned; post-shutdown, it will be unavailable for external queries or integration, effectively cutting off all access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*juP-f3LeWHrJP7kQxgvApQ.png" /><figcaption>The deprecation and shutdown of gpt-3.5-turbo-0613 (<a href="https://platform.openai.com/docs/deprecations">source</a>)</figcaption></figure><p>When compared to standard software deprecation practices, this timeline for phasing out models appears markedly accelerated. For context, Python language versions are typically supported for <a href="https://endoflife.date/python">five years</a> after their release, and even Kubernetes, known for its brisk update cycle, offers a <a href="https://endoflife.date/kubernetes">14-month</a> support window for each version. Moreover, it’s common for software to lack a definitive “shutdown” date, allowing users to run unsupported versions at their discretion and assume the associated risks. This stark contrast highlights the unique pressures and rapid cycles of innovation characteristic of the Gen AI landscape.</p><p>This isn’t to suggest that such an aggressive deprecation strategy hasn’t been carefully considered. Quite the contrary, it is only after thorough deliberation and compelling reasons that a deprecation plan is crafted to be this assertive. Let’s delve into the considerations behind this approach.</p><h4>The Unit Economics of LLM Model Serving</h4><p>We all might be curious at some point — how can the cost of querying LLMs be kept relatively low, while hosting these models requires some of the most expensive and scarce GPUs on the planet? What are the unit economics behind LLM model serving?</p><p>The crucial factor in this economic equation is time-sharing. Each LLM request is processed by the GPU in a batch mode, simultaneously with numerous other requests directed at the same model, potentially from various users. This is akin to a form of crowdfunding, where the collective contributions of numerous users cover the cost of the GPU’s operational time.</p><p>Determining the number of concurrent requests required to offset the cost of GPU usage — thus ensuring the service operates profitably — is a closely guarded metric that LLM hosting providers typically keep under wraps. This figure can fluctuate significantly based on a variety of factors, including the pricing strategy of token usage, the base cost of GPU resources (often charged on an hourly basis by cloud providers), and the efficiency gains from specialized serving framework optimizations, among others. Insights gleaned from analyses like <a href="https://www.semianalysis.com/p/inference-race-to-the-bottom-make">Inference Race To The Bottom — Make It Up On Volume?</a> suggest a general benchmark of approximately 50 concurrent requests to break even. However, as software and hardware technologies advance, this threshold is likely to decrease, and I wouldn’t be surprised if some of the most advanced LLM hosting players may have already achieved <strong>economies of scale</strong> that could bring this figure down even to the level of 10-ish.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Oh0Rqjni9LMv1M-u.png" /><figcaption>Economies of scale through traffic concurrency i.e., batch size (source: <a href="https://www.semianalysis.com/p/inference-race-to-the-bottom-make">Inference Race To The Bottom — Make It Up On Volume?</a>)</figcaption></figure><p>It’s important to clarify that the figure 50 refers to “concurrent requests” rather than “active users”. Sustaining such a level of concurrent requests indicates that the service caters to a substantial user base. For context, consider Google Search. While exact figures are confidential, estimates suggest Google has about <a href="https://zipdo.co/statistics/google-user/">2 billion</a> monthly active users. With a reported rate of <a href="https://www.oberlo.com/blog/google-search-statistics">99,000</a> requests per second, the ratio of monthly active users to requests per second is approximately 20,000:1. If we assume each LLM query lasts about 10 seconds, then a single request per second corresponds to a concurrency of 10. Therefore, a concurrency of 50 could suggest a business with 100,000 monthly active users. Yet, this figure might be conservative for most companies, which typically do not enjoy the same level of brand recognition and user engagement as Google. Moreover, not all applications, even within larger organizations, will generate traffic comparable to a widely-used service like Search. Some critical internal applications might only see concurrency in the single digits.</p><p>Indeed, substantial traffic is necessary to ensure that the investment in hosting LLMs is justified, particularly given the current scarcity of high-performance GPUs. Consequently, when superior LLMs are released and the majority of the major players — who are often the ones to adopt new technologies swiftly — transition their workloads to the newer models, LLM hosting providers are inclined to decommission the older models promptly. This allows them to maintain profitability and transfer the <strong>economies of scale</strong> to the more advanced LLMs. Maintaining legacy Gen AI applications, colloquially referred to as ‘Keep the Lights On,’ is not a simple or cost-effective option compared to upgrading. Whether by choice or necessity, Gen AI applications must adapt and progress in tandem with the evolution of the models.</p><h4>The Purpose of Gen AI System</h4><p>From our discussion, it’s evident that a Gen AI App is not a static creation. Although the initial development of a Gen AI App from the ground up is undeniably important, its value is surpassed by the benefits of ongoing evolution and innovation in the medium to long term. Therefore, the purpose and goal of a Gen AI System extend not only to streamlining the initial development process but also, more significantly, to facilitating a seamless and straightforward path for continuous evolution and innovation.</p><p>Adopting this perspective and examining the current suite of Gen AI tools in the industry, we can discern that the pace of evolution is beginning to encounter obstacles. Numerous Gen AI tools are developed with the presupposition that the foundational LLM is a GPT variant, with prompts often hardcoded and lacking in customization flexibility, tailored specifically for GPT models. This form of low-level dependency, while it certainly makes sense to rapidly kickstart development, creates substantial resistance during model evolution, affecting not just interoperability between different model providers but also compatibility across various versions of GPT itself. With the recent news (on March 26) that Claude 3 Opus has officially surpassed GPT-4-Turbo on the <a href="https://huggingface.co/spaces/lmsys/chatbot-arena-leaderboard">LMSYS Chatbot Arena Leaderboard</a>, it might be an opportune moment for us to consider how to better architect our tools for the future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tSlCHFin1SwX3QNSESNOZA.png" /><figcaption>Updated leaderboard as of March 26: Claude 3 Opus now takes the lead (source: <a href="https://huggingface.co/spaces/lmsys/chatbot-arena-leaderboard">LMSYS Chatbot Arena Leaderboard</a>)</figcaption></figure><p>Fortunately, as the recognition of these pain points increases, so too does the advancement of solutions. Tools and frameworks like <a href="https://github.com/stanfordnlp/dspy">DSPy</a> are in active development, specifically designed to provide a higher level of abstraction from the underlying complexities. In the next blog post, we will continue this thread by examining potential abstractions and analogies, and their role in enhancing Gen AI Systems. Stay connected for this continued exploration — see you soon.</p><h3>Acknowledgment</h3><p>This blog owes its clarity and final form to the significant contributions of GPT-4 Turbo, which was instrumental in proofreading and polishing the content. GPT-4 Turbo also provided crucial support in generating examples, especially those that shed light on the evolution of a wide array of systems.</p><blockquote>This above paragraph is also polished by GPT 4 Turbo :)</blockquote><h3>Disclaimer</h3><p><a href="https://peilunl.medium.com/disclaimer-7f02bf6a7a7a">Disclaimer</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*OMbj-C44ncYAK2SE.png" /></figure><p>This story is published on <a href="https://generativeai.pub/">Generative AI</a>. Connect with us on <a href="https://www.linkedin.com/company/generative-ai-publication">LinkedIn</a> and follow <a href="https://www.zeniteq.com/">Zeniteq</a> to stay in the loop with the latest AI stories. Let’s shape the future of AI together!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*jO7BxK2kwkZGt6A6.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bdeb789c634" width="1" height="1" alt=""><hr><p><a href="https://generativeai.pub/architecting-gen-ai-systems-1-the-time-dimension-and-model-evolutions-5bdeb789c634">Architecting Gen AI Systems #1: The Time Dimension and Model Evolutions</a> was originally published in <a href="https://generativeai.pub/">Generative AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Monitoring Availability for Serverless Applications on Kubernetes]]></title>
            <link>https://awstip.com/monitoring-availability-for-serverless-applications-on-kubernetes-ab879ba79137?source=rss-efe81354a52c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab879ba79137</guid>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[monitoring]]></category>
            <dc:creator><![CDATA[Peilun Li]]></dc:creator>
            <pubDate>Fri, 15 Mar 2024 05:36:19 GMT</pubDate>
            <atom:updated>2024-04-01T17:17:59.444Z</atom:updated>
            <content:encoded><![CDATA[<h4>Crafting an Optimal Metric Query for Effective Uptime Tracking</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Vrb98dClQ1IH5m4ao2gFw.png" /><figcaption>Illustrated by DALL·E 3: Monitoring Availability for Serverless Applications on Kubernetes</figcaption></figure><p>In the dynamic realm of cloud computing, serverless architectures have revolutionized the way we deploy and manage applications. This paradigm shift is not just about abstracting away the servers; it’s about the ability to dynamically scale application resources, even down to zero when idle, eliminating unnecessary costs and resource consumption. Kubernetes, the leading container orchestration platform, has embraced this concept, offering sophisticated tools to deploy, manage, and automatically scale containerized applications to meet demand precisely. This is particularly impactful for serverless applications, which are designed to be highly responsive to traffic fluctuations. As AI/ML and Gen AI technologies gain momentum, demanding sporadic and intensive computational power, the serverless model becomes even more attractive. The on-demand scaling nature of serverless, especially its <strong>scale-to-zero</strong> capability, presents substantial cost efficiencies for resource-intensive workloads like ML models.</p><p>With the convenience of serverless comes the challenge of ensuring high availability and reliability. Monitoring the uptime and responsiveness of serverless applications on Kubernetes is critical to maintaining a seamless user experience and achieving operational excellence. However, the <strong>scale-to-zero</strong> nature of serverless applications means traditional monitoring methods may not suffice, and a more nuanced approach is required.</p><h4>How Availability is Typically Monitored</h4><p>The typical way to monitor service availability or uptime is through health checks or synthetic tests that probe the target service, such as <a href="https://docs.aws.amazon.com/prescriptive-guidance/latest/implementing-logging-monitoring-cloudwatch/monitoring-application-service-availability.html">AWS CloudWatch Synthetics</a> and <a href="https://www.datadoghq.com/monitoring/uptime-monitoring-tools/">Datadog Uptime Monitoring Tools</a>. However, this approach may not work for serverless applications, as probe requests are essentially always-on traffic, which will effectively prevent the scale-to-zero mechanism of the target service, negating one of the major benefits of the serverless paradigm.</p><h4>Monitoring Availability for Serverless Applications</h4><p>Since probe requests may not work, there are alternative ways to obtain the service availability signal. For example, if the serverless application is on a service mesh like <a href="https://istio.io/">Istio</a>, we could potentially monitor the status of (non-probe) requests at the Istio layer using Istio metrics like <a href="https://istio.io/latest/docs/reference/config/metrics/">istio_requests_total</a>, which can serve as a proxy signal for service availability.</p><p>However, these methods:</p><ol><li>Often require delicate tuning to prevent false positives and negatives.</li><li>Are indirect signals that may lead to delayed alarms or missing collections.</li><li>Depend on specialized middle layers and may not work for all infra configurations.</li></ol><p>Is there a more generalized approach that’s widely applicable to a broader range of Kubernetes workloads? The answer is yes — we can rely on direct signals from Kubernetes <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/">deployment</a> resources.</p><p>To begin, let’s discuss how the serverless paradigm is typically implemented on Kubernetes. Many popular frameworks support serverless workloads on Kubernetes, such as <a href="https://knative.dev/">Knative</a> (Serving) and <a href="https://keda.sh/">KEDA</a>. For this blog, we’ll use Knative (Serving) as a case study, but the principles apply to many other serverless frameworks as well.</p><p>The following figure from the paper <a href="https://arxiv.org/abs/2106.03601">Analyzing Open-Source Serverless Platforms: Characteristics and Performance</a> offers a great high-level summary of Knative (Serving)’s architecture. We won’t dive deep into the “Ingress Controller”, “Activator”, “Auto-scaler”, and “Queue-proxy Container” here — some complex network routing, metrics reporting &amp; gathering, and request queuing are happening there. But essentially, all the autoscaling signals, including scale to and from zero, are sent to the top-right yellow box — Kubernetes “Deployment” resource.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EBxW32E-W_HUo5LuGM369g.png" /><figcaption>High-Level Architecture of Knative (Serving) <a href="https://arxiv.org/abs/2106.03601">reference</a></figcaption></figure><p>Here’s an example of how the serverless deployment looks in the Kubernetes cluster:</p><pre># Service scaled down to zero<br>$ kubectl get deployment example-knative-service-deployment<br>NAME                                 READY   UP-TO-DATE   AVAILABLE   AGE<br>example-knative-service-deployment   0/0     0            0           1d<br><br># A request towards the service triggers it to scale up from zero<br>$ kubectl get deployment example-knative-service-deployment<br>NAME                                 READY   UP-TO-DATE   AVAILABLE   AGE<br>example-knative-service-deployment   0/1     1            0           1d<br><br># After a while, when the service pod is ready for serving<br>$ kubectl get deployment example-knative-service-deployment<br>NAME                                 READY   UP-TO-DATE   AVAILABLE   AGE<br>example-knative-service-deployment   1/1     1            1           1d<br><br># If more traffic comes in, the service could further scale up<br>$ kubectl get deployment example-knative-service-deployment<br>NAME                                 READY   UP-TO-DATE   AVAILABLE   AGE<br>example-knative-service-deployment   3/3     3           3          1d</pre><p>The READY column shows a value of X/Y , with X being the number of ready replicas, and Y being the number of desired replicas as decided by the autoscaler. In almost all cases, we see X&lt;=Y (as Kubernetes will quickly terminate surplus replicas when scaling down, achieving X=Y almost immediately)</p><p>By tuning <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/">pod probes</a>, such as the readiness probe, we can make the pod’s ready status synonymous with availability. Thus, one way we’d know our service is facing availability issues is when X=0 and Y&gt;0 for a considerable time, e.g., 3 min. (Note: this won’t capture broader networking issues or if the serverless infrastructure itself or even the entire cluster is down — separate monitors need to be set up to cover those scenarios, which are beyond the scope of this blog.)</p><h4>The Maze of Metrics Monitoring</h4><p>Great! Now we have a generic way to monitor availability for our serverless application: alert us if X=0 and Y&gt;0 persists for over, say, 3 min . Let’s define that in our monitoring stack.</p><p>Using Datadog as an example, it’s straightforward to instrument <a href="https://docs.datadoghq.com/containers/kubernetes/data_collected/">Kubernetes metrics</a> representing X and Y :</p><ul><li>X can bekubernetes_state.deployment.replicas_available (or kubernetes_state.deployment.replicas_ready)</li><li>Y can bekubernetes_state.deployment.replicas_desired</li></ul><p>However, when defining the alert metrics and conditions, things become tricky — Datadog (as well as many other popular observability platforms) requires the alert metric to be defined in a way that can be only 1) raw metrics collected, or 2) an expression using simple arithmetic (e.g., +-*/) over raw metrics collected. Also, the alert conditions, i.e., alert threshold and alert recovery threshold, need to be numeric values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*flKYNqa47pDlCDcfWqkurw.png" /><figcaption>Datadog Alert Metrics and Conditions (<a href="https://docs.datadoghq.com/monitors/guide/non_static_thresholds/?tab=uiconfiguration">ref</a>)</figcaption></figure><p>We’ll then need to find a way to represent X=0 and Y&gt;0 using a simple expression, as logical AND is not supported. The first idea is to use X/Y and alert if the value is 0 . However, the nature of serverless application kicks in again — the service might work fine when scaled to zero, i.e., X=0 and Y=0 . Depending on the observability platform’s implementation, X/Y can be 0 , NaN , or even cause a hard error. It’s challenging to use X/Y to distinguish between X=0 and Y=0 (scale to zero, service might work fine) and X=0 and Y&gt;0 (service may have availability issues).</p><p>To make it even more complex, X=0 and Y=0 does not always mean the target service is working fine. There are chances that the target service is down (ideally when the alert should have already been triggered), and the clients have given up trying, leading the serverless infrastructure to scale down the target service to zero. In other words, X=0 and Y=0 is effectively a No Action for our alert— the alert should maintain its current state, whether triggered or healthy, when observing a datapoint of X=0 and Y=0 . If the alert has already been triggered, it should only return to a healthy state when observing X&gt;=1 (and Y&gt;=X) .</p><p>Let’s summarize quickly to streamline this mental maze. Given X and Y which are both nonnegative integers and Y&gt;=X, we’ll need to find an arithmetic expression using X and Y , with the properties of</p><ol><li>A triggered range delimited by an alert threshold , covering the state of X=0 and Y&gt;0, within which the alert should be triggered.</li><li>A healthy range delimited by an alert recovery threshold , covering the state of X&gt;=1 (and Y&gt;=X), within which the alert should be in a healthy state.</li><li>The triggered range and healthy range should not overlap.</li><li>The scale to zero (i.e., No Action) state X=0 and Y=0 should fall in neither the triggered range nor the healthy range .</li></ol><p>Now we officially enter the world of math! It could be quite a journey to work out an elegant solution (if any). If you want to enjoy the experience of math problem-solving yourself, you can pause reading here :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/0*OxfccNahHSUhKbdw" /></figure><p>There might be many possible solutions to this math problem, and here I’ll present a simple one: Y/(X-0.5) . Through the following table, we can see the triggered range (-∞, -2] and healty range (1, +∞) are not overlapping, and the value for scale to zero state, 0, falls in neither range. Also, we won’t face any zero division error given that X is always an integer.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/72d3fc039b0826b148b6e4b754580b5d/href">https://medium.com/media/72d3fc039b0826b148b6e4b754580b5d/href</a></iframe><p>We can further confirm the property of this expression through some simple dot plots (remembering that X,Y&gt;=0 and X&lt;=Y , and you’ll notice how the state of X=0 and Y=0 falls in neither the triggered range nor the healty range)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dUWDykNZOboXhYfzF7L85g.png" /><figcaption>Alert threshold: Y/(X-0.5)&lt;=-2. The states represented by the blue dots will trigger the alert</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_tyjqm-uGS5EtqApJNC43w.png" /><figcaption>Alert recovery threshold: Y/(X-0.5)&gt;1. The states represented by the blue dots will recover the alert</figcaption></figure><p>Fantastic! We can now set this Y/(X-0.5) expression in our preferred observability platform, with an alert threshold of (&lt;=)-2 and an alert recovery threshold of (&gt;)1 , and confidently monitor the availability of your serverless application in a generic and reliable way!</p><h4>Acknowledgment</h4><p>This blog is co-authored with GPT 4 Turbo</p><blockquote>&gt; You are an expert in tech blog writing and media marketing.</blockquote><blockquote>Please proofread the following blog titled “Monitoring Availability for Serverless Applications on Kubernetes”, to make it more fluent and appealing. {original blog content}</blockquote><blockquote>Please suggest a subtitle for the blog.</blockquote><blockquote>Please suggest a few tags for the blog.</blockquote><h4>Disclaimer</h4><p><a href="https://peilunl.medium.com/disclaimer-7f02bf6a7a7a">Disclaimer</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab879ba79137" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/monitoring-availability-for-serverless-applications-on-kubernetes-ab879ba79137">Monitoring Availability for Serverless Applications on Kubernetes</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Disclaimer]]></title>
            <link>https://peilunl.medium.com/disclaimer-7f02bf6a7a7a?source=rss-efe81354a52c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f02bf6a7a7a</guid>
            <category><![CDATA[disclaimer]]></category>
            <dc:creator><![CDATA[Peilun Li]]></dc:creator>
            <pubDate>Sun, 03 Mar 2024 01:40:04 GMT</pubDate>
            <atom:updated>2024-03-03T01:40:04.902Z</atom:updated>
            <content:encoded><![CDATA[<h4>For all my articles published on medium.com</h4><blockquote>Co-author: GPT 4 Turbo</blockquote><blockquote>&gt; You are an expert in legal, blog writing, and media marketing.</blockquote><blockquote>Can you help me write a disclaimer page for my medium.com blog, including the following key points each as an individual paragraph:<br>1. Opinions in my blog are my own and do not reflect those of my employer.<br>2. I value intellectual property and copyright. I’ll cite external resources used, and please also cite my works if you find them useful and refer to them.<br>3. A liability disclaimer that while I strive to provide accurate information in my blog articles, it’s not guaranteed they are free of error. Usage of my blog content is up to the reader’s judgment and I do not take any liability.</blockquote><blockquote>Use professional and formal language.</blockquote><p>Welcome to my blog on medium.com. Please take a moment to read the following important information regarding the content and use of this blog. Your access to and use of the information contained herein is subject to the terms and conditions set forth in this disclaimer.</p><h3>Personal Opinions</h3><p>The views, thoughts, and opinions expressed on this blog are solely my own and do not represent the opinions or policies of any company or organization I may be affiliated with, including my employer. The content provided here is for informational purposes only and reflects my personal perspectives and insights, which are subject to change over time.</p><h3>Intellectual Property and Copyright</h3><p>I hold intellectual property rights in high regard and am committed to acknowledging and respecting the work of others. All content on this blog, unless otherwise noted, is my original work. When I incorporate or reference external sources, I make every effort to properly cite and give credit where it is due. Similarly, I ask that if you find the content of my blog valuable and choose to reference it in your own work, please provide appropriate citation and credit to this blog as the source. This mutual respect for intellectual property fosters a healthy and creative online community.</p><h3>Liability Disclaimer</h3><p>While I endeavor to ensure that the information presented in my blog articles is accurate and up-to-date, I cannot guarantee that the content is entirely free from errors or omissions. The information provided is on an “as is” basis and is for general informational purposes only. As the reader, you acknowledge that you are using the information from this blog at your own discretion and risk. I expressly disclaim any liability for any inaccuracies or incompleteness found in the blog’s content, as well as for any actions you take or refrain from taking based on such information. It is your responsibility to independently verify any information you may choose to rely on.</p><p>By using this blog, you agree to the terms of this disclaimer. If you do not agree with these terms, please do not use this blog. Thank you for your understanding and cooperation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f02bf6a7a7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>