Sari la conținut

Română · beta. Traducerea a fost făcută automat și este încă în curs de revizuire. Citește pagina în engleză

perspectiva aiqbenchCercetare AI

analiza aiqbench

This study investigates how pre-trained code models internally encode formal type semantics by probing their hidden states across Java and Python, revealing emergent cross-lingual representations even in untyped contexts. The findings demonstrate that these internal structures are partially robust to lexical changes and syntactic variations, offering new insights into the interpretability of large language models for programming tasks.
Sursă care acoperăarXiv
Ce este aceastaLectura unui model asupra articolului și a acoperirii conexe, scrisă pentru aiqbench. Nu sunt cuvintele publicației.

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

arXiv2 min de cititArticolul și perspectiva sunt în engleză.

arXiv:2607.08339v2 Announce Type: replace Abstract: 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.

Abstract: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.

18 pages, 12 figures. Accepted at ESSLLI 2026 (StuS; double-blind)

Computation and Language (cs.CL); Artificial Intelligence (cs.AI); Programming Languages (cs.PL)

arXiv:2607.08339 [cs.CL]

(or arXiv:2607.08339v2 [cs.CL] for this version)

https://doi.org/10.48550/arXiv.2607.08339 Focus to learn more arXiv-issued DOI via DataCite

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Text integral sub licența deschisă a publicației · 240 cuvinte

Subiecte conexe