Decoding Layer by Layer: Uncovering Hierarchical Reasoning in Language Models

Luo Ji, Yihong Wang, Ningyuan Xi, Yue Zhao, Qingqing Gu, Xiyuan Chen, Hao Wu, Sheng Xu, Hange Zhou, Hongyan LiOpenReview 2026 · Submission to ICLR 2026 · Rejected

TL;DR

Researchers have developed HdLM (Hierarchical decoding Language model), a new architecture that allows Large Language Models to "think" and "speak" at intermediate layers rather than just the final one. By delegating strategic planning or classification to earlier layers, the model achieves state-of-the-art performance on reasoning tasks while significantly reducing computational overhead.

What Problem Does This Paper Address?

Modern Large Language Models (LLMs) like GPT-4 and Llama are "flat" decoders. Whether they are predicting a simple "Yes" or a complex mathematical proof, every single token must pass through every single layer of the model (often 32, 80, or more).

While techniques like Chain-of-Thought (CoT) help models reason by writing out their steps, this "thinking" still happens at the very last layer, leading to massive computational waste. Furthermore, human reasoning is naturally hierarchical: we decide on a high-level strategy (e.g., "I will be empathetic") before choosing specific words. Standard LLMs struggle to explicitly model this "slow thinking" vs. "fast thinking" dynamic within their internal architecture.

Methods

The authors propose HdLM, which adapts pretrained decoder-only models into hierarchical reasoners.

  1. Head Replication: They take the language head (the part that turns internal vectors into words) from the final layer and copy it onto selected intermediate layers.
  2. Post-hoc Adaptation: Instead of training from scratch, they fine-tune these intermediate "heads" to perform specific sub-tasks. For example, layer 25 might be trained to identify a user's emotion, while layer 32 generates the actual response.
  3. Latent Flow: During inference, the latent vectors from the intermediate layers are passed forward to the next stage. This ensures that the "strategic" decision made at an early layer directly informs the "tactical" word choices at the final layer.
  4. Multi-Pass Inference: The model generates a sequence of responses (labels, rationales, then final text) where each step is grounded by the "thoughts" generated in the layers below.

Datasets

The researchers evaluated HdLM across three main paradigms:

  • Hierarchical Text Classification (HTC): Using WoS (Web of Science) and DBpedia to classify text into increasingly specific categories.
  • Classification-guided Generation (CgG): Using ESConv and EmpatheticDialogues to classify emotional states and strategies before generating a response.
  • Hierarchical Text Generation (HTG): Using reasoning benchmarks like AQuA (math), CommonSenseQA, and cognitive tests like ToMI, BigToM, and Vignette-based problems to test "Theory of Mind" and logical planning.

Key Insights and Ideas

  • Intermediate Layers are "Chatty": One of the most surprising findings is that intermediate layers (like layer 24 of a 32-layer model) already contain enough semantic information to generate highly coherent text if given the right "output nozzle" (language head).
  • The "Refinement Region": The authors identified that the best layers for intermediate decoding usually fall between layers 25 and 28. Decoding too early doesn't give the model enough time to "understand" the input; decoding too late provides no computational benefit.
  • Efficiency through Depth: Because intermediate rationales don't have to travel through the full stack of layers, HdLM provides a linear reduction in training and inference FLOPs (floating-point operations). You essentially get "Chain-of-Thought" reasoning at a discount.
  • Strategic Alignment: By forcing the model to commit to a strategy at an earlier layer, the final output is more likely to remain consistent with that strategy, reducing "hallucinations" in reasoning.

Key Results

  • Performance: HdLM achieved state-of-the-art results on hierarchical classification (WoS and DBpedia).
  • Cognitive Superiority: On "Theory of Mind" benchmarks (ToMI and BigToM), HdLM (based on Llama-3-8B) significantly outperformed much larger models like GPT-4, scoring 98.2% and 99.4% respectively.
  • Speed & Savings: The theoretical analysis and empirical tests confirmed that HdLM reduces computation. For a rationale of 512 tokens, the model saw a 26.25% reduction in training FLOPs compared to standard flat decoding.
  • Scalability: The method proved effective across different model sizes, from 1B to 70B parameters.

Limitations and Future Work

  • Manual Layer Selection: Currently, the researchers manually select which intermediate layers ($k$) to use for decoding. They acknowledge that an automatic, self-adaptive selection method would be a significant improvement.
  • Pretraining from Scratch: This study focused on adapting existing models. The authors speculate that building a hierarchical model from the very first day of pretraining could unlock even more advanced reasoning capabilities.
  • Task Complexity: The current work mostly explores hierarchies of depth 2 or 3. Future work could look into deeper, more complex "trees of thought" decoded across many different layers.

Summary updated

BibTeX
@misc{ji2026decoding,
  author = {Luo Ji and Yihong Wang and Ningyuan Xi and Yue Zhao and Qingqing Gu and Xiyuan Chen and Hao Wu and Sheng Xu and Hange Zhou and Hongyan Li},
  title = {{Decoding Layer by Layer: Uncovering Hierarchical Reasoning in Language Models}},
  year = {2026},
  url = {https://openreview.net/forum?id=tAJiFOx8YF},
  howpublished = {OpenReview},
  note = {Submitted to ICLR 2026},
}
Figure