InnerThoughts: Disentangling Representations and Predictions in Large Language Models

Didier Chételat, Joseph Cotnareanu, Rylee Thompson, Yingxue Zhang, Mark Coates

Abstract

Large language models (LLMs) contain substantial factual knowledge which is commonly elicited by multiple-choice question-answering prompts. Internally, such models process the prompt through multiple transformer layers, building varying representations of the problem within its hidden states. Ultimately, however, only the hidden state corresponding to the final layer and token position is used to predict the answer label. In this work, we propose instead to learn a small separate neural network predictor module on a collection of training questions, that take the hidden states from all the layers at the last temporal position as input and outputs predictions. In effect, such a framework disentangles the representational abilities of LLMs from their predictive abilities. On a collection of hard benchmarks, our method achieves considerable improvements in performance, sometimes comparable to supervised fine-tuning procedures, but at a fraction of the computational cost.

Introduction

Large Language Models (LLMs) serve as vast repositories of factual information. However, their ability to accurately retrieve and output this information in multiple-choice formats is often hindered by surface-level biases, such as choice ordering or prompt phrasing. While standard calibration techniques attempt to mitigate this by adjusting final output logits, they often fail to capture the rich information present in intermediate layers. Conversely, supervised fine-tuning (SFT) methods like LoRA are computationally expensive.

This paper introduces InnerThoughts, a method that disentangles an LLM's representational capacity from its predictive output by utilizing the hidden states of all layers to inform a specialized, lightweight predictor module.

Methodology

The InnerThoughts framework follows a three-step process to enhance predictive accuracy while keeping the base LLM frozen.

1. Feature Extraction

When a question is processed by the LLM (e.g., Llama 3 70B), the hidden states from every layer $L$ are extracted at the final token position. This results in a feature matrix of shape (Layers × Hidden Dimension), capturing the model's internal "thought process" at various levels of abstraction.

2. The Predictor Module

Instead of relying on the standard RMSNorm and Projection head of the final layer, InnerThoughts feeds the extracted feature matrix into a dedicated predictor module.

Comparison of standard LLM prediction (a) versus the proposed InnerThoughts method (b), which utilizes hidden states from all layers.

The architecture of this module is inspired by MLP-Mixer. It independently processes the "layer" dimension and the "hidden state" dimension through successive normalization, linear, and activation layers. This allows the module to identify which layers and features are most relevant for the specific task.

Detailed architecture of the Predictor Module showing the MLP-Mixer inspired processing pipeline.

3. Training and Efficiency

The predictor module is trained on a labeled dataset to map internal states directly to answer labels. Because the LLM remains frozen, training requires only a single forward pass to generate the training data, avoiding the massive computational overhead of backpropagation through billions of parameters.

Key Insights

  • Disentanglement: By separating representation (the LLM's job) from prediction (the module's job), the system avoids the "corruption" of information that can occur in the final generic prediction head.
  • The "Overwrite" Hypothesis: Information in early layers may be lost or obscured by the time it reaches the final layer. InnerThoughts preserves this history, allowing the predictor to access nuances missed by the final layer.
  • Helping the Hesitant: The biggest gains occurred on datasets where the LLM was originally "hesitant" (i.e., a small margin between top choices). InnerThoughts acts as a tie-breaker by looking at deeper evidence.
  • The Layer 35 Jump: Analysis of Llama 3 70B indicates that predictive utility in hidden states remains low until approximately layer 35, where it sharply increases, marking a transition toward concrete reasoning.

Results

InnerThoughts was evaluated across six benchmarks, including AQuA, MMLU, and MedMCQA.

  • Performance Gains: The method achieved a significant 10% accuracy boost on the AQuA math benchmark.
  • Cost-Effectiveness: On average, InnerThoughts captured 35% of the performance gains seen with full QLoRA fine-tuning while requiring only 16% of the computational resources.
  • Superiority over Calibration: It consistently outperformed logit-based calibration, demonstrating that internal states are a far richer source of predictive signal than final outputs.

Conclusion

InnerThoughts demonstrates that LLMs "know" more than they typically express through their final output layer. By listening to the model's internal layers, we can significantly improve performance on reasoning and factual tasks with minimal additional training cost. Future work will explore extending this classification-based approach to sequential text generation and more complex reasoning chains.

Summary updated

BibTeX
@inproceedings{chetelat2025innerthoughts,
  author = {Didier Chételat and Joseph Cotnareanu and Rylee Thompson and Yingxue Zhang and Mark Coates},
  title = {{InnerThoughts: Disentangling Representations and Predictions in Large Language Models}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2025},
  url = {https://openreview.net/forum?id=H0ZBGst3Vh},
}
Figure