Jump to content

Large language model (LLM): Difference between revisions

From Wikibase
Rewire to the renamed pages forward pass and model parameters (via update-page on MediaWiki MCP Server)
Sequence length is T, not N, so that N means number of layers (via update-page on MediaWiki MCP Server)
Line 19: Line 19:
== Inference ==
== Inference ==


With [[tokenisation (machine learning)#Definition|token vocabulary]] $\mathcal{V}$, given input $x$, '''inference''' produces output [[token (machine learning)|token]] sequence $y=(y_1,\cdots,y_N) \in \mathcal{V}^N$ chosen probabilistically:
With [[tokenisation (machine learning)#Definition|token vocabulary]] $\mathcal{V}$, given input $x$, '''inference''' produces output [[token (machine learning)|token]] sequence $y=(y_1,\cdots,y_T) \in \mathcal{V}^T$ chosen probabilistically:


$$
$$

Revision as of 16:22, 11 November 2026

Languages: English · français · Esperanto

A large language model (LLM) is an artificial neural network (ANN) with a very large parameter count, trained by machine learning on broad text corpora to model the distribution of token sequences, so that it can generate text in response to a prompt.

Architecture

The dominant architecture at the time of writing (2026-11) is the autoregressive decoder-only Transformer.[1]

Scaling laws

The performance of LLMs improves predictably with

  • model size
  • training-data volume
  • computational budget

Language model loss and Chinchilla prescription describe the correlation.[2][3]

Inference

With token vocabulary $\mathcal{V}$, given input $x$, inference produces output token sequence $y=(y_1,\cdots,y_T) \in \mathcal{V}^T$ chosen probabilistically:

$$ y\sim P_\theta(\cdot\mid x). $$

Computational limitation

The globally most probable output sequence $$ y^\star=\arg\max_{y\in\mathcal{V}^N}P_\theta(y\mid x) $$

is calculated by a maximiser function over a space of size $|\mathcal{V}|^N \to \infty$, which cannot be enumerated for long sequences (large $N$). The output sequence must be generated sequentially in smaller steps (e.g., 1 to a few tokens).

Typical implementation: sequential next token prediction

Sequential next token prediction starting with prompt the with ChatGPT3. · Open in a new tab

$$\begin{gathered} \vec{z}_t=f_\theta\left(x,y_{1:t-1}\right)\in\mathbb{R}^{|\mathcal{V}|},\\ y_t\sim\operatorname{Categorical}\left(\mathrm{softmax}\left(\vec{z}_t\right)\right). \end{gathered}$$

where $f_\theta$ is the model forward pass with model parameters $\theta$, and $\operatorname{Categorical(\cdot)}$ denotes the categorical distribution given probability vector $\cdot$.


In sequential next token prediction, the LLM first determines $y_1$ based on $x$, then determines $y_2$ based on $x,y_1$, $y_3$ based on $x,y_1,y_2$, so on so forth.