Reference. WatChat: Explaining perplexing programs by debugging mental models
Often, a good explanation for a program’s unexpected behavior is a bug in the programmer’s code. But sometimes, an even better explanation is a bug in the programmer’s mental model of the language or API they are using. Instead of merely debugging our current code (“giving the programmer a fish”), what if our tools could directly debug our mental models (“teaching the programmer to fish”)? In this paper, we apply recent ideas from computational cognitive science to offer a principled framework for doing exactly that. Given a “why?” question about a program, we automatically infer potential misconceptions about the language/API that might cause the user to be surprised by the program’s behavior – and then analyze those misconceptions to provide explanations of the program’s behavior. Our key idea is to formally represent misconceptions as counterfactual (erroneous) semantics for the language/API, which can be inferred and debugged using program synthesis techniques. We demonstrate our framework, WatChat, by building systems for explanation in two domains: JavaScript type coercion, and the Git version control system. We evaluate WatChatJS and WatChatGit by comparing their outputs to experimentally-collected human-written explanations in these two domains: we show that WatChat’s explanations exhibit key features of human-written explanation, unlike those of a state-of-the-art language model.
Cite
Cites 79 works (0 here)
External (79)
- Designing and Evaluating Explanations for a Predictive Health Dashboard: A User-Centred Case Study (2024)
- Identifying and Correcting Programming Language Behavior Misconceptions (2024)
- Cooperative Explanation as Rational Communication (2024)
- GPT-4 technical report (2024)
- HELM: A holistic framework for evaluating foundation models (2024)
- LMSys chatbot arena leaderboard (2024)
- A Grounded Conceptual Model for Ownership Types in Rust (2023)
- Evaluating language models for mathematics through interactions (2023)
- Inferring the Future by Imagining the Past (2023)
- Selective Explanations: Leveraging Human Input to Align Explainable AI (2023)
- ECMAScript 2024 language specification (2023)
- git branches: intuition & reality (2023)
- Do Developers Really Know How to Use Git Commands? A Large-scale Study Using Stack Overflow (2022)
- Left to the Reader: Abstracting Solutions in Mathematical Reasoning (2022)
- "That's (not) the output I expected!" On the role of end user expectations in creating explanations of AI systems (2021)
- A Behavioral Approach to Understanding the Git Experience (2021)
- JISET: JavaScript IR-based Semantics Extraction Toolchain (2020)
- Inference from explanation (2020)
- Violations of expectation trigger infants to search for explanations (2020)
- Expectations affect physical causation judgments (2019)
- To explain or not to explain: the effects of personal characteristics when explaining music recommendations (2019)
- Designing Explanation Interfaces for Transparency and Beyond (2019)
- It's Like Python But: Towards Supporting Transfer of Programming Language Knowledge (2018)
- Automatic Diagnosis of Students' Misconceptions in K-8 Mathematics (2018)
- The power of "why" and "why not": enriching scenario exploration with provenance (2017)
- Bonsai: synthesis-based reasoning for type systems (2017)
- Program Synthesis (2017)
- Explanation in Artificial Intelligence: Insights from the Social Sciences (2017)
- Do Developers Read Compiler Error Messages? (2017)
- Plan Explanations as Model Reconciliation: Moving Beyond Explanation as Soliloquy (2017)
- Domain-Specific Symbolic Compilation (2017)
- Fast Krippendorff: Fast computation of Krippendorff’s alpha agreement measure (2017)
- Purposes, concepts, misfits, and a redesign of git (2016)
- Faster Teaching via POMDP Planning (2016)
- Type Directives in Elm (2016)
- Tutorons: Generating context-relevant, on-demand explanations and demonstrations of online code (2015)
- Inferring Learners' Knowledge From Their Actions (2015)
- Compiler errors for humans (2015)
- Git (xkcd 1597) (2015)
- A lightweight symbolic virtual machine for solver-aided host languages (2014)
- Challenges and Confusions in Learning Version Control with Git (2014)
- Pro Git (2nd edition) (2014)
- A case of computational thinking: The subtle effect of hidden dependencies on the user experience of version control (2014)
- How to debug small programs (2014)
- How to create a minimal, reproducible example (2014)
- Growing solver-aided languages with rosette (2013)
- What's wrong with git?: a conceptual design analysis (2013)
- Explaining the user experience of recommender systems (2012)
- Automated feedback generation for introductory programming assignments (2012)
- Answer to stack overflow question: “What is the explanation for these bizarre JavaScript behaviours mentioned in the ‘Wat’ talk for CodeMash 2012?” (2012)
- Stack overflow question: In javascript, why is "0" equal to false, but when tested by 'if' it is not false by itself? (2011)
- Depth: An Account of Scientific Explanation (2011)
- Stack overflow question: why is [1,2] + [3,4] = "1,23,4" in javascript? (2011)
- Extracting and answering why and why not questions about Java program output (2010)
- The Essence of JavaScript (2010)
- Stack overflow question: why does (0 < 5 < 3) return true? (2010)
- Finding causes of program output with the Java Whyline (2009)
- Stack overflow question: why does isnan(" ") (string with spaces) equal false? (2009)
- Z3: An Efficient SMT Solver (2008)
- The mystery of "b := (b = false)" (2008)
- Debugging reinvented: asking and answering why and why not questions about program behavior (2008)
- From mere coincidences to meaningful discoveries (2007)
- Are They All Created Equal? A Comparison of Different Concept Inventory Development Methodologies (2007)
- The structure and function of explanations (2006)
- Designing the whyline: a debugging interface for asking questions about program behavior (2004)
- Content Analysis: An Introduction to Its Methodology (2004)
- Goal-based Explanations of Actions and Outcomes (2002)
- Bugs as deviant behavior: a general approach to inferring errors in systems code (2001)
- Expert Blind Spot : When Content Knowledge Eclipses Pedagogical Content Knowledge (2001)
- Mental Models and Causal Explanation: Judgements of Probable Cause and Explanatory Relevance (1996)
- Cognitive Tutors: Lessons Learned (1995)
- Abductive inference : computation, philosophy, technology (1994)
- Force concept inventory (1992)
- Contrastive Explanation (1990)
- Conversational processes and causal explanation (1990)
- Mind Bugs: The Origins of Procedural Misconceptions (1990)
- Mental Models in Cognitive Science (1980)
- Logic and conversation (1975)
- The Nature of Explanation (1967)