SubspacePath Pruner: Inference-time Pruning via Probe-based Representation–Parameter Coupling

Zhiren Gong, Yikun Hou, Fan Wu, Che Wang, Fuyao Zhang, Tiantong Wu, Yurong Hao, Jiaming Zhang, Yiyang Duan, Tiantong Wang, Fei Huang, Chau Yuen, Wei Yang Bryan Lim

TL;DR

This paper introduces SubspacePath Pruner, a novel method for efficiently specializing large language models (LLMs) for specific tasks at inference time without retraining. It achieves this by identifying and pruning "noise" pathways in the LLM's internal representations, leading to significant speedups and memory reductions while maintaining or even improving accuracy.

What Problem Does This Paper Address?

Modern applications increasingly rely on Large Language Models (LLMs) for specialized tasks. However, deploying LLMs for these dedicated scenarios often requires them to be highly accurate, fast, and memory-efficient. The challenge is that real-world scenarios are diverse and complex, making it difficult to gather enough training data or fine-tune models for each specific use case. Existing methods for model compression or specialization often struggle with this heterogeneity, leading to brittle performance across different scenarios or requiring costly retraining. This paper aims to address the need for efficient, inference-time specialization of LLMs that can adapt to various scenarios without compromising performance.

Methods

The core of SubspacePath Pruner lies in its "Subspace-Pathway Coupling" principle. The authors observed that specific domains or scenarios tend to activate consistent and sparse sets of internal "reasoning pathways" within the LLM. Their method leverages this by:

  1. Domain-Basis Synthesis (DBS): This offline step constructs a stable, quasi-orthogonal "coordinate system" in the LLM's embedding space. It identifies distinct domain axes that capture the essence of different knowledge areas. This is achieved by analyzing input pools from various domains, performing Principal Component Analysis (PCA) to find dominant directions, and then selecting a subset of these axes that are both orthogonal and cover significant variance.
  2. Probe-based Scenario Pruning (PSP): This component uses lightweight, trained "probes" to connect the domain axes identified by DBS to specific pathways (attention heads) within the LLM.
  3. Offline Preparation: Probes are trained to predict domain alignment from intermediate LLM activations. Head-wise importance scores are computed based on how much each head contributes to specific domain axes. A "whitelist" of always-retained heads is also identified to preserve general capabilities.
  4. Online Compilation: For a given scenario (represented by a few initial inputs), the probes estimate the scenario's domain mixture. This mixture, along with cached head importance, is used to score heads and select a budget-constrained subset of essential pathways. This results in a pruned subnetwork (mask) that is then reused for all subsequent inputs in that scenario, avoiding re-computation.

Datasets

The paper evaluates its method on several QA datasets to capture diverse domain shifts:

  • XDomainBench: A multi-domain benchmark specifically designed for cross-domain evaluation. The authors use a partition into selected-domain, out-of-domain, and cross-domain subsets. The selected-domain subset is used for offline preparation, while OOD and cross-domain subsets are used for online inference and testing.
  • CommonsenseQA: A dataset for commonsense reasoning.
  • Natural Questions (NQ): An open-domain QA dataset with real user queries.
  • ARC (AI2 Reasoning Challenge): A dataset for science question answering.

Key Insights and Ideas

  • LLMs have "reasoning pathways" that are domain-specific: The core insight is that LLMs don't use all their parameters equally. Instead, specific domains or tasks activate distinct, sparse sets of internal pathways (attention heads).
  • Embedding space has a structured "coordinate system": The authors show that by analyzing embeddings, they can find orthogonal "axes" that represent different domains, providing a stable reference for understanding LLM behavior.
  • Pruning can improve accuracy: By selectively removing "noisy" or irrelevant pathways, the model can become more focused and accurate, a phenomenon they call "pruning paradox."
  • Cross-domain scenarios allow for more aggressive pruning: Because different domains often activate distinct pathways, pruning can be more aggressive in cross-domain settings without sacrificing performance as much as in single-domain scenarios.
  • Inference-time specialization is practical and efficient: The method allows for efficient adaptation to new scenarios without retraining, making it highly practical for real-world deployment.

