paper-with-me

Papers

AST-Probe: Recovering abstract syntax trees from hidden representations of pre-trained language models

2022-06-23 · José Antonio Hernández López, Martin Weyssow, Jesús Sánchez Cuadrado, Houari Sahraoui

The objective of pre-trained language models is to learn contextual representations of textual data. Pre-trained language models have become mainstream in natural language processing and code modeling. Using probes, a technique to study the linguistic properties of hidden vector spaces, previous works have shown that these pre-trained language models encode simple linguistic properties in their hidden representations. However, none of the previous work assessed whether these models encode the whole grammatical structure of a programming language. In this paper, we prove the existence of a syntactic subspace, lying in the hidden representations of pre-trained language models, which contain the syntactic information of the programming language. We show that this subspace can be extracted from the models' representations and define a novel probing method, the AST-Probe, that enables recovering the whole abstract syntax tree (AST) of an input code snippet. In our experimentations, we show that this syntactic subspace exists in five state-of-the-art pre-trained language models. In addition, we highlight that the middle layers of the models are the ones that encode most of the AST information. Finally, we estimate the optimal size of this syntactic subspace and show that its dimension is substantially lower than those of the models' representation spaces. This suggests that pre-trained language models use a small part of their representation spaces to encode syntactic information of the programming languages.

📄 PDF Abstract BibTeX arXiv:2206.11719

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

A Structural Probe for Finding Syntax in Word Representations

2019-06-01 · NAACL 2019 6 · John Hewitt, Christopher D. Manning

Recent work has improved our ability to detect linguistic knowledge in word representations. However, current methods for detecting syntactic knowledge do not test whether syntax trees are represented in their entirety. …

PSIMiner: A Tool for Mining Rich Abstract Syntax Trees from Code

2021-03-23 · Egor Spirin, Egor Bogomolov, Vladimir Kovalenko, Timofey Bryksin

The application of machine learning algorithms to source code has grown in the past years. Since these algorithms are quite sensitive to input data, it is not surprising that researchers experiment with input representat…

Method name prediction

Using LLVM-based JIT Compilation in Genetic Programming

2017-01-20 · Michal Gregor, Juraj Spalek

The paper describes an approach to implementing genetic programming, which uses the LLVM library to just-in-time compile/interpret the evolved abstract syntax trees. The solution is described in some detail, including a …

StruAP: A Tool for Bundling Linguistic Trees through Structure-based Abstract Pattern

2017-09-01 · EMNLP 2017 9 · Kohsuke Yanai, Misa Sato, Toshihiko Yanase, Kenzo Kurotsuchi 외

We present a tool for developing tree structure patterns that makes it easy to define the relations among textual phrases and create a search index for these newly defined relations. By using the proposed tool, users dev…

Decision MakingInformation RetrievalRelation Extraction

Abstract Syntax Networks for Code Generation and Semantic Parsing

2017-04-25 · ACL 2017 7 · Maxim Rabinovich, Mitchell Stern, Dan Klein

Tasks like code generation and semantic parsing require mapping unstructured (or partially structured) inputs to well-formed, executable outputs. We introduce abstract syntax networks, a modeling framework for these prob…

Code GenerationDecoderSemantic Parsing