Manuscript Offprint
arXiv:2611.05728Generative Modeling for Cascading Extremes via Autoregressive Transformers
Miguel de Carvalho
School of Mathematics and Maxwell Institute for Mathematical Sciences University of Edinburgh CIDMA–Department of Mathematics Universidade de Aveiro
Myung Won Lee
School of Mathematics and Maxwell Institute for Mathematical Sciences University of Edinburgh
Jordan Richards
School of Mathematics and Maxwell Institute for Mathematical Sciences University of Edinburgh
Sotirios Sabanis
School of Mathematics and Maxwell Institute for Mathematical Sciences University of Edinburgh National Technical University of Athens Athena/Archimedes Research Centre
Abstract
Extreme events often occur sequentially, from earthquake–tsunami cascades to successive extreme losses in financial markets. We introduce an extremal token representation that encodes multivariate observations as a categorical sequence. A quiet token records the absence of threshold exceedances; otherwise, the token identifies the exceeding component with the largest marginal probability-scale score. The representation is invariant to componentwise strictly increasing transformations. It preserves the identity and temporal ordering of dominant exceedances but discards their magnitudes and the identities of nondominant simultaneous exceedances. A decoder-only transformer estimates the history-dependent next-token kernel on this representation, and recursive sampling generates future token sequences from the induced joint predictive law. We amortize our generative model by pretraining across simulated process families with varying parameters and dependence persistence. Next-token predictions are evaluated against exact conditional probabilities for held-out categorical processes and particle filter references for heavy-tailed vector autoregressive processes. Applied to ten-second returns for five semiconductor stocks, the pretrained model supports zero-shot transfer, while a few epochs of adaptation improve agreement between observed and generated token frequencies and transition patterns. These results support task-specific tokenization and simulation-based pretraining for modeling which dimensions dominate multivariate extremes.
1 Introduction
Extreme events often unfold sequentially. As recently emphasized by de Carvalho et al. (2026), the order in which such events occur matters in many applications, and modeling such sequences of extremes poses nontrivial methodological challenges. Building on their work, we develop this perspective through an analogy with text: Just as a large language model generates a continuation conditional on preceding words, we seek to generate sequences of extremes conditional on their recent history.
While generative modeling of extremes is an increasingly important task in modern machine learning and extreme value theory (e.g., Allouche et al., 2022; De Monte et al., 2025), we focus on how extreme activity evolves across components over time. We study the predictive law of what we will refer to as extremal token sequences. Given recent extreme activity, we predict the next quiet or dominant-exceedance token and assess plausible subsequent token paths.
We encode the multivariate observations as extremal tokens. Each observation receives a quiet token when no threshold is exceeded; otherwise, it records the exceeding component, selecting the one with the greatest marginal probability-scale score when multiple components exceed. For a d-variate series, the vocabulary contains tokens. The representation retains quiet observations and the ordered labels of dominant exceedances, while discarding their magnitudes and nondominant simultaneous exceedances. We predict and generate these token sequences rather than the original continuous series. An autoregressive model supports both prediction and generation in this representation. It specifies next-token conditional probabilities; their product defines the joint law from which future paths are sampled recursively. We use a decoder-only transformer to learn this next-token kernel. To reduce dependence on tail observations from any one series, we pretrain a shared model on simulated processes spanning different parameters and orders. This amortizes training across prediction tasks, enabling direct use on new series or further adaptation.
Main contributions. Our key contributions are as follows:
-
We pioneer the development of generative models for cascading extremes by introducing a -token representation for extremal sequences, that is invariant to componentwise strictly increasing transformations of the raw multivariate time series.
-
We characterize the high-threshold limit of the next-token kernel using extreme value theory and bound fixed-horizon recursive-generation error in terms of one-step approximation error for finite-context kernels.
-
We develop an amortized next-token learning scheme on simulated data and evaluate it on independently sampled processes from the training families, using exact conditional probabilities for categorical processes and sequential Monte Carlo references for tokenized heavy-tailed vector autoregressions.
-
We investigate zero-shot transfer and adaptation using ten-second negative returns for five semiconductor stocks, assessing agreement between observed and generated token frequencies and transition structure.
Related prior work. Extreme value theory provides the probabilistic framework for studying univariate and multivariate extremes. Our theoretical development draws on this framework to characterize the limiting conditional probabilities of dominant-exceedance tokens.
The mathematical foundations of artificial intelligence (AI) can be traced to developments in logic and computability in the 1930s (Ertel, 2025), roughly the same period in which extreme value theory (EVT) emerged through the pioneering work of Fisher and Tippett (Fisher & Tippett, 1928). Despite these parallel beginnings, it has taken nearly a century for the two fields to begin meaningfully intersecting. The special issue editorial by de Carvalho & Richards (2026) surveys the emerging interface between heavy tails and artificial intelligence. Clémençon & Sabourin (2026) review key results connecting multivariate extreme value theory and statistical learning theory.
Deep generative models, including generative adversarial networks (GANs) (Goodfellow et al., 2014), normalizing flows (Papamakarios et al., 2021), and diffusion models (Ho et al., 2020) have been supported by theoretically in approximation and convergence (Liang, 2021; Teshima et al., 2020; Bruno & Sabanis, 2025). However, standard implementations can encounter difficulties in accurately reproducing heavy tails and extremal dependence. These challenges have motivated generative methods tailored to extremes, including GAN-based approaches (Bhatia et al., 2021; Allouche et al., 2022; 2026; Lhaut et al., 2026) and normalizing flows (De Monte et al., 2025; Hu & Castro-Camilo, 2025). In parallel, diffusion models have been explored for extreme-weather forecasting (Price et al., 2025) and the generation of financial time series and spatial fields exhibiting heavy tails (Takahashi & Mizuno, 2025; Walchessen et al., 2025). Complementing these developments, Wessel et al. (2026) compare the generative models for multivariate angular simulation.
A key distinction in our setting, with respect to that of previous works, lies in the generated object. Our model produces categorical paths of what we here define as quiet and dominant-exceedance tokens, rather than continuous observations. The predictive target is the history-dependent distribution of the next token in this representation. To achieve this, we build upon an autoregressive transformer architecture (Vaswani et al., 2017; Radford et al., 2018; Bishop & Bishop, 2024) and on related work in amortized learning and neural inference (Ruoss et al., 2024; Richards et al., 2024; Zammit-Mangion et al., 2025; Lee et al., 2026). Although the model describes how predictions depend on preceding extreme activity, these conditional distributions do not identify causal effects (Pearl, 2009; Gnecco et al., 2021).
Outline. Section 2 introduces the extremal-token representation and the high-threshold limit of its next-token kernel. It also details the transformer model and amortized training objective, and establishes fixed horizon stability of recursive generation. Section 3 examines transferability of the amortized generator to semiconductor stock returns, while Section 4 discusses limitations and extensions. Appendix A provides proofs and technical details, Appendix B presents Monte Carlo simulation experiments, and the remaining appendices contain implementation details and diagnostics.
2.1 Probabilistic Setup and Extremal Tokens
Framework
Let be a -variate process, such as negative returns on a -asset portfolio, with and continuous marginal distribution functions . Choose thresholds at a common high probability level (e.g., ), and define the extremal indicators and active sets for each time .
We map the observations to a sequence of extremal tokens, , over the extremal vocabulary , where
Token 0 is the quiet token, indicating that there are no exceedances for any component ; otherwise, token identifies the dominant exceeding component. When only one component exceeds its threshold—as occurs at approximately 75% of times with an exceedance in our data application—the token simply identifies the component experiencing the extreme. Thresholding determines which components are active, while the scores rank them by marginal extremeness on a common uniform scale. With marginals and thresholds transformed consistently, these scores, and hence , are invariant to componentwise strictly increasing transformations. Appendix A.1 gives the invariance argument.
Let the window context at time be defined as
where is the maximum context length. Thus, contains all available tokens when and the most recent tokens otherwise. The next token has conditional distribution
(2)
Below, dependence on the threshold level is suppressed whenever it is unambiguous and made explicit when studying the high-threshold limit. One of our key objectives is to estimate this distribution and use the estimate for the recursive generation of sequences of extremal tokens. The quiet token in our setup is treated as an ordinary token, not an End-of-Sequence delimiter; it remains in and neither terminates the sequence nor resets the conditioning history. Fig. 1 illustrates the tokenization scheme.

