Manuscript Offprint

arXiv:2610.31667

Direct Pass@kk Optimization for Thought Pruning: Balancing Quality and Diversity in Test-Time Reasoning

Mahdi Salmani, Adel Javanmard, Devansh Gupta, Meisam Razaviyayn

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Test-time scaling has emerged as a key inference strategy for reasoning models, where a model generates a large number of candidate solutions in the hope of finding at least one correct solution. Running all candidate solutions to completion can be computationally demanding, so recent work prunes the candidate pool after generating only a short prefix, committing further computation only to the surviving candidates. Existing pruning strategies divide broadly into two categories: Quality-based methods assign a score to each partial solution and discard those predicted to ultimately lead to an incorrect final solution, while diversity-based methods select partial solutions that follow different reasoning trajectories and are therefore likely to cover different final solutions. The tension between these two objectives is an instance of exploration versus exploitation, yet little to no prior work on pruning exposes this trade-off directly, let alone optimizes it. In this paper, we introduce a pruning procedure that addresses this trade-off directly by optimizing pass@k over the selected solution pool. In particular, it chooses the pool to maximize the probability that at least one of its partial solutions, when continued to completion, yields a correct answer. Because this objective simultaneously rewards high-quality partial solutions and penalizes redundancy among them, quality and diversity are naturally balanced by the criterion itself rather than through separate ad-hoc design choices. On eight open-weight reasoning models, our method outperforms existing quality-based and diversity-based pruning strategies. The gains are particularly pronounced when the pruning procedure keeps a moderate number of partial solutions for continued generation, highlighting the value of directly balancing quality and diversity during pruning.

1 Introduction

Large Language Models (LLMs) have demonstrated remarkable capabilities in complex reasoning, showcasing a strong aptitude for solving complex problems that require multi-step logic [15, 18, 21, 45, 52]. To further enhance these capabilities, test-time scaling has emerged as a prominent strategy, where generating multiple candidate solutions for a single problem allows the model to explore diverse reasoning strategies and achieve substantially better final performance [3, 35, 44, 48]. However, a significant challenge in scaling test-time compute is the prohibitive cost of generating many full solutions, which we refer to as rollouts moving forward [23, 33]. Beyond generation, there is also the cost of evaluating the finished rollouts in best-of-N methods, which score each rollout with a reward model, and this is computationally demanding on a large pool of long reasoning traces [11, 26, 36]. This computational bottleneck, both in generation and in evaluating all N rollouts in best-of-N methods, necessitates test-time pruning of partial rollouts before they reach a final answer.

Figure

Figure 1: Test-time pruning. Only k of the N rollouts (ringed) continue past the cutoff T, up to the budget B.

and terminate. In other words, we generate all N rollouts only up to a cutoff of T tokens, keep the k most promising of them and run those to the full token budget B, as illustrated in Fig. 1.

One family of methods examines the confidence dynamics of the model during generation, utilizing metrics such as logit entropy or confidence [17, 30, 43, 50]. The underlying intuition is that if a model is overly confident at an intermediate decoding step, extending the reasoning process is a waste of compute; conversely, if the model is entirely lacking in confidence, it is unlikely to reach a correct solution regardless of the additional compute provided, allowing for early termination. Another line of work leverages the model's internal state, specifically the hidden states of its transformer blocks, to identify which rollouts are worth continuing [1, 54]. By “probing” these internal states, one can predict whether the model will ultimately arrive at a correct solution, effectively framing the pruning problem as a classification task. This allows for the early discarding of partial rollouts that are unlikely to yield a correct final answer. In parallel, a separate line of research prioritizes representation exploration (RepExp) to select a subset of rollouts that cover as many distinct reasoning strategies as possible [39]. By selecting partial rollouts whose corresponding embeddings are dissimilar, RepExp aims to explore a diverse set of reasoning trajectories.

These approaches, however, sit at the two ends of a spectrum, and neither directly optimizes the quantity we actually care about. The problem with probing methods is that the rollouts they rank highest tend to be similar to one another. As a result, the probe may be confidently wrong about all of the kept rollouts at once, and none of them reaches a correct answer. This is the problem of pure exploitation (Fig. 2a). RepExp, on the other hand, finds diverse rollouts, but because it ignores the quality of the rollouts, it can spend much of its budget on rollouts that are unlikely to succeed (Fig. 2b). These limitations motivate selecting the rollouts by the metric we actually want to optimize, choosing the set SS of kk rollouts that maximizes pass@k, that is, max⁡∣S∣=kpass@k(S)\max_{|S|=k} \text{pass}@k(S), which we formalize in Eq. 3. Optimizing this objective directly keeps the selected rollouts diverse enough to avoid shared failures while still favoring high-quality ones (Fig. 2c).

To this end, we propose PKTP (Pass@k Thought Pruning), a pruning framework that chooses the kept rollouts by maximizing pass@k directly. The main difficulty is that, even if the rollouts are sampled independently, their outcomes are not independent (conditioned on the partial observation of the rollout). Hence, pass@k depends on their joint distribution (i.e., rollouts with similar partial rollouts tend to succeed or fail together). We model this joint distribution with a latent Gaussian model, in which the correctness of each rollout is obtained by thresholding a Gaussian

Pure Exploitation

Figure

(a) Keep highest-quality k, redundant and correlated

Pure Exploration

Figure

(b) Keep most diverse k, wastes budget on weak rollouts

Ours (PKTP)

Figure

(c) Keep high-quality and diverse k

Predicted correct

Uncertain

Predicted wrong

✓ Correct

✗ Incorrect

Kept (k)

Figure 2: Conceptual illustration. The same pool of candidate rollouts, positioned by their partial rollout representations in embedding space, under three pruning strategies. Each rollout is colored by its predicted correctness and marked ✓/✗ by its actual outcome; the k = 3 kept rollouts are ringed. (a) Pure exploitation keeps the highest-scoring rollouts, but they are correlated and cluster together, so they miss the correct rollout. (b) Pure exploration keeps a maximally diverse subset yet spends its budget on low-quality rollouts, also missing it. (c) Our method optimizes pass@k directly over the kept subset, balancing quality and diversity, and retains the correct rollout.

score. Evaluating pass@k under this model requires an expectation over the latent variables, so we instead derive a closed-form second-order approximation of it. We show that this approximation is submodular, enabling us to approximately solve it using a greedy procedure to find a subset of size k. An important aspect of the proposed framework is that the latent model is trained only once and does not depend on k, and a single greedy pass yields a nested sequence of subsets, so the budget k can be chosen online at inference time without retraining.

Contributions. First, we cast pruning as maximizing the pass@k of the kept set, and we model how similar rollouts fail together. Second, we derive a closed-form, submodular approximation of pass@k that links the probe and RepExp. Third, through experiments on eight reasoning models, we show that PKTP improves over existing pruning methods, especially for moderate values of k.

References (51)