There’s Something Happening Here…

What it is ain’t exactly clear.

On November 30, 2022, ChatGPT was released to the public. The ideas underpinning ChatGPT were not new. The capabilities of the system were. Since that time, the technology has advanced considerably. The pace is staggering. Where it’s going is uncertain. There are talks of artificial general intelligence (AGI), an artificial intelligence that matches or surpasses human ability across most if not all intellectual tasks, and even artificial super intelligence (ASI), an artificial intelligence that exceeds the ability of human experts across nearly all domains, not just one narrow problem. What does seem to be certain is that there’s no going back. So, let’s at least try to understand where we are, how we got here, and how we might make sense of what’s to come.

Table of Contents

Goals

  1. Know how the current generation of LLM-based AI compares to other AI technology.
  2. Understand some of the historical context for the current generation of AI.
  3. Develop a basic understanding of LLM-powered Agents and their current usage patterns.

Objectives

  1. Identify key moments and research leading to LLMs and the current state-of-the-art AI.
  2. Compare and contrast current state-of-the-art AI to other AI systems, past and present.
  3. Explain the role of tokens, embeddings, and transformers in LLMs.
  4. Explain the basic architecture of current agent harnesses.
  5. Utilize effective prompting techniques for current agent systems.

AI, LLMs, and Agents, Oh My!

AI has been a serious subject of study since the earliest days of modern computing, i.e. for the better part of a century. Going back to antiquity, people have wondered and worried about humanity’s ability to produce a machine, something artificial, that could surpass our own abilities and possibly lead to our downfall. As a result, the phrase artificial intelligence, or AI, is quite loaded.

When people talk about AI these days, they’re generally referring to systems like OpenAI’s ChatGPT, Anthropic’s Claude, or Google/DeepMind’s Gemini. These are examples of generative AI: they generate new content given some existing content. The AI du jour generates text. This is in contrast with discriminative AI/predictive AI, which is used to categorize and classify things (think image recognition and spam detection) or make forecasts about future events given historical events.

In its simplest form, a text generation AI takes some input text called a prompt, predicts what text is most likely to follow that prompt, and then generates new, likely text. If more text is desired, it just feeds the text it just generated back into the system as part of the next prompt. This process makes these systems inherently probabilistic, based on probability or likelihood. Rather than selecting the most likely next token, they will sample from likely tokens. This means choosing with respect to their computed likelihood. This means that they are non-deterministic: they do not always produce the same outcome given the same input. Current systems are not solely based on a prompt. Instead, they maintain a general context that can include the prompt and other “conversation” history, rules for the AI, information about the background of the task, information about available tools, and more. From this complex context the AI determines likely text.

Current AI systems use a large language model (LLM) to determine what text to generate. We’ll get into more details about LLMs later. For now, we can think of this as a complex encoding of our language according to a very, very large collection of texts sourced from the internet and other sources. This text is broken up into tokens, which are small bits of text (think words, parts of words, etc.) that are treated as the atomic units of the language. This encoding includes some sense of the semantic meaning of these tokens as well as some sense of how that meaning is affected by its context within other tokens.

To arrive at this encoding, model developers use machine learning where text is given to the system, a prediction is made based on that text, and then the encoding parameters are modified based on the quality of the prediction. Modern LLMs use a process called self-supervised learning, where they take a sequence of tokens, mask out the last one in the sequence, then try to predict what it should be, then check themselves against the masked-out token. This is in contrast to supervised learning, where researchers use known input and output pairs (think learning to identify pictures of animals with labels saying what kind of animal is in the picture) or unsupervised learning where correct answers/predictions are unknown and instead the AI identifies hidden patterns or structures in the data (think grouping news articles together if they’re about similar topics). There is also reinforcement learning where other metrics of quality are used to determine success (think learning to identify safe foods to eat by eating them and seeing if you get sick or not) and the system learns through trial and error.

When people talk about models and frontier models, the models at the very cutting-edge, they are talking about a large language model that is trained to predict and generate tokens. It is the source of what we might identify as knowledge and intelligence. While a good model is necessary for the kind of artificial intelligence we’re seeing these days, it is not sufficient. Systems must be built that can leverage that intelligence in order to achieve goals and tasks. After all, it’s not just what you know, but how you use it.