Key Results

  • Significant speedups and memory reduction: Experiments on LLaMA-2-13B show a 1.27x speedup at a ~30% pruning ratio. Table 1 shows performance metrics where retention values often exceed 1.0, indicating efficiency-adjusted gains.
  • Competitive or improved accuracy: The method achieves strong performance, with an average Recall of 29.3 on cross-domain tests (vs. 24.7 dense) and 21.6 on cross-dataset tests (vs. 25.5 dense) for LLaMA-2-13B at ~30% pruning.
  • Robustness to distribution shifts: The method demonstrates strong performance on out-of-domain and cross-dataset evaluations, outperforming dense baselines in many cases.
  • Effective component contributions: Ablation studies confirm the critical role of DBS for axis selection, whitelisting for general capacity, and multi-domain mixing for adaptive pruning.
  • Fast and reusable pruning: The offline preparation is reusable, and online compilation is very fast (0.02-0.08 seconds per scenario), making it efficient for dynamic scenarios.

Limitations and Future Work

Limitations:

  • Domain pool dependency: The method relies on input-only pools for offline DBS preparation. The quality and representativeness of these pools directly impact the constructed axis basis and pruning performance.
  • Pruning ratio sensitivity: While effective at moderate ratios, aggressive pruning beyond the "elbow point" can lead to significant performance degradation. Selecting the optimal pruning ratio is crucial and can vary by dataset and task type.
  • Task-type variation: Reasoning tasks show higher sensitivity to pruning compared to multiple-choice or factual tasks.
  • Model and dataset scope: The evaluation covers models up to 14B parameters and four datasets. Further validation is needed for larger models and different task types (e.g., generation, summarization).
  • Scenario boundary assumption: The method assumes clear scenario boundaries. Dynamic or ambiguous boundaries might require additional mechanisms.

Future Work:

  • Adaptive pruning ratio selection: Developing automatic methods to select optimal pruning ratios based on scenario characteristics.
  • Task-aware pathway selection: Explicitly considering task type in pathway compilation to potentially improve performance on reasoning tasks.
  • Integration with quantization: Combining pruning with quantization for further memory and inference efficiency.
  • Extension to generation tasks: Adapting the method for tasks like summarization and translation, where evaluation metrics and pruning criteria may differ.

Summary updated

Abstract

Large-scale dedicated application of LLMs in diverse scenarios increasingly demands specialized model inference behavior under strict constraints of accuracy, latency, and memory. However, the heterogeneous and long-tailed nature of real-world specialized scenarios makes it difficult to obtain training data and optimize models. We study a practical inference-time specialization setting: given an LLM base, we compile a reusable, budget-bounded pathway/subnetwork within a specific scenario. Our approach is motivated by an empirical coupling phenomenon: input scenario sets aligned with similar representation subspaces (e.g., domain) in embedding space tend to activate a consistent and sparse set of internal reasoning pathways in model parameter space. To build the bridge between them, we propose probe-based SubspacePath Pruner with two core components: (1) Domain-Basis Synthesis (DBS) constructs a quasi-orthogonal basis of domain axes in embedding space, serving as a stable coordinate system. (2) Probe-based Scenario Pruning (PSP) uses efficient layer-wise linear probes to estimate axis alignment and compute budgeted head-wise pathways for a specific scenario. Experiments on LLaMA-2-13B show 29.3 average Recall on cross-domain tests (vs. 24.7 dense) and 21.6 on cross-dataset tests (vs. 25.5 dense) with 1.27x speedup at ~30% pruning ratio.
BibTeX
@inproceedings{gong2026subspacepath,
  author = {Zhiren Gong and Yikun Hou and Fan Wu and CHE WANG and Fuyao Zhang and Tiantong Wu and Yurong Hao and Jiaming Zhang and Yiyang Duan and Tiantong Wang and Fei Huang and Chau Yuen and Wei Yang Bryan Lim},
  title = {{SubspacePath Pruner: Inference-time Pruning via Probe-based Representation–Parameter Coupling}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=fvkCjFvWKf},
}
Figure