Figure 1: Autoregressive transformer schematic based on the probabilistic setup in Section 2.1.
High-Threshold Limit of the Next-Token Kernel
We next characterize the next-token kernel as the common marginal threshold level tends to one. Following common practice in multivariate extreme value theory, we first transform all margins to a common scale; assuming continuous marginal distribution functions , we transform the process to standard Pareto margins via the probability integral transform,
so that , for . For each , the extremal token in (1) then admits the equivalent representation
where , and
for , the infinity norm. The uses the same deterministic tie-breaking rule as (1). The representation in (3) follows because if and only if almost surely, and is strictly increasing for . Under the stationarity assumption below, for and whenever the conditioning event has positive probability, define the population next-token kernel, with its dependence on and the context made explicit, by
where is a candidate next extremal token and is an extremal token history. Our aim is to characterize (4) directly as , or equivalently as .
The unconditional token process converges over every fixed time window to the all-quiet process because, as ,
To characterize the high-threshold limit in (4), suppose that is stationary. For , assume that the block vector is multivariate regularly varying in the standard sense. Thus, for some nonzero Radon measure on ,
where denotes vague convergence (Resnick, 2007, Theorem 6.1).
To express the limiting next-token kernel (see Theorem 2.1), for and , define the following sets of scaled Pareto blocks:
For example, if and , then consists of pairs for which is quiet and component 2 is the dominant exceedance in ; additionally requires component 1 to be the dominant exceedance in .
Theorem 2.1. Suppose that is stationary, contains at least one non-quiet token, , and that and , for every , are continuity sets of and , respectively. Then, as ,
Here, denotes the limiting kernel as . The limiting next-token kernel is nondegenerate, if and only if at least two next-token probabilities are positive, or equivalently, , and it assigns positive probability to a non-quiet continuation if and only if .
Theorem 2.1 warrants some comments. First, when , we identify the context with its single token . For , the limiting lag-one conditional probability, from dominant component to token , is
In particular, is the limiting probability that extreme activity remains present one step later. For , the limit conditions on the complete recent token context. Second, to define the limiting law after recent extreme activity has disappeared, let , and let be the set of length- contexts satisfying the context-specific hypotheses of Theorem 2.1. Extend the kernel by
where is the point mass at the quiet token, and set . Appendix A verifies that this extension agrees with the above high-threshold limit.
Nonstationarity
For continuous time-varying marginals, the construction extends by replacing and throughout with and . The extremal vocabulary, common probability-scale comparison, and monotone-invariance property are preserved; dominant exceedances are then defined relative to the marginal distribution at time . Theorem 2.1 continues to apply if the standardized process is stationary and satisfies the stated regular-variation and continuity conditions. If its extremal dependence also varies over time, however, the limiting tail measures become time-dependent, requiring a corresponding reformulation of the theorem; this more complex setting of nonstationary extremal dependence typically warrants separate treatment (e.g., Castro-Camilo et al., 2018; de Carvalho & Ramirez, 2025; Murphy-Barltrop et al., 2026).
2.2 Autoregressive Transformer Architecture
An autoregressive transformer is a decoder-only transformer (Radford et al., 2018; Bishop & Bishop, 2024) that models the next-token probability vector in (2) from the supplied context.
Token embedding and positional encoding. To process the discrete token sequence through an autoregressive transformer, each token is mapped to a continuous vector representing its identity and augmented by a positional encoding. Without positional information, unmasked self-attention is permutation-equivariant, so permitting the input positions permutes the corresponding outputs. Positional encodings identify locations within the supplied context, whereas the causal mask introduced below prevents a representation from using future tokens.
For a generic input segment , each token is mapped to an embedding and receives a learned absolute positional vector , where . The resulting representation is , and . Here , with in all experiments, and the indices refer to positions within the supplied segment rather than global time stamps or inferred stages of a cascade.
The cornerstone of the transformer architecture is the notion of self-attention (Bahdanau et al., 2015; Vaswani et al., 2017). The transformer is constructed by stacking transformer blocks with identical architectures, with each block containing its own learnable parameters and comprising two sublayers:
-
masked multi-head self-attention (MHSA) layer;
-
feed forward neural network layer.
We describe a single transformer block, following the notation of Vaswani et al. (2017) and Bishop & Bishop (2024). We use pre-normalization, in which layer normalization (Ba et al., 2016) is applied to the residual representation before each sublayer. Let be the pre-normalized representation of the input tokens.
Sublayer 1: masked multi-head self-attention layer. Assume that divides and let . For each head , let and be learnable projection matrices and biases, and let be the vector of ones. The query, key, and value matrices are
respectively, so that . The masked scaled dot-product self-attention for head is
where the softmax is applied row-wise and . The causal mask has entries when and when , so the representation at position can attend only to positions . Division by prevents the scale of the dot-product logits from growing with the head dimension.
Concatenating the head outputs gives . With a learnable output projection and bias , the multi-head self-attention output is
Concatenating the parallel heads preserves their distinct representations.
Sublayer 2: feed forward neural layer. Following the projection of the multi-head self-attention layer in (5), we again apply layer normalization (LayerNorm, Ba et al., 2016) and then pass the output into a multilayer perceptron (MLP) encased within a residual connection, which adds the input of the MLP directly to its output (He et al., 2016). This facilitates gradient propagation and generally improves optimization stability when stacking multiple transformer blocks later on. Residual connections can help mitigate vanishing gradients, but do not guarantee that gradients remain nonzero. Thus, the neural layer follows as
The two layer-normalization operations within each block have distinct learned parameters. We iterate this forward pass across stacked transformer blocks with identical architecture. Further technical details on the transformer specification can be found in Appendix C.
Final projection and probability mapping. After the final transformer block, let . For the supplied context , whose length is , the final row is projected onto the probability simplex to give the next-token distribution
where and are the learnable projection matrix and biases, respectively, and collects all the estimable parameters of the decoder-only autoregressive transformer. The output in (6) is a parametrized model of the probability vector in (2). The th component is ; for , this is the conditional probability that component is selected as the dominant exceedance at time , whereas gives the conditional probability of the quiet token. Accordingly, conditional on the first token, the finite-context model assigns
At position , the model predicts from the within-segment prefix . During training, consecutive tokens are extracted. The first are inputs and all outputs are paired with the targets . Thus, when a segment begins inside a longer trajectory, the context for its early positions is truncated at the segment boundary. At inference, the final position forecasts the token following the complete input segment. Appendix C, Algorithm 1, gives the complete forward pass.
2.3 Estimation and Amortization
Estimation has two stages. First, each in (1) is replaced by an estimator fitted using training observations only, yielding the token sequence . The most natural option is the empirical distribution function,
which is the option taken below.¹ Second, the transformer is fitted to estimate the probability vector in (6); the transformer parameters are trained using categorical cross-entropy. Let denote a sampled training segment, with fixed and positions reindexed locally. Its context at position is the prefix . The average next-token negative log-likelihood scores all targets:
The risk analysis uses the prediction kernel in (6) with dropout disabled; dropout is used during optimization. In the experiments, .
Training on a single cascading trajectory may capture its specific features while providing limited coverage of other cascading regimes. Hence, we use amortized training (Ruoss et al., 2024) across a parameterized family of data generating processes (DGPs) . Here is the law of a sampled training segment under generative parameter and the training sampling protocol, including randomness in its trajectory location and tokenizer calibration.
Let denote the training prior over DGP parameters. Following Young & Smith (2005), define the frequentist and Bayes risks of for the loss in (8) as
¹Appendix B (Table 5) compares alternatives to (7): a generalized Pareto model (Coles, 2001, Chapter 4) and time-varying kernel estimates (Harvey & Oryshchenko, 2012), under the same tokenization in (1).
The Bayes risk characterizes the population prediction objective under the training hierarchy. Its empirical counterpart averages the loss over sampled training segments , which may share DGP parameters or overlap:
Training uses categorical cross-entropy with dropout to estimate a shared parameter ; (9) evaluates its prediction risk on the sampled segments. The amortized parameters can be estimated by repeatedly refreshing the training dataset during optimization or at the end of every epoch. Details of amortized training are given with the simulation specification in Appendix B. Importantly, the model parameters are not reinitialized; the same transformer weights are updated continuously. We write for the fitted next-token probability vector.
2.4 Autoregressive Generation
For a parameter vector , let denote the probability assigned to token by the transformer given context , as defined in (6). The fitted kernel is . Recursively sampling from this kernel defines an ancestral sampler for the corresponding joint predictive law (Bishop & Bishop, 2024, Section 12.3.2). Let be the fitted transformer's output based on the observed context . This fitted vector estimates for fixed exceedance level close to one. Its th component is
The first generated token is drawn according to
After each draw, the generated token is appended to the context and, if its length exceeds , the oldest token is removed. Let be this updated context before the th draw, with . Recursively,
where . These recursive draws define the -step rollout distribution, that is, the joint distribution of the complete generated continuation , rather than only that of its final token. To write this distribution explicitly, fix a candidate continuation , and let be the context obtained by appending to and retaining the most recent tokens. Its probability under the fitted kernel is
Thus, at T = 1, each generated trajectory is one draw from the fitted rollout distribution. A generated quiet token, , is appended to the context like any other token and does not stop the recursion.
Below, let be the distribution on obtained by recursively applying , and be the distribution obtained from the limiting kernel in Theorem 2.1, for an initial context and horizon .
The following result compares these rollout distributions using the total variation distance over the contexts reached by the limiting rollout. Recall that for probability measures and on the same finite set , their total variation distance is
Here, for next-token distributions and for rollout distributions.
Theorem 2.2. Fix an initial context and an integer . Let be the set of contexts that can occur with positive probability immediately before one of the first draws in a rollout obtained by recursively applying from , including itself before the first draw, and suppose that . For any transformer kernel on , define
Then
Thus, for fixed , any sequence satisfying also satisfies in total variation.
Theorem 2.2 shows that uniform one-step accuracy over the contexts encountered by the limiting rollout guarantees accuracy of the joint distribution of the entire -token continuation. The rollout error is bounded by at most times the largest one-step error. In words, a key takeaway of Theorem 2.2 is that accurate next-token probabilities yield an accurate generated path distribution.
To separate learning error from the high-threshold approximation, write and, for sufficiently close to one that the relevant finite-threshold kernels are defined, let
Here, is the one-step fitting error at threshold and is the threshold approximation error. The triangle inequality gives
Because is finite, Theorem 2.1 and its all-quiet extension imply as . Hence, along any sequence and fitted kernels for which , the corresponding fixed-horizon rollout laws converge to in total variation.
2.5 Temperature-Adjusted Generation
As is standard (e.g., Bishop & Bishop, 2024, Chapter 12), temperature-adjusted generation can be performed by dividing the softmax logits by a temperature ; the unadjusted case corresponds to generation based on (6), for which the rollout-law interpretation and the stability result in Theorem 2.2 apply.
For , temperature scaling defines a different next-token kernel, so the theorem does not by itself guarantee fidelity to . Despite this, in applications such as finance, exploring alternative cascade patterns, including unusual token transitions or unexpected propagation of extreme losses, may motivate sampling with .
Extending (6), temperature-adjusted conditional probabilities can be obtained as
If the maximizing probability is unique, the distribution concentrates on that token as ; if several probabilities share the maximum, the limiting distribution is uniform over those tokens. When , the probability mass is spread out more evenly across possible tokens, increasing the likelihood of sampling less probable outcomes. We further investigate temperature-adjusted generation of extremal tokens in Section 3.3.
3 Cascading Extreme Returns in Semiconductor Stocks
3.1 Motivation, Data and Transfer Learning Design
Semiconductor stocks data. Fueled by the AI infrastructure boom, the importance of the semiconductor industry within the tech sector has substantially increased (Haramboure et al., 2023). These firms are also strongly interconnected through common market cycles, supply chains, and exposure to macroeconomic and major technology sector shocks. This provides a natural real-world setting for studying cascading extremes and, in particular, for assessing whether the proposed transformer can learn the conditional propagation of extreme losses in high-frequency stock-price movements.
Data are observed at ten-second intervals and consist of the five largest constituents of the Philadelphia Semiconductor Index (SOX) by market capitalization: NVIDIA Corp. (NVDA, 2.09 Tr), Broadcom Inc. (AVGO, 1.04 Tr), and Advanced Micro Devices Inc. (AMD, $0.85 Tr). The raw data span 2nd January 2020 to 24th July 2026, contain 1 648 trading days, and were obtained from the Alpaca Market Data API (Alpaca, 2026) using the Securities Information Processor feed². The observation period includes several significant market stresses, including the COVID-19 market crash in March 2020, the 2025 tariff crash, and an oil-price spike in spring 2026.³
We retain stock prices from 09:00 to 16:00 Eastern Time, an interval that includes the final 30 minutes of premarket trading. These observations allow the token sequence to capture extreme movements immediately preceding the regular trading session. A missing premarket price often indicates that no trade occurred; we treat such periods as Quiet tokens. We therefore forward fill the most recently recorded price, which yields a zero negative log return.
Data preparation and evaluation setup. Since we focus on extreme losses, our units of analysis below are negative returns. For stock with price at time , we define the negative log return as
so that larger positive values correspond to larger proportional price declines. At each time point, the five loss returns are mapped to the extremal vocabulary
using (1). Thus, whenever the token is non-quiet, its ticker identifies the stock selected as the dominant exceedance at that time.
Observations from 2nd January 2020 through 31st March 2026 constitute the training period, and those from 1st April through 31st May 2026 form the validation period, comprising 1 569 days (3 955 449 tokens) and 41 days (103 361 tokens), respectively. The remaining observations through 24th July 2026 are reserved for testing and comprise 38 trading days and 86 031 data points. We set as it retains enough extremal tokens for evaluating cascading behavior and matches the simulation setup from Appendix B.
We apply the pretrained model from Appendix B.1 to the extremal token sequence and compare four levels of adaptation (Radford et al., 2018; Raffel et al., 2020; Yenduri et al., 2024).
Transfer learning and evaluation. Zero-shot uses the pretrained model without adaptation; one-shot and few-shot use one and five epochs of adaptation, respectively, to the training data. We run adaptation for 200 epochs, and checkpoint the optimal-shot when the lowest validation cross-entropy is attained. To illustrate the numerical benefits of pretraining, the four pretrained variants are compared against a non-pretrained benchmark model. Model configurations follow Appendices B and C.
Generation uses 1 000 Monte Carlo repetitions and context length of 256 tokens. Test rollouts start from the final validation context. We compare the observed and generated continuations following the same test contexts. We assess predictions and generated trajectories against empirical test period token frequencies, transition probabilities, and persistence, since the true next-token kernel is unknown.
²A centralized system that aggregates all-inclusive trade and quote data from every U.S. exchange forming the official National Best Bid and Offer (NBBO).
³Appendix D (Fig. 7) illustrates persistent and recurrent dominant-exceedance activity on 23rd March 2020. Repeated transitions among stocks during market-wide stress motivate a propagation model rather than isolated exceedance prediction.
3.2 Empirical Results
Predictive performance. Fig. 2 compares the observed marginal token distribution with Monte Carlo generation from the optimal-shot model obtained at epoch 17 with temperature T=1. The main deviation is for the Quiet token, to which the model assigns probability 0.739 compared with 0.729 empirically, indicating a close agreement to predict termination of ongoing extreme activity. The model captures the allocation of dominant-exceedance probability across stocks well, with particularly accurate marginal estimates for MU and TSM and a maximum discrepancy of 0.013 for AMD.