How we use and experience these models is where we start to bump into the terms agent and agentic. An intelligent agent is a system that observes some problem, uses some intelligence, and then acts autonomously in order to achieve some goal or complete some task. ChatGPT took the GPT model and then trained it specifically to carry out the task of chatting. It gets some tokens from a user and figures out how best to respond. By extending an LLM with other features or task-specific training, we’ve been able to build agentic systems, systems driven by one or more agents, from the LLM core.

In technical computing work, we often turn to systems built with agentic coding in mind. These systems use the LLM core and extend it with an agent loop that builds in thinking, planning, and reasoning (driven by the LLM), access to tools that give the agent the ability to write, execute, and interpret the results of code and even our terminal commands, context management systems that modify and manage the context, the LLM input, and an agent harness that helps orchestrate the whole process. Later we’ll explore these systems, and LLMs, in more detail and compare the architecture of an agentic system to that of a computing system. For now, let’s stop and notice how this didn’t all happen overnight and see how the ideas behind this current era of AI have been brewing for decades.

A Very Brief Timeline of AI

  • A Logical Calculus of the Ideas Immanent in Nervous Activity., (McCulloch & Pitts, 1943)
    • Introduced artificial neurons and neural networks, the system at the heart of the LLM.
  • Computing Machinery and Intelligence. (Turing, 1950)
    • Proposed a test for intelligence and a long-term research plan for achieving it that emphasized the need for machine learning.
  • A Proposal for the Dartmouth Summer Research Project on Artificial Intelligence (McCarthy, Minsky, Rochester, and Shannon, 1955)
    • Introduced the term Artificial Intelligence and launched the field of study.
  • The Perceptron: A Perceiving and Recognizing Automaton (Project PARA), (Frank Rosenblatt, 1957)
    • Further developments on neural networks.
  • Learning representations by back-propagating errors. (Rumelhart, Hinton & Williams, 1986)
    • Established an effective means (Back-Propagation) of training layered networks. This method is still in use today.
  • A statistical approach to language translation. (Brown et al., 1988)
    • Championed a numerical, statistical approach to working with languages.
  • Backpropagation Applied to Handwritten Zip Code Recognition. (LeCun et al., 1989)
    • Further improvements and refinements to build more complex neural networks and use them to address real-world problems.
  • Deep Blue beats Kasparov (1997)
    • AI beat one of our best at one of our traditional games of intelligence and strategy.
  • A Neural Probabilistic Language Model (Bengio et al., 2000/2003)
    • Introduced embeddings and techniques needed for larger language models.
  • A Fast Learning Algorithm for Deep Belief Nets (Hinton, Osindero, & Teh, 2006)
    • Techniques for highly layered, deep, neural networks.
  • Large-scale Deep Unsupervised Learning using Graphics Processors (Raina, Madhavan, Ng, 2009)
    • Championed the use of GPUs to accelerate machine learning.
  • Watson wins Jeopardy! (2011)
    • AI beat one of our best at a general knowledge game based around text.
  • Neural machine translation by jointly learning to align and translate. (Bahdanau, Cho, and Bengio, 2014)
    • Introduced attention mechanisms for learning context-aware information about text.
  • AlphaGo beats Lee Sedol (2016)
    • AI beat one of our best at our most complex, traditional game of intelligence and strategy.
  • Attention Is All You Need. (Vaswani et al., 2017)
    • Launched the modern LLM era by introducing the transformer, the neural network architecture used by all the modern LLMs.
  • AlphaGo Zero beats AlphaGo (2017)
    • An AI learned how to be the best Go player only by playing against itself. It did not learn from any prior record of the game.
  • BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding (Devlin et al., 2018)
    • Early transformer-based language model from Google.
  • Improving Language Understanding by Generative Pre-Training (Radford et al., 2018)
    • The GPT in ChatGPT
  • Language Models are Few-Shot Learners. (Brown et al., 2020)
    • GPT-3. Shows that LLMs can be used to complete tasks given a prompt with some examples and don’t require task-specific training.
  • Training language models to follow instructions with human feedback (Ouyang et al., 2022)
    • Popularized Reinforcement Learning with Human Feedback (RLHF) to train models for alignment, producing outcomes that align with values (truthful, avoid harm, etc.).

