Manuscript Offprint
arXiv:2610.13041RAMP: Recurrent Adaptive Mixed Precision for Efficient Prefill in Recurrent-Depth Language Models
Abstract
Recurrent-depth language models improve inference-time reasoning by repeatedly applying a shared network to refine internal representations, but the additional recurrent computation also increases inference cost. This overhead is particularly pronounced during long-context prefill, where the full input sequence is repeatedly processed across recurrent depth. Weight-and-activation quantization offers a natural way to accelerate this computation through lower-precision arithmetic, yet repeatedly applying quantized computation introduces numerical perturbations that accumulate along the recurrent trajectory. We systematically analyze how such errors propagate across recurrent depth and show that quantization errors introduced earlier are attenuated by more subsequent recurrent steps and therefore have a smaller effect on the final representation. Matched-budget experiments strongly support this prediction, showing that placing quantized computation earlier in recurrent depth consistently yields the best fidelity. Based on this insight, we introduce RAMP (Recurrent Adaptive Mixed Precision), which performs early recurrent refinement using low-precision weight-and-activation computation and restores high precision for terminal refinement. Across context lengths up to 4K, RAMP preserves near-full-precision prefill quality while achieving up to end-to-end first-prefill speedup on an NVIDIA H100, corresponding to a 13.9% latency reduction.
1 Introduction
Recurrent-depth language models provide a new way to scale inference-time computation without generating additional intermediate tokens: a shared transformation is repeatedly applied to refine internal representations (Wan & Chen, 2026). Increasing recurrent depth has been shown to improve model performance (Geiping et al., 2026), suggesting that additional recurrent computation can translate into stronger reasoning. However, this benefit comes with increased inference latency. The cost is especially pronounced during long-context prefill, where each recurrent step repeatedly processes the full input sequence. This motivates a fundamental question: can we accelerate recurrent-depth prefill while preserving the performance gains of deeper recurrent computation?
Quantization provides a natural way to reduce inference cost (Dettmers et al., 2022; Xiao et al., 2023; Lin et al., 2024). In particular, weight-and-activation quantization lowers the precision of both model parameters and intermediate activations, enabling faster low-precision arithmetic during prefill (Xiao et al., 2023; Zhao et al., 2024; Lin et al., 2025). A straightforward approach for recurrent-depth models is therefore to quantize the recurrent computation uniformly throughout prefill. However, repeatedly applying low-precision computation to an evolving representation introduces numerical perturbations at every recurrent step, causing the quantized trajectory to deviate progressively from its full-precision counterpart. A natural alternative is to use mixed precision across recurrent depth, assigning quantized computation to some recurrent steps while

(b)

