StructLens: A Structural Lens for Language Models via Maximum Spanning Trees

Haruki Sakajo, Frederikus Hudi, Yusuke Sakai, Hidetaka Kamigaito, Taro Watanabe
2/10/2026
1 citation
cs.CLcs.AI

Official code: naist-nlp/structlens (4 stars, TypeScript, last commit 2026-10-22).

Abstract

Language exhibits inherent structures, a property that explains both language acquisition and language change. Given this characteristic, we expect language models to manifest their own internal structures as well.

Show full abstract

While interpretability research has investigated how models compute representations mechanistically through attention patterns and Sparse AutoEncoders, the organization of the resulting representations is overlooked. To address this gap, we introduce StructLens, a framework to analyze representations through a holistic structural view. StructLens constructs maximum spanning trees based on the semantic representations in residual streams, inspired by tree representation in dependency parsing, and provides summaries of token relationships in representation space. We analyze how contiguous tokens are also nearby in representation space and find that middle layers show the strongest local-span organization. Moreover, analysis of pre-training checkpoints reveals that smaller local units become detectable earlier in pre-training, and larger units later. Our findings demonstrate that StructLens provides insights into how models organize token representations across layers and training. Our code is available at https://github.com/naist-nlp/structlens.

View on arXivView PDF

Code Implementations(1)

A structural lens for language models via maximum spanning tree (NeurIPS 2026)

40TypeScript, PythonJan 30, 20261 months ago

Similar Papers

Cite this paper

@article{sakajo2026structlens,
  title  = {StructLens: A Structural Lens for Language Models via Maximum Spanning Trees},
  author = {Haruki Sakajo and Frederikus Hudi and Yusuke Sakai and Hidetaka Kamigaito and Taro Watanabe},
  year   = {2026},
  eprint = {2603.03328},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2603.03328v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2603.03328.svg)](https://codeofpaper.com/paper/2603.03328)

Discussion