Under the Hood of an AI Agent System

Let’s start by taking an architectural, systems-level look at agentic systems. It is unsurprising that current agent systems are getting structured in a way that is similar to computing systems. If nothing else, a direct comparison helps to understand how an LLM can be harnessed as a more generalized task or goal oriented problem solving system.

Subsystem Role Computing Counterpart
LLM Generates new tokens based on the current context The CPU
Context Window Stores tokens that determine the LLM’s next token Memory
Files Longer term storage of text/tokens Drives
Agent Loop Think-Act-Observe Loop that drives LLM usage CPU Fetch-Decode-Execute Runtime Cycle
Tools (CLI/MCP) External programs and services that can be called to take action. Results are returned to the context. I/O Devices
Agent Harness System that oversees and orchestrates Loop Execution, Tool Use, and Context Management The OS

Tokens, Context, and the Agent Loop

User prompts are now just a part of what drives the agent. The agent loop will direct the system to first analyze and break down the task, consider potential action steps, carry out those steps, observe and critique the results, then begin again by thinking, acting and observing. In more concrete terms, this means modifying the context window to include the user prompt as well as directives to think-act-observe. The text that is generated as a result is fed back into the context window to enact the loop. When actions are taken, the harness oversees the tool usage and adds to the context the results of the action/tool use. All of the tokens that this generates are the agent system equivalent of computing costs. If you want deep thinking with complex tool usage, then you need lots of tokens or an LLM that can somehow do more with less. When you want computation to be fast, you find a fast CPU and an algorithm that requires the least number of CPU operations. If you want a good agent system, then you try to balance model complexity with token usage.

If agent systems are a tool for us to complete complex tasks, then we need to consider both the quality of the result and the cost of achieving that result. Comparing token usage across models and agents gives us one way to compare and contrast the costs. It is also how the AI providers are evaluating our usage, i.e. it turns into a real, monetary cost. This NYT Visual Explainer on Tokens helps illustrate this point by looking at token usage across different generations of GPT.

The Models

We know computers work off binary data and so we’ve figured out how to encode our information into binary. The core of the LLM isn’t really computing with tokens. Tokens are the interface we use. Before an LLM can be used, it must first learn an effective encoding/decoding scheme for tokens that captures whatever it needs to know to be a really, really good general purpose next-token generator. This learning process is called training. The overall architectural structure of the model is decided by the designers. The structure has a very large number of parameters that must be assigned values. The goal of training is to assign to those parameters the set of values that yields the best next token predictions/generation.

Modern LLM architectures have two main features. The first is embeddings and the second is the transformer. Each token is embedded as a point in a very high-dimensional space (think 512 dimensions or higher). The model learns the best coordinate values such that the location for tokens with similar meaning is also similar. These coordinate vectors are the embeddings. In language, meanings are fluid. What a word means is dependent on the context in which it is used; the word cool can mean that something is good or that something has a particular temperature. To account for this, transformers learn attention parameters, which account for how one token (via its embedding) attends to or relates to other tokens within the prediction context. In a nutshell, they allow the model to account for the ways in which context changes meaning. The final part of the transformer is a neural network that uses learned weight parameters to determine how to evaluate the information encoded in the learned embeddings and attention values. This really great visual explainer from the Financial Times illustrates how all of this works without getting too technical. What’s really striking here is that the architecture doesn’t do anything other than give the system the space to learn contextualized meanings. There’s nothing to tell it what does or does not have meaning or what part of the context is important. The training process determines this through adjusting parameters.

Using Agent Systems - It’s Not Search

Current systems are designed to be problem solvers, not a static database of knowledge. To use them effectively means to guide them and take part in the process of solving a problem or completing a task. This means don’t ask it for something, but explain the problem, your goals, and give it guidance on how you’d like it to approach the problem. What’s more, you should encourage it to engage in dialogue with you either to help you sort through your goals and plans or to help ensure that what it plans to do is aligned with what you really want.

The ABCDQ prompting technique embodies this idea. The ABC portion stands for Act-Blueprint-Context. Tell the agent how it should act, what kind of problem solver it should behave like. Give it a blueprint for your desired end product: what kind of text do you want, and in what format? Finally, give it good contextual information like example documents, resources, etc. Basically, think of the best assignment you’ve ever been given; one with excellent instructions that left you knowing exactly what you needed to work on and what you needed to turn in. That’s what you need to give the agent.

