This article is a popular-science piece published by Ars Technica in July 2023, titled "A jargon-free explanation of how AI large language models work," aimed at general readers who want to truly understand large language models (LLMs), providing a gentle introductory guide. Without relying on technical jargon or advanced mathematics, the article attempts to explain the known internal workings of LLMs.
Purpose: To help non-expert readers understand the basic working mechanisms of large language models such as ChatGPT, including core concepts such as word vectors, Transformers, attention mechanisms, and training data requirements.
Main capabilities (that is, the knowledge points covered by the article):
- Word vectors: Language models represent words with a long string of numbers (such as 300-dimensional vectors), similar to using longitude and latitude to represent geographic locations. Words with similar meanings are closer together in vector space (for example, near cat are dog, kitten, and pet). Vector arithmetic can capture analogical relationships, such as "big is to biggest as small is to smallest," as well as relationships involving nationality, capital cities, antonyms, plurals, and gender roles. Word vectors also reflect biases in human language; for example, "doctor minus man plus woman" may yield "nurse." Reducing such biases is an active area of research.
- Context-dependent representations: The word-vector approach can handle polysemy and homonyms, with the same word using different vectors in different contexts (such as bank meaning a financial institution or a riverbank, and magazine meaning a physical magazine or a publishing organization). Vectors for polysemous words are more similar than those for homonyms. Natural language is full of ambiguity, such as pronoun reference and part-of-speech determination, and world knowledge is needed to resolve it.
- Transformer architecture: Each layer is a Transformer, first proposed by Google in a 2017 paper. The input is a partial sentence, with each word represented by a word vector. After passing through multiple layers of Transformers, contextual information is added layer by layer to form hidden-state vectors. Earlier layers focus on syntax and ambiguity resolution, while later layers build a high-level understanding of the entire text and track information such as character gender, age, relationships, locations, personality, and goals. The most powerful version of GPT-3 has 96 layers, and its word-vector dimension reaches 12,288 dimensions. These extra dimensions can be regarded as a "scratch space" for the model to record contextual notes.
- Attention mechanism and feed-forward network: A Transformer internally updates hidden states in two stepsstate. In the attention step, each word generates a query vector (describing the characteristics of the word it is looking for) and a key vector (describing its own characteristics). The network compares keys with queries via dot products, finds the best match, and passes information. In the feedforward step, each word "thinks" about the information gathered by the previous attention and tries to predict the next word.
- Training and data requirements: The article explains how the model is trained and discusses why good performance requires massive amounts of data.
How to use: This article is an online article that readers can access and read directly via URL, with no installation or registration required.
Applicable scenarios: Suitable for readers interested in AI large language models who want an intuitive understanding but lack a technical background; it can serve as introductory popular science material.
Limitations: The article clearly points out that no one fully understands the internal workings of LLMs, researchers are still working on it, and this process may take years or even decades. Some examples in the article (such as the schematic diagram of a multi-layer Transformer) are stylistic assumptions and should not be over-interpreted in detail. The article does not provide information on specific products, fees, prices, platforms, or effects.
