5 Decoders in Action

 

This chapter covers

  • Understanding Decoder model core principles
  • A deeper dive into decoding algorithms
  • An insight into using prompt engineering for our application
  • Choosing between Open-Source vs Closed-Source LLMs
  • Challenges within LLMs

In Chapter 4, we built a solid foundation for our semantic search engine by exploring the process of generating embeddings, utilizing distance metrics, and introducing the powerful FAISS library. We witnessed the effectiveness of semantic search in understanding user queries and retrieving relevant hotel information.

In this chapter, we will explore the most popular theme in today's Gen AI Landscape: Decoder models or simply large language models. As we have witnessed in previous chapters, Encoder models play an important role in generating embeddings and enabling us to search through a myriad of documents. Decoder models are responsible for generating text, which will become quite handy in the next chapter as we explore Retrieval Augmented Generation (RAG) explained in Chapter 1. I am also very excited to have a contributor for this chapter, Ali Shafique, a PhD candidate focused on building State of the Art LLMs.

5.1 Understanding the Core Principles of Decoder Models

5.1.1 Autoregressive Nature of LLMs

5.2 Decoding Algorithms

5.2.1 Greedy Decoding

5.2.2 Beam Search

5.2.3 Sampling Methods

5.3 Getting Started with Large Language Models and Prompting

5.3.1 What is Prompting?

5.3.2 Prompt Engineering

5.4 Selecting the Right LLM for our Application

5.5 Challenges with LLMs

5.6 References

5.7 Summary