H-Probes: Extracting Hierarchical Structures From Latent Representations of Language Models
Organizations: Supervised Program for Alignment Research · Yale University · Harvard University
Abstract
Representing and navigating hierarchy is a fundamental primitive of reasoning. Large language models have demonstrated proficiency in a wide variety of tasks requiring hierarchical reasoning, but there exists limited analysis on how the models geometrically represent the necessary latent constructions for such thinking. To this end, we develop H-probes, a collection of linear probes that extract hierarchical structure, specifically depth and pairwise distance, from latent representations. In synthetic tree traversal tasks, the H-probes robustly find the subspaces containing hierarchical structure necessary to complete the tasks; furthermore, in comprehensive ablation experiments, we show that these hierarchy-containing subspaces are low-dimensional, causally important for high task performance, and generalize within- and out-of-domain. Furthermore, we find analogous, though weaker, hierarchical structure in real-world hierarchical contexts such as mathematical reasoning traces. These results demonstrate that models represent hierarchy not only at the level of syntax and concepts, but at deeper levels of abstraction -- including the reasoning process itself.
Figures & tables
Appendix figures & tables21 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | best MSE | best MSE | best MSE | best MSE |
|---|---|---|---|---|
| DeepSeek-R1-Distill-Qwen-1.5B | 1.2986 | 1.2435 | 1.2447 | 1.2303 |
| DeepSeek-R1-Distill-Qwen-7B | 0.5689 | 0.5858 | 0.5856 | 0.5846 |
| DeepSeek-R1-Distill-Qwen-14B | 0.4081 | 0.4024 | 0.4017 | 0.4022 |
| Qwen1.5-1.8B-Chat | 1.3691 | 1.3186 | 1.3028 | 1.3036 |
| Qwen1.5-7B-Chat | 1.4391 | 1.3662 | 1.3446 | 1.3371 |
| Qwen1.5-14B-Chat | 1.3504 | 1.2782 | 1.2557 | 1.2514 |
| Model | Exact Acc. | Partial Acc. |
|---|---|---|
| DeepSeek-R1-Distill-Qwen-1.5B | 0.227 | 0.360 |
| DeepSeek-R1-Distill-Qwen-7B | 0.705 | 0.790 |
| DeepSeek-R1-Distill-Qwen-14B | 0.885 | 0.901 |
| Qwen1.5-1.8B-Chat | 0.025 | 0.251 |
| Qwen1.5-7B-Chat | 0.071 | 0.347 |
| Qwen1.5-14B-Chat | 0.179 | 0.420 |
| Model | Depth MSE (test, best layer) | Pearson (test, best layer) |
|---|---|---|
| DeepSeek-R1-Distill-Qwen-1.5B | 0.5194 | 0.3949 |
| DeepSeek-R1-Distill-Qwen-7B | 0.4493 | 0.4158 |
| DeepSeek-R1-Distill-Qwen-14B | 0.4796 | 0.3656 |
| Qwen1.5-1.8B-Chat | 0.6312 | 0.2054 |
| Qwen1.5-7B-Chat | 0.6101 | 0.3038 |
| Qwen1.5-14B-Chat | 0.5538 | 0.3380 |
| Category | Accuracy | |
|---|---|---|
| Fundamental binary | 39.29% | 84 |
| Fundamental multiple | 65.41% | 159 |
| JSON | 42.86% | 28 |
| Code | 52.38% | 21 |
| Formula | 43.47% | 681 |
| Paper | 26.55% | 27 |
| Baseline | Probe | Random | Zero | |
| Overall (leaf + common_ancestor, ) | ||||
| Accuracy | 21.21% | 20.00% | 21.21% | 0.00% |
| common_ancestor only ( ) | ||||
| Accuracy | 40.24% | 40.24% | 42.68% | 0.00% |
| Exact retention | — | 51.52% | 72.73% | 0.00% |
| Inexact rescue | — | 32.65% | 22.45% | 0.00% |
Representation Geometry in Language Models
Representation geometry in language models studies how embeddings and hidden states organize concepts, computation, and behavior.
See all 417 papers