Figure 1: Empirical validation of depth-dependent quantization error propagation. (a) Perturbation survival as a function of injection depth. Both Gaussian perturbations and INT8 quantization-residual perturbations exhibit substantially lower survival when injected earlier in recurrent depth, while perturbations introduced near terminal depth retain a larger fraction of their initial error. Error bars denote the original 95% confidence intervals. (b) Precision-placement comparison under the same budget of 24 FP8 and 8 BF16 recurrent steps. Each point represents one of 20 frozen random precision schedules, with the horizontal axis indicating the mean depth of its BF16 steps and the vertical axis showing final hidden-state relative error. Moving BF16 computation toward later recurrent depth is associated with lower final error. RAMP places all eight BF16 steps at the end and outperforms all 20 random schedules, whereas the reverse (EARLY-BF16) schedule places all eight BF16 steps at the beginning and produces substantially larger error.
preserving the original precision for others. This raises a fundamental question: how should a fixed precision budget be allocated across recurrent depth to maximize efficiency while preserving the fidelity of full-precision recurrence?
To understand this tradeoff, we analyze how quantization error propagates through recurrent computation. Our analysis reveals a depth asymmetry in precision requirements: under locally contractive recurrent dynamics, perturbations introduced earlier are attenuated by more subsequent recurrent steps, whereas perturbations introduced near the end retain a larger effect on the final representation. Consequently, under a fixed precision budget, placing low-precision computation early and preserving high precision for later recurrent steps minimizes the theoretical final-error bound. Based on this insight, we introduce RAMP (Recurrent Adaptive Mixed Precision), which performs early recurrent refinement with low-precision computation and reserves high precision for terminal refinement. Our contributions are summarized as follows:
-
We theoretically show that, under a fixed precision budget, quantized computation should be placed earlier in recurrent depth while high-precision computation should be preserved for later steps. As shown in Figure 1, experiments strongly support this prediction.
-
Based on this analysis, we introduce RAMP (Recurrent Adaptive Mixed Precision), a training-free mixed-precision inference method that performs early recurrent refinement with low-precision weight-and-activation computation and restores the original precision for terminal recurrent refinement.
-
We show that RAMP preserves near-full-precision prefill quality across context lengths up to 4K while achieving up to end-to-end first-prefill speedup on an NVIDIA H100, corresponding to a 13.9% reduction in latency.
2.1 Recurrent-Depth Language Models
A recurrent-depth language model repeatedly applies a shared transformation to refine an internal representation across multiple recurrent steps. Let denote the hidden representation after recurrent step , with produced by the model's input processing stage. Recurrent computation can be written as
where is a shared recurrent block parameterized by , and T denotes the recurrent depth. Unlike a conventional depth-T Transformer with distinct parameters at different layers, recurrent-depth models reuse the same parameters across recurrent steps. After the final recurrent step, the resulting representation is processed by the model's output layers to produce token logits. In this work, we consider inference at a fixed recurrent depth T and study the numerical precision used to execute the recurrent computation.
2.2 Prefill in Recurrent-Depth Inference
Given an input sequence of length S, the prefill stage processes the complete input sequence before autoregressive token generation begins. For a batch of size B, recurrent prefill operates on hidden representations containing BS token positions. In a recurrent-depth model, the full-sequence representation is processed at every recurrent step, such that
We define first-prefill latency as the time required to process the input sequence and produce the logits for the first generated token. Our primary efficiency metric is end-to-end first-prefill latency, and throughput is measured as the number of prompt tokens processed per second.
2.3 Weight-and-Activation Quantization
Weight-and-activation quantization reduces the numerical precision of both model weights and intermediate activations during inference. Consider a linear transformation
where X denotes the activation matrix, W denotes the weight matrix, and Y denotes the output matrix. Under weight-and-activation quantization, both operands are mapped to lower-precision numerical representations,
where and denote the activation and weight quantizers, respectively, and the corresponding low-precision computation is
For recurrent-depth inference, let denote the numerical precision used at recurrent step t, and define a precision schedule as
A uniform quantization schedule uses the same low-precision format at every recurrent step, whereas a mixed-precision schedule may use different numerical precisions across recurrent depth.
3 Quantization Error Analysis
We analyze the error introduced by weight-and-activation quantization in recurrent-depth inference relative to a reference-precision trajectory. Our analysis addresses two questions: how numerical error introduced at one recurrent step propagates through subsequent recurrence, and how a fixed budget of quantized computation should be placed across recurrent depth. We require only local contraction of perturbations within the operating region relevant to quantized inference, rather than global contraction of the recurrent operator, and empirically examine this condition in our experiments. We first derive a general error bound for an arbitrary precision schedule and then show that, under a fixed quantization budget, placing low-precision computation earlier and reference-precision computation later minimizes this bound.
Let the reference-precision recurrent trajectory be
and let denote the corresponding weight-and-activation quantized computation at recurrent step . We define
as the deviation from the reference trajectory. Let indicate whether recurrent step is quantized, where denotes quantized computation and denotes reference-precision computation, and let
denote the corresponding precision schedule.
Theorem 3.1 (Quantization Error Propagation). Suppose that, within the relevant operating region, the reference recurrent operator satisfies
and that each weight-and-activation quantized recurrent step satisfies the uniform perturbation bound
Then the recurrent deviation obeys
If the quantized and reference trajectories share the same initial representation, such that , the final deviation satisfies
Theorem 3.1 separates the final error into contributions from individual quantized recurrent steps. A perturbation introduced at step contributes to the final bound after being attenuated by all subsequent recurrent steps through the factor . Consequently, earlier quantization errors experience more subsequent contraction, whereas errors introduced near the end of recurrence retain a larger fraction of their effect. The proof is provided in Appendix A.1.
Theorem 3.2 (Optimal Precision Placement under a Fixed Quantization Budget). Under the conditions of Theorem 3.1, consider all precision schedules containing exactly K quantized recurrent steps,
Define the low-to-high schedule used by RAMP as
and the reverse schedule as

