Mathematical Foundations and Architectures of OpenAI and Anthropic Models

  • Home
  • Mathematical Foundations and Architectures of OpenAI and Anthropic Models
image

Mathematical Foundations and Architectures of OpenAI and Anthropic Models

  • CategoryIT & Software
  • AuthorArmen Melkumyan
  • Views0
  • PublishedAugust 9, 2026
31 min read

The strongest public evidence shows that OpenAI has used several distinct transformer families rather than a single architecture: the original GPT, GPT-2, and GPT-3 are decoder-only autoregressive transformers; Whisper is an encoder-decoder transformer for speech; OpenAI’s text/code embedding models are transformer encoders trained with a contrastive objective; and CLIP is a dual-encoder contrastive model aligning text and images. By contrast, GPT-4’s technical report explicitly withholds architecture and model-size details, and Anthropic’s public Claude system cards describe Claude as a large language model or hybrid reasoning large language model but do not publish a GPT-3-style layer-by-layer architecture table or parameter count for deployed Claude models. In other words, for OpenAI the public mathematical record is richer; for Anthropic, the public record is much thinner on exact block structure and much richer on alignment and safety procedure. [1]

At the mathematical level, these systems are built on the same backbone: token embeddings plus positional information, stacked attention and feed-forward blocks, and a final linear projection with softmax to produce next-token probabilities. The formal law is the autoregressive factorization

with each conditional obtained by a causal transformer and vocabulary softmax. Embedding vectors are learned either indirectly through language-model cross-entropy or directly through contrastive objectives that optimize cosine-similarity geometry in a shared vector space. [2]

Increasing context windows is not "free scale," and it is not the same kind of improvement as increasing training data or parameter count. A larger context window expands temporary access to evidence inside the prompt; larger training datasets and larger parameter counts change what the model has learned into its weights. Accuracy improves only when useful evidence is present and the model can locate and use it, or when added data and parameters improve the learned distribution. Full self-attention still induces quadratic pairwise interactions in sequence length, long-context inference accumulates a linearly growing KV cache and severe memory-bandwidth pressure, and model quality can degrade even when the nominal context window grows. There are also real theorems here: conditional lower bounds show that standard self-attention cannot in general be made subquadratic unless widely believed complexity assumptions fail; other results show fixed-depth/head self-attention has formal language limitations; and empirical studies show strong primacy/recency bias in long contexts. Sparse attention, kernelized linear attention, recurrence, external memory, retrieval, and position-scaling methods help, but each changes the inductive bias and introduces its own failure modes. [3] [31] [41] [43]

The deepest conclusion is therefore negative in the strict mathematical sense: there is no known theorem proving a universal finite end point for AI capability growth, and no known theorem proving that capability is unbounded in the real world. What we do have are narrower results: scaling laws on many tasks are approximately power-law over wide ranges; compute-optimality imposes hard trade-offs between model size and data; generalization bounds imply sample-complexity limits for fixed hypothesis classes; no-free-lunch results deny a universally best learner over all data-generating processes; and architecture-specific theorems show both limits and workarounds. The evidence supports continued improvement with diminishing returns and changing architectures, not a single closed-form “final ceiling.” [4]

Publicly documented architectures used by OpenAI and Anthropic

The most rigorous way to answer “what architectures do OpenAI and Anthropic use?” is to separate what is explicitly published from what is only inferred. OpenAI has published exact architecture details for early GPT models, Whisper, CLIP, and embedding systems; it has not published those details for GPT-4. Anthropic has published system cards and alignment papers for Claude, but the public materials reviewed here do not provide GPT-3-like disclosures of layer count, hidden width, attention head count, or total parameter count for Claude family models. [5]

Below is a structured overview of what is publicly known.

1. OpenAI GPT: Fully Public for the Original Generation

The original OpenAI GPT model is described as a decoder-only Transformer using masked self-attention.

OpenAI’s paper explicitly states that the model used a multi-layer Transformer decoder. It also provides the autoregressive objective:

L₁(U) = Σᵢ log P(uᵢ | uᵢ₋ₖ:ᵢ₋₁; Θ)

The paper further documents the state update:

h⁰ = UWₑ + Wₚ

and the output distribution:

P(u) = softmax(hⁿWₑᵀ)

The reported model configuration was a 12-layer decoder-only Transformer with masked self-attention, 768-dimensional hidden states, and 12 attention heads. [6]

Disclosure status: fully public for this generation.

2. GPT-2: Public Decoder-Only Transformer Language Model

GPT-2 follows the same broad architectural lineage as GPT, but with several important refinements.

The GPT-2 paper describes the model as a decoder-only Transformer language model with pre-normalization, an additional final layer normalization, modified residual initialization, byte-level BPE tokenization, and a larger context window increased from 512 to 1024 tokens. [7]

Disclosure status: fully public.

3. GPT-3: GPT-2-Style Architecture at Massive Scale