Table 1
| Quiet | NVDA | TSM | AVGO | MU | AMD | d_{TV} | |
|---|---|---|---|---|---|---|---|
| Observed | 0.729 | 0.011 | 0.055 | 0.029 | 0.098 | 0.077 | - |
| Zero-shot | 0.818 | 0.020 | 0.036 | 0.027 | 0.056 | 0.043 | 0.098 |
| One-shot | 0.795 | 0.022 | 0.033 | 0.027 | 0.057 | 0.064 | 0.078 |
| Few-shot | 0.705 | 0.018 | 0.068 | 0.036 | 0.106 | 0.066 | 0.035 |
| Optimal-shot | 0.739 | 0.018 | 0.056 | 0.032 | 0.091 | 0.064 | 0.021 |
| Non-pretrained | 0.762 | 0.025 | 0.037 | 0.038 | 0.072 | 0.067 | 0.055 |
Figure 2: Left: Relative frequency histograms comparing observed marginal token frequencies with those generated by the optimal-shot model at T = 1. Right: Table 1 reports the marginal probabilities and the total variation distance at each stage of transfer learning and the non-pretrained model. Values in bold are the marginal probabilities closest in absolute distance to the corresponding observed empirical values, or the lowest estimates of the total variation distance.
To assess sequential structure, Figure. 3 compares transition frequencies pooled across matched observed and generated continuations. Each generated continuation starts from the same observed test history as its matched observed continuation. For tokens in (10), let and count transitions from to within these continuations, pooled separately over the observed and generated samples. The transition probability estimates are
Fig. 3 reports the entries and the absolute differences , for the optimal-shot model at T = 1. Agreement indicates that the generated continuations reproduce the empirical one-step transition structure, including stock-specific dominant exceedances. These are pooled lag-one frequencies, not the transformer's full-context predictive kernel. The transfer-learning path is consistent with a bias-variance

