Ver en Español
LLMs from start to finish
Feb 22, 2025
Updated: Jun 25, 2026

LLMs from start to finish

Large Language Models (LLMs) have revolutionized the field of artificial intelligence (AI) in recent years. These models, based on neural networks, are designed to understand and generate text with impressive sophistication. From content generation to machine translation and code creation, LLMs are redefining what is possible at the intersection of AI and natural language processing (NLP).

An LLM is a neural network that models the distribution of the text it was trained on. This kind of model can take an input, such as an incomplete sentence, and predict the next word or sequence of words based on the patterns it learned during training. What makes LLMs truly impressive is their ability to perform a variety of complex tasks without needing to be trained specifically for each one of them.

The story of LLMs started to gain traction with the introduction of the Transformer by Google in 2017. This architecture let models process and generate text far more efficiently and effectively than previous methods, such as recurrent neural networks (RNNs). Since then, LLMs have evolved quickly, with ever larger and more powerful models that can handle natural language processing tasks with surprising accuracy and creativity.

Fundamentals of LLMs

To understand how LLMs work, it is essential to know their structure and internal workings. At the heart of these models sits the Transformer architecture, which is responsible for the LLMs' ability to handle large amounts of data and generate coherent, relevant text.

The Transformer architecture is based on a mechanism called attention, which lets the model focus its processing on different parts of the input text. This is particularly useful when dealing with long sequences of text, since it lets the model keep the context and generate responses that are coherent with the input provided.

A crucial component in how LLMs work is the concept of tokens and tokenization. LLMs split their input into smaller units called tokens, which can be individual characters, whole words, or parts of words. This process of breaking text down is known as tokenization. As a rule of thumb, and according to Google's documentation for the Gemini models, one token equals roughly four characters, and 100 tokens correspond to between 60 and 80 words in English. Keep in mind that the tokenizer varies across model families, so this figure is an approximate guide, not an exact value.

Context windows are another fundamental aspect to consider. These windows define how much input the user can provide and how much output the model can generate. In today's frontier models, these context windows can be as large as millions of tokens depending on the model, which allows handling large amounts of information in a single interaction. Since these numbers move very fast, it is worth checking the current limit in the documentation of the model you are using.

Multimodality in LLMs

One of the most interesting advances in LLMs is the ability to handle multimodality, that is, the ability to process and generate content from different types of data, such as text, images, video, audio, and code. Several modern models, such as Google's Gemini or the OpenAI and Anthropic families, are designed from the ground up for multimodality, which lets them reason and generate content fluidly across multiple kinds of media.

Multimodality is crucial because it lets a single model handle tasks that traditionally would have required several specialized models. For example, a multimodal model can interpret an image, generate a textual description, and then turn that description into programming code. This not only simplifies the development process, it also improves the coherence and accuracy of the tasks performed.

Compared to using several independent models, multimodal integration ensures that information is not lost between different modalities. For example, when an audio file is converted into text, the tone and emotion present in the voice can be lost. A multimodal model, however, can preserve and use this additional information, improving the quality of the generated output.

Use cases and applications of LLMs

LLMs have a wide range of applications across many industries. One of the most common uses is text generation, which can range from creating content for blogs and social media to drafting emails and technical documents. LLMs are also able to generate code, which is particularly useful for developers looking to automate tasks or build prototypes quickly.

In the realm of conversational applications, LLMs are the foundation of many advanced chatbots and virtual assistants. These models can hold conversations with users, answer complex questions, and provide personalized recommendations. Thanks to their ability to understand context, LLMs can interact more naturally and effectively with users, which significantly improves the user experience.

LLMs also have great potential in education and creativity. In education, they can help generate personalized learning content, answer student questions, and provide detailed explanations of complex topics. In terms of creativity, LLMs can generate poetry, stories, and art, opening new possibilities for artists and creators.

Today's ecosystem of models

Although in this post we use Gemini as a recurring example, the LLM ecosystem is much broader, which is exactly why it is worth knowing it from start to finish. Today there are several frontier model families worth keeping on your radar:

  • OpenAI with its GPT family, one of the best known and surrounded by a large ecosystem of tools.
  • Anthropic with its Claude family, oriented toward reasoning tasks, long horizon agentic work, and responsible use. At the time of writing, its most capable models are Claude Opus 4.8 and Claude Fable 5.
  • Google with its Gemini family, with a strong emphasis on multimodality and very large context windows.
  • Open weight models, such as the Llama or Mistral families, which you can download and run on your own infrastructure.