GPT-3 is described as using the same model and architecture as GPT-2, with one notable change: alternating dense and locally banded sparse attention patterns.

The GPT-3 paper reports the largest model as having 175 billion parameters, 96 layers, model dimension d_model = 12,288, 96 attention heads, head dimension d_head = 128, and context length n_ctx = 2048. [8]

Disclosure status: fully public.

4. InstructGPT and ChatGPT: Public Post-Training, Less Public Production Detail

InstructGPT is best understood as a GPT-3-style autoregressive base model followed by alignment-oriented post-training.

OpenAI describes InstructGPT as GPT-3 fine-tuned using supervised demonstrations, reward modeling, and reinforcement learning from human feedback. ChatGPT is described as a sibling model to InstructGPT.

The broad post-training recipe is public. However, exact deployed checkpoint details and production variants are not fully disclosed. [9]

Disclosure status: backbone family public; exact production variants not fully public.

5. GPT-4: Architecture Intentionally Undisclosed

GPT-4 is described by OpenAI as a large multimodal model.

However, the GPT-4 technical report explicitly states that it contains no further details about architecture, including model size, hardware, training compute, dataset construction, training method, or similar implementation information. [10]

Disclosure status: intentionally undisclosed.

6. Whisper: Public Encoder-Decoder Transformer

Whisper is one of OpenAI’s most clearly documented architectures.

OpenAI describes Whisper as an encoder-decoder Transformer. Audio is first converted into a log-Mel spectrogram, then passed into an encoder. A decoder then predicts text tokens and task-control tokens.

The paper also states that the encoder and decoder have the same width and the same number of Transformer blocks. [11]

Disclosure status: fully public.

7. OpenAI Text and Code Embeddings: Public Research Objective, Partially Documented Commercial Models

OpenAI’s embedding research describes a Transformer encoder trained using a contrastive learning objective with in-batch negatives.

The paper reports embedding dimensions ranging from 1024 to 12,288 across model sizes from 300 million to 175 billion parameters. OpenAI’s current commercial embedding family includes text-embedding-3-large, which supports up to 3072 dimensions. [12]

Disclosure status: research objective public; commercial checkpoints partly documented.

8. CLIP: Public Dual-Encoder Architecture

CLIP is a dual-encoder model consisting of an image encoder and a text encoder trained into a shared embedding space.

OpenAI states that CLIP jointly trains the image and text encoders to predict correct image-text pairings. The system uses normalized embeddings and a symmetric contrastive cross-entropy loss over similarity scores. [13]

Disclosure status: fully public.

9. Anthropic Claude Family: Public Alignment Methods, Limited Block-Level Disclosure

Anthropic publicly describes the Claude family as large language models. For Claude 4, Anthropic describes Claude Opus 4 and Claude Sonnet 4 as “hybrid reasoning” large language models.

The Claude 4 system card documents training data and process, extended thinking mode, and Constitutional AI-related post-training. Earlier Anthropic papers also describe fine-tuning pretrained language models with reinforcement learning from human feedback and Constitutional AI.

However, the cited public materials do not provide a GPT-3-style block specification with precise architectural parameters. [14]

Disclosure status: public training and alignment details; exact block architecture not disclosed.

The architectural landscape is easier to see as a map than as prose:

This schematic matches the primary sources above: GPT papers specify the decoder-only line; Whisper gives an encoder-decoder architecture; CLIP and OpenAI’s embedding paper specify contrastive encoders; Anthropic’s public Claude materials characterize the product family at a higher level and do not release exact stack hyperparameters. [15]

Let a tokenized sequence be denoted by x₁:ₙ, where |V| is the vocabulary size and d is the embedding dimension.

For each token xᵢ, let eₓᵢ ∈ ℝ|V| be the one-hot vector corresponding to that token. The standard input representation at position i is then:

hᵢ⁽⁰⁾ = Eᵀeₓᵢ + pᵢ

Here, E ∈ ℝ|V|×d is the token-embedding matrix, and pᵢ ∈ ℝᵈ is the positional representation for the i-th position in the sequence.

The term Eᵀeₓᵢ maps the sparse one-hot token representation into a dense vector in ℝᵈ. The positional representation pᵢ is then added to this token embedding so that the model receives information about both the identity of the token and its position in the sequence.

In the original Transformer architecture, positional encodings can be sinusoidal. This allows the model to encode token order without using recurrence or convolution.

Formal transformer mathematics, embeddings, and next-token generation

Let a tokenized sequence be x_(1:n), with vocabulary size |V| and embedding dimension d. If e_(x_i) ∈ R^|V| is the one-hot vector for token x_i, the standard input representation is

h_i^((0)) = E^⊤ e_(x_i) + p_i,

where E ∈ R^(|V|×d) is the token-embedding matrix and p_i ∈ R^d is the positional representation. In the original Transformer, positional encodings can be sinusoidal,

