Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 2

Understanding Large Language Models: Architecture and Capabilities

Recommended resources

Introduction

In our last lesson, we established the crucial strategic distinction between Predictive AI, which forecasts outcomes, and Generative AI, which creates new content. This foundational understanding is key to identifying the right tool for a given business problem.

Today, we delve into the engine behind the most advanced forms of Generative AI: Large Language Models (LLMs). These are the models that power systems like ChatGPT and are transforming how we interact with information. Our goal for this lesson is to describe the architecture and capabilities of LLMs at a conceptual level. You will learn what they are, how they are trained, and what makes them so powerful. This knowledge is essential for you as a future consultant, as it will enable you to assess the feasibility of using these models for complex tasks in the EPC sector, such as analyzing contractual documents or summarizing daily progress reports.


What is a Large Language Model?

At its heart, a Large Language Model is a massive neural network designed to understand and generate human language. While the technology is incredibly complex, the core idea is surprisingly simple. An LLM is trained on a single, fundamental task: predicting the next word in a sequence of text.

To grasp this intuitively, watch this short, animated explanation.

Large Language Models explained briefly

This video from the 3Blue1Brown channel provides a concise and clear visual introduction to the core function of an LLM.

Watch the segment from the beginning which explains that an LLM is a function that predicts the next word by assigning probabilities to all possibilities.

This simple objective, when performed on a colossal scale with vast amounts of text from the internet, forces the model to learn grammar, syntax, facts about the world, and even rudimentary reasoning.

Andrej Karpathy, a leading AI researcher, offers a powerful analogy. He describes an LLM as consisting of just two things:

  1. A file containing the model's parameters (billions of numbers, also called weights).
  2. A piece of code that runs those parameters.

The parameters are the result of the training process, which can be thought of as a lossy compression of a huge portion of the internet. The model doesn't store the internet verbatim; it learns the statistical patterns within it.

[1hr Talk] Intro to Large Language Models

In this clip from his "Intro to Large Language Models" talk, Andrej Karpathy demystifies what an LLM is and how the next-word prediction task enables it to learn about the world.

First, watch his explanation of an LLM as two simple files and how they work together to generate text. Then, watch the segment explaining how the seemingly simple task of next-word prediction forces the model to compress vast amounts of world knowledge into its parameters.

This concept of compressing vast archives of unstructured text into a knowledgeable, interactive system should resonate with your experience in the EPC industry, where projects generate mountains of documentation that are difficult to query and synthesize.


How LLMs are Built: A Multi-Stage Training Process

Creating a capable LLM like the one behind ChatGPT isn't a single step. It involves a sophisticated, multi-stage training process designed to first impart knowledge and then align the model's behavior with human expectations.

To understand this journey from a raw data-processor to a helpful assistant, the following article provides an excellent, non-technical walkthrough.

How Large Language Models Work. From zero to ChatGPT

This article from Data Science at Microsoft lucidly explains the conceptual mechanics of LLMs, including their multi-phase training.

Please read the sections titled "Large Language Models," "GPT = Generative Pre-trained Transformer," and the descriptions of the training phases. Focus on understanding the purpose of each stage. Start by reading about the core idea of language modeling: learning to predict the next word. Understand how this enables text generation. Read the breakdown of the GPT acronym and the introduction to the three phases of training. Finally, read the detailed explanations of each training stage: Pre-training, Instruction Fine-tuning, and RLHF.

Let's summarize the key stages you just read about:

  1. Pre-training: This is the knowledge acquisition phase. The model is trained on a massive, diverse dataset (e.g., a large portion of the public internet) using the "next-word prediction" task. This is computationally immense, costing millions of dollars, and is where the model learns grammar, facts, and reasoning abilities. The result is a base model that is knowledgeable but not necessarily helpful or conversational.

  2. Supervised Fine-Tuning (SFT): This is the alignment phase, where the model learns to be an assistant. The base model is further trained on a smaller, high-quality dataset of instruction-and-response pairs created by humans. This teaches the model the format of a conversation and how to follow instructions.

  3. Reinforcement Learning from Human Feedback (RLHF): This is the preference-tuning phase. Humans rank multiple model-generated answers to a given prompt from best to worst. The model is then rewarded for producing answers that are more like the ones humans preferred. This step refines the model's outputs to be more helpful, honest, and harmless.