Figure 3: Empirical (left) and optimal-shot model (centre) transition probabilities, with tilewise absolute differences (right). tradeoff. Zero-shot over-assigns probability to the Quiet token and under-represents several dominant-exceedance tokens, whereas optimal-shot reduces marginal total variation distance from 0.098 to 0.021 and gives the smallest transition discrepancies in Fig. 10 (second row). The optimal-shot also outperforms the non-pretrained model, suggesting that our judicious choice of initialisation helps to improve training and, thus, the predictive performance of our generator.
3.3 Temperature-Adjusted Monte Carlo Generation
Following Section 2.5, we compare generation across temperature levels . The complete transition-error grid is reported in Appendix D (Fig. 10). At , the transition discrepancies are generally small, particularly for the optimal-shot model, indicating that recursively generated paths preserve the empirical balance between cascade termination and continuation without adjustment. Departures from the default temperature alter this balance substantially. Lowering the temperature to reduces transition errors for the few-shot specification and retains relatively small discrepancies for the optimal-shot model, while larger deviations remain for the less-adapted specifications, particularly in transitions involving the Quiet state. In contrast, increasing the temperature to produces pronounced errors in transitions into Quiet for the few-shot and optimal-shot models, indicating that greater sampling dispersion could distort the conditional distributions. Thus, temperature tuning can generate scenario-specific token trajectories and induce systematic changes.
Overall, is the natural unadjusted benchmark, under which the optimal-shot model most closely represents the observed transition dynamics. Comparison across adaptation stages further shows that the pretrained model already contains a useful dependence structure for cascading extremes; financial adaptation primarily refines the relative probabilities of token-specific propagation and termination rather than learning the transition structure from scratch.
4 Discussion
This paper introduces generative models for extremal tokens, providing a natural interface between extreme value theory and the autoregressive architectures underlying large language models. The token representation retains the identity and temporal ordering of dominant exceedances without modeling their magnitudes. Our theoretical results characterize the high-threshold next-token law and bound fixed-horizon path-distribution error in terms of uniform one-step approximation error. The simulations support conditional-probability estimation across the studied process families, while the financial application illustrates how modest adaptation can reproduce observed cascade patterns. While cascades can, in principle, also be generated from a fitted parametric model, for either continuous or discrete series (e.g., the fitted VAR() model in Appendix D), our transformer-based approach targets conditional extremal token probabilities directly, preserving invariance to strictly increasing marginal transformations and potentially reducing sensitivity to misspecification of the return dynamics.
Some comments on future research are in order. Firstly, it would seem natural to extend the proposed setting to generate transitions of dominant exceedances or full exceedance rankings jointly with latent variables, such as bull and bear market regimes. Secondly, while the focus here has been on dominant exceedances, in practice one may also be interested in constructing a richer vocabulary that records the ranking of all exceedances. Tokens could then be ordered tuples of distinct exceeding components, ranked in decreasing order of their marginal probability-scale scores, with the empty tuple representing quiet observations. For five components, there are possible subsets of exceeding components and rankings of each subset. Including the quiet token, the vocabulary therefore contains
rather than 6 as in this paper. While natural, such extension would be computationally much more intensive as the ranked-exceedance vocabulary yields complexity and would call for an extension of Theorem 2.1. Thirdly, in practice one may also be interested in the actual magnitudes of extremes, which would require an approach grounded in EVT. Combining transformer-based architectures with multivariate extreme value theory is outside the scope of this work but would be a natural extension. Theorem 2.1 could perhaps provide some hints on how this could be achieved. We leave such open problems for future analysis.
Acknowledgments
This work is supported by the Centre for Investing Innovation of the University of Edinburgh. We also thank the participants of GAME 2026 (Generative AI Modeling for Extreme Events), GL(EN) (the Glasgow–Lancaster–Edinburgh–Newcastle Extremes Network), GAIL (UoE Generative AI Lab), ECFI (Edinburgh Centre for Financial Innovations), Nikolaos Makras and Grégoire Clarté for insightful discussions. This work has made use of the computing resources provided by the Edinburgh Compute and Data Facility.
References
Michaël Allouche, Stéphane Girard, and Emmanuel Gobet. EV-GAN: Simulation of extreme events with ReLU neural networks. Journal of Machine Learning Research, 23(150):1–39, 2022.
Michaël Allouche, Stéphane Girard, and Emmanuel Gobet. ExceedGAN: Simulation above extreme thresholds using generative adversarial networks. Extremes, 29:279–301, 2026.
Alpaca. Market Data API Documentation. Alpaca, 2026. URL https://docs.alpaca.markets/us/docs/about-market-data-api.
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer normalization. arXiv:1607.06450, 2016.
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations, 2015.
Siddharth Bhatia, Arjit Jain, and Bryan Hooi. ExGAN: Adversarial generation of extreme samples. Proceedings of the Association for the Advancement of Artificial Intelligence Conference on Artificial Intelligence, 35(8):6750–6758, 2021.
Christopher M. Bishop and Hugh Bishop. Deep Learning: Foundations and Concepts. Springer, Cham, 2024.
David A. Brannan. A First Course in Mathematical Analysis. Cambridge University Press, Cambridge, 2006.
Stefano Bruno and Sotirios Sabanis. Wasserstein convergence of score-based generative models under semi-convexity and discontinuous gradients. Transactions on Machine Learning Research, 2025. ISSN 2835-8856.
Daniela Castro-Camilo, Miguel de Carvalho, and Jennifer Wadsworth. Time-varying extreme value dependence with application to leading european stock markets. Annals of Applied Statistics, 12:283–309, 2018.
Ching-Wai Jeremy Chiu, Haroon Mumtaz, and Gabor Pinter. Forecasting with VAR models: Fat tails and stochastic volatility. International Journal of Forecasting, 33(4):1124–1143, 2017.
Stephan Clémençon and Anne Sabourin. Weak signals and heavy tails: learning theory meets extreme value analysis. Extremes, 29:303–345, 2026. doi: 10.1007/s10687-026-00540-z. URL https://doi.org/10.1007/s10687-026-00540-z.
Stuart Coles. An Introduction to Statistical Modeling of Extreme Values. Springer, London, 2001.
Miguel de Carvalho and Karla Vianey Palacios Ramirez. Semiparametric Bayesian modeling of nonstationary joint extremes: How do big tech's extreme losses behave? Journal of the Royal Statistical Society: Series. C (Applied Statistics), 74:447–465, 2025.
Miguel de Carvalho and Jordan Richards. Bridging heavy tails and Artificial Intelligence. Extremes, 29(2): 121–128, 2026.
Miguel de Carvalho, Clemente Ferrer, and Ronny Vallejos. A Kolmogorov–Arnold neural model for cascading extremes. Extremes, 29:419–444, 2026.
Lambert De Monte, Raphaël Huser, Ioannis Papastathopoulos, and Jordan Richards. Generative modelling of multivariate geometric extremes using normalising flows. arXiv:2505.02957, 2025.
Arnaud Doucet, Nando De Freitas, and Neil Gordon. An Introduction to Sequential Monte Carlo Methods. Springer, 2001.
Wolfgang Ertel. Introduction to Artificial Intelligence. Springer, Wiesbaden, 3rd edition, 2025.
R. A. Fisher and L. H. C. Tippett. Limiting forms of the frequency distribution of the largest or smallest member of a sample. Proceedings of the Cambridge Philosophical Society, 24(2):180–190, 1928.
Nicola Gnecco, Nicolai Meinshausen, Jonas Peters, and Sebastian Engelke. Causal discovery in heavy-tailed models. The Annals of Statistics, 49(3):1755–1778, 2021.
Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. Advances in Neural Information Processing Systems, 27, 2014.
Antton Haramboure, Guy Lalanne, Cyrille Schwellnus, and Joaquim Guilhoto. Vulnerabilities in the semiconductor supply chain. OECD Science, Technology and Industry Working Papers, 2023(05), 2023.
Andrew Harvey and Vitaliy Oryshchenko. Kernel density estimation for time series data. International Journal of Forecasting, 28(1):3–14, 2012.
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 770–778, 2016.
Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (GELUs). arXiv:1606.08415, 2016.
Bruce M Hill. A simple general approach to inference about the tail of a distribution. The Annals of Statistics, pp. 1163–1174, 1975.
Jonathan Ho, Ajay N. Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems, volume 33, 2020.
Chenglei Hu and Daniela Castro-Camilo. GPDFlow: Generative multivariate threshold exceedance modeling via normalizing flows. arXiv:2503.11822, 2025.
Eric Jacquier, Nicholas G. Polson, and Peter E. Rossi. Bayesian analysis of stochastic volatility models with fat-tails and correlated errors. Journal of Econometrics, 122(1):185–212, 2004.
Ben Seiyon Lee, Reetam Majumder, Jordan Richards, Emma S Simpson, and Likun Zhang. Spatial extremes at scale: A case study of surface skin temperature and heat risk in the United States. arXiv:2604.18840, 2026.
Daniel Lewandowski, Dorota Kurowicka, and Harry Joe. Generating random correlation matrices based on vines and extended onion method. Journal of Multivariate Analysis, 100(9):1989–2001, 2009.
Stéphane Lhaut, Holger Rootzén, and Johan Segers. Simulation of multivariate extremes: A Wasserstein–Aitchison GAN approach. Extremes, 29(2):157–194, 2026.
Tengyuan Liang. How well generative adversarial networks learn distributions. Journal of Machine Learning Research, 22(228):1–41, 2021.
Jingyuan Liu et al. Muon is scalable for llm training, 2025. URL https://arxiv.org/abs/2502.16982.
Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. In International Conference on Learning Representations, 2017.
Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2019.
Iosif Lytras, Nikolaos Makras, and Sotirios Sabanis. The tamed subgradient unadjusted Langevin algorithm beyond convexity. arXiv preprint arXiv:2608.06283, 2026.
Nikolaos Makras and Sotirios Sabanis. Muon meets tamed Langevin: Momentum preconditioning beyond convex and gradient-Lipschitz potentials. arXiv preprint arXiv:2610.02158, 2026.
Thomas Mikosch and Olivier Wintenberger. Extreme Value Theory for Time Series: Models with Power-Law Tails. Springer, Cham, 2024.
Callum. J. R. Murphy-Barltrop, Jennifer. L. Wadsworth, Miguel. de Carvalho, and Ben. D. Youngman. Modelling non-stationary extremal dependence through a geometric approach. Extremes, 2026. doi: 10.1007/s10687-026-00543-w.
George Papamakarios, Eric Nalisnick, Danilo Jimenez Rezende, Shakir Mohamed, and Balaji Lakshminarayanan. Normalizing flows for probabilistic modeling and inference. Journal of Machine Learning Research, 22(57):1–64, 2021.
Judea Pearl. Causality. Cambridge University Press, Cambridge, 2009.
Ilan Price, Alvaro Sanchez-Gonzalez, Ferran Alet, Tom R Andersson, Andrew El-Kadi, Dominic Masters, Timo Ewalds, Jacklynn Stott, Shakir Mohamed, Peter Battaglia, Remi Lam, and Matthew Willson. Probabilistic weather forecasting with machine learning. Nature, 637:84–90, 2025.
Alec Radford, Karthik Narasimhan, Tim Salimans, Ilya Sutskever, et al. Improving language understanding by generative pre-training. OpenAI, 2018.
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the limits of transfer learning with a unified Text-to-Text transformer. Journal of Machine Learning Research, 21(140):1–67, 2020.
Adrian E. Raftery. A model for high-order Markov chains. Journal of the Royal Statistical Society Series B: Statistical Methodology, 47(3):528–539, 1985.
Sidney I. Resnick. Heavy-Tail Phenomena: Probabilistic and Statistical Modeling. Springer, New York, 2007.
Jordan Richards, Matthew Sainsbury-Dale, Andrew Zammit-Mangion, and Raphaël Huser. Neural Bayes estimators for censored inference with peaks-over-threshold models. Journal of Machine Learning Research, 25(390):1–49, 2024.
Anian Ruoss, Grégoire Delétang, Sourabh Medapati, Jordi Grau-Moya, Li K. Wenliang, Elliot Catt, John Reid, Cannada A. Lewis, Joel Veness, and Tim Genewein. Amortized planning with large-scale transformers: A case study on chess. Advances in Neural Information Processing Systems, 37:65765–65790, 2024.
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(1): 1929–1958, 2014.
Tomonori Takahashi and Takayuki Mizuno. Generation of synthetic financial time series by diffusion models. Quantitative Finance, 25(10):1507–1516, 2025.
Takeshi Teshima, Isao Ishikawa, Koichi Tojo, Kenta Oono, Masahiro Ikeda, and Masashi Sugiyama. Coupling-based invertible neural networks are universal diffeomorphism approximators. Advances in Neural Information Processing Systems, 33:3362–3373, 2020.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in Neural Information Processing Systems, 30, 2017.
Julia Walchessen, Andrew Zammit-Mangion, Raphaël Huser, and Mikael Kuusela. Neural conditional simulation for complex spatial processes. arXiv preprint arXiv:2508.20067, 2025.
Jakob Benjamin Wessel, Callum J. R. Murphy-Barltrop, and Emma S. Simpson. Generative machine learning for multivariate angular simulation. Extremes, 29(2):195–243, 2026.
Gokul Yenduri, Muthukumaran Ramalingam, G. Chemmalar Selvi, Y. Supriya, Gautam Srivastava, Praveen Kumar Reddy Maddikunta, G. Deepti Raj, Rutvij H. Jhaveri, B. Prabadevi, Weizheng Wang, et al. GPT (Generative Pre-Trained Transformer)—a comprehensive review on enabling technologies, potential applications, emerging challenges, and future directions. IEEE access, 12:54608–54649, 2024.
G. Alastair. Young and Richard L. Smith. Essentials of Statistical Inference. Cambridge University Press, Cambridge, 2005.
Andrew Zammit-Mangion, Matthew Sainsbury-Dale, and Raphaël Huser. Neural methods for amortized inference. Annual Review of Statistics and Its Application, 12(1):311–335, 2025.
A Proofs and Technical Details
A.1 Proofs of the Main Results
This subsection verifies monotone invariance, proves Theorems 2.1 and 2.2, and establishes the all-quiet extension noted in Section 2.1. The kernel limits are taken as under the notation and assumptions of Section 2.1, with C fixed.
Monotone invariance. Let , where each is strictly increasing, and let be its marginal distribution function and . Then
from where it immediately follows that for every t,
where is obtained from (1) using the transformed observations, marginals, and thresholds; that is, componentwise strictly increasing transformations leave the extremal token sequence unchanged.
Proof of Theorem 2.1. Let
The representation gives
Because contains a non-quiet token, every block in either set has at least one vector with sup-norm greater than one. Thus, both sets are bounded away from the origin and relatively compact in the compactified cone. Vague convergence, the continuity-set assumptions, and stationarity for the -block ending at therefore yield that, as ,
Since , we have for q sufficiently close to one, and hence
For every , the events defining , , form a disjoint partition of the event defining . Hence . Multiplying by and taking limits, with the finite sum passing through the limit, gives
so the limiting ratios define the categorical next-token distribution . This distribution is nondegenerate exactly when at least two next-token probabilities are positive, and it assigns positive probability to a non-quiet continuation exactly when .
Proof of all-quiet extension of Theorem 2.1. For fixed , stationarity and the same union-bound argument for the unconditional token process yield, as ,
Hence the all-quiet extension stated in Section 2.1 agrees with the one-step high-threshold limit because
Consequently, for every fixed , the probability that a rollout obtained by recursively applying from contains a non-quiet token equals
Thus the fixed-horizon rollout law converges to the point mass on the all-quiet path.
Proof of Theorem 2.2. For a fixed , couple a rollout from and a rollout from , both initialized at , by using a maximal coupling at each step whenever their generated histories agree and any coupling after they differ. Let be the sigma-field generated by the coupled rollouts through step , and let be the event that their first generated tokens agree, with certain. On , the two rollouts have the same context , which belongs to because it is also the current context of the limiting rollout. Their next tokens can therefore be coupled to agree with conditional probability at least
Since , it follows that
Taking expectations and iterating yields . The coupling inequality then bounds the total variation distance between the two complete rollout distributions by the probability that the coupled paths differ. Bernoulli's inequality (Brannan, 2006) gives the final bound:
Thus the bound holds for every fitted kernel. Applying it to a sequence with proves the asserted total variation convergence.
A.2 Bayes Risk and Amortized Prediction
The key takeaway of this subsection is that minimizing the population transformer risk over is equivalent to minimizing the average expected Kullback–Leibler divergence, , from the posterior predictive rule under the training hierarchy.
Under the sampled-segment hierarchy of Section 2.3, let denote the posterior predictive vector for a prefix , , where
for contexts of positive probability. Because the context length identifies the local position , these probabilities define a single context-based predictive rule; original trajectory locations are averaged over by the segment law. Its minimum Bayes risk is
This is the average conditional entropy given the supplied prefix, with unobserved. For each , assume that whenever , almost surely, and set zero-weight terms to zero. The finite token and context spaces then imply . For probability vectors and , the Kullback–Leibler divergence is .
Lemma A.1. For every ,
Equality holds if and only if almost surely for each . The posterior predictive rule uniquely minimizes the Bayes risk among unrestricted context-based predictive rules, up to contexts of probability zero.
Proof. Conditioning each summand in (8) on its prefix gives its conditional cross-entropy. Subtracting yields the risk decomposition in Lemma A.1. Nonnegativity of and its equality condition establish optimality among unrestricted context-based predictive rules. No independence or stationarity of the tokens is required.
For nonempty , define the class approximation error,
The predictive target is the training hierarchy's posterior rule, not each known DGP's conditional law; need not imply attainment. The best population risk within the class is
Thus, by Lemma A.1, the key result follows, i.e., minimizing the population transformer risk over is the same as minimizing the average expected from the posterior predictive rule under the training hierarchy.
B Monte Carlo Simulation Studies
This section evaluates: (i) recovery of context-specific next-token probabilities and (ii) generalization across orders, transition regimes, and distribution families. We use two complementary settings: a) a pth-order categorical process isolates the learning problem, with known next-token probabilities, and b) a vector autoregressive process that evaluates the full modeling pipeline in Fig. 1, from continuous multivariate data through thresholding and tokenization. For both simulation studies we consider .
B.1 Simulation Settings and Details on Amortization
a) th-order categorical process. We simulate a th-order categorical process, , by drawing
where . This can be regarded as a version of (2) with context length , but where the next-token probabilities are specified by an exponential tilt of a fixed baseline:
We fix and use normalized exponential lag weights, motivated by high-order mixture transition models (Raftery, 1985),
Here, controls the decay of influence with lag, while governs the strength of temporal dependence. At , the next token follows the baseline distribution independently of the history; favours tokens with larger lag-weighted counts. The construction treats all active-token labels symmetrically.
For amortized training, we sample categorical DGPs from the training prior described in Section 2.3, with distributed as follows:
Finally, we emphasize that the categorical kernel is available analytically for every simulated history, providing an exact benchmark for the transformer's next-token probabilities without Monte Carlo error in the reference values.
b) Heavy-tailed th order vector autoregressive process. We simulate a heavy-tailed VAR() process (Mikosch & Wintenberger, 2024),
with coefficient matrices and time-varying innovations
Here, is the -dimensional Student- distribution () with degrees of freedom and positive definite scale matrix with unit diagonal. The baseline scales are modulated by the log-volatility process , which follows a component-specific AR(1) model (Jacquier et al., 2004; Chiu et al., 2017):
Here, contains the persistence coefficients, while and represent common and component-specific shocks, scaled by and , respectively. These dynamics combine common and component-specific volatility fluctuations; setting yields fixed innovation scales.
Using again the normalized exponential lag weights defined for the categorical process, we set
where are the unnormalized coefficient matrices. The simulated VAR process is then mapped to the extremal vocabulary using (1).
For amortized training, we draw the VAR parameters at each training refresh from the prior in Section 2.3:
for and . Here, denotes a normal distribution truncated to positive values, DU denotes the discrete uniform distribution, and LKJ denotes the Lewandowski–Kurowicka–Joe correlation-matrix distribution (Lewandowski et al., 2009). The LKJ(2) prior has the identity matrix as its mode. Within each simulated trajectory, the volatility shocks are drawn as
The numerical prior settings are arbitrary, and for numerical stability, each log-volatility update is clipped componentwise to before computing the innovation scales.
For each sampled DGP, we estimate the component-specific thresholds at from a separate calibration trajectory. This trajectory is generated independently of the trajectory to be tokenized, using the same DGP parameters.
Unlike the categorical DGP, the tokenized VAR process does not provide conditional next-token probabilities in closed form. Their evaluation requires integration over latent continuous and volatility states compatible with the observed token history. We approximate these probabilities using sequential Monte Carlo particle filtering (Doucet et al., 2001); the final paragraph of this appendix gives implementation details and assesses the performance of our approach.
Evaluation metrics. A key target of the simulation study is the conditional distribution of the next token given the cascading sequences. For a realized context of length , we compare the fitted probability vector with the DGP's reference vector . We consider the Kullback–Leibler divergence and the total variation distance,
All discrepancy measures are computed first at the individual history level and then aggregated within each DGP and order by taking the mean. Finally, we report , the absolute error in the conditional probability of a non-quiet token.
Model configuration The training, validation, and testing DGPs are generated independently but they share the same conditional DGP families and hyperparameter priors specified above. The training set samples the different orders from the truncated geometric prior described above, whereas the test sets are balanced across to permit comparable order-specific evaluation. Hence the test sets represent unseen realizations of the same amortization family.
The training data are organised into training refreshes, with 32 different regimes generated within each refresh; each regime uses a new set of parameters and autoregressive order , generated from the prior. From each refresh, 4,096 segments of length are sampled, with the temporal ordering preserved within every segment. The trajectories are then represented as a sequence of extremal tokens via the probability-scale rule defined in (1). This results in 1 048 576 target positions per epoch during training. Each refresh is used for two consecutive epochs before the trajectory is refreshed. No early stopping rule is imposed during training. For evaluation, we construct a balanced test set by generating 25 sets of test parameters for each order , giving unseen test datasets.
Training uses a decoder-only transformer with layers, attention heads, , feed forward dimension 512 with Gaussian Error Linear Unit (GELU, Hendrycks & Gimpel, 2016) activation and dropout (Srivastava et al., 2014) rate 0.1. This compact specification is fixed across the amortization and is chosen to provide sufficient capacity while keeping the simulation computationally manageable. Also, the transformer does not receive as input the order, thresholding quantile, transition effects, lag decay parameter, and true transition parameters.
Thus, our model architecture contains 827 654 learnable parameters. For optimization, we use a stochastic gradient descent based algorithm, AdamW (Loshchilov & Hutter, 2019) with batch size of 32 to minimize the cross entropy loss at all shifted target positions. Specific details on the optimization routine are described in Appendix C.
B.2 Results from Simulation Studies
a) th-order categorical process. Table 2 (top) first reports the results for the categorical process, for which the conditional probabilities are available in closed form. The transformer recovers these probabilities closely across all orders. Mean ranges from 0.0079 to 0.0105, while mean ranges from 0.0007 to 0.0012. The largest mean discrepancy occurs at , with of 0.0105 and of 0.0012, but the variation across orders is small and there is no indication of deteriorating recovery as increases. The conditional probability vectors are likewise closely matched. The exact active mass, ranges from 0.066 to 0.077, compared with transformer estimates between 0.070 and 0.075. Even at , where the difference in active mass is largest, the exact value is 0.066 compared with 0.071 estimated by the transformer. For several orders, including , , and , the two active masses agree to three decimal places. The history-wise and therefore provide direct evidence that the transformer recovers the conditional distributions accurately, while the averaged probability vectors show that the remaining local discrepancies do not induce a systematic distortion in the allocation of probability between quiet and active tokens.
b) Heavy-tailed th order vector autoregressive process. Table 2 reports the simulation results for the heavy-tailed VAR() process, for which the reference conditional probabilities are approximated using Monte Carlo. Agreement remains close across orders , where mean ranges from 0.0056 to 0.0128, while mean lies between 0.0161 and 0.0237. The largest mean discrepancy occurs at , with and , whereas the remaining orders exhibit comparably small errors. Importantly, there is no systematic deterioration in conditional probability recovery as the dependence order increases. The history-averaged active mass is also reproduced closely: the Monte Carlo reference values range from 0.069 to 0.082, compared with transformer estimates between 0.071 and 0.084. Averaged across orders, the Monte Carlo and transformer active masses are approximately 0.0766 and 0.0778, respectively. Thus, despite the additional difficulty introduced by thresholding a continuous heavy-tailed process and approximating its conditional token probabilities using Monte Carlo, the amortized transformer preserves the overall allocation between quiet and active tokens and maintains stable conditional recovery across the full range of orders considered.
Other takeaways from numerical experiments. Fig. 4 reinforces the results in Table 2, showing close agreement between estimated and reference active-event probabilities for both DGP families. Across most test histories, the estimated and reference probabilities lie close to the 45 degree line, indicating that the transformer recovers not only the allocation of probability across individual tokens but also the aggregate probability assigned to an active event. The categorical process exhibits particularly close agreement: its mean ranges from only 0.0079 to 0.0105 across , and the context averaged active masses differ by at most approximately 0.005. The VAR process displays somewhat greater contextwise variability, consistent with its larger mean values of 0.0161–0.0237. The largest mean discrepancy again occurs at , but the errors remain small and there is no systematic deterioration as the dependence order increases.
Table 2: Conditional probability recovery on the test set for categorical process (top subtable) and vector autoregressive process (bottom subtable). For each order , and are the mean conditional probability vectors across the test set. Here, and are computed for each history and then averaged within each order. The final two columns report the corresponding averaged active event probabilities.
| p | ||||||
|---|---|---|---|---|---|---|
| 1 | (0.929, 0.014, 0.015, 0.014, 0.014, 0.014) | (0.928, 0.014, 0.015, 0.015, 0.014, 0.014) | 0.0009 | 0.0089 | 0.071 | 0.072 |
| 2 | (0.928, 0.014, 0.014, 0.014, 0.014, 0.014) | (0.928, 0.014, 0.014, 0.015, 0.014, 0.014) | 0.0012 | 0.0105 | 0.072 | 0.072 |
| 3 | (0.924, 0.015, 0.015, 0.015, 0.015, 0.015) | (0.927, 0.015, 0.015, 0.015, 0.015, 0.015) | 0.0008 | 0.0083 | 0.076 | 0.073 |
| 4 | (0.927, 0.015, 0.015, 0.015, 0.015, 0.015) | (0.927, 0.014, 0.015, 0.015, 0.015, 0.015) | 0.0007 | 0.0084 | 0.073 | 0.073 |
| 5 | (0.932, 0.014, 0.014, 0.014, 0.014, 0.014) | (0.930, 0.014, 0.014, 0.014, 0.014, 0.014) | 0.0010 | 0.0091 | 0.068 | 0.070 |
| 6 | (0.929, 0.014, 0.014, 0.014, 0.014, 0.014) | (0.929, 0.014, 0.014, 0.014, 0.014, 0.014) | 0.0009 | 0.0092 | 0.071 | 0.071 |
| 7 | (0.925, 0.015, 0.015, 0.015, 0.015, 0.015) | (0.925, 0.015, 0.015, 0.015, 0.015, 0.015) | 0.0007 | 0.0081 | 0.075 | 0.075 |
| 8 | (0.934, 0.013, 0.013, 0.013, 0.013, 0.013) | (0.929, 0.014, 0.014, 0.014, 0.014, 0.014) | 0.0008 | 0.0082 | 0.066 | 0.071 |
| 9 | (0.923, 0.015, 0.015, 0.015, 0.015, 0.015) | (0.925, 0.015, 0.015, 0.015, 0.015, 0.015) | 0.0008 | 0.0079 | 0.077 | 0.075 |
| 10 | (0.929, 0.014, 0.014, 0.014, 0.014, 0.014) | (0.928, 0.014, 0.014, 0.015, 0.015, 0.014) | 0.0011 | 0.0096 | 0.071 | 0.072 |
| p | ||||||
|---|---|---|---|---|---|---|
| 1 | (0.918, 0.016, 0.019, 0.014, 0.018, 0.015) | (0.917, 0.017, 0.017, 0.016, 0.017, 0.016) | 0.0128 | 0.0237 | 0.082 | 0.083 |
| 2 | (0.922, 0.013, 0.016, 0.019, 0.014, 0.015) | (0.922, 0.015, 0.015, 0.017, 0.015, 0.015) | 0.0067 | 0.0191 | 0.078 | 0.078 |
| 3 | (0.921, 0.016, 0.017, 0.017, 0.015, 0.014) | (0.920, 0.017, 0.016, 0.016, 0.016, 0.015) | 0.0079 | 0.0202 | 0.079 | 0.080 |
| 4 | (0.927, 0.015, 0.014, 0.014, 0.016, 0.014) | (0.925, 0.016, 0.014, 0.015, 0.016, 0.014) | 0.0064 | 0.0181 | 0.073 | 0.075 |
| 5 | (0.922, 0.016, 0.015, 0.013, 0.015, 0.018) | (0.923, 0.016, 0.014, 0.014, 0.016, 0.017) | 0.0067 | 0.0178 | 0.078 | 0.077 |
| 6 | (0.931, 0.014, 0.012, 0.014, 0.013, 0.015) | (0.929, 0.015, 0.012, 0.015, 0.014, 0.015) | 0.0056 | 0.0172 | 0.069 | 0.071 |
| 7 | (0.931, 0.014, 0.012, 0.014, 0.015, 0.013) | (0.929, 0.015, 0.014, 0.014, 0.015, 0.014) | 0.0058 | 0.0161 | 0.069 | 0.071 |
| 8 | (0.919, 0.018, 0.019, 0.014, 0.015, 0.015) | (0.916, 0.018, 0.018, 0.016, 0.016, 0.017) | 0.0060 | 0.0178 | 0.081 | 0.084 |
| 9 | (0.922, 0.016, 0.016, 0.015, 0.017, 0.014) | (0.920, 0.017, 0.016, 0.016, 0.017, 0.014) | 0.0059 | 0.0173 | 0.078 | 0.080 |
| 10 | (0.921, 0.012, 0.016, 0.017, 0.015, 0.019) | (0.921, 0.014, 0.016, 0.016, 0.016, 0.018) | 0.0062 | 0.0184 | 0.079 | 0.079 |
The VAR active masses in Table 2 show similarly close agreement, with Monte Carlo reference values between 0.069 and 0.082 and transformer estimates between 0.071 and 0.084. Moreover, the difference in active mass changes sign across orders rather than exhibiting a persistent directional bias. Overall, Fig. 4 complements the averaged and summaries in Table 2 by showing that the small average discrepancies are not solely an artefact of aggregation across histories; for the majority of individual test histories, the conditional probability assigned to the occurrence of an active event is recovered closely.