PE(pos,2i) = sin(pos / 10000^(2i/d)),

PE(pos,2i+1) = cos(pos / 10000^(2i/d)),

while the original GPT uses a learned position embedding matrix W_p added to token embeddings. MIT Press’s overview emphasizes the underlying reason: a vanilla transformer is permutation-invariant unless position information is injected. [16]

The core primitive is scaled dot-product attention. For queries Q, keys K, and values V,

Attention(Q,K,V) = softmax((QK^⊤) / √(d_k))V.

Multi-head attention applies several learned projections in parallel:

MultiHead(Q,K,V) = Concat(head_1,…,head_h) W^O,

with

head_i = Attention(QW_i^Q, KW_i^K, VW_i^V).

In the original Transformer, the position-wise feed-forward network is

FFN(x) = max(0, xW_1 + b_1) W_2 + b_2.

These are the canonical equations from the original Transformer paper. [17]

Using this notation, a standard encoder layer can be written schematically as

H̃^((l)) = LN(H^((l-1)) + MHA(H^((l-1)), H^((l-1)), H^((l-1)))),

H^((l)) = LN(H̃^((l)) + FFN(H̃^((l)))).

A standard decoder layer has the same self-attention structure but with a causal mask M that forbids attention to future positions:

CausalAttn(Q,K,V) = softmax((QK^⊤ + M) / √(d_k))V,

M_ij = -∞ for j > i.

An encoder-decoder model then adds a cross-attention sublayer in which decoder queries attend to encoder-produced keys and values. The original Transformer paper explicitly states: encoder self-attention uses Q = K = V from the encoder; decoder self-attention is masked; encoder-decoder attention uses queries from the decoder and keys/values from the encoder output. [18]

That leads directly to the three major transformer families relevant here:

OpenAI’s GPT line instantiates the decoder-only branch; Whisper instantiates the encoder-decoder branch; OpenAI text/code embeddings instantiate a transformer encoder trained to produce sentence or code embeddings; CLIP instantiates a dual-encoder extension in which separate encoders are trained into a shared space. Anthropic’s public Claude documents do not publish a block-level diagram of this kind for Claude itself. [19]

An embedding vector is simply a learned vector v ∈ R^d representing a token, sequence, document, image, or code snippet in a latent space. OpenAI’s embeddings guide defines an embedding as a vector of floating-point numbers whose distances measure relatedness; the text/code embedding paper computes cosine similarity

sim(x,y) = (v_x ⋅ v_y) / (∥v_x∥ ∥v_y∥),

then forms logits

logit(x_i,y_j) = sim(x_i,y_j) exp(τ),

with trainable temperature τ, and optimizes symmetric cross-entropy over the batch matrix. CLIP uses the same basic geometry with L2-normalized embeddings and symmetric contrastive loss over image-text similarity scores. Current OpenAI production embeddings include a commercial model producing vectors of up to 3072 dimensions. [20]

This yields a useful taxonomy of how embeddings are learned in OpenAI systems:

For GPT, GPT-2, and GPT-3, the embedded objects are tokens and contextual sequence states. These embeddings are learned through autoregressive cross-entropy on next-token prediction. In this setting, embeddings are optimized indirectly as part of the broader objective of minimizing the language-model loss. [21]

For OpenAI text/code embeddings, the embedded objects are text and code sequences. These models are trained using a contrastive objective with in-batch negatives. Their mathematical geometry is explicit: the embedding space is shaped around cosine similarity, with a trainable temperature parameter controlling the scale of the similarity logits. [22]

For CLIP, the embedded objects are image and text representations. The training signal is symmetric contrastive cross-entropy over paired image-text similarity scores. This produces normalized embeddings in a shared multimodal space, allowing images and text to be compared directly through their learned representations. [23]

For Whisper, the embedded object is an audio-to-text latent mapping. The training signal is sequence-to-sequence conditional generation. In this architecture, spectrogram features are encoded, and text is then predicted autoregressively from those encoded representations. [24]

For decoder-only language models, next-token generation follows from the chain rule of probability. If h_t = f_θ(x_(≤t)) is the causal hidden state at position t, then the model produces logits

z_t = W_U h_t + b ∈ R^|V|,

and a conditional distribution over the vocabulary:

p_θ(x_t = v ∣ x_(<t)) = exp(z_(t,v)) / (∑(u∈V) exp(z(t,u))).

The joint probability of the entire sequence is then

p_θ(x_(1:T)) = ∏(t=1)^T p_θ(x_t ∣ x(<t)),

and maximum-likelihood training maximizes

∑(t=1)^T log p_θ(x_t ∣ x(<t)),

equivalently minimizing token-level cross-entropy. This is exactly the mathematical form used in OpenAI’s original GPT paper and the general Transformer decoder architecture. [25]

At inference time, the most common decoding rules are easy to write down. Greedy decoding chooses