The good news is that many of the concepts we cover in this post (tokens, context windows, multimodality, prompt design, sampling parameters) apply across almost any model family. Learning the fundamentals lets you move between providers with far greater ease.

Considerations in prompt design

Prompt design is a key aspect of working with LLMs. A well designed prompt can guide the model to generate the desired output more precisely and coherently. A prompt can be as simple as a question or as complex as a sequence of detailed instructions the model must follow.

One of the approaches in prompt design is the use of few shot prompts, where we give the model a few examples of what the input and output should look like, and then ask it to continue the pattern. This can be especially useful when you need to generate content with a specific structure or style.

Tuning the model's parameters, such as temperature, top k, and top p, also matters in prompt design. These parameters control the level of creativity and diversity in the generated output. For example, a higher temperature can result in more creative and varied responses, while a lower temperature can produce more coherent and predictable ones.

Tuning and customizing models

Tuning, or adjusting models, is a process that lets you customize an LLM for specific tasks. This can be done through tools such as Google AI Studio, which offers a friendly interface for testing and adjusting models without writing much code. Keep in mind that the tuning surface has been shifting: some advanced tuning now happens in Vertex AI, so it is worth confirming the current entry point.

Tuning is particularly useful when you need a model to perform specialized tasks or adapt to a specific domain. For example, a model can be tuned to generate code in a particular programming language or to understand and answer questions in a specific technical field.

Tuning can also improve the model's performance by optimizing how it handles input data and generates output. This not only improves the model's accuracy, it can also reduce the costs associated with using the API, since the number of tokens needed to complete a task is minimized.

Ethical considerations and responsibility in the use of LLMs

With the power and capability of LLMs come great responsibilities. Using these models raises a number of ethical challenges, such as the risk of generating biased or inappropriate content. It is essential that organizations using LLMs implement safety measures and content reviews to avoid potential harm.

The major AI providers have pushed for the responsible use of the technology, investing in research and tools to ensure that LLMs are safe and equitable. Transparency in the use of these models and the ability to cite sources when content is generated are key aspects for maintaining user trust and promoting the ethical use of the technology.

The future of LLMs and conclusion

The future of LLMs is promising, with continuous advances in these models' ability to handle ever more complex tasks. LLMs are expected to play a crucial role in transforming entire industries, from healthcare to education and entertainment.

As LLMs keep evolving, so will the tools and techniques to use them more effectively and responsibly. Tuning, customization, and multimodality will remain key areas of innovation, opening new possibilities for content creation and interaction with AI.

In conclusion, Large Language Models have changed the way we think about artificial intelligence and natural language processing. Their ability to understand and generate text, code, and other kinds of content is transforming industries and redefining the limits of what is possible with technology. However, with this power comes the responsibility to use these models ethically and effectively, ensuring that their benefits are maximized while their risks are minimized.

Suggested exercises

  1. Take any paragraph and estimate how many tokens it would have using the rough rule of four characters per token. Then compare it with the official token counter of the model you use.
  2. Write a few shot prompt with three input and output examples for a concrete task (for example, classifying reviews as positive or negative) and watch how the model continues the pattern.
  3. Repeat the same request to a model varying only the temperature (for example, 0.2 and 0.9) and compare the creativity and coherence of the responses.
  4. Research the context windows and pricing of at least three different model families (for example, OpenAI, Anthropic, and Google) and compare them.

3-point summary

  1. LLMs are based on the Transformer architecture and the attention mechanism; they process text as tokens and work within a context window that defines how much information they handle at once.
  2. Multimodality lets a single model reason over text, images, audio, and code, while prompt design and sampling parameters (temperature, top k, top p) control the quality and diversity of the output.
  3. The ecosystem is broad (OpenAI, Anthropic Claude, Google Gemini, and open weight models) and, together with tuning, opens up enormous possibilities, always with the responsibility to use these models ethically.

That is all. I hope this post is useful to you and that you can apply it to a project you have in mind, or that it simply helped you understand from start to finish how LLMs work.

Leave me a comment if it helped, if you want to add an opinion, or if you have any questions. And remember, if you liked it, you can also share it using the social links below. Good luck.

Sebastian Gomez

Sebastian Gomez

Creador de contenido principalmente acerca de tecnología.

Leave a Reply

0 Comments

Advertisements

Related Posts

Categorias