arXiv:2610.33441cs.CLOct 2026

Manuscript Offprint

arXiv:2610.33441

Quantifying Meaning with SCAPE-T: Semantic Complexity from Encoder-Only Transformer Attention

Maxim Khovansky, Lev Mukhanov

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Maxim Khovansky

EECS

Queen Mary University of London

London, United Kingdom

Lev Mukhanov

EECS

Queen Mary University of London

London, United Kingdom

Abstract—Automated semantic complexity estimation remains underexplored in NLP, despite important applications in linguistics and interpretability. This paper defines semantic complexity as the code length required to uniquely specify a text's semantic meaning, and operationalises it via SCAPE-T, an attention-derived metric based on encoder-only transformers. Existing measures either model reader effort (readability, lexical difficulty), which correlates with surface features (word length, syntax), or quantify surface features directly (type-token ratio, word frequency). SCAPE-T targets semantic integration directly by combining three submetrics – (i) inverse-weighted self-focus (token→self), (ii) CLS focus (token→[CLS]), (iii) inter-head redundancy (cosine similarity across heads) – using layer-weighted aggregation; data-driven learning is confined to hyperparameter tuning for calibration. Development uses philosophical prose vs MCTest stories; evaluation is on children's stories vs technical Wikipedia articles, with pairwise accuracy on contrasts as the primary criterion. Baselines include readability, syntactic/lexical, and LLM-derived measures. SCAPE-T substantially outperforms all tested baselines under word-length control, with a pairwise accuracy of 78.5% (95% bootstrap CI: 76.1–80.4, N=10k pairwise comparisons; +12.7pp over strongest baseline); without that control, readability heuristics overtake, consistent with their reliance on surface features. On a short-terms abstractness dataset, SCAPE-T also leads. Ablations show each submetric contributes materially. Overall, the results show SCAPE-T isolates conceptual structure from lexical/syntactic confounds better than existing methods, and generalises across two held-out domains. The implementation is released as a Python package, installable via pip install git+https://github.com/MaxKho/SCAPE.git, with resources available at https://github.com/MaxKho/SCAPE.

Index Terms—semantic complexity, complexity estimation, encoder attention, attention analysis, pairwise accuracy, readability, text simplification, transformers

I. INTRODUCTION

Automated semantic complexity scoring has clear utility across NLP, linguistics, and other domains, yet research into it remains scarce. A reliable measure could support: (i) empirical tests of the long-standing equi-complexity hypothesis in linguistic typology [1], [2]; (ii) curriculum design and automated sequencing of instructional materials (from simpler to harder content) in education and assessment; and (iii) dataset construction, domain adaptation, and summarisation control, where complexity-aware sampling or targets are desirable. When operationalised via model-internal processing signals (as in this paper), analysing the metric's systematic limitations could also aid interpretability and model diagnostics – for example, by flagging inputs that elicit a disproportionate semantic processing load, thereby localising where representation learning struggles with semantic integration.

Most work on language complexity focuses on readability or lexical sophistication, leaving semantic complexity under-defined. Even works aimed primarily at semantic complexity often adopt extensional characterisations such as abstractness, or informal notions such as “meaning density” [3]; such definitions are sufficient for ground-truth labelling, but are not rigorous enough to derive metrics from first principles. Consequently, this paper proposes the following definition:

Definition. The semantic complexity of a text is the minimum per-token code length required to uniquely specify the text's semantic content relative to a fixed situation model 1^{1}[4] and empirical world state 1^{1}.

As such, it can be conceptualised as the Kolmogorov complexity of semantic content normalised by token length and conditional on a fixed empirical world state and situation model. The definition is expected to be approximately model-invariant: admissible situation models that preserve semantic granularity should induce the same ranking up to a monotone transform 2^{2}. On this view, complexity increases as a text introduces, binds, or interrelates more propositions. Conversely, discrepancies in measured semantic complexity when different situation models are used can indicate that the used situation models are flawed (see the discussion of semantic integration blindspots in §VI). Despite its utility, the literature offers few operationalisations that target this notion directly.

1^{1}“Empirical world state” here denotes a set of extra-linguistic facts sufficient to ground empirical lexical denotations (e.g. rock, river); it is ontic and agent-independent. “Situation model” denotes a specific semantic representation of said empirical world state.

Corresponding author: maxkho00@gmail.com. This work was completed as part of the first author's final-year MSc project.

2^{2}This assumption is to be tested in future work by applying SCAPE and SCAPE-T across different encoders (see §VIII).