Figure 2: Overview of RAMP. RAMP executes the shared recurrent block using FP8 weight-and-activation computation during early recurrent refinement and restores BF16 computation for the final recurrent steps. The dashed line marks the precision switch, while the recurrent architecture and total recurrent depth remain unchanged.
Then, for every schedule q satisfying Equation 14,
Thus, among all schedules with the same number of quantized recurrent steps, placing quantized computation as early as possible minimizes the theoretical final-error bound, while placing it as late as possible maximizes the bound.
Theorem 3.2 provides the central theoretical motivation for RAMP: its advantage does not arise merely from using fewer quantized steps than full quantization, but from where low- and high-precision computation are placed across recurrent depth. Early quantization errors receive the largest amount of subsequent attenuation, while preserving reference precision for terminal refinement avoids introducing the most weakly attenuated errors. Random or interleaved schedules with the same quantization budget lie between the low-to-high and high-to-low extremes in the resulting bound. As a direct consequence, RAMP also has a tighter bound than full quantization,
where
and
The proof of Theorem 3.2 is provided in Appendix A.2.
4 RAMP
Theorem 3.2 shows that, under a fixed precision budget, placing low-precision computation earlier in recurrent depth minimizes the final-error upper bound. Motivated by this result, we introduce RAMP (Recurrent Adaptive Mixed Precision), a training-free inference method that performs early recurrent refinement with low-precision computation and preserves the original precision for terminal refinement.
4.1 Depth-Adaptive Precision Schedule
Let T denote the total recurrent depth and denote the precision-switching step. RAMP defines the recurrent precision schedule as
where denotes the low-precision format and denotes the model's original inference precision. The corresponding recurrent computation is
where denotes the weight-and-activation quantized recurrent operator and denotes the reference-precision recurrent operator. RAMP therefore differs from uniform quantization only in the terminal recurrent steps: instead of continuing to inject quantization error throughout the complete trajectory, it restores reference-precision computation after step K.
4.2 FP8–BF16 Instantiation
In our implementation, we instantiate with FP8 and with BF16. During the low-precision phase, the eligible dense linear operations in the recurrent block use FP8 weights and dynamically quantized FP8 activations with native low-precision matrix multiplication, while the recurrent hidden representation and the surrounding operations remain in BF16. At step K, the recurrent block switches back to its original BF16 computation and remains in BF16 for all subsequent recurrent steps. Unless otherwise specified, we use T = 32 and K = 24, corresponding to 24 FP8 recurrent steps followed by 8 BF16 recurrent steps. RAMP requires no retraining, does not modify the recurrent architecture or recurrent depth, and introduces only a single precision transition during inference.
5 Related Work
5.1 Recurrent-Depth and Looped Language Models
Recurrent computation across network depth has a long history, with Universal Transformers introducing parameter sharing and adaptive recurrence across Transformer depth (Dehghani et al., 2018). More recent work has revisited looped or recurrent-depth architectures as a mechanism for scaling test-time computation without explicitly generating intermediate reasoning tokens. Saunshi et al. (2025) show that looped Transformers can emulate substantially deeper networks on reasoning tasks, while Geiping et al. (2026) introduce a recurrent-depth language model whose performance improves with additional recurrent computation. Subsequent work studies elastic recurrent depth, recurrent stability, and latent reasoning behavior (Jeddi et al., 2026; Yang et al., 2026). In contrast to these works, which primarily study modeling capability or recurrent dynamics, we focus on the inference cost of recurrent-depth prefill and exploit depth-dependent numerical sensitivity to reduce this cost.
5.2 Quantized Large Language Model Inference
Quantization reduces inference cost by representing model computation at lower numerical precision. Early methods focus on efficient INT8 execution and weight compression (Lin et al., 2024), while weight-and-activation quantization directly lowers the precision of dense arithmetic. SmoothQuant enables training-free W8A8 inference by mitigating activation outliers (Xiao et al., 2023), and subsequent systems such as Atom and QServe extend low-bit weight-and-activation execution toward higher-throughput LLM serving (Zhao et al., 2024; Lin et al., 2025). Recent methods such as QuaRot and SpinQuant further improve aggressive weight-and-activation quantization by transforming representations to reduce quantization difficulty (Ashkboos et al., 2024; Liu et al., 2025). These approaches primarily seek a quantization configuration that can be applied throughout a feed-forward model. RAMP instead exploits recurrent depth as an additional precision-allocation dimension, assigning different precision to different executions of the same shared block.
5.3 Mixed-Precision and Prefill-Efficient Inference
Mixed-precision quantization allocates different numerical precisions to different parts of a network in order to balance accuracy and hardware efficiency. Prior methods typically assign precision across layers, operators, channels, or tensors according to sensitivity or hardware cost (Yao et al., 2021; Zhao et al., 2024). RAMP differs in that the same recurrent block is executed repeatedly, and precision is allocated across recurrent time rather than across distinct network components. Our setting is also motivated by the distinct system characteristics of LLM prefill: prefill processes many prompt tokens in parallel and is typically compute-intensive, while its latency determines time to first token (Agrawal et al., 2024; Zhong et al., 2024; Patel et al., 2024). We therefore focus specifically on reducing recurrent-depth prefill latency through depth-adaptive numerical precision.
6 Experiments
6.1 Experimental Setup
Model and precision configuration. We evaluate RAMP on Huginn-0125 (Geiping et al., 2026), using the default recurrent depth T = 32. The model consists of a prelude, a shared recurrent block repeatedly applied across recurrent depth, and a coda that produces the final token logits. Unless otherwise specified, RAMP uses a single-precision transition at K = 24: the first 24 recurrent steps execute the eligible dense linear operations using FP8 weight-and-activation computation, while the final 8 recurrent steps restore the original BF16 computation. The recurrent hidden state, prelude, coda, and operations outside the quantized recurrent linears remain in BF16. End-to-end efficiency is evaluated separately on an NVIDIA H100 using native FP8 weight-and-activation arithmetic.
Datasets and evaluation cohorts. Our primary language-modeling fidelity evaluation uses frozen WikiText sequences, with PG19 serving as an independent long-context generalization dataset. For WikiText, we construct 32 fixed evaluation endpoints and form nested input contexts of tokens ending at the same corpus location. For each endpoint, the final 64 target tokens are identical across context lengths, so increasing S changes only the amount of preceding context rather than the evaluated continuation. For PG19, we similarly select 32 frozen validation books and construct document-contained nested contexts of with identical tail-64 prediction targets across context lengths. This paired construction is used for the long-context fidelity results in Section 6.2 and prevents context-length comparisons from being confounded by changes in the prediction target. The fixed-budget precision-placement experiment in Figure 1 uses the earlier frozen WikiText cohort for language-modeling loss together with a fixed 12-prompt fidelity cohort for hidden-state and logit comparisons. The perturbation-recoverability experiment in Figure 1 uses a separate frozen 24-prompt diagnostic cohort and is used only to test the error-propagation mechanism rather than downstream language-modeling quality.
Baselines. We compare RAMP against four primary baselines that isolate different explanations for its behavior. BF16-32 executes all 32 recurrent steps in BF16 and serves as the full-precision reference. BF16-8 executes only 8 recurrent steps, all in BF16, and serves as a reduced-depth control for testing whether the first 24 low-precision steps in RAMP provide useful recurrent refinement rather than merely adding dispensable computation. All-FP8 executes all 32 recurrent steps with FP8 weight-and-activation computation and measures the effect of uniform quantization throughout recurrence. Early-BF16 executes 8 BF16 steps followed by 24 FP8 steps; it uses exactly the same 24-FP8/8-BF16 precision budget as RAMP but reverses their placement, providing a matched-budget control for precision ordering. Our method, RAMP, executes 24 FP8 steps followed by 8 BF16 steps. Except for the intentionally shallower BF16-8 control, all primary configurations use the same model parameters, recurrent depth, inputs, and number of recurrent applications.
Table 1: Prefill fidelity at 4K context on WikiText and PG19. All metrics are measured relative to the full-depth BF16-32 reference within each dataset. BF16-8 is a reduced-depth control that executes only 8 recurrent steps, all in BF16. All-FP8, Early-BF16, and RAMP execute the full 32 recurrent steps; Early-BF16 and RAMP use the same budget of 24 FP8 and 8 BF16 recurrent steps but place the BF16 computation at opposite ends of recurrent depth. Lower is better for error metrics, while higher is better for top-1 agreement.
| Schedule | WikiText | PG19 | ||||||
|---|---|---|---|---|---|---|---|---|
| Hidden | Logit | Top-1 | Hidden | Logit | Top-1 | |||
| BF16-32 | ||||||||
| BF16-8 | ||||||||
| All-FP8 | ||||||||
| Early-BF16 | ||||||||
| RAMP | ||||||||
Quality metrics. We measure fidelity relative to the BF16-32 trajectory. Our primary metric is the paired change in teacher-forced negative log-likelihood over the final 64 target tokens, denoted , where each configuration is compared against BF16 on exactly the same endpoint and target tokens. We additionally report final hidden-state relative error and final-logit relative error to distinguish representation-level deviation from output-level deviation. Where available under the same evaluation protocol, we also retain KL divergence between the predictive distributions and top-1 token agreement. Confidence intervals for are obtained by bootstrapping over the frozen evaluation endpoints. We emphasize these continuous fidelity measures because numerical deviations introduced by quantization may be detectable before they change the model's top-1 prediction.
Precision-placement evaluation. To test the fixed-budget prediction of Theorem 3.2 independently of the hand-designed RAMP and Early-BF16 schedules, we additionally evaluate 20 frozen random precision schedules. Every random schedule contains exactly 24 FP8 and 8 BF16 recurrent steps; the eight BF16 positions are sampled uniformly before any outcomes are observed, and neither RAMP nor Early-BF16 is included in the random set. We compare the schedules using paired WikiText NLL, final hidden-state error, and final logit error, and summarize precision placement by the mean recurrent depth of the BF16 steps. The perturbation experiment in Figure 1 provides a complementary mechanism-level test: perturbations are injected at multiple recurrent depths, and their residual error after the final recurrent step is measured to quantify depth-dependent attenuation.
Systems evaluation. We evaluate end-to-end first-prefill efficiency on an NVIDIA H100 using native FP8 weight-and-activation arithmetic. We measure single-request prefill over context lengths and compare RAMP directly against the BF16-32 reference. Timing begins with token IDs already resident on the GPU and an empty attention cache, and ends when the model produces the logits required for the first generated token. Tokenization, dataset loading, host-to-device transfer, network overhead, and subsequent autoregressive decoding are excluded. We report first-prefill latency, prompt-token throughput, and speedup relative to BF16. Both BF16 and RAMP use the same semantics-preserving optimized empty-cache prefill path, which removes per-token cache bookkeeping while leaving the model computation and produced outputs unchanged. The reported speedups therefore reflect the realized effect of numerical precision under the same optimized prefill implementation rather than an implementation asymmetry between the two configurations.
6.2 RAMP Preserves Full-Precision Prefill Quality Across Datasets
RAMP consistently recovers the full-precision trajectory across datasets. Table 1 compares the main precision schedules at 4K context on WikiText and PG19. The same qualitative pattern appears on the two independently constructed evaluation cohorts. Uniform FP8 computation produces substantially larger deviations in the final hidden representation and output logits, whereas RAMP retains low-precision

