paper-with-me

홈 › Papers

Emergent Representations of Program Semantics in Language Models Trained on Programs

2023-05-18 · Charles Jin, Martin Rinard

We present evidence that language models (LMs) of code can learn to represent the formal semantics of programs, despite being trained only to perform next-token prediction. Specifically, we train a Transformer model on a synthetic corpus of programs written in a domain-specific language for navigating 2D grid world environments. Each program in the corpus is preceded by a (partial) specification in the form of several input-output grid world states. Despite providing no further inductive biases, we find that a probing classifier is able to extract increasingly accurate representations of the unobserved, intermediate grid world states from the LM hidden states over the course of training, suggesting the LM acquires an emergent ability to interpret programs in the formal sense. We also develop a novel interventional baseline that enables us to disambiguate what is represented by the LM as opposed to learned by the probe. We anticipate that this technique may be generally applicable to a broad range of semantic probing experiments. In summary, this paper does not propose any new techniques for training LMs of code, but develops an experimental framework for and provides insights into the acquisition and representation of formal semantics in statistical models of code. Our code is available at https://github.com/charlesjin/emergent-semantics.

📄 PDF Abstract BibTeX arXiv:2305.11169

Code (1)

charlesjin/emergent-semantics 공식 구현 pytorch

Tasks

Inductive BiasLanguage ModellingProgram Synthesis

Methods 이 논문이 사용한 방법론

Multi-Head Attention 설명 없음
Attention 설명 없음
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Position-Wise Feed-Forward Layer 설명 없음
Dense Connections Dense Connections, or Fully Connected Connections, are a type of layer in a deep neural network that use a linear operation where every input is connected to every output…
Adam 설명 없음
Residual Connection 설명 없음
Absolute Position Encodings Absolute Position Encodings are a type of position embeddings for [Transformer-based models] where positional encodings are…

Similar Papers 제목 키워드 기반

EC^2: Emergent Communication for Embodied Control

2023-04-19 · Yao Mu, Shunyu Yao, Mingyu Ding, Ping Luo 외

Embodied control requires agents to leverage multi-modal pre-training to quickly learn how to act in new environments, where video demonstrations contain visual and motion details needed for low-level perception and cont…

Contrastive LearningLanguage Modelling

EC2: Emergent Communication for Embodied Control

2023-01-01 · CVPR 2023 1 · Yao Mu, Shunyu Yao, Mingyu Ding, Ping Luo 외

Embodied control requires agents to leverage multi-modal pre-training to quickly learn how to act in new environments, where video demonstrations contain visual and motion details needed for low-level perception and …

Contrastive LearningLanguage Modelling

Avoiding hashing and encouraging visual semantics in referential emergent language games

2019-11-13 · Daniela Mihai, Jonathon Hare

There has been an increasing interest in the area of emergent communication between agents which learn to play referential signalling games with realistic images. In this work, we consider the signalling game setting of …

How agents see things: On visual representations in an emergent language game

2018-08-31 · EMNLP 2018 10 · Diane Bouchacourt, Marco Baroni

There is growing interest in the language developed by agents interacting in emergent-communication settings. Earlier studies have focused on the agents' symbol usage, rather than on their representation of visual input.…

Representing Partial Programs with Blended Abstract Semantics

2020-12-23 · ICLR 2021 1 · Maxwell Nye, Yewen Pu, Matthew Bowers, Jacob Andreas 외

Synthesizing programs from examples requires searching over a vast, combinatorial space of possible programs. In this search process, a key challenge is representing the behavior of a partially written program before it …

Program Synthesis