Modeling Question Asking Using Neural Program Generation

Ziyun Wang, Brenden M. LakeeScholarship 2019

Abstract

Current AI systems struggle to ask rich, informative, and creative questions. This paper introduces a neuro-symbolic framework that models human question-asking by generating formal, executable programs instead of natural language text. Using an encoder-decoder architecture and reinforcement learning, the model can accurately predict what humans will ask and creatively generate highly informative, novel questions from scratch without needing human training data.

Introduction

Asking good questions is a core part of how humans learn about the world, but it remains a massive challenge for AI. The space of possible questions is infinite, and evaluating which question is "best" in a partially observable environment is computationally heavy.

Previous machine learning approaches have either relied on rigid heuristic rules, retrieved past questions from memory, or used purely data-driven text generation that struggles with hidden states and lacks creativity. Conversely, cognitive science approaches have modeled question-asking using symbolic programs, but these require expensive, slow searches to find the right question. This paper bridges the gap by combining the compositional power and precision of symbolic programs with the speed and flexibility of deep neural networks.

Methodology

The authors propose a "neural program generation" framework tested on a modified game of "Battleship," where a player must ask questions to deduce the hidden locations, sizes, and orientations of three ships on a 6x6 grid.

Instead of outputting English text, the model generates questions in a Domain Specific Language (DSL)—LISP-like programs that can be directly executed on the game state (e.g., (size Red) instead of "How long is the red ship?").

Network Architecture

The architecture consists of a Convolutional Neural Network (CNN) encoder and a Transformer-based decoder. The CNN encodes the partially revealed game board using multi-scale filters (5x5, 3x3, and 1x1). The decoder then generates the program sequence. For reinforcement learning, the model builds programs by selecting production rules from a context-free grammar.

The neural program generation architecture (a) and the symbolic derivation process (b).

Training Procedures

  1. Supervised Learning: To overcome the lack of large human datasets, the model is pre-trained on synthetic questions sampled based on their Expected Information Gain (EIG)—a mathematical measure of uncertainty reduction. It is then fine-tuned on a small dataset of real human questions.
  2. Reinforcement Learning: To generate questions from scratch, the model is trained using the REINFORCE algorithm. Rewards are based purely on the EIG of the generated question, with a step penalty to encourage conciseness.

Datasets

  • Rothe et al. (2017) Dataset: A dataset of ~600 human-generated questions across 18 board configurations, used for fine-tuning and evaluation.
  • Synthetic Pre-training Data: 2,000 automatically generated game boards, each paired with 10 questions sampled proportionally to their EIG.

Key Results and Discussion

Predicting Human Questions

The full pre-trained and fine-tuned model achieved a significantly better log-likelihood (-150.38) on held-out human questions compared to prior symbolic-only methods (-1400.06). The CNN encoder proved crucial for low-entropy (mostly revealed) boards where specific context is needed to ask a good question.

Generating Novel and Controllable Questions

The grammar-enhanced RL model successfully generated high-quality questions, with 94.90% achieving an EIG > 0.95. Notably, the RL model generated 96 completely novel questions not present in the human dataset. Furthermore, by conditioning the decoder's starting state on specific grammar non-terminals, the authors could force the model to generate specific types of questions (e.g., boolean, number, or location) on demand.

Examples of generated questions across different types, showing their program representations and Expected Information Gain (EIG).

Creativity and Strategy

Even when trained purely via RL with an EIG-based reward (and zero human examples), the model naturally converged on question-asking strategies remarkably similar to humans, such as prioritizing questions about ship sizes over locations. This suggests that human question-asking is deeply tied to information-seeking efficiency.

Conclusion

Representing questions as executable programs provides a compositional "language of thought." This approach allows AI to synthesize new ideas from familiar building blocks and formally evaluate their quality without the ambiguity of natural language. Future work will explore training models jointly to both ask and answer questions to develop a richer understanding of question semantics.

Summary updated

BibTeX
@misc{wang2019modeling,
  author = {Ziyun Wang and Brenden M. Lake},
  title = {{Modeling Question Asking Using Neural Program Generation}},
  year = {2019},
  eprint = {1907.09899},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1907.09899},
}
Figure