Figure 4: Scatter plots of active mass against for categorical DGP (orange) and VAR DGP (blue), by true order . The diagonal line marks exact calibration.
Fig. 5 shows that the transformer recovers the exact next token distribution accurately across a broad range of contexts and dependence orders. Most cells are dark, indicating small token-wise absolute probability errors. Averaged across context, the conditional MAE ranges from 0.0022 to 0.0052, while the corresponding mean ranges from 0.0066 to 0.0155 across . The smallest mean errors occur at , where the MAE and are 0.0022 and 0.0066, respectively, while even at the largest mean discrepancy, occurring at , these remain only 0.0052 and 0.0155. The largest cell-wise discrepancies are concentrated in the

Figure 5: Within DGP conditional probability error heatmaps for categorical DGP. Each plot corresponds to testing DGP of true order p; rows are distinct histories and columns are the subsequent values in the extremal vocabulary. Each tile shows the absolute conditional probability error and each tick on the left hand side is the testing history.
Quiet token, whose mean absolute error across all displayed histories is approximately 0.0092, compared with roughly 0.0020–0.0022 for each active token.
Table 3: Context specific recovery of the fixed 10th-order conditional distribution. For each context , is the realized next token and the vectors contain the tokenwise absolute conditional probability errors with conditioning length , and 10 for the corresponding Fig. 6.
| (0,0,0,2,2,0,0,0,4,2) | 2 | (0.0353, 0.0119, 0.0041, 0.0113, 0.0029, 0.0134) | (0.0575, 0.0157, 0.0057, 0.0157, 0.0145, 0.0173) | (0.0570, 0.0132, 0.0059, 0.0123, 0.0105, 0.0151) |
| (0,0,0,0,3,0,0,2,3,3) | 2 | (0.0264, 0.0174, 0.0294, 0.0142, 0.0131, 0.0111) | (0.0670, 0.0250, 0.0117, 0.0164, 0.0200, 0.0172) | (0.0595, 0.0223, 0.0155, 0.0195, 0.0178, 0.0154) |
| (3,0,0,0,0,2,0,0,1,3) | 3 | (0.0276, 0.0116, 0.0148, 0.0051, 0.0137, 0.0056) | (0.0070, 0.0245, 0.0032, 0.0037, 0.0094, 0.0012) | (0.0037, 0.0215, 0.0039, 0.0018, 0.0090, 0.0021) |
| (0,0,0,0,3,2,0,1,4,2) | 2 | (0.0720, 0.0134, 0.0300, 0.0320, 0.0150, 0.0116) | (0.0035, 0.0041, 0.0189, 0.0208, 0.0329, 0.0008) | (0.0154, 0.0012, 0.0258, 0.0177, 0.0301, 0.0032) |
| (0,0,0,0,0,4,0,1,5,4) | 5 | (0.0362, 0.0239, 0.0114, 0.0063, 0.0161, 0.0106) | (0.0125, 0.0098, 0.0032, 0.0011, 0.0217, 0.0028) | (0.0056, 0.0111, 0.0042, 0.0000, 0.0181, 0.0028) |
| (1,0,0,0,0,2,0,0,3,3) | 2 | (0.0104, 0.0087, 0.0195, 0.0128, 0.0043, 0.0087) | (0.0132, 0.0120, 0.0119, 0.0042, 0.0065, 0.0109) | (0.0181, 0.0178, 0.0104, 0.0059, 0.0069, 0.0099) |
| (0,0,0,3,5,0,0,0,5,5) | 2 | (0.0200, 0.0000, 0.0155, 0.0009, 0.0038, 0.0325) | (0.0132, 0.0009, 0.0160, 0.0030, 0.0025, 0.0306) | (0.0002, 0.0011, 0.0169, 0.0094, 0.0017, 0.0254) |
| (5,0,5,0,0,3,0,0,4,4) | 3 | (0.0178, 0.0199, 0.0066, 0.0125, 0.0008, 0.0309) | (0.0004, 0.0212, 0.0093, 0.0062, 0.0043, 0.0290) | (0.0117, 0.0212, 0.0079, 0.0041, 0.0048, 0.0181) |
| (0,0,3,0,0,0,0,5,5,2) | 4 | (0.0121, 0.0108, 0.0175, 0.0075, 0.0024, 0.0105) | (0.0289, 0.0176, 0.0178, 0.0148, 0.0058, 0.0085) | (0.0271, 0.0163, 0.0199, 0.0194, 0.0046, 0.0068) |
| (0,0,0,5,0,0,0,5,4,3) | 5 | (0.0567, 0.0000, 0.0070, 0.0143, 0.0123, 0.0903) | (0.0148, 0.0082, 0.0154, 0.0140, 0.0250, 0.0773) | (0.0182, 0.0061, 0.0140, 0.0130, 0.0224, 0.0737) |
Lastly, Table 3 and Fig. 6 examine how well the transformer approximates the fixed 10th-order conditional distribution when only a truncated suffix of the history is observed. Across the selected cascade-rich histories, recovery is already relatively accurate for short contexts and improves as additional lag information becomes available. Averaged across histories and tokens, the mean absolute probability error decreases from 0.0169 at to 0.0146 at , while the corresponding mean total variation decreases from 0.0507 to 0.0438. The largest discrepancies are concentrated in the Quiet-token probability, whose mean absolute error decreases from 0.0314 to 0.0217, whereas the mean error across the individual active tokens is substantially smaller and decreases from 0.0140 to 0.0132. Thus, the aggregate results indicate that the amortized transformer makes effective use of additional lag information encoded by the VAR process while retaining accurate conditional probability estimates under truncated histories.
The simulations support the transformer as an amortized estimator of conditional token probabilities across the transition mechanisms and context lengths considered.
Particle filter reference probabilities. For each heavy-tailed VAR DGP and token history, we approximate next-token probabilities by particle filtering (Doucet et al., 2001). We initialize 8192 particles after a 1000-step burn-in, condition on successive observed tokens using binary matching weights, and resample. Fewer than eight matching particles trigger a complete restart with twice as many particles, up to 131 072. In a complete repeat , we draw next tokens from the particle predictive mixture. For independent filtering-and-prediction repeats, define