x_t = arg max_(v∈V) p_θ(v ∣ x_(<t)).

Top-k chooses the k highest-probability tokens K_t ⊆ V and samples from the renormalized distribution

q_k(v) = { p_θ(v ∣ x_(<t)) / ∑(u∈K_t) p_θ(u ∣ x(<t)), if v ∈ K_t, 0, otherwise. }

Nucleus or top-p sampling chooses the smallest set S_t ⊆ V whose cumulative mass is at least p, then samples from the renormalized distribution over S_t. Holtzman et al. motivate nucleus sampling by showing that open-ended generation often benefits from truncating the unreliable tail of the token distribution; more recent theory formalizes top-k as a sparse-probability truncation rule. [26]

Context windows, positional information, and why long context is hard

A context window is the maximum sequence length that a model can condition on in one forward pass. In public OpenAI model documentation, GPT-4.1 is presented with a 1M-token context window; earlier GPT-3 used 2048 tokens; documented GPT-4 Turbo had 128K; Anthropic first announced Claude’s expansion from 9K to 100K, later offered 200K in Projects, and now advertises 1M-token context windows in beta for Claude Sonnet 4.6 and Claude Opus 4.6. The important mathematical point is that the context window is a property of both the architecture and the positional mechanism, not just the tokenizer or product packaging. [27]

Positional information is central because self-attention without it is indifferent to sequence order. The original Transformer injects sinusoidal positions; GPT introduces learned position embeddings; RoPE rotates query/key coordinates by position-dependent matrices; ALiBi adds a learned-distance bias directly to attention scores. RoPE is attractive for long-context models because it encodes relative phase structure in attention; ALiBi is attractive because it supports train-short, test-long extrapolation with almost no additional parameters or runtime cost. [28]

The first difficulty with long context is purely computational. In standard full attention, the score matrix QK^⊤ is n × n, so both work and memory scale quadratically with sequence length n. FlashAttention improves wall-clock speed and memory movement by tiling the computation without changing the exact attention semantics; later work proves the I/O complexity achieved by FlashAttention is optimal for broad cache regimes. But this is still an exact-attention optimization, not a proof that full attention ceases to be expensive. [29]

The second difficulty is autoregressive inference memory. Once a decoder generates token t, it typically stores per-layer keys and values so later tokens can attend back without recomputing everything. This KV cache grows linearly with past context length and can become the dominant memory-bandwidth bottleneck in serving large decoder models. Berkeley’s “AI and Memory Wall” argues that, for serving decoder transformers, memory bandwidth increasingly dominates arithmetic throughput; related inference studies emphasize that latency targets become hard because parameters and KV state must be streamed from high-bandwidth memory during generation. [30]

The third difficulty is quality, not just cost. Stanford’s Lost in the Middle shows that many LLMs do not use long contexts uniformly well: performance can degrade sharply depending on where the relevant information is placed, with strong primacy and recency effects. So “accepts 100K or 1M tokens” does not by itself imply “uses those tokens optimally.” This distinction matters when interpreting product claims for both OpenAI and Anthropic long-context systems. [31]

There are also formal limits. Stanford’s Hahn proves strong limitations for self-attention sequence models: across soft and hard attention, they cannot model certain periodic finite-state languages or hierarchical structure unless layers or heads grow with input length. Keles, Wijewardena, and Hegde prove conditional lower bounds showing that the time complexity of self-attention is necessarily quadratic in sequence length in a wide range of settings unless the Strong Exponential Time Hypothesis fails, and that this barrier persists even under approximation and variants such as windowing/striding. These are unusually strong results for an area that is otherwise mostly heuristic and empirical. [32]

Not all long-context alternatives are equal, and the cleanest way to compare them is mathematically:

For full attention, the core idea is to compute exact softmax(QK^⊤/√d)V over all token pairs. Its typical asymptotic effect in sequence length n is quadratic pairwise interactions in n. The main trade-off is that it offers the best fidelity, but the worst scaling. [33]

For sparse / local-global attention, the core idea is to restrict the attention graph to windows, global tokens, and/or random edges. Its typical asymptotic effect is often near-linear in n when window and global counts stay bounded. The main trade-off is efficiency, but the inductive bias may miss arbitrary dependencies unless routing is well chosen. Longformer uses local plus task-motivated global attention; BigBird reduces quadratic dependence to linear and proves universal approximation and Turing completeness. [34]

For I/O-aware exact attention, the core idea is to reorder exact attention computation to minimize memory traffic. Its semantics remain the same, but wall-clock performance and memory traffic improve. The main trade-off is that it does not remove quadratic attention arithmetic; it is chiefly a systems fix. [35]

For linear / kernel attention, the core idea is to rewrite attention using feature maps, for example ϕ(Q)(ϕ(K)^⊤V). Its typical asymptotic effect is linear in n for fixed feature dimension or rank. The main trade-off is that it is faster and more recurrent-like, but approximation quality and content-based selectivity can suffer. [36]

