# Understanding Key Terms in Large Language Models and Generative AI
Written on
Chapter 1: Introduction to Generative AI
Generative AI refers to models engineered to create new and original content based on the data they were trained on. These models can generate a wide range of outputs, including text, images, and music.
For instance, imagine a generative AI model trained on classical music. If prompted, it could compose an entirely new piece that sounds classical, yet it is original and not derived from its training material.
Chapter 2: Large Language Models (LLMs)
Large Language Models are developed using extensive text datasets, which allow them to comprehend context and produce text that resembles human writing. They can perform tasks such as answering queries, composing essays, and even writing poetry.
For example, if you ask an LLM to “Create a brief poem about the moon,” it might generate:
Silver orb in the night sky,
Casting shadows, shining high.
Guardian of dreams, so bright,
Guiding us with gentle light.
Chapter 3: Understanding Tokens
Tokens are the fundamental units that LLMs process, representing characters, words, or segments of text.
For example, the phrase “ChatGPT is fun!” is broken down into tokens as follows: [“Chat”, “G”, “PT”, “ is”, “ fun”, “!”].
Section 3.1: Completion Tokens
Completion tokens are those generated by the model to continue or finalize a given prompt.
For instance, if prompted with “The sun is…,” the model might complete it with “shining brightly in the sky.” Here, “shining brightly in the sky” serves as the completion tokens.
Section 3.2: Prompt Tokens
Prompt tokens are the initial inputs or instructions given to the model.
In the example “The sun is…,” the phrase itself constitutes the prompt tokens.
Chapter 4: The Art of Prompt Engineering
Prompt engineering is the practice of crafting and refining input prompts to steer the model towards a specific output. This technique enhances the interaction with the model.
For example, instead of simply saying, “Tell me a recipe,” one might employ prompt engineering by asking, “Please provide a detailed recipe for a chocolate cake, listing all ingredients and steps.”
Chapter 5: What are Agents?
In the realm of AI, agents are systems capable of perceiving their environment, making decisions, and taking action. They are designed to interact, respond, and accomplish targeted tasks.
For example, a chatbot that assists users in booking flight tickets qualifies as an agent. It interprets user queries, determines the best flight options, and acts by delivering the relevant information.
Chapter 6: Understanding Chains
Chains denote ongoing interactions with the model, facilitating extended conversations rather than isolated responses.
Example interaction:
- User: “Tell me a story.”
- Model: “Once upon a time, in a land far away…”
- User: “Go on.”
- Model: “There lived a brave knight named Lancelot…”
Chapter 7: Vector Databases Explained
Vector databases are tailored for storing and querying vector data, commonly utilized in semantic searches and machine learning applications.
For instance, a recommendation system could employ a vector database to hold embeddings of various movies. If a user enjoys a particular film, the system can rapidly identify other films with similar embeddings, thus delivering relevant suggestions.
I previously authored a comprehensive article on Vector Databases; be sure to check it out: Vector Databases and Their Importance in Generative AI: An Explained Guide.
Chapter 8: Exploring Embeddings
Embeddings are numerical vectors that convey the semantic meaning of words or phrases. They play a vital role in various natural language processing (NLP) tasks, helping to elucidate context and relationships between words.
For instance, the word “king” may have an embedding closely associated with “queen,” but distanced from “an apple,” signifying their semantic ties.
In conclusion, I trust these detailed explanations along with examples have clarified each term within the context of Large Language Models. I plan to delve deeper into large language models and generative AI in accessible language for all. Stay tuned for more insights!