Figure 6: Within-DGP fixed-target diagnostic for the VAR DGP. Each row represents one of the selected contexts in Table 3, each column represents an extremal token, and each plot corresponds to a context length supplied to the transformer. The color scale is absolute conditional probability error.
The Monte Carlo standard error MCSE of the average is estimated by
Complete-repeat variation includes both filtering and predictive sampling uncertainty; this MCSE does not assess systematic approximation error arising from the finite particle population or finite burn-in. Table 4 summarizes Monte Carlo uncertainty by process order . The particle filter reference probabilities exhibit low Monte Carlo uncertainty across all latent VAR orders, with median absolute MCSEs remaining around and median relative MCSEs below approximately 2%. Even in the upper tail of the distribution, the 95th percentile relative MCSE remains below approximately 8.2%, indicating that Monte Carlo variability remains well controlled across process orders.
Table 4: MCSE of the particle filter approximation of next-token probabilities. The median and 95th percentile are computed across all DGP, context and token probabilities for each order, and relative MCSE is expressed as a percentage in parentheses. The MCSE is computed from independent complete filtering-and-prediction repeats as the between-repeat sample standard deviation divided by .
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| Median MCSE | 0.000333 (1.90) | 0.000323 (1.81) | 0.000332 (2.01) | 0.000284 (1.87) | 0.000329 (1.98) |
| 95th percentile MCSE | 0.001682 (8.17) | 0.001511 (7.55) | 0.001598 (7.13) | 0.001463 (6.59) | 0.001519 (7.61) |
| 6 | 7 | 8 | 9 | 10 | |
| Median MCSE | 0.000275 (1.92) | 0.000287 (1.88) | 0.000327 (1.81) | 0.000356 (1.90) | 0.000313 (1.92) |
| 95th percentile MCSE | 0.001380 (6.61) | 0.001352 (6.90) | 0.001291 (6.72) | 0.001457 (6.75) | 0.001433 (6.96) |
Robustness of the probability-scale rule Entries below report Monte Carlo medians, with the 97.5% credible interval across 500 replications.
Table 5: Monte Carlo robustness of the probability-scale marginal transformation and the induced extremal token structure.
Panel A: Fixed-empirical transformation evaluation
| Metric | Target | Fixed empirical |
|---|---|---|
| Mean PIT | 0.5000 | 0.4999 [0.4985, 0.5013] |
| PIT variance | 0.08333 | 0.08333 [0.08268, 0.08398] |
| Full-distribution QQ RMSE | 0 | 0.00182 [0.00122, 0.00265] |
| Upper-tail probability, Pr(U > 0.98) | 0.0200 | 0.01997 [0.01908, 0.02092] |
| Upper-tail QQ RMSE | 0 | 0.000232 [0.000168, 0.000353] |
Panel B: Agreement with the fixed-empirical benchmark
| Metric | Fixed GPD | Time-varying GPD | Time-varying Harvey |
|---|---|---|---|
| Active-region CDF MAE | 0.00010 [0.00008, 0.00014] | 0.00019 [0.00013, 0.00029] | 0.0106 [0.00933, 0.0123] |
| Exceedance-indicator agreement (%) | 100.0 [100.0, 100.0] | 100.0 [100.0, 100.0] | 100.0 [100.0, 100.0] |
| Extreme-token agreement (%) | 99.72 [99.61, 99.80] | 99.58 [99.40, 99.71] | 95.61 [95.09, 96.02] |
| Cascade-token agreement (%) | 99.51 [99.30, 99.69] | 99.28 [98.97, 99.55] | 92.47 [91.48, 93.23] |
| Conditional nonzero marginal TV (%) | 0.046 [0.015, 0.092] | 0.072 [0.023, 0.146] | 0.531 [0.224, 1.019] |
| Frequency-weighted transition TV (%) | 0.013 [0.008, 0.019] | 0.019 [0.011, 0.029] | 0.109 [0.080, 0.146] |
| Extreme-source transition TV (%) | 0.115 [0.075, 0.173] | 0.166 [0.096, 0.279] | 0.983 [0.727, 1.288] |
C Transformer and Optimizer Specifications
C.1 Transformer Architecture and Forward Pass
Algorithm 1 gives the complete forward pass for the architecture in Section 2.2, with block- and head-specific parameters; it returns next-token probability vectors at all input positions.
Algorithm 1 Decoder-only autoregressive transformer
Input: Sequence of extremal tokens , with as in (1), and Attention weights and biases for and : and Multi-layer perceptron parameters for layers: and Token-embedding, position-embedding, and layer-normalization parameters Final output parameters and
Output: Estimated conditional probability matrix
1: 2: for do 3: \mathbf{X}^{(l)}' \leftarrow \text{LayerNorm}_1^{(l)}[\mathbf{X}^{(l-1)}] 4: \mathbf{Z}^{(l)} \leftarrow \mathbf{X}^{(l-1)} + \text{MHSA}^{(l)}\left(\mathbf{X}^{(l)}'; M\right) 5: \mathbf{Z}^{(l)}' \leftarrow \text{LayerNorm}_2^{(l)}[\mathbf{Z}^{(l)}] 6: \mathbf{X}^{(l)} \leftarrow \mathbf{Z}^{(l)} + \text{GELU}\left(\mathbf{Z}^{(l)}' \mathbf{W}^{(1,l)} + \mathbf{1}_m(\mathbf{b}^{(1,l)})^\top\right) \mathbf{W}^{(2,l)} + \mathbf{1}_m(\mathbf{b}^{(2,l)})^\top 7: 8: 9: return
C.2 Optimization and Computing Resources
The model is optimized using AdamW (Loshchilov & Hutter, 2019) with the initial learning rate at , the decoupled weight decay coefficient is , and the first and second moment parameters are . Optimization uses a batch size of 32 and the Euclidean norm of the gradient is clipped at 1 before each optimizer update. The learning rate is updated once after every epoch using cosine annealing
(Loshchilov & Hutter, 2017), without warm-up or cosine restarts. For related theoretical developments on the optimization algorithms for LLMs, see Liu et al. (2025), Lytras et al. (2026) and Makras & Sabanis (2026). For epoch , the scheduler follows
Intermediate checkpoints are saved every 1 000 epochs, and training diagnostics are logged every 25 mini-batches and validation is performed periodically during optimization. The validation set uses a larger batch size of 4 096 as it does not require gradient evaluation.
All data generation and transformer training were performed on the University of Edinburgh's Eddie cluster (Edinburgh Compute and Data Facility), using a single NVIDIA A100 Tensor Core GPU with TensorFloat-32 (TF32) precision and 20 CPU cores on Intel Xeon Gold 6338 processors (2.00 GHz). The initial 20 000-epoch amortization training required approximately 10 hours, while the 200-epoch adaption to the semiconductor data required approximately 2 hours. Evaluations on the heavy-tailed VAR DGP required generating Monte Carlo samples via SMC particle filter and took approximately 10 minutes; for the categorical DGP with known conditional probability, evaluation took 6 minutes.
D Supplementary Empirical Details for Semiconductor Stocks
This section presents the exploratory analysis on the negative log returns of the five semiconductor stocks.
The dominant-exceedance representation entails a loss of contemporaneous information only when multiple marginal thresholds are exceeded simultaneously. In the ten-second intraday financial data, such events account for only 1.87% of the complete timeline. Conditional on observing at least one exceedance, 75.03% of observations have a unique extreme component, while 24.97% have multiple exceedances. Moreover, simultaneous events are predominantly low-dimensional, with two-component exceedances accounting for 61.64%, and two- or three-component exceedances jointly account for 84.94% of all simultaneous exceedance observations. The conditional frequency of multiple exceedances is also approximately equal between the train and test samples (25.03% and 24.36%, respectively), despite a higher unconditional exceedance frequency in the test period. These results support the dominant-exceedance token as a parsimonious representation of the identity of the most severe marginal extreme.