For recurrence / memory tokens / state-space models, the core idea is to pass compressed state or memory across segments instead of attending to all prior tokens. These methods provide segmentwise or linear-time alternatives. The main trade-off is better asymptotics, but with a stronger bottleneck through state compression and different optimization dynamics. Universal Transformer adds recurrence and gains computational universality under assumptions; Recurrent Memory Transformer adds memory tokens; Mamba replaces attention with selective state-space dynamics. [37]

For retrieval / external memory, the core idea is to fetch relevant chunks from a large corpus or memory and cross-attend to them. The context cost shifts from raw sequence length to retrieval plus cross-attention. The main trade-off is potentially huge effective memory, but retrieval quality and latency become first-order errors. RETRO retrieves from trillions of tokens; Memorizing Transformer augments attention with KNN-style memory. [38]

For positional extrapolation / interpolation, the core idea is to keep the model mostly fixed and modify position handling. This extends usable sequence length n without retraining from scratch. The main trade-off is that it helps stability and window extension, but does not by itself solve reasoning degradation. ALiBi adds linear distance bias; Position Interpolation rescales indices for RoPE models and proves a much smaller upper bound than extrapolation; YaRN improves compute efficiency. [39]

A compact historical view of long-context methods looks like this:

The right conclusion is therefore not “long context is solved,” but “long context has decomposed into several partially orthogonal subproblems”: positional extrapolation, exact-kernel efficiency, sparse graph design, recurrent compression, and retrieval quality. Modern deployed systems mix several of these techniques, but public documentation for GPT-4 and Claude does not fully reveal which combination each company uses internally. [40]

Accuracy, learning scale, and usable context

The previous section explains why long context is difficult as an engineering and mathematical problem. The next step is to separate three different kinds of scale that are often confused: N, the number of model parameters; D, the number of training tokens; and W, the context-window length. These variables all affect performance, but they affect accuracy in different ways.

A compact way to describe task accuracy is:

A(N,D,W) = Pr[the model gives the correct answer | N,D,W, task distribution]

For language-model pretraining, the more common mathematical proxy is test loss rather than direct answer accuracy:

L(N,D,W) = E[-log p_theta(x_t | x_{t-W:t-1})].

Lower loss usually correlates with stronger models, but it does not guarantee perfect factuality, reasoning, or instruction-following. Accuracy depends not only on the average next-token prediction problem, but also on whether the task gives enough information, whether the model learned the relevant domain, whether the prompt is clear, and whether the model can use the evidence inside the context window.

Context window: access to evidence, not automatic accuracy

A context window controls how much input the model can temporarily condition on during one forward pass. For an autoregressive model, the ideal conditioning on the whole past is usually approximated by conditioning on the visible window:

p_theta(x_t | x_<t) approx p_theta(x_t | x_{max(1,t-W):t-1}).

If the required evidence is outside the window, the model cannot directly use it. In that case, accuracy is capped by memorized knowledge, guessing, retrieval outside the model, or tool use. Increasing W can therefore improve accuracy when it brings relevant evidence into view. However, once the relevant evidence is already inside the prompt, making W even larger does not mathematically guarantee better accuracy.

The reason is that the model must find and prioritize the right evidence among more tokens. In a simplified attention picture, the attention mass on a relevant token can be approximated as:

alpha_relevant approx 1 / (1 + (W - 1) exp(-(s_star - s_bar))).

Here s_star represents the score of the relevant token and s_bar represents the average score of distractor tokens. The formula is only an explanatory simplification, but it captures the key pressure: as W grows, the relevant evidence must stand out from more irrelevant evidence. If the score gap is not large enough, additional context can dilute attention or distract the model instead of improving the answer.

This creates a difference between the nominal context window and the effective context window:

W_nominal = maximum tokens the product accepts

W_effective = maximum tokens the model can use reliably for the task

A product can accept a very large prompt while still having a smaller effective context for difficult reasoning or retrieval. Stanford's Lost in the Middle result is important here because it shows that models can use information unevenly across a long prompt, with performance depending strongly on where the relevant information appears. The earlier long-context section also explains the compute, KV-cache, and formal self-attention limits that make W expensive to scale. [29] [30] [31] [32]

Training data and parameters: learned capability, not guaranteed truth

Training data and parameter count affect a different part of the system. Context tokens are temporary input. Training tokens update the model parameters. During pretraining, a simplified objective is:

min_theta (1/D) sum_{t=1}^D -log p_theta(x_t | x_<t).

Increasing D gives the model more examples from which to learn language, facts, code patterns, reasoning patterns, and domain structure. Increasing N gives the model more capacity to represent and transform those patterns. But accuracy is not a one-variable function of parameter count. Empirical scaling-law work is better summarized by an approximate relation such as:

