Learning Distribution-wise Control in Representation Space for Language Models

Chunyuan Deng, Ruidi Chang, Hanjie Chen

Abstract

Traditional methods for steering Large Language Model (LLM) behavior often rely on "pointwise" interventions, which modify internal hidden representations using fixed vectors. However, these methods can be brittle and fail to capture the continuous nature of the model's concept space. This paper introduces Distribution-Wise Intervention (D-Intervention), a novel approach that learns probability distributions within the latent space to steer model behavior. By intervening with learned Gaussian distributions rather than static points, D-Intervention achieves superior reasoning performance and significantly higher robustness to input noise. Evaluated across 15 benchmarks, this method outperforms state-of-the-art techniques like Representation Fine-Tuning (ReFT) while modifying as little as 0.039% of the model's parameters.

Introduction

Steering the behavior of LLMs—whether to improve mathematical reasoning or adjust stylistic tone—typically involves intervening in the model's internal representation space during the forward pass. Current state-of-the-art methods, such as ReFT, utilize pointwise transformations to shift these internal states. While effective, pointwise methods are inherently rigid. They assume that a single vector is sufficient to represent a complex concept, ignoring the surrounding region in the latent space that may also contain relevant information.

We propose that the concept space inside an LLM is continuous. If a specific vector improves reasoning, the neighborhood around that vector should also be beneficial. To exploit this, we introduce D-Intervention, which learns a distribution (mean $\mu$ and variance $\sigma^2$) to represent a concept. This approach allows the model to explore a "region of utility," leading to more flexible and robust steering.

Methodology

Distribution-Wise Intervention (D-Intervention)

Instead of a deterministic transformation, D-Intervention treats the intervention as a stochastic process. The model learns to map inputs to a Gaussian distribution in the latent space. To ensure the model remains trainable via standard gradient descent, we employ Stochastic Reparameterization (the reparameterization trick). This allows the intervention to be expressed as a deterministic function of the learned mean, variance, and a random noise variable $\epsilon$, preserving the flow of gradients during backpropagation.

Stability and Strategy

To maintain numerical stability and prevent the model from producing erratic outputs due to random sampling, we implement Model-Specific Clamping. The boundaries for these interventions are automatically derived from the model's own weight distributions in adjacent layers.

Furthermore, we adopt a Layer-Wise Strategy based on the Data Processing Inequality. Information theory suggests that as data progresses through a neural network, information is compressed or lost. Therefore, interventions are most effective in the early layers of the model, where the representation is richest. Our mixed strategy applies stochastic interventions in early layers while keeping later layers deterministic to refine the final output.

Experimental Setup

The effectiveness of D-Intervention was tested using the Llama model family (7B to 13B parameters, including Llama-3-8B) across 15 diverse benchmarks:

  • Commonsense Reasoning: 8 benchmarks including BoolQ, PIQA, HellaSwag, and WinoGrande.
  • Arithmetic Reasoning: 7 benchmarks including GSM8K, SVAMP, and AQuA.

The models were fine-tuned using the Commonsense170K and Math10K datasets.

Key Results

Performance and Efficiency

D-ReFT (the distribution-wise implementation of ReFT) consistently outperformed standard ReFT, LoRA, and DoRA. In early-layer experiments, D-Intervention provided an accuracy boost of +4% to +6% over deterministic baselines. Remarkably, these gains were achieved by modifying only 0.039% of the total model parameters, demonstrating extreme parameter efficiency.

Robustness to Noise

A critical finding of this research is the inherent robustness of distribution-wise methods. Because the model is trained to handle the internal noise of sampling from a distribution, it becomes more resilient to external input noise. In stress tests where non-essential words were deleted from mathematical prompts, D-ReFT maintained stable performance, whereas pointwise ReFT experienced an accuracy drop of nearly 30%.

Variance and Success

Analysis revealed a positive correlation between the learned variance in stochastic nodes and final task accuracy. This suggests that "broader exploration" of the latent space during training allows the model to develop more robust internal representations of complex concepts.

Discussion and Limitations

While D-Intervention offers significant advantages, it introduces new considerations for inference. While stochasticity helps during training and for creative tasks, deterministic inference (setting noise to zero) proved most effective for rigid reasoning tasks. Additionally, performance is sensitive to the "noise scale" and the specific ratio of stochastic-to-deterministic layers, requiring careful hyperparameter tuning for different architectures.

Future work will focus on scaling these distribution-wise controls to frontier models (e.g., Llama-3-70B) and exploring their utility in broader instruction-following contexts.

Conclusion

D-Intervention represents a shift from thinking of LLM internal states as discrete points to viewing them as regions within a distribution. By embracing uncertainty and latent neighborhoods, we can steer LLMs more effectively, efficiently, and robustly than previously possible with pointwise methods.

Summary updated

BibTeX
@inproceedings{deng2025learning,
  author = {Chunyuan Deng and Ruidi Chang and Hanjie Chen},
  title = {{Learning Distribution-wise Control in Representation Space for Language Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=9vwkmxLZVL},
}
Figure