Manuscript Offprint

arXiv:2610.25076

P2N: Reusing Deep Representations for Greater Effective Depth

Yiqin Hao, Boyi Zeng, Zitong Wang, He Li, Shixiang Song, Feichen Song, Yifan Liu, Zhouhan Lin

Abstract

Mathematical problem solving and autonomous agents are increasingly important applications of language models, demanding stronger reasoning capabilities. Computational depth is a key resource for such reasoning, but adding model layers increases both training and inference costs, while test-time scaling incurs substantial additional inference computation. We introduce P2N (Previous to Next), which reuses the previous token's deep representations—already available during generation—to increase effective computational depth with negligible decoding overhead. Specifically, P2N adds the previous token's deep hidden state to the current token's shallow representation, allowing subsequent layers to build on previously completed deep computation. This recurrence extends effective computational depth across tokens, while introducing only a single vector addition per decoding step. We train the recurrence using parallel Jacobi updates restricted to a middle-layer core. Experiments with Qwen-style models show that, at 1.5B parameters, P2N improves GSM8K accuracy by over 10 percentage points under both zero-shot and few-shot prompting, with nearly unchanged decoding latency. The benefits also extend to language modeling and average performance on general downstream benchmarks.

(a) 0-shot

Figure

(b) 8-shot

Figure

Figure 1 | Mathematical reasoning at the 1B and 1.5B scales. At 1.5B, P2N improves GSM8K accuracy over Vanilla by 10.9 and 11.1 percentage points under zero-shot and eight-shot prompting, respectively, corresponding to relative gains of 52.2% and 65.8%.

1. Introduction

The growing use of language models for mathematical problem solving and autonomous agents places increasing demands on their reasoning capabilities. Computational depth is an important resource for reasoning, enabling representations to be refined through successive stages of computation (Dehghani et al., 2018; Geiping et al., 2026). However, adding Transformer layers increases both training and inference costs, while test-time scaling (Snell et al., 2024) incurs additional computation during generation. These costs motivate a natural question: can language models obtain greater effective depth by reusing computation that has already been performed?

We therefore introduce P2N (Previous to Next), which reuses the previous token's deep representations—already available during generation—to increase effective computational depth with negligible decoding overhead. Specifically, for a contiguous core of Transformer layers, P2N adds the previous token's core output to the current token's core input. This parameter-free feedback requires only a single vector addition per token.

Although this recurrence fits naturally into autoregressive decoding, directly applying it during training would introduce a left-to-right dependency across tokens. We address this dependency using Jacobi iteration (Saad, 2003). After an initial warm pass, each update combines the fixed core inputs with the preceding iteration's outputs shifted one position to the right, allowing all token positions to be updated in parallel. To limit the additional training cost, we restrict the recurrent core to the middle third of the network and evaluate the prefix and suffix only once, as illustrated in Figure 2.

We pretrain Qwen-style models (Yang et al., 2025) from 150M to 1.5B parameters from scratch on the Pile (Gao et al., 2020), comparing P2N with vanilla baselines at matched parameter and token budgets. At 1.5B, after matched supervised fine-tuning, P2N improves GSM8K (Cobbe et al., 2021) final-answer exact match by 10.92 and 11.07 percentage points under zero-shot and eight-shot prompting, respectively. Decoding benchmarks show nearly unchanged per-token latency. The benefits also extend to language modeling and general downstream performance: P2N consistently lowers validation loss across scales and, at 1.5B, reduces Pile validation perplexity from 6.72 to 6.52 while improving average zero-shot and five-shot accuracy across nine task configurations by 1.68 and 2.11 percentage points, respectively.

References (66)