L(N,D) approx L_inf + a N^(-alpha) + b D^(-beta), with alpha,beta > 0.

This form means that more parameters and more training data can reduce loss over broad studied ranges, but the improvements have diminishing returns. As N and D grow, each additional parameter or token usually buys less improvement than the previous one. The Chinchilla result sharpens the same point: under a fixed compute budget, model size and training-token count must be balanced; more parameters alone can produce an undertrained model. [41] [43]

Data quality is also a hard limitation. More data helps only when the additional examples contain useful signal. Noisy, duplicated, biased, outdated, contradictory, or irrelevant data can limit or distort what the model learns. Large networks can also fit random labels, so high capacity alone does not prove useful generalization. This is why model size, training-token count, data quality, optimization, architecture, and post-training all matter. [44] [46]

Practical comparison

For context window W, the main improvement is temporary access to evidence in the current prompt, conversation, document, or retrieved material. The main accuracy limitation is that the model may not find or use the evidence; irrelevant or conflicting text can distract it; and nominal context can exceed effective context.

For training tokens D, the main improvement is statistical learning stored in the weights before deployment. The main accuracy limitations include diminishing returns, noisy or duplicated data, outdated facts, distribution shift, and finite high-quality data.

For parameters N, the main improvement is capacity to store and transform complex learned patterns. The main accuracy limitations include undertraining if D is too small, high compute and memory cost, overfitting or memorization, and no guarantee of alignment or truth.

For compute C, the main improvement is enough optimization and inference computation to use N, D, and W effectively. The main accuracy limitations are hardware cost, energy, latency, memory bandwidth, and serving constraints.

The practical lesson is that a larger context window improves access, while larger training data and more parameters improve learned capability. Access and capability are different. Accuracy requires both, plus good data, reliable attention, sufficient compute, appropriate architecture, and post-training that makes the model follow instructions rather than merely continue text.

Plain-language interpretation

An intuitive analogy is useful. Training data is like education before an exam. The context window is like the open book allowed during the exam. Parameters are like the capacity of the student to store and process what was learned. More pages in the open book do not guarantee a correct answer if the student cannot find the right page. More education does not guarantee truth if the books were noisy or wrong. A larger capacity does not guarantee accuracy if it was not trained, organized, or aligned well.

Therefore, when judging OpenAI, Anthropic, or any other LLM product, the most important question is not only how large the model is or how many tokens it accepts. The better question is how much of that context it can use reliably, how good the training data was, whether model size and data were balanced, what post-training was applied, and whether the system has retrieval or tools for facts that are not stored in the weights.

Scaling laws, learning-theoretic limits, and what they imply

OpenAI’s 2020 scaling-law paper is still one of the clearest mathematical descriptions of frontier LLM progress. It reports that test loss scales as a power law with model size N, dataset size D, and training compute C, and that within a broad regime performance depends much more strongly on overall scale than on depth/width tradeoffs. It also reports predictable overfitting behavior via the ratio N^0.74/D, and concludes that compute-efficient training prefers very large models trained significantly short of convergence. [41]

GPT-4’s technical report adds a second layer of evidence: OpenAI states that it predicted GPT-4’s final loss by fitting

L(C) = aC^b + c

from much smaller runs, and also predicted HumanEval pass rate by an approximate power law in compute. That is important because it shows power laws were not only descriptive ex post curves, but operational tools used during development. At the same time, the report is careful: some individual capabilities can behave irregularly, and GPT-4’s exact block architecture remains undisclosed. [42]

DeepMind’s Chinchilla paper sharpened the trade-off by arguing that many large models were undertrained: under a fixed compute budget, model size and training-token count should scale together much more closely than the earlier Kaplan rule implied. In the paper’s summary, for compute-optimal training “for every doubling of model size the number of training tokens should also be doubled,” and the resulting 70B-parameter Chinchilla is shown outperforming larger but more weakly trained contemporaries. This is one of the most concrete “there is no free scale” results in the field: more parameters alone are not enough; the parameter/data/compute triple must be co-optimized. [43]

The most useful rigorous way to place these empirical scaling laws inside learning theory is with a hierarchy of limits:

For finite-sample statistical limits, the formal content is that standard learning theory bounds imply test error is controlled by empirical error plus a complexity term that shrinks roughly like 1/√n for fixed hypothesis classes. Berkeley lecture notes summarize the classic form:

R(f) ≤ R̂(f) + O(√((VCdim(F) + log(1/δ)) / n)). [44]

The consequence is that more data helps, but not arbitrarily fast; gains diminish unless the effective hypothesis class or training distribution changes.

For deep-net complexity limits, Bartlett, Foster, and Telgarsky give margin-based generalization bounds in terms of spectral complexity rather than parameter count alone. [45]

The consequence is that “just add parameters” is theoretically too crude; norms, margins, and optimization bias matter.

