CORTEXA
← Browse
arxivcs.CLcs.AIcs.PL2026-07-09

TypeProbe: Recovering Type Representations from Hidden States of Pre-trained Code Models

Giuliano Gorgone, Fausto Carcassi

State-of-the-art code models achieve impressive performance, yet the extent to which they internally encode type information remains poorly understood. We probe the residual streams of pretrained code models for internal type representations using a parallel dataset of Java and Python code examples. Our results show that cross-lingual type representations emerge even from untyped code. Moreover, we test whether hidden states linearly encode the result type implied by typed function application by training probes on one language to infer argument and result types in the other. Finally, we find that this structure is partly robust to lexical perturbations and cross-language syntactic variations. To the best of our knowledge, prior work on interpretability of code models has not directly targeted formal type semantics or cross-lingual type representations. We release our code and datasets.

View free PDFSource page

Related papers

arxivcs.AIcs.CLcs.LGcs.PL2026-07-14

Theory-Level Autoformalization: From Isolated Statements to Unified Formal Knowledge Bases

Marcus J. Min, Mike He, Zhaoyu Li, Zixuan Yi, Sharad Malik, Aarti Gupta, et al.

Autoformalization translates informal natural language into formal, machine-verifiable languages. While most work focuses on individual statements, real formalization efforts are inherently theory-level: they require an entire web of axioms, definitions, and lemmas before target…

View free PDFSource page
arxivcs.CLcs.AIcs.LG2026-07-16

In-Place Tokenizer Expansion for Pre-trained LLMs

Jimmy T. H. Smith, Tarek Dakhran, Alberto Cabrera, Simon S. Lee, Paul Pak, Aditya Tadimeti, et al.

A tokenizer fixed at the start of pre-training allocates vocabulary in proportion to the pre-training corpus, reflecting the deployment priorities at that time. When those priorities shift, languages added later are split into many more tokens per word, which can raise latency, c…

View free PDFSource page
arxivcs.CLcs.AI2026-07-08

Riemannian Geometry for Pre-trained Language Model Embeddings

Szczepan Konior, Alexandre Quemy, Przemysław Klocek, Bartłomiej Sobieski, Grégoire Cattan

Understanding the geometric structure of pre-trained language model embeddings matters for interpretability and safety. We ask whether sentence-level classification signal lives in the Riemannian geometry of contextual token embeddings, and probe it by extracting per-token pullba…

View free PDFSource page
arxivcs.CLcs.AI2026-07-01

Recovering Input Text from Hidden States: Study of Gradient-Based Inversion of Decoder-Only Language Models

Mikołaj Słowikowski, Maciej Witold Majewski

This work studies the hidden-state inversion problem: recovering the original input token sequence of a decoder-only language model from its last-layer hidden states. Rather than treating inversion as a one-shot reconstruction, we study it as a continuous embedding-space optimisa…

View free PDFSource page