Understanding AI and learning how to use it effectively.

.


Overview and Issues

Artificial Intelligence (AI) has grown far beyond its roots in language processing. Today's systems analyze images, generate video, write software, solve complex problems, and interact in ways that often appear human. AI is powerful and will become a routine part of everyday life: yet it is not magic, nor is it "super intelligence." At its core, AI is the result of relatively simple processes repeated on an enormous scale, producing surprisingly versatile results. Because it will have a profound influence on all our lives and careers, we all need to understand how it works. 

AI makes headlines but nobody should be intimidated by it. Our challenge is not to reject it but to learn how to use it effectively and responsibly. Those who understand it will gain an advantage; students who ignore it may find themselves left behind.

The focus of this paper is the Large Language Model (LLM), where it all began.

How LLMs work  

LLM’s process words: they break them down into small pieces called tokens. Humans read words, LLMs read tokens! (I think of them as wordlets).

They are built around the surprisingly powerful idea of predicting what token comes next in a phrase, for example: "The cat went...."   where? They can extend a simple phrase like that into a sentence, a paragraph, or a book: how it does that is clever. 

The tokens may be a whole word, part of a word, punctuation, or even a space. For example, "unhappiness" might be represented as "un" and "happiness" (different models use different systems to create the tokens). The tokens included in the model represent its vocabulary (which can be as large as an entire language), but reducing them to tokens reduces the vocabulary size.

There are four major components to an AI system:

1.        The vocabulary of tokens. To improve the response time, the size of the vocabulary may be limited, or subject oriented. In addition, each token is associated with an embedding, a collection of numerical values that place it within a mathematical space. Tokens are described as coordinates which help the model recognize that "dog" is more closely related to "puppy", “pet”, and “golden retriever” than to "airplane", and that words like “bank” can acquire different meanings depending on context. The combination of the vocabulary and its embedding comprise a very large matrix, with thousands of values matched to each token.

2.       The second component is a specialized computer architecture based on transformers, large mathematical pattern-finding systems which add still more parameters. Graphics processing units (GPUs) match this analysis very well, and are widely used in parallel computations that evaluate not only sequences of words, but entire segments of text simultaneously. This enables the computer to evaluate words in context, and produce answers that often appear to involve reasoning.

(You can see an example of LLM reasoning in the Appendix at the end of the paper).

3.       The third component is the methodology of communicating with the model. Instructions to the model are specified in terms of “prompts”, natural language commands that direct its behavior. Prompts are hierarchical. At the designer level, they specify a collection of behavioral guidelines and safety constraints that are intended to discourage illegal activity, protect privacy, respect intellectual property, support child safety, and encourage useful responses. User prompts are the natural language expression of inputs to the model (they are what you write when you communicate with a chatbot).

4.       The fourth component is training, in which the model is given millions of examples of text that show how humans use tokens in communications. The sequencing of the tokens is evaluated in different applications created by different humans, and billions of numerical weights in the embedding are adjusted using the training texts. Over time, the model gradually learns statistical relationships between words, ideas, grammar, facts, and context that allows the model to generate answers that resemble intelligence.

Modern frontier models are typically trained in stages:

Pretraining    Goal: "What token comes next?"

Result: a "base model" that has learned language patterns, facts, coding styles, reasoning patterns, and much more as a byproduct.

Supervised Fine-Tuning     Goal: "How should an assistant answer?"

Human involvement pairs prompts with good answers to teach the LLM to respond in the format humans expect.

Alignment Training      Goal: "Which answer would humans prefer?"

Human evaluators compare outputs, and the model is adjusted to prefer answers rated as more helpful, honest, and safe.

The largest ("Frontier") LLMs are not trained with the goal of "acting like a human"; they process language, predicting likely token sequences from patterns found in vast amounts of human-generated content. In doing so, they accumulate statistical patterns derived from how millions of humans have written, communicated, and responded to one another across an enormous variety of contexts. 

In other words, they learn how humans respond. As you will see below, the credibility of that response increases dramatically as they are able to evaluate context over longer sections of text, but what do they really understand?  

The complexity of a model is often measured by the number of parameters it contains:

parameters are the numerical weights distributed throughout the model, including but not limited to the embedding representations of tokens. Learned during training, modern Frontier models contain hundreds of billions of parameters that require enormous amounts of computing power and data to train, and LLM training costs can exceed $100M.

So, when we are all done with scanning billions of phrases, loading them into supercomputers, analyzing the relationships between every token in millions of situations, what can it do? 

What can a LLM do?

The technology is young. CHAT GPT-4, released in March 2023, was among the first Frontier models to demonstrate where LLM could go. The following table shows how increasing LLM parameter size has, over a very short period of time, increased the number of applications that they can do. Capabilities emerge gradually rather than at fixed parameter thresholds, and parameter counts provide only an approximate indication of model capability, because architecture, training data, training methods, and computational resources also influence performance. The table is intended as an illustrative summary of general trends reported in the

LLM literature. 1




AI and Your Student

MathDoesWork

Peter Gregory Bonita Springs, FL petergregory@computer.org · A personal approach to math