Products based on generative artificial intelligence have rapidly become a reality over the past years.
Just a few years ago, it was hard to imagine that models could generate images based on text or write essays or poems on a given topic, and do so at a level comparable to humans. Today, millions of people use products based on generative models to solve various problems.
ChatGPT is one of the most striking examples of products built on generative AI. Even without traditional marketing, it managed to become the fastest-growing service in history.
Many are looking to these technologies for ways to become more productive and solve new problems. Businesses are no different: CEOs and company founders are actively demanding their teams find ways to integrate generative AI solutions into their products.
But to truly create value with these technologies, it is essential to understand their fundamentals: how they work, where they can be beneficial, and what limitations and risks they entail.
In this article, we will explain in simple terms and without complex mathematics how large language models (LLMs), a subset of generative AI technology for working with text, work. This will help you to understand the capabilities of LLMs and build products based on them.
How large language models work
The term large language model (LLM) does not have a strict definition, but it generally refers to models that contain a massive number of parameters (billions) and have been trained on vast amounts of textual data.
The working principle of such models is quite simple:
- The model receives an “input prompt” (a user query or a set of words) and then selects the most appropriate word that should follow.
- After this, the generated word is appended to the prompt and fed back into the model, and it selects the next word.
- The cycle repeats until the model emits a special ending word or hits a predefined number of words.
This results in a “plausible continuation” of the initial query. To the user, it appears as a response that makes sense.
In this context, the prompt (hint, seed) is the main control element. Text generation occurs precisely based on the initial query, so by modifying and optimizing the prompt, you can control and improve the model’s output.