LLM Internal Representations: Observing Intermediate Concepts That Never Reach the Output

    An LLM makes its decisions in an internal representation space, while the output channel exposes only the final result. Concepts that are genuinely activated but never emitted — such as the "spider" retrieved during a two-hop reasoning step — matter for early fault localization, input intent detection, and regression analysis. This article explains why hidden internal states are worth observing, compares three observation methods (layerwise linear readout, sparse feature decomposition, and sensitivity projection) along with their capability boundaries and cost, and describes a four-stage pipeline for turning a one-off analysis into a repeatable signal, plus deployment advice and the mistakes most likely to invalidate conclusions.

    The LLM’s Unspoken Reasoning: Observing Intermediate Concepts That Never Get Output

    Starting From a Question That Looks Simple

    Ask an LLM: “How many legs does an animal that spins webs have?” It answers “eight.” The answer is unremarkable from an engineering standpoint, but mechanically it is two-hop reasoning: first retrieve candidate species from “spins webs,” settle on spider; then read off the attribute “legs = 8” from “spider.”

    The key point is that the intermediate step “spider” never appears in any output. It is an internally activated representation — otherwise the second hop could not resolve a value at all. This matters for anyone building on LLMs: the model’s decisions happen in the internal representation space, and the output channel exposes only the last step of those decisions. A person can curse someone out internally while smiling; expression and internal state are separable. The same holds for a model.

    For teams building LLM applications, this is not merely academic curiosity. The invisible part of the computation is exactly where the earliest signs of failure appear: a concept retrieved incorrectly, an ambiguity left unresolved, an instruction bypassed while the surface-level answer still sounds fine.

    Why Measuring Internal States Is Worth the Cost

    Treating internal representations as an observable signal class pays off in three areas:

    • Early fault localization: factual errors usually go wrong at the “concept selection” step, not during generation. By the time you judge from the token output, inference budget has already been spent.
    • Input intent detection: adversarial and manipulative prompts often activate a semantic direction that is inconsistent with their surface text, which can feed an independent detection signal.
    • Regression localization and prompt tuning: after a model upgrade or a prompt change, drift in the distribution of intermediate representations while output metrics stay flat indicates silent degradation at the representation layer.

    Three Observation Methods and Their Boundaries

    Layerwise Linear Readout

    The idea is straightforward: apply the output layer’s decoding matrix directly to the hidden states of intermediate layers, and see “which tokens the model would favor if it had to emit output right here.”

    1. # Layerwise linear readout (illustrative)
    2. cache = model.forward_with_hidden_states(prompt)
    3. for layer_idx, h in cache.hidden.items():
    4. logits = output_head(h[-1]) # reuse the output projection
    5. top = top_k_tokens(logits, k=5)
    6. print(layer_idx, top)

    It is cheap to implement, adds almost no inference overhead, and fits autoregressive decoding naturally. The limitation: it can only answer “which tokens the current layer is ready to emit.” An intermediate concept like “spider,” which will only be used several steps later, may not appear among the top candidates at all — at this point the model’s output target is still explaining “spins webs,” not naming a species.

    Sparse Feature Decomposition

    Decomposing the activation vector of a layer into a large number of sparse, interpretable basis directions (sparse autoencoders belong to this family) yields semantic units far more numerous than the hidden dimension and much finer-grained, down to individual domain terms or single-language markers.

    The upside is the strongest interpretability: it answers “which features lit up.” The limitation is equally clear: it cannot distinguish which features are currently serving the reasoning from which are byproducts of corpus statistics or formatting residue. A frequently occurring feature may be a critical reasoning node, or merely the encoding trace of “this is an English technical Q&A.” Functional role must be established by external testing.

    Sensitivity Projection

    A third family of methods does not ask “what does this layer want to output,” but “how would the output change if this layer were modified.” Compute the sensitivity matrix of the output distribution with respect to the hidden state (the Jacobian), then take its leading singular subspace as the readout direction.

    The essential difference from the first two is that it captures concept directions that are causally effective but not yet candidates for output. “Spider” in the two-hop example is exactly this kind: it is not an output target now, but it is a prerequisite for resolving the value later.

    The cost is real, too: extra backpropagation or approximate estimation, significant compute and memory overhead, weaker stability on out-of-distribution inputs, and low-rank truncation that compresses noise while also discarding fine-grained information.

    Method Main question it answers Cost Captures concepts used only later? Main risk
    Layerwise linear readout What the current layer is ready to output Very low Largely no Missing intermediate concepts
    Sparse feature decomposition Which semantic units make up the activation Medium Partially Unknown functional role, high false positives
    Sensitivity projection How changing that direction changes the output High Yes Poor stability, loss of fine-grained detail

    The three are complementary rather than substitutive: sensitivity projection finds the problematic direction, sparse decomposition gives it a nameable explanation, and layerwise readout provides a cheap continuous monitoring baseline.

    From Observation to a Usable Signal: A Four-Stage Pipeline

    The real difficulty in practice is not the math; it is turning a one-off analysis into a repeatable engineering chain.

    1. Collection. Capture the hidden states of the specified layers through forward hooks or cache interfaces. The engineering priorities are to capture only the necessary layers (middle layers usually carry the most information) and to control the memory and throughput impact — sample by default, and capture in full only when a risk rule fires.

    2. Projection. Project the collected activations onto the target subspace, then normalize and calibrate against a baseline. A fixed reference distribution is mandatory; otherwise values are not comparable across batches.

    3. Validation. This is the step most often skipped, and the one that decides how credible a conclusion is. A high correlation only shows that things “change together.” Confirming a functional role requires causal intervention: replace the suspect activation with the activation from a clean sample and observe whether the output changes.

    1. # Minimal causal intervention check (illustrative)
    2. base = model.generate(x_adv, cache=keep_activations(x_adv))
    3. patched = copy_activations(base_cache)
    4. patched[layer]["direction"] = clean_activations[layer]["direction"] # activation replacement
    5. out_fixed = model.generate(x_adv, cache=patched)
    6. delta = semantic_similarity(base.text, out_fixed.text) # magnitude of behavioral change

    A clear behavioral change after intervention means the direction really does carry function; no change at all points more toward a statistical byproduct.

    4. Application. Threshold the validated signal and wire it into online alerting, offline sampling review, and evaluation dataset accumulation.

    Engineering Recommendations for Enterprise Deployment

    • Tiered sampling: sample normal traffic by ratio, and run full analysis on high-risk requests (long context, external content injection, permission-sensitive operations).
    • Decouple the data path: archive activations and metadata to object storage, write structured events to a logging service, and hand metrics and thresholds to monitoring and alerting. This kind of analysis suits containerized offline batch runs, fully separated from the online inference path so the two do not compete for resources. On the cloud, object storage, logging, container platforms, and monitoring are common capability categories — select based on your existing stack rather than a specific implementation.
    • Metric selection: do not look only at “detection accuracy.” Pay more attention to agreement between the signal and human labels, the magnitude of behavior change after intervention, the latency from anomaly to alert, and the false-positive rate — for internal observation methods the cost of a false positive is usually higher than that of a miss, because investigating them one by one is expensive.
    • Data compliance: internal activations are derivative data of user input and may indirectly contain sensitive information. Define masking rules, retention periods, and access auditing, and confirm retention boundaries with the business side before going live.

    Five Mistakes to Avoid

    1. Treating correlation as causation. Feature co-occurrence is the easiest thing to over-interpret; attribution conclusions without intervention experiments should not end up in design documents.
    2. Looking at a single point. Concepts form progressively across layers, so a single-layer snapshot is easy to misread; observe activation trajectories across layers.
    3. Reusing old thresholds. Any change in model version, context length, or decoding parameters causes representation drift, so baselines must be rebuilt with each version.
    4. Using it to replace evaluation. Internal observation is a diagnostic tool for explaining “why it’s wrong”; it cannot replace sufficiently broad end-to-end quality evaluation.
    5. Ignoring the cost curve. Sensitivity-based methods are expensive; enabling them indiscriminately across all traffic often leads to discovering unaffordable compute only at load-test time.

    Key Takeaways

    • The output channel exposes only conclusions; intermediate concepts must be observed in the internal representation space.
    • Each of the three methods has boundaries: layerwise readout is cheap but narrow, sparse decomposition explains well but leaves functional role unclear, and sensitivity projection catches key concepts that were never output but costs a lot.
    • Correlation must be validated by causal intervention, or the conclusions are not reliable.
    • Engineering hinges on tiered sampling, decoupling from online inference, and rebuilding baselines per version.
    • The goal is to add diagnostic capability for “why it’s wrong,” not to replace the existing evaluation system.