(a)

(b)
Figure 3: Quality preservation and end-to-end prefill efficiency of RAMP. (a) WikiText prefill fidelity at 4K context under different precision schedules. RAMP uses 24 FP8 recurrent steps followed by 8 BF16 steps, while Early-BF16 uses the same precision budget in the opposite order. Restoring BF16 computation for terminal refinement substantially reduces the NLL deviation from BF16-32. (b) WikiText fidelity and H100 first-prefill efficiency across context lengths. The green curve reports end-to-end first-prefill speedup over BF16, while the blue curve reports paired WikiText tail-64 NLL relative to BF16-32. RAMP preserves near-BF16 fidelity across context lengths up to 4K while reaching approximately first-prefill speedup at long context.
execution for most of the recurrent trajectory while remaining much closer to the BF16 reference. The agreement across language-modeling loss, representation error, logit error, and top-1 agreement shows that this recovery is neither metric-specific nor restricted to a single corpus.
Precision placement, rather than precision budget alone, determines fidelity. Early-BF16 provides a matched-budget control for the placement of high-precision computation: it uses exactly the same number of FP8 and BF16 recurrent steps as RAMP, but reverses their order. On both WikiText and PG19, placing BF16 computation before the quantized phase leaves the final trajectory close to uniform FP8 execution, whereas reserving the same high-precision budget for terminal refinement substantially reduces representation- and logit-level error. On PG19, the likelihood difference between the two matched-budget schedules is not statistically resolved, but the representation-level ordering remains pronounced. Together, the two datasets support the depth asymmetry predicted by Theorem 3.2: early quantization errors have more subsequent recurrent computation over which they can be attenuated, while preserving high precision near terminal depth avoids introducing weakly recoverable errors late in the trajectory.
Early low-precision recurrent steps perform useful refinement. BF16-8 provides a reduced-depth control for testing whether the first 24 low-precision recurrent steps in RAMP can simply be removed. Across both WikiText and PG19, executing only eight BF16 recurrent steps produces substantially larger likelihood, representation, and logit deviations than the full-depth RAMP trajectory. This behavior rules out the interpretation that only the final eight high-precision steps are responsible for RAMP's fidelity. Instead, the preceding 24 FP8 steps continue to perform useful recurrent refinement, while the terminal BF16 phase recovers the trajectory toward the full-precision solution.
Quality remains stable across long contexts. We additionally evaluate RAMP using nested contexts while holding the prediction target fixed. On WikiText, paired NLL remains close to zero from 128 to 4096 tokens with no systematic growth, as shown in Figure 3b. On PG19, RAMP likewise remains close to BF16-32 over 512–4096 tokens: hidden-state and logit errors remain stable, while NLL stays small with a mild positive trend toward longer contexts. Thus, across both datasets, increasing the amount of full-sequence
Table 2: End-to-end first-prefill latency across context lengths on an NVIDIA H100. BF16 and RAMP use the same optimized empty-cache prefill path. Speedup is computed as BF16 latency divided by RAMP latency; values above 1× indicate faster execution with RAMP.
| Context Length | BF16 (ms) | RAMP (ms) | Speedup ↑ |
|---|---|---|---|
| 128 | 131.784 | 164.972 | 0.7988× |
| 256 | 152.802 | 197.474 | 0.7738× |
| 512 | 148.473 | 139.567 | 1.0638× |
| 1024 | 274.090 | 239.395 | 1.1449× |
| 2048 | 543.158 | 469.357 | 1.1572× |
| 4096 | 1103.444 | 949.847 | 1.1617× |
Table 3: Fixed-budget precision-placement comparison on the fixed 12-prompt fidelity cohort. All configurations use exactly 24 FP8 and 8 BF16 recurrent steps. Random-20 reports the mean hidden-state error across the frozen random schedules, while Early-BF16 and RAMP place all BF16 computation at the beginning and end of recurrent depth, respectively.
| Schedule | BF16 Placement | Hidden ↓ |
|---|---|---|
| Random-20 (mean) | Random | 6.17% |
| Early-BF16 | Steps 0–7 | 7.20% |
| RAMP | Steps 24–31 | 1.81% |
recurrent computation performed under FP8 does not lead to a corresponding growth in representation-level deviation over the evaluated long-context range.
6.3 End-to-End Long-Context Prefill Efficiency
RAMP exhibits a clear long-context efficiency regime. Table 2 reports end-to-end first-prefill latency as context length increases from 128 to 4096 tokens. At short contexts, RAMP is slower than BF16 because low-precision execution overhead is large relative to the recurrent matrix computation being accelerated. As the context becomes longer, this overhead is increasingly amortized by the larger full-sequence recurrent workload. The crossover occurs between 256 and 512 tokens, after which RAMP becomes faster than BF16, with the gain becoming stable from 1K tokens onward. Fidelity results are shown in Appendix A.3.
RAMP reaches a stable 1.16× end-to-end speedup at long context. At 4K context, first-prefill latency decreases from 1103.444 ms with BF16 to 949.847 ms with RAMP, corresponding to a 1.1617× speedup and a 13.9% reduction in latency. Similar gains are already observed at 1K and 2K contexts, where RAMP achieves 1.1449× and 1.1572× speedup, respectively. The consistent long-context gains show that the 4K result is not an isolated operating point: once the recurrent prefill workload is sufficiently large, native FP8 computation converts the reduced arithmetic precision of the early recurrent steps into stable end-to-end savings.
The systems gain grows while WikiText fidelity remains stable. Figure 3b juxtaposes H100 first-prefill efficiency with the paired WikiText fidelity measurements from Section 6.2. As context length increases, the first-prefill speedup rises and approaches 1.16×, while the corresponding WikiText ΔNLL remains close to zero. Combined with the independent PG19 fidelity results in Section 6.2, these measurements show that the long-context regime in which low-precision execution becomes most beneficial does not require a corresponding loss of prefill fidelity.
Table 4: Effect of the terminal BF16 cleanup length on WikiText at 4K context. All configurations use the same 32 recurrent steps while varying the precision-switch point. Lower is better for both metrics.
| FP8 → BF16 Steps | ΔNLL ↓ | Hidden ↓ |
|---|---|---|
| +0.00516 | 8.18% | |
| +0.00010 | 2.65% | |
| -0.00016 | 1.91% | |
| 0 | 0 |
6.4 Precision Placement Matters
RAMP consistently outperforms random precision placement. We isolate the effect of precision placement by holding the precision budget fixed and varying only which recurrent steps use BF16. As summarized in Table 3, RAMP produces substantially lower final hidden-state error on the fixed 12-prompt fidelity cohort than either the random schedules or Early-BF16. The same qualitative advantage holds for paired NLL on the frozen WikiText cohort and for final-logit error on the prompt cohort, with RAMP outperforming every frozen random schedule on all three fidelity measures. Thus, the benefit of RAMP cannot be explained merely by the presence of a fixed number of high-precision recurrent steps.
Later high-precision computation systematically improves fidelity. Figure 1 reveals a clear relationship between BF16 placement and final hidden-state error across the frozen random schedules. Schedules that place their BF16 steps later in recurrent depth tend to achieve higher fidelity, while schedules that allocate high precision earlier retain larger terminal deviations. RAMP and Early-BF16 occupy the two placement extremes, providing a matched-budget comparison in which only the direction of precision allocation changes.
Observed precision ordering agrees with the theoretical prediction. These results provide direct empirical support for Theorem 3.2. Under the local contraction model, perturbations introduced earlier have more subsequent recurrent steps over which they can be attenuated, whereas perturbations introduced near terminal depth have less opportunity to recover. The observed schedule ordering follows the same prediction: low precision is most effectively allocated to early recurrent refinement, while high precision is most valuable near the end of the trajectory.
6.5 Precision-Switch Ablation
A short terminal BF16 phase recovers most of the lost fidelity. Table 4 varies the precision-switch point on the 4K WikiText evaluation while keeping the total recurrent depth fixed. Uniform FP8 execution produces a clear deviation from the BF16 reference, whereas restoring BF16 for only the final eight recurrent steps removes most of this error. Extending the BF16 phase further continues to improve representation fidelity, but the additional recovery beyond the default RAMP schedule is comparatively small.
The default switch balances fidelity and low-precision coverage. The ablation highlights the trade-off underlying the choice of . Moving the switch earlier allocates more recurrent computation to BF16 and therefore provides additional numerical recovery, but correspondingly reduces the fraction of recurrent work executed in FP8. The default RAMP configuration preserves low-precision execution for three quarters of the recurrent trajectory while already recovering most of the fidelity gap to full BF16, making it the operating point used throughout the main experiments.
7 Conclusion
We study mixed-precision inference for recurrent-depth language models from the perspective of where quantized computation should be placed across recurrent depth. Our analysis shows that, under locally contractive recurrent dynamics, perturbations introduced earlier receive more subsequent attenuation, yielding a smaller final-error upper bound than perturbations introduced near terminal depth. This depth asymmetry is strongly supported by perturbation experiments and fixed-budget precision-placement comparisons. Motivated by this observation, we introduce RAMP, a training-free inference method that performs early recurrent refinement using FP8 weight-and-activation computation and restores BF16 precision for terminal refinement. Across context lengths up to 4K, RAMP preserves near-full-precision prefill quality while converting low-precision recurrent computation into up to end-to-end first-prefill speedup on an NVIDIA H100, corresponding to a 13.9% latency reduction. These results suggest that recurrent depth is not only an additional axis for scaling computation, but also an opportunity for structured precision allocation: early recurrent computation can be executed aggressively in low precision, while a short high-precision terminal phase can recover most of the fidelity of full-precision inference.
References
Amey Agrawal, Nitin Kedia, Ashish Panwar, Jayashree Mohan, Nipun Kwatra, Bhargav Gulavani, Alexey Tumanov, and Ramachandran Ramjee. Taming {Throughput-Latency} tradeoff in {LLM} inference with {Sarathi-Serve}. In 18th USENIX symposium on operating systems design and implementation (OSDI 24), pp. 117–134, 2024.
Saleh Ashkboos, Amirkeivan Mohtashami, Maximilian L Croci, Bo Li, Pashmina Cameron, Martin Jaggi, Dan Alistarh, Torsten Hoefler, and James Hensman. Quarot: Outlier-free 4-bit inference in rotated llms. Advances in Neural Information Processing Systems, 37:100213–100240, 2024.
Mostafa Dehghani, Stephan Gouws, Oriol Vinyals, Jakob Uszkoreit, and Łukasz Kaiser. Universal transformers. arXiv preprint arXiv:1807.03819, 2018.
Tim Dettmers, Mike Lewis, Younes Belkada, and Luke Zettlemoyer. Gpt3. int8 (): 8-bit matrix multiplication for transformers at scale. Advances in neural information processing systems, 35:30318–30332, 2022.
Jonas Geiping, Sean McLeish, Neel Jain, John Kirchenbauer, Siddharth Singh, Brian Bartoldson, Bhavya Kailkhura, Abhinav Bhatele, and Tom Goldstein. Scaling up test-time compute with latent reasoning: A recurrent depth approach. Advances in Neural Information Processing Systems, 38:41340–41391, 2026.
Ahmadreza Jeddi, Marco Ciccone, and Babak Taati. Loopformer: Elastic-depth looped transformers for latent reasoning via shortcut modulation. arXiv preprint arXiv:2602.11451, 2026.
Ji Lin, Jiaming Tang, Haotian Tang, Shang Yang, Wei-Ming Chen, Wei-Chen Wang, Guangxuan Xiao, Xingyu Dang, Chuang Gan, and Song Han. Awq: Activation-aware weight quantization for on-device llm compression and acceleration. Proceedings of machine learning and systems, 6:87–100, 2024.
Yujun Lin, Haotian Tang, Shang Yang, Zhekai Zhang, Guangxuan Xiao, Chuang Gan, and Song Han. Qserve: W4a8kv4 quantization and system co-design for efficient llm serving. Proceedings of Machine Learning and Systems, 7, 2025.
Zechun Liu, Changsheng Zhao, Igor Fedorov, Bilge Soran, Dhruv Choudhary, Raghuraman Krishnamoorthi, Vikas Chandra, Yuandong Tian, and Tijmen Blankevoort. Spinquant: Llm quantization with learned rotations. In Y. Yue, A. Garg, N. Peng, F. Sha, and R. Yu (eds.), International Conference on Learning Representations, volume 2025, pp. 92009–92032, 2025. URL https://proceedings.iclr.cc/paper_files/paper/2025/file/e5b1c0d4866f72393c522c8a00eed4eb-Paper-Conference.pdf.
Pratyush Patel, Esha Choukse, Chaojie Zhang, Aashaka Shah, Íñigo Goiri, Saeed Maleki, and Ricardo Bianchini. Splitwise: Efficient generative llm inference using phase splitting. In 2024 ACM/IEEE 51st Annual International Symposium on Computer Architecture (ISCA), pp. 118–132. IEEE, 2024.
Nikunj Saunshi, Nishanth Dikkala, Zhiyuan Li, Sanjiv Kumar, and Sashank J Reddi. Reasoning with latent thoughts: On the power of looped transformers. In International Conference on Learning Representations, volume 2025, pp. 14855–14881, 2025.
Ke Wan and Chen Chen. Attention routing stabilizes early: Working-set inference for recurrent language models. arXiv preprint arXiv:2609.27373, 2026.
Guangxuan Xiao, Ji Lin, Mickael Seznec, Hao Wu, Julien Demouth, and Song Han. Smoothquant: Accurate and efficient post-training quantization for large language models. In International conference on machine learning, pp. 38087–38099. PMLR, 2023.
Xiao-Wen Yang, Ziyu Han, Xi-Hua Zhang, Wen-Da Wei, Jie-Jing Shao, Lan-Zhe Guo, and Yu-Feng Li. Stabilizing recurrent dynamics for test-time scalable latent reasoning in looped language models. arXiv preprint arXiv:2605.26733, 2026.
Zhewei Yao, Zhen Dong, Zhangcheng Zheng, Amir Gholami, Jiali Yu, Eric Tan, Leyuan Wang, Qijing Huang, Yida Wang, Michael Mahoney, et al. Hawq-v3: Dyadic neural network quantization. In International conference on machine learning, pp. 11875–11886. PMLR, 2021.
Yilong Zhao, Chien-Yu Lin, Kan Zhu, Zihao Ye, Lequn Chen, Size Zheng, Luis Ceze, Arvind Krishnamurthy, Tianqi Chen, and Baris Kasikci. Atom: Low-bit quantization for efficient and accurate llm serving. Proceedings of Machine Learning and Systems, 6:196–209, 2024.
Yinmin Zhong, Shengyu Liu, Junda Chen, Jianbo Hu, Yibo Zhu, Xuanzhe Liu, Xin Jin, and Hao Zhang. {DistServe}: Disaggregating prefill and decoding for goodput-optimized large language model serving. In 18th USENIX symposium on operating systems design and implementation (OSDI 24), pp. 193–210, 2024.
A Proofs for Quantization Error Analysis
A.1 Proof of Theorem 3.1
Proof. For a quantized recurrent step, , and the deviation from the reference trajectory is
Adding and subtracting and applying the triangle inequality gives
(24)
Applying Equations 11 and 10 yields
For a reference-precision step, , both trajectories are propagated by , and therefore
(26)
The two cases can therefore be written jointly as
Since the two trajectories share the same initial representation, . Repeatedly applying Equation 27 gives
(28)
Collecting these terms yields
which proves Theorem 3.1.
A.2 Proof of Theorem 3.2
Proof. Define the final-error weight associated with quantizing recurrent step i as
The bound in Equation 13 can then be written as
For two recurrent steps , their weights satisfy
Because , we have
Thus, the error weights are nondecreasing with recurrent depth: earlier quantized steps have no larger final-error weight than later quantized steps.
Consider any precision schedule q containing exactly K quantized steps. Its error bound is the sum of exactly K elements selected from the ordered sequence
The smallest possible sum of K such elements is obtained by selecting the first K weights, corresponding to
which is precisely . Therefore,
for every schedule with K quantized steps.
Likewise, the largest possible sum of K weights is obtained by selecting the final K elements,
which corresponds to . Hence,
Combining Equations 36 and 38 gives
which proves Theorem 3.2. If the relevant contraction factors satisfy , the ordering of the corresponding weights is strict whenever an exchanged pair spans at least one strictly contractive recurrent step, so any non-prefix schedule has a strictly larger bound than the corresponding RAMP schedule unless the exchanged weights are equal.
Table 5: WikiText long-context fidelity of RAMP. Results use 32 frozen evaluation endpoints with nested contexts and identical tail-64 prediction targets across context lengths. NLL is measured relative to BF16-32. Hidden-state and logit relative errors are reported as percentages.
| Context | BF16 NLL | RAMP NLL | NLL | Hidden | Logit |
|---|---|---|---|---|---|
| 128 | 2.603711 | 2.605315 | +0.001604 | 2.937% | 1.429% |
| 256 | 2.345469 | 2.347890 | +0.002422 | 2.881% | 1.647% |
| 512 | 2.216275 | 2.217365 | +0.001090 | 2.699% | 1.378% |
| 1024 | 2.153023 | 2.153203 | +0.000179 | 2.556% | 1.277% |
| 2048 | 2.116153 | 2.115046 | -0.001107 | 2.586% | 1.294% |
| 4096 | 2.101984 | 2.102086 | +0.000102 | 2.653% | 1.342% |
Table 6: PG19 long-context fidelity of RAMP. Results use 32 frozen validation books with document-contained nested contexts and identical tail-64 prediction targets across context lengths. NLL is measured relative to BF16-32. Hidden-state and logit relative errors are reported as percentages.
| Context | BF16 NLL | RAMP NLL | NLL | Hidden | Logit |
|---|---|---|---|---|---|
| 512 | 2.671946 | 2.669488 | -0.002457 | 2.722% | 1.201% |
| 1024 | 2.623134 | 2.621616 | -0.001518 | 2.825% | 1.325% |
| 2048 | 2.607391 | 2.607932 | +0.000542 | 2.792% | 1.234% |
| 4096 | 2.592401 | 2.592470 | +0.000068 | 3.075% | 1.354% |
A.3 Full Long-Context Fidelity Results
WikiText context scaling. Table 5 reports the complete long-context fidelity results underlying the WikiText quality curve in Figure 3b. We use the same 32 frozen WikiText endpoints at every context length, with nested contexts ending at the same corpus location and identical final 64 prediction targets. All metrics are computed under the same tail-64 evaluation protocol. Across context lengths from 128 to 4096 tokens, RAMP remains consistently close to the BF16-32 trajectory: paired NLL remains near zero, while hidden-state and logit errors remain stable.
PG19 context scaling. We repeat the same long-context fidelity analysis on 32 frozen PG19 validation books. Contexts are constructed entirely within individual documents, and the final 64 prediction targets remain identical for each book as context length changes. As shown in Table 6, RAMP again remains close to BF16-32 throughout the evaluated range. Hidden-state and logit errors remain stable from 512 to 4096 tokens, while paired NLL stays small. PG19 exhibits a mild positive trend in NLL toward longer contexts; the negative values at shorter contexts should therefore be interpreted as small numerical deviations rather than evidence that RAMP improves over BF16.
Cross-dataset long-context behavior. The two datasets exhibit a consistent long-context fidelity pattern. On WikiText, paired NLL remains near zero throughout 128–4096 tokens, while hidden-state and logit errors remain approximately constant. PG19 shows the same stability in representation- and output-level error over 512–4096 tokens, with paired NLL remaining small despite a mild positive trend toward longer contexts. Together with the 4K cross-dataset comparison in Table 1, these results show that terminal BF16 refinement preserves near-full-precision recurrent trajectories across both datasets and remains effective as context length increases.