LLMs: Unlocking the Power of Pre-trained AI Models

Happy Sunday

In this week's issue of Applied Intelligence, we discuss:

  • Something unrelated to GenAI (for once!) - a podcast with my coach, Peter Roxburgh, on Achieving Peak Performance.

  • LLMs - what they are, what they can do, and how it's driving AI adoption at a rapid pace.

Finally, a special shoutout to Peter V.S. Bond from The CPG Guys Podcast for creating the intro audio for the Applied Intelligence Podcast - I really appreciate the support & love!

Podcast: Achieving Peak Performance - with my Coach Pete Roxburgh

Applied Intelligence looks at the intersection of tech, people, and getting stuff done - primarily focusing on AI. But from time to time - I'll also be exploring the stories of the incredible people around me and what makes them tick.

In this special episode of Applied Intelligence, I interviewed my performance coach Peter Roxburgh and discussed the importance of finding purpose, having a coach, and accountability. Throughout the conversation, we discuss the power of coaching, the significance of building relationships beyond transactional interactions, and the importance of following through on commitments, specifically with yourself.

We also went through how to build a personal compass, and I shared my compass as an example (click to download). The personal compass is a document that level sets the expectations of your life and helps you prioritize what's important to you versus what isn't.

Peter Roxburgh Contact Details:

  • Watch on Youtube:

LLMs: Unlocking the Power of Pre-trained AI Models

Pre-trained AI models, known as Language Models (LLMs), have revolutionized software development, allowing individual developers to create impressive AI applications in a few days. In this summary, we explore the different approaches to building with LLMs, focusing on the concept of in-context learning and its associated workflow.

Understanding In-Context Learning:

In-context learning is a design pattern that allows developers to leverage LLMs off the shelf, without fine-tuning, while controlling their behavior through clever prompting and conditioning on contextual data. This approach is beneficial when working with large datasets, as it mitigates the limitations imposed by the context window of the LLM. Developers can achieve scalable and efficient inference by sending only the most relevant documents and utilizing embedding models and vector databases.

The Workflow:

The in-context learning workflow can be divided into three stages: data preprocessing and embedding, prompt construction and retrieval, and prompt execution and inference. Data preprocessing involves storing private data, such as legal documents, in a specialized vector database after breaking them into chunks and passing them through an embedding model. Prompt construction entails creating prompts that combine hard-coded templates, few-shot examples, information from external APIs, and relevant documents retrieved from the vector database. Finally, prompt execution involves submitting the compiled prompts to a pre-trained LLM for inference, potentially incorporating operational systems like logging and caching.

Choosing the Right Tools:

To facilitate in-context learning, various tools and frameworks are available. For data preprocessing and embedding, developers often utilize the OpenAI API, which offers decent results for a relatively low cost. Next up, we need a vector database - a ginormous database that can be searched for specific data points in microseconds (i.e., something that would take our traditional hierarchical or SQL minutes/hours to do).

Promoting Prompting Strategies:

Prompting LLMs is a critical aspect of in-context learning. While simple prompts, such as direct instructions or few-shot examples, can yield decent results, more advanced prompting strategies are emerging. These strategies, such as chain-of-thought, self-consistency, and generated knowledge, enhance model responses and provide external context not included during training. Orchestration frameworks like LangChain and LlamaIndex streamline the prompting process by abstracting away complexities and integrating with external APIs and vector databases.

Choosing the Right LLM Model:

The OpenAI API, with models like gpt-4, is a popular choice for new projects due to its ease of use and wide range of input domains. However, as apps scale, developers may consider options like gpt-3.5-turbo for cost-effectiveness. Open-source models are also gaining traction, with providers like Meta and emerging startups offering alternatives that approach the accuracy of proprietary models.

To summarize:

LLMs have revolutionized software development by allowing individual developers to create powerful AI applications in a fraction of the time it used to take large teams. These new AI applications often outperform projects that require months of work using traditional supervised machine learning methods.

It's important to understand that the tools and techniques discussed in this article are just the beginning. The AI landscape is constantly evolving, and we anticipate even more significant changes in the near future. For example, a growing trend toward model training/customizations opens up new possibilities and challenges.