The Evolution of Building Systems with Large Language Models

Andres Zenteno
The Tech Pulse
Published in
4 min readMar 15, 2024

--

Photo by Debby Hudson on Unsplash

The landscape of software development is undergoing a seismic shift with the advent of Large Language Models (LLMs) like ChatGPT. This transformation is not just about the technology itself but about how we approach the creation and improvement of systems that leverage these models. The journey from understanding the basics of LLMs to deploying sophisticated applications that interact seamlessly with users is both fascinating and instructive.

Building complex applications with LLMs requires more than a single prompt; it involves chaining multiple calls and possibly integrating external data.

At the heart of this evolution is the recognition that building systems with LLMs extends far beyond simple prompt engineering. It involves a nuanced understanding of the model’s capabilities, limitations, and the best practices for integrating it into complex applications. The example of creating an end-to-end customer service assistant system illustrates this beautifully. Such a system doesn’t merely respond to user queries with pre-defined answers but engages in a dynamic process of understanding, processing, and generating responses that are contextually relevant and accurate.

Tokenization affects how LLMs understand and generate text, with implications for tasks like reversing the order of letters in a word.

The process begins with a clear understanding of how LLMs work, including their training through supervised learning and the significance of tokenization in determining their output. This foundational knowledge is crucial for developers to effectively prompt the LLM and anticipate its behavior. However, the real challenge lies in structuring the interaction between the user and the system in a way that leverages the LLM’s strengths while mitigating its weaknesses.

Building a complex application like a customer service assistant requires a series of steps that are largely invisible to the end-user. These steps include evaluating user input for problematic content, classifying the type of query, retrieving relevant information, and generating a helpful response. Each step must be carefully designed to ensure that the system’s output is not only accurate but also appropriate and helpful.

Chaining prompts can simplify complex tasks by breaking them down into a series of simpler subtasks, potentially reducing errors and costs.

One of the key themes in building systems with LLMs is the iterative process of development and improvement. Unlike traditional software development, where the focus might be on coding efficiency or algorithm optimization, working with LLMs emphasizes prompt tuning, output evaluation, and continuous refinement based on user feedback and system performance.

Photo by Clayton Robbins on Unsplash

This iterative process is exemplified in the methods for evaluating system outputs. Developers must employ both quantitative and qualitative measures to assess the quality of the system’s responses. This might involve creating rubrics for evaluating responses based on predefined criteria or comparing system outputs to expert-provided ideal answers. Such evaluations are critical for identifying areas for improvement and ensuring that the system meets the desired standards of accuracy, relevance, and appropriateness.

Create a customer support bot:

Step1: Inspect the input to determine whether it triggers any alerts with the Moderation API or constitutes an attempt at prompt injection.

Step 2: Identify and compile a list of mentioned products.

Step 3: Search for the identified products in the database.

Step 4: Respond to the user's inquiry.

Step 5: Submit the response for review by the Moderation API.

Step 6: Consult the model to assess if the provided response adequately addresses the user's original question.

Step 7: Depending on the assessment, either proceed with the generated response or inform the user that they will be redirected to a live support agent.

As we look to the future, the potential applications of LLMs in building complex systems are vast and varied. From customer service assistants to educational tools, content creation platforms, and beyond, LLMs offer a powerful tool for enhancing human-computer interaction. However, realizing this potential requires a deep understanding of the technology, a thoughtful approach to system design, and a commitment to continuous improvement.

Engage in continuous learning and experimentation with LLMs to discover new applications and improve existing systems.

In conclusion, building systems with LLMs represents a new frontier in software development. It challenges us to rethink our approaches to problem-solving, user interaction, and system design. As we continue to explore this exciting landscape, it is clear that the key to success lies in our ability to learn, adapt, and innovate.

If the idea of developing systems using the ChatGPT API piques your interest, I highly recommend exploring this concise yet enlightening course offered by Andrew Ng, Building systems with the ChatGPT API.

--

--