Existing measures tend to quantify reader effort or predictability rather than semantic content. Readability formulae and human-anchored lexical difficulty measures, such as Flesch–Kincaid, age-of-acquisition norms, frequency-based proxies, and ML models trained on human difficulty ratings, correlate strongly with surface features such as word length, frequency, and syntactic configuration [5], [6], [7], [8], [9], confounding the semantic complexity signal this paper aims to isolate. Traditional semantic frameworks that depend on human domain labelling or handcrafted inventories do not scale to large cross-domain or cross-lingual corpora and are sensitive to the biases of the annotators and the chosen domain definitions [10]. Alternative approaches include language-model perplexity and Minimum Description Length (MDL)-based approaches. Language-model perplexity measures the per-token cross-entropy under a language model trained on some corpus; while this approach avoids substantial dependence on surface features, it largely measures deviation from the model's training distribution (e.g., domain shift, rare lexico-syntactic patterns) rather than conceptual load. Minimum Description Length (MDL)-based approaches minimise the code length of the observed string under a model, so they compress on text symbols rather than on semantic meaning; their scores therefore still track surface features like word length/frequency and syntax more than semantic integration [11]. Defining an MDL over meanings would require an explicit semantic representation and supervision, reintroducing human bias and limiting scalability. In short, prior work leaves us with strong tools for lexical and syntactic difficulty, but no generally adopted metric that directly targets semantic integration.

This paper addresses this gap with SCAPE-T: Semantic Complexity from Attention Patterns in Encoders (SCAPE), explored here in its encoder-only Transformer variant (T), which derives three complementary attention-derived submetrics directly from the specified definition (see §III for further details): (i) inverse-weighted self-focus (proportion of total attention from each token to itself) as a proxy for token interdependence; (ii) CLS focus (proportion of total attention directed at the CLS token) as a proxy for emergent sentence-level meaning; and (iii) interhead redundancy, which penalises duplicated attention patterns via cross-head similarity. These submetrics are integrated via layer-weighted aggregation, which emphasises middle-to-late layers using a linear combination of uniform and Gaussian layer weights. For calibration and scaling, a set of hyperparameters – namely the submetric exponents, a reciprocal-penalty scale, a head-similarity threshold for redundancy, and the layer-weighting parameters – are tuned on token-length-matched development contrasts; no additional task supervision or model-weight training is performed to limit overfitting. In this paper, SCAPE-T is instantiated with BERT, but the approach is model-agnostic among encoders that expose attention and a sequence-level aggregator (e.g., modern BERT-family encoders and encoder-decoder models that retain a [CLS]-like token on the encoder side). In such cases, hyperparameters would likely require re-tuning.

Because semantic complexity ground truth is largely unavailable due to the ambiguity in existing definitions and absence of reliable metrics, proxies have to be relied on for evaluation. To minimise subjective bias, the proxies are chosen based on popular consensus: it is widely understood that dense philosophical prose is generally more semantically complex than simple descriptive statements, and that technical analysis of abstract concepts is generally more semantically complex than children's stories aimed at very young readers [12]. Accordingly, the development contrast pairs sentences scraped from Hegel and Kant with sentences from MCTest stories, and the test contrast pairs sentences from Wikipedia articles on technical topics with sentences from children's stories for very young readers via Project Gutenberg; the domain and genre shift from philosophical prose to encyclopaedic content, and from MCTest to children's stories, is introduced to test generalisation. Since the ground truth consists of binary contrasts, pairwise accuracy is chosen as the primary evaluation metric: given one simple and one complex sentence, the metric should assign the higher score to the complex one. Additionally, a short-terms abstractness set is generated with OpenAI o3 under physical-embodiment criteria: while still only a proxy, abstractness helps distinguish semantic complexity from lexical/syntactic complexity and probes generalisation in a style- and domain-neutral setting (one-two-word terms, no punctuation, no style or domain cues). Baselines include DHH lexicon complexity [13]; MDL bits per byte compressor; GPT-2 perplexity; Flesch-Kincaid; Zipf frequency; BERT token length; type-token ratio; and mean dependency-tree depth. All metrics are computed on both the raw splits and a word-length-controlled variant obtained by sampling so that the word-length distributions of the two sets closely match, as well as on the abstractness dataset. Under length control, SCAPE-T substantially outperforms all baselines on held-out domains (+12.7pp over the strongest baseline); without control, readability heuristics overtake, consistent with their dependence on surface features like word length. SCAPE-T also leads on the abstractness set, providing further evidence of generalisability.

Contributions. This paper (1) formalises semantic complexity as the per-token description length relative to a fixed situation model and empirical world state; (2) introduces SCAPE-T, one of the first automated metrics to directly target semantic (rather than lexical/syntactic/predictive) complexity; (3) proposes a novel operationalisation of language complexity based on internal processing (encoder attention structure) rather than data-driven classification or regression; (4) establishes an evaluation protocol that isolates semantics from lexical confounds via word-length control and pairwise accuracy on widely accepted proxy contrasts (Hegel/Kant vs. MCTest; technical Wikipedia vs. children's stories), complemented by a style- and domain-neutral abstractness set; and (5) demonstrates that, under length control, SCAPE-T substantially outperforms strong readability, lexical, syntactic, LLM, and compressor baselines on held-out domains (+12.7pp over the strongest baseline), also leading on the abstractness set, with ablations confirming that each attention-derived submetric contributes.

References (54)