What Are LLMs Thinking Inside: Methods and Limitations of Observing Intermediate Representations

    This article explains why inspecting a large language model's internal states matters beyond reading its final output, walks through a two-step reasoning example where a hidden intermediate concept drives the answer, and compares three observation methods — logit lens, sparse autoencoders, and Jacobian-based sensitivity analysis — covering their principles, capabilities, and limitations. It also outlines validation caveats and practical recommendations for engineering teams adopting these techniques as part of routine quality assurance.

    1. Why Look at What the Model Doesn’t Say

    Models generate tokens one at a time, and users only see the final text. But before each token is produced, the model runs through many layers of computation, forming a large number of intermediate representations. Some of these directly determine the next token, some prepare information for later steps, and some are merely byproducts of automated processing.

    Looking at the output alone, you cannot tell whether an answer comes from reliable reasoning or from coincidental pattern matching. In scenarios that require auditing, error diagnosis, or explaining the basis of a decision, observing internal states becomes a necessary complement.

    2. A Two-Step Reasoning Example

    Suppose the question is “How many legs does a web-spinning animal have?” and the answer is 8. Reaching this answer typically takes two steps. First, the model infers the intermediate concept “spider” from “spins a web.” Second, it retrieves the fact “eight legs” associated with “spider.”

    The word “spider” never appears in the final answer. Yet if the model had not formed this intermediate concept internally, it would be hard to produce the correct result. The existence of such a concept can be inferred from indirect evidence, but it is difficult to read out directly.

    This example shows that what appears at the output layer is not equivalent to what happens during reasoning. The problem interpretability research aims to solve is finding and quantifying the intermediate concepts that influence reasoning without being directly expressed.

    3. Existing Methods for Observing Internal States

    Over the past few years, researchers have proposed several observation methods. Each has a clear principle and a well-defined boundary of capability.

    3.1 Logit Lens

    Principle: At every layer, pass the hidden state through the same mapping used by the output layer, projecting it into vocabulary space to see which tokens the layer most favors.

    Strengths: The method is intuitive and cheap to compute. It reveals at which layer the model starts leaning toward a particular answer.

    Limitations: The projection only reflects the tendency for the next token. Intermediate concepts that will only be used in later steps — like “spider” — typically do not appear as tokens at the current position.

    Pseudocode:

    1. for layer_index, hidden in enumerate(all_hidden_states):
    2. logits = unembed(final_norm(hidden))
    3. top_tokens = topk(softmax(logits), k=5)
    4. record(layer_index, top_tokens)

    3.2 Sparse Autoencoders (SAE)

    Principle: Train an autoencoder with a sparsity constraint on the activation vectors of a given layer, decomposing the activations into a large number of features pointing in different directions.

    Strengths: The number of features can reach into the thousands or more, offering fine granularity. Many features correspond to concrete semantics, making them easy to inspect manually.

    Limitations: Whether a feature actually participates in the current reasoning requires additional judgment. Some features only handle formatting, punctuation, or surface-level processing of the input. They show up in activations but have little to do with the task outcome. An SAE can answer “what features exist,” but not directly “which features are doing the work.”

    3.3 Jacobian-Based Sensitivity Analysis

    Principle: Compute the partial derivatives of an output (for example, the logit of a candidate token) with respect to internal representations, producing a Jacobian matrix. Taking a basis along the directions with the greatest influence on the output yields a set of subspaces that are sensitively related to that output.

    Strengths: This class of methods focuses on influence, not just presence. It can filter out the intermediate directions that actually affect the result, and can be combined with logit lens to observe at which layer these directions are constructed.

    Limitations: The computation is expensive, and results depend on the chosen output target and perturbation range. Linear approximations may be inaccurate in strongly nonlinear regions, so conclusions must be verified through intervention experiments.

    Pseudocode:

    1. # Approximate the output-sensitive directions of a layer's representation
    2. J = jacobian(target_logit, hidden_layer) # shape: [d_out, d_hidden]
    3. U, S, Vt = svd(J)
    4. top_directions = Vt[:k] # the k directions with the greatest influence on the output
    5. # Intervene along these directions and observe whether the output changes accordingly

    4. Comparing the Three Methods

    Dimension Logit Lens Sparse Autoencoder Jacobian Sensitivity Analysis
    Observation target Tokens favored at each layer Interpretable features in activations Internal directions that influence the output
    Ability to distinguish causal roles Weak Weak Strong
    Granularity Token level Feature level Subspace level
    Computational cost Low Medium (requires training) High
    Main risks Only sees the next token Mixed features, many byproducts Linear approximation bias, sensitive to experimental setup

    Each method has its own focus. In practice, they are often combined: use sensitivity analysis to narrow the scope, use sparse features to name candidate directions, and use logit lens to confirm at which layer a direction takes effect.

    5. Limitations and Caveats

    First, observation is not explanation. Finding an internal representation does not mean you can fully account for why the model gave a particular answer.

    Second, conclusions require intervention-based validation. Modifying the activation along a direction and observing how the output changes is what supports a causal claim. Looking only at correlation makes it easy to mistake coincidence for mechanism.

    Third, conclusions do not transfer directly. Results vary considerably across models, scales, and layers; switching models requires re-validation.

    Fourth, reporting must distinguish verified conclusions from speculation. Presenting correlation as causation will mislead downstream engineering decisions.

    6. Practical Recommendations for Engineering Teams

    1. Define the goal. For error diagnosis, prefer logit lens and layer-wise ablation; for building a feature library, choose sparse autoencoders; when causal evidence is needed, introduce sensitivity analysis.
    2. Establish baselines. Record the outputs and internal states of normal samples on the same set of tasks, so anomalous samples have something to be compared against.
    3. Run intervention experiments. Perturb candidate directions, check whether the output changes as expected, and record the relationship between perturbation strength and output change.
    4. Keep records. Archive observation data together with the model version, dataset, and prompt templates to enable reproduction and auditing.
    5. Control costs. Recording activations for all layers at full scale is expensive; sample only key layers and key tasks.

    These steps do not require a dedicated new system. Internal state sampling and metric comparison can be folded into existing logging services, monitoring and alerting, and model evaluation pipelines. Teams should start with small-scale tasks and expand the scope only after the methods prove stable.

    7. Conclusion

    A large model’s output is only part of its reasoning process. Logit lens, sparse feature decomposition, and sensitivity analysis each observe internal states from a different angle, and each has a clear blind spot. Only by combining the three and validating findings with intervention experiments can we reliably judge which concepts are actually at work inside the model. For teams that make decisions based on model outputs, this kind of observational capability is shifting from a research tool into an everyday quality assurance practice.