The DQ portion is about keeping its work aligned and keeping you in the loop. Telling it to think deeply and critically and to check its own work is telling it that you want something that doesn’t miss out on some problem lurking over the horizon. You want it to leave no stone unturned. Instructing it to ask you clarifying questions will make sure that it checks in with you about options and details rather than assume what you want. You can’t cover everything with ABC. There are always unknown unknowns. The DQ portion of the prompt directs the agent to discover those unknowns and then involve you in the process of deciding how to handle them.

Glossary

Term Definition
Agent An intelligent system that observes a problem, uses intelligence (such as an LLM), and acts autonomously to achieve a goal or complete a task.
Agent Harness The system (analogous to an operating system) that oversees and orchestrates agent loop execution, tool use, and context management.
Agent Loop A recurring think-act-observe cycle (analogous to a CPU’s fetch-decode-execute cycle) that drives LLM usage by breaking down tasks, taking actions, observing results, and feeding those results back into the context.
Agentic Describing systems driven by one or more autonomous agents built around an LLM core with additional features, tools, or task-specific training.
Alignment Training models (such as through RLHF) so that they produce outcomes aligned with human values, such as being truthful and avoiding harm.
Artificial General Intelligence (AGI) An artificial intelligence that matches or surpasses human ability across most, if not all, intellectual tasks.
Artificial Intelligence (AI) The field of study and technology concerned with building artificial systems capable of performing tasks that typically require human intelligence.
Artificial Super Intelligence (ASI) An artificial intelligence that exceeds the ability of human experts across nearly all domains, not just one narrow problem.
Attention Parameters Parameters learned by a transformer that determine how one token (via its embedding) attends to or relates to other tokens within the prediction context, allowing the model to account for how context changes meaning.
Context The broader input maintained by an AI system—including the user prompt, conversation history, rules, task background, tool information, and prior tool outputs—from which the LLM determines likely next tokens.
Context Management Systems and mechanisms that modify and manage the context (the input to the LLM) over the course of an agent’s work.
Discriminative AI AI systems used to categorize and classify inputs (such as image recognition and spam detection), contrasted with generative AI.
Embeddings Learned coordinate vectors representing tokens as points in a very high-dimensional space (512 dimensions or higher), positioned so that tokens with similar meanings have similar locations.
Frontier Models Large language models at the very cutting edge of AI capability, trained to predict and generate tokens and serving as the core source of knowledge and intelligence in modern AI systems.
Generative AI AI systems (such as ChatGPT, Claude, and Gemini) that generate new content—such as text—given some existing content or context.
Large Language Model (LLM) A complex, learned encoding of language trained on massive collections of text that predicts and generates tokens based on their semantic meaning and surrounding context.
Machine Learning A process in which data is given to a system, a prediction is made, and the system’s parameters are modified based on the quality of that prediction.
Non-Deterministic A property of systems (such as LLMs using sampling) that do not always produce the same outcome given the same input.
Predictive AI AI systems used to make forecasts about future events based on historical data, contrasted with generative AI.
Probabilistic Based on probability or likelihood; in text generation, an LLM computes likelihoods for candidate next tokens and samples from them rather than following fixed deterministic rules.
Prompt Input text provided to a text-generation AI from which it predicts and generates likely following text.
Reinforcement Learning A machine learning approach in which a system learns through trial and error using external metrics of quality or feedback to determine success.
Self-Supervised Learning A machine learning process used by modern LLMs in which the system takes a sequence of tokens, masks out the last token, tries to predict it, and checks its prediction against the masked-out token.
Supervised Learning A machine learning approach in which models are trained using known input-and-output pairs (such as labeled pictures of animals).
Tokens Small bits of text (such as words or parts of words) treated as the atomic units of language by an LLM.
Training The learning process of assigning values to a model’s parameters so that it yields the best next-token predictions and generation.
Transformer The neural network architecture used by modern LLMs, combining learned attention parameters with a neural network to capture context-sensitive meaning and evaluate information across tokens.
Unsupervised Learning A machine learning approach in which correct answers or labels are unknown and the AI instead identifies hidden patterns or structures in the data (such as grouping news articles by topic).