Figure 7: Intraday profile of dominant-exceedance tokens assigned to NVDA, TSM, AVGO, MU, and AMD on 23rd March 2020 (COVID-19 market crash) under the specification. Each cell reports the number of ten-second dominant-exceedance tokens aggregated within the corresponding minute.
To assess tail heaviness, we use the Hill estimator (Hill, 1975),
where is the th smallest of the positive observations for stock , and . Across the five stocks, the marginal Hill estimates (Hill, 1975) range from approximately 0.26 to 0.45.

Figure 8: Marginal Hill estimator with its 95% confidence interval for each stock. The estimator is evaluated at every 1,000 values of spanning the largest 1 to 15,000 upper-tail observations out of 1.19 million.
As alternatives to the empirical distribution function in (7), Table 5 compares extremal token sequences obtained from a stationary generalized Pareto model (Coles, 2001, Chapter 4) and time-varying kernel estimates (Harvey & Oryshchenko, 2012). The latter give greater weight to recent observations.

Figure 9: Number of non-quiet tokens per day from 2nd January 2020 to 24th July 2026 for the five selected semiconductor stocks.
We fit a Student- VAR model to the semiconductor stocks' log returns, considering and . The validation trading days were used for model selection, with each candidate evaluated by mapping its Monte Carlo one-step predictive distribution through the frozen tokenizer and computing validation next-token cross-entropy loss. Hence, the minimum validation cross-entropy was attained by the VAR(10) model with , with a validation loss of 0.554. Table 6 shows that the optimal-shot transformer model provides substantially better performance than the parametrized heavy-tailed VAR(10) benchmark.
Table 6: Comparison of transition probability metrics (, , and relative discrepancy, ) across checkpoints and the Student- VAR(10) baseline at temperature . Lower values indicate closer agreement with empirical transition probabilities.
| Metric | Previous Token | Zero-shot | One-shot | Few-shot | Optimal-shot | Non-pretrained | Student- VAR |
|---|---|---|---|---|---|---|---|
| Rowwise Total Variation () | Quiet | 0.1147 | 0.0796 | 0.0200 | 0.0252 | 0.1147 | 0.1887 |
| NVDA | 0.0756 | 0.1163 | 0.1319 | 0.0757 | 0.0756 | 0.2384 | |
| TSM | 0.0759 | 0.0714 | 0.1049 | 0.0590 | 0.0759 | 0.1830 | |
| AVGO | 0.0701 | 0.1127 | 0.0806 | 0.0409 | 0.0701 | 0.2252 | |
| MU | 0.0580 | 0.1031 | 0.0307 | 0.0246 | 0.0580 | 0.2143 | |
| AMD | 0.0451 | 0.0836 | 0.0906 | 0.0444 | 0.0451 | 0.1727 | |
| Kullback-Leibler Divergence () | Quiet | 0.0507 | 0.0266 | 0.0042 | 0.0049 | 0.0507 | 0.2134 |
| NVDA | 0.0682 | 0.0928 | 0.0837 | 0.0638 | 0.0682 | 0.3218 | |
| TSM | 0.0431 | 0.0327 | 0.0448 | 0.0226 | 0.0431 | 0.2170 | |
| AVGO | 0.0502 | 0.0562 | 0.0330 | 0.0156 | 0.0502 | 0.2568 | |
| MU | 0.0170 | 0.0365 | 0.0043 | 0.0044 | 0.0170 | 0.2934 | |
| AMD | 0.0129 | 0.0339 | 0.0222 | 0.0089 | 0.0129 | 0.1904 | |
| Mean rowwise relative discrepancy | Quiet | 0.3978 | 0.3729 | 0.1711 | 0.2093 | 0.3978 | 0.5920 |
| NVDA | 0.3456 | 0.3602 | 0.5340 | 0.3315 | 0.3456 | 0.7709 | |
| TSM | 0.8848 | 0.6553 | 0.8785 | 0.6251 | 0.8848 | 0.7941 | |
| AVGO | 1.2472 | 0.8184 | 0.9872 | 0.5645 | 1.2472 | 0.5465 | |
| MU | 0.3981 | 0.3985 | 0.1810 | 0.1774 | 0.3981 | 0.6740 | |
| AMD | 0.3858 | 0.4457 | 0.3851 | 0.2584 | 0.3858 | 0.5430 |

Figure 10: Observed and generated next-token transition structure. Each panel reports the absolute transition probability error. Rows correspond to temperatures , and 0.95, from top to bottom; columns correspond to the zero-shot, one-shot, few-shot, optimal-shot, and non-pretrained models, from left to right.