For the theory gap for modern deep learning, “Understanding deep learning requires rethinking generalization” shows large networks can fit random labels, so classical counting-based explanations are incomplete; MIT’s review likewise emphasizes that deep-learning generalization remains only partially understood. [46]

The consequence is that there is no accepted closed-form theorem that predicts frontier-model capability from parameter count alone.

For specific transformer capability theorems, Berkeley-authored work proves that trained transformers can implement linear-regression-like algorithms in context for certain task families; Universal Transformer increases theoretical capability via recurrence; BigBird preserves universal approximation and Turing completeness. [47]

The consequence is that Transformer power is real and partly analyzable, but often only for restricted task families or modified architectures.

For specific transformer limitation theorems, Stanford’s Hahn proves fixed-depth/head self-attention limits on periodic and hierarchical languages; Keles et al. prove conditional quadratic-time lower bounds for self-attention. [48]

The consequence is that architectural progress can hit genuine formal barriers unless the architecture itself changes.

For hardware and memory limits, Berkeley’s memory-wall analysis shows decoder serving is increasingly memory-bandwidth bound, not just FLOP-bound. [49]

The consequence is that even if modeling theory allows improvement, practical scaling can stall on systems cost.

For no-free-lunch, no-free-lunch results deny the existence of a learner that is uniformly best over all possible tasks/distributions without assumptions or inductive bias. [50]

The consequence is that there cannot be a single architecture that is provably optimal for every environment.

Two extra results matter for interpreting apparent “AI enhancement” trends. First, the OpenAI scaling-law paper explicitly says the empirical power laws show no sign of deviation at the upper end in their studied range, while also noting loss must eventually flatten before reaching zero. Second, Claude and GPT product evolution shows that companies can change the effective system, not just the model weights: larger windows, better post-training, external tools, retrieval, and multimodality all move the frontier. This means “capability” is not a one-parameter function of model size; it is a moving target defined by model class, optimizer, data, post-training, inference-time compute, tools, and memory system. [51]

So is there a provable end point to AI enhancement? The evidence-based answer is:

But equally,

For fixed tasks, fixed distributions, and fixed architectures, there are clear limits: finite-sample bounds, irreducible distributional difficulty, architectural expressivity limits, and compute/memory lower bounds. For changing systems—for example, replacing full attention with sparse attention, adding retrieval, adding external tools, or moving from standard transformers to recurrent/state-space hybrids—the theoretical landscape changes, and previously binding limits may disappear or be replaced by new ones. Empirically, the field so far looks more like piecewise-open-ended advancement with diminishing returns and periodic architectural resets than like either a hard final ceiling or a proof of infinite ascent. [52]

Conclusion and limitations

The mathematically clean part of the story is straightforward. OpenAI’s published systems span decoder-only, encoder-decoder, encoder-only-contrastive, and dual-encoder-contrastive transformer families. The GPT line is decoder-only and autoregressive in the public papers; Whisper is encoder-decoder; CLIP and OpenAI’s embedding models learn geometric representations with contrastive losses. Anthropic’s public Claude materials do not disclose a comparable block-level architecture, but they clearly place Claude inside the large-language-model paradigm and document post-training via human feedback and Constitutional AI. [53]

The theoretically important part is that context length, training data, and parameter count are different routes to accuracy. A larger context window gives the model more access to information at inference time, but access is not the same as understanding or reliable use. Larger training data and more parameters can improve learned capability, but only when data quality, compute, architecture, and post-training are also strong. Long context raises compute, memory, and optimization burdens; fixed-form self-attention has proven limits; and even when product windows become huge, models can still underuse the middle of the prompt. Sparse attention, exact-kernel engineering, linear attention, state-space recurrence, retrieval, and position remapping are all mathematically meaningful partial answers, but none is a universal solution. [54]

The most defensible evidence-based answer to the report's final question is therefore this: AI enhancement has no currently proven universal terminal point, but it also does not have a theorem guaranteeing unlimited improvement. What is proven are narrower statements--power-law scaling within studied regimes, compute/data co-scaling laws, architecture-specific limitations, finite-sample and data-quality limits, and resource lower bounds. What is not proven is a single final ceiling for all future architectures and system designs. The frontier remains open, but not unconstrained. [55]

Plain-language conclusion for LLM learning and accuracy

In simple terms, an LLM learns from training data before it is used. It turns patterns from that data into billions or trillions of numerical parameters. When it later answers a question, it does not usually search the training set like a database; it uses those learned parameters plus the current prompt to predict the next token, then the next token, and so on.

Accuracy is highest when two things work together: the model has already learned strong and relevant patterns, and the current context supplies the evidence needed for the specific question. A bigger context window helps only if the right evidence is inside the prompt and the model can actually use it. More training data helps only if the data is high quality and relevant. More parameters help only if they are trained and aligned well.