This multi-stage process is what turns a raw "internet compressor" into a useful tool that you can interact with.


The Transformer: The Architectural Breakthrough

The neural network architecture that underpins modern LLMs is called the Transformer, introduced in a 2017 paper by Google researchers. You don't need to understand its mathematical details, but as a strategist, you should be familiar with the name and its key innovation: the self-attention mechanism.

Prior to the Transformer, models processed text sequentially (word by word), which made it difficult to capture long-range dependencies. Think of a long, complex clause in a construction contract; the meaning of a word at the end might depend heavily on something stated at the beginning.

The self-attention mechanism allows the model to look at all the words in the input text simultaneously and weigh the importance of every other word as it processes each individual word. This is what gives Transformers their powerful ability to understand context.

This diagram illustrates the layered structure of a Transformer's encoder. The input text passes through multiple identical blocks, each containing a Multi-Head Attention layer and a Feed-Forward layer, allowing the model to build progressively richer representations of the text's meaning.

This architecture of stacking multiple attention-based layers is what allows the model to go "deep" in its understanding of language.

For a quick visual intuition of how attention works, see the following clip.

Large Language Models explained briefly

This clip, again from 3Blue1Brown, provides a simple conceptual explanation of the Transformer architecture and the role of attention.

Watch the segment explaining the Transformer model and its use of attention to allow words to "talk to one another" and refine their meaning based on context.


LLM Capabilities and Use Cases

The sophisticated training process and the power of the Transformer architecture give LLMs a wide range of impressive capabilities. While their fundamental function is generating text, this can be applied to many high-value business tasks.

This graphic shows the basic workflow: a user provides a prompt, the Large Language Model processes it, and this enables a variety of applications like content generation, summarization, and more.

A more detailed list of common applications is provided in this IBM resource.

What Are Large Language Models (LLMs)? | IBM

This section of the IBM article provides a clear, business-oriented list of common LLM use cases.

Read the section titled Large language model use cases. As you read, think about how each one could be applied to a problem in the EPC industry.

As you saw, the primary capabilities include:

  • Text Generation & Summarization: Drafting reports, emails, or summarizing lengthy project documents.
  • Question Answering & AI Assistants: Creating chatbots for internal knowledge bases (e.g., querying project specifications).
  • Code Generation: Assisting developers, though this is less central to your advisory role.
  • Sentiment Analysis: Analyzing stakeholder feedback or daily reports for tone and urgency.
  • Language Translation: Translating technical documents for international projects.
  • Reasoning: Solving logic problems or planning multi-step processes, which has powerful implications for tasks like analyzing delay claims.

Furthermore, advanced LLMs are now being integrated with other tools (like calculators or web browsers) and are becoming multimodal (able to process images and audio), dramatically expanding their potential.


Conclusion

In this lesson, we have demystified the technology behind Large Language Models, moving from the hype to a solid conceptual understanding of how they work.

Key Takeaways:

  • LLMs are based on the Transformer architecture, whose key innovation is the self-attention mechanism that allows it to understand complex context in text.
  • Their core function is simple: predicting the next word. When done at a massive scale, this single task endows them with knowledge and reasoning abilities.
  • They are built via a multi-stage process: pre-training on vast internet data for knowledge, followed by fine-tuning (SFT & RLHF) to align their behavior with human instructions and preferences.
  • This process results in a wide range of capabilities, from summarization and translation to complex reasoning and question-answering.

Now that we have a grasp of what LLMs are and how they are built, we are equipped to take a more critical look at their real-world performance. In the next lesson, we will assess the current capabilities and business limitations of generative AI, focusing on critical issues for any consultant, such as accuracy, bias, and the now-famous problem of "hallucinations."