For that reason, AI progress should not be described as simply making the context window bigger or adding more parameters. Real improvement comes from balancing context length, data quality, model size, compute, architecture, retrieval, tools, and post-training. Progress can continue through better combinations of these ingredients, but every known path faces practical and mathematical constraints.

Open questions and limitations

This report intentionally prioritizes primary sources and official technical reports, so some popular claims were excluded. In particular, the exact deployed block architecture of GPT-4 and the exact deployed internal architecture of the Claude family are not publicly disclosed in the cited official materials, so any stronger claim would be speculative. Likewise, product pages can verify context-window sizes, but not the hidden implementation choices that make those windows usable. [56]

#ArtificialIntelligence #LargeLanguageModels #TransformerArchitecture #MachineLearning #GenerativeAI #AIResearch

[1] [5] [6] [15] [19] [21] [25] [53] https://cdn.openai.com/research-covers/language-unsupervised/language_understanding_paper.pdf

https://cdn.openai.com/research-covers/language-unsupervised/language_understanding_paper.pdf

[2] [16] [17] [18] [28] [29] [33] https://arxiv.org/pdf/1706.03762

https://arxiv.org/pdf/1706.03762

[3] [35] [54] https://arxiv.org/abs/2205.14135

https://arxiv.org/abs/2205.14135

[4] [41] [51] [52] [55] https://arxiv.org/pdf/2001.08361v1

https://arxiv.org/pdf/2001.08361v1

[7] https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf

https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf

[8] https://arxiv.org/pdf/2005.14165

https://arxiv.org/pdf/2005.14165

[9] https://arxiv.org/abs/2203.02155

https://arxiv.org/abs/2203.02155

[10] [42] [56] https://cdn.openai.com/papers/gpt-4.pdf

https://cdn.openai.com/papers/gpt-4.pdf

[11] [24] https://openai.com/index/whisper/

https://openai.com/index/whisper/

[12] [22] https://cdn.openai.com/papers/Text_and_Code_Embeddings_by_Contrastive_Pre_Training.pdf

https://cdn.openai.com/papers/Text_and_Code_Embeddings_by_Contrastive_Pre_Training.pdf

[13] [23] https://cdn.openai.com/papers/Learning_Transferable_Visual_Models_From_Natural_Language_Supervision.pdf

https://cdn.openai.com/papers/Learning_Transferable_Visual_Models_From_Natural_Language_Supervision.pdf

[14] https://www-cdn.anthropic.com/6be99a52cb68eb70eb9572b4cafad13df32ed995.pdf

https://www-cdn.anthropic.com/6be99a52cb68eb70eb9572b4cafad13df32ed995.pdf

[20] https://developers.openai.com/api/docs/guides/embeddings

https://developers.openai.com/api/docs/guides/embeddings

[26] https://openreview.net/forum?id=Hn0o_fesOVY

https://openreview.net/forum?id=Hn0o_fesOVY

[27] https://developers.openai.com/api/docs/models/gpt-4.1

https://developers.openai.com/api/docs/models/gpt-4.1

[30] https://arxiv.org/pdf/2211.05102

https://arxiv.org/pdf/2211.05102

[31] https://cs.stanford.edu/~nfliu/papers/lost-in-the-middle.arxiv2023.pdf

https://cs.stanford.edu/~nfliu/papers/lost-in-the-middle.arxiv2023.pdf

[32] [48] https://nlp.stanford.edu/pubs/hahn2020theoretical.pdf

https://nlp.stanford.edu/pubs/hahn2020theoretical.pdf

[34] https://arxiv.org/abs/2004.05150

https://arxiv.org/abs/2004.05150

[36] https://arxiv.org/abs/2006.16236

https://arxiv.org/abs/2006.16236

[37] https://arxiv.org/pdf/1807.03819v1

https://arxiv.org/pdf/1807.03819v1

[38] https://arxiv.org/abs/2112.04426

https://arxiv.org/abs/2112.04426

[39] [40] https://arxiv.org/abs/2108.12409

https://arxiv.org/abs/2108.12409

[43] https://arxiv.org/abs/2203.15556

https://arxiv.org/abs/2203.15556

[44] https://www.stat.berkeley.edu/~bartlett/talks/201711BAIR.pdf

https://www.stat.berkeley.edu/~bartlett/talks/201711BAIR.pdf

[45] https://arxiv.org/abs/1706.08498

https://arxiv.org/abs/1706.08498

[46] https://arxiv.org/abs/1611.03530

https://arxiv.org/abs/1611.03530

[47] https://jmlr.org/papers/volume25/23-1042/23-1042.pdf

https://jmlr.org/papers/volume25/23-1042/23-1042.pdf

[49] https://arxiv.org/abs/2403.14123

https://arxiv.org/abs/2403.14123

[50] https://arxiv.org/abs/2304.05366

https://arxiv.org/abs/2304.05366

Author Armen Melkumyan

Armen Melkumyan

Armen Melkumyan