Manuscript Offprint

arXiv:2609.03470

ExplainRoute: A Pre-Deployment Audit Framework for Non-Answer-Giving Programming Tutors

Yiming Gai, Yingying Zhang, Xuefei Huang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Yiming Gai, Yingying Zhang and Xuefei Huang

Abstract—Programming tutors should make room for a learner's own explanation rather than immediately replacing it with a model answer. We present EXPLAINROUTEas a pre-deployment audit framework for a non-answer-giving teaching assistant: it reads a code line and a learner explanation, estimates the explanation state, and selects one of two bounded responses—a Feynman-style open self-explanation prompt or a Socratic scaffold. The framework exposes its state, strategy, cited code fragment, and leakage risk in a machine-checkable contract. Unlike a benchmark that ranks tutors by a single fluency score, it tests information boundaries, response polarity, failure closure, and the value of learner-explanation visibility before a classroom study. We evaluate it offline on the 1,770-pair SelfCode corpus. A code-group split leaves 443 pairs in 11 untouched holdout groups until generation is sealed. The holdout compares a direct answer, fixed open self-explanation, fixed Socratic scaffolding, adaptive two-role routing, and an adaptive no-state ablation. Contract validity is 100% for both fixed pedagogical conditions and the adaptive condition; adaptive routing agrees with the frozen score-based reference rule on 60.5% of records. Its state macro-F1 is 0.238, falling between the two fixed strategies (Open 0.229; Socratic 0.246) and showing no reliable adaptive advantage. An independent language-model judge rates adaptive responses 4.516/5 on a composite rubric, above the no-state ablation (2.819/5) but slightly below fixed open self-explanation (4.598/5) and Socratic scaffolding (4.658/5). A blinded teaching-assistant rubric evaluation on a stratified 40-row subset corroborates the information-value result (a visible learner explanation beats the no-state ablation) and the absence of an adaptive advantage over fixed strategies. The resulting contribution is a validated audit protocol and a boundary finding, not a claim of improved learning, retention, or causal instructional effectiveness.

Index Terms—teaching-assistant agents, programming education, self-explanation, Socratic scaffolding, Feynman technique, learner-state estimation, auditable LLM systems

I. INTRODUCTION

PROGRAMMING learners can recognize that a line of code “does something” without being able to reconstruct why it does so. A teaching assistant that immediately supplies the correct interpretation may produce a fluent exchange while hiding the learner’s mental model and reducing the opportunity to repair it. Self-explanation asks the learner to reconstruct an explanation in the learner’s own words, making missing links and misconceptions observable [1]–[3]. Socratic tutoring uses a question to elicit the missing relation without disclosing the conclusion [4], [5]. These strategies are complementary, but a deployed tutor needs an observable rule for deciding which response to produce.

Large language models have made conversational tutoring easy to prototype [6]–[8], while making evidence acquisition and response decisions difficult to audit. Agentic systems address this opacity by exposing plans, tools, intermediate decisions, and verification actions [9]–[11]. However, adding roles does not guarantee a better tutor: a longer workflow can introduce cost, routing errors, or answer leakage. A rigorous teaching-assistant evaluation should therefore compare adaptive routing against fixed strategies, retain failure traces, and distinguish response quality proxies from learning outcomes [12], [13].

This paper studies that bounded pre-deployment audit problem. EXPLAINROUTE is a two-role teaching-assistant agent: a code-focused diagnostician produces a structured explanation-state record, and a tutor role chooses a single Feynman-style or Socratic action. A deterministic contract rejects malformed or answer-leaking scaffold outputs. The experiment uses SelfCode, an annotated corpus of learner and expert explanations of Java lines [3]. Expert fields remain hidden until generation artifacts are sealed. The paper is not another attempt to obtain the highest aggregate score from an LLM tutor. Its unit of analysis is the auditable interaction: what information was visible, which action was selected, whether the response obeyed the pedagogical contract, and where adaptive routing failed. We ask:

  1. RQ1: Can a non-answer-giving programming tutor be constrained by a machine-checkable contract that exposes its state estimate, action, code evidence, and leakage risk?

  2. RQ2: Does observing the learner's explanation improve observable tutoring-response quality relative to a no-state ablation?

  3. RQ3: Does adaptive routing outperform fixed open or Socratic strategies on offline proxy endpoints, or does the audit reveal that the adaptive state estimate is not yet strong enough? We pre-register both outcomes as informative.

Our contributions are: (i) a pre-deployment audit framework for non-answer-giving programming tutors, with explicit state, strategy, code evidence, leakage fields, and fail-closed response polarity; (ii) a frozen group-held-out evaluation whose five conditions isolate answer-giving, fixed pedagogy, learner-explanation visibility, and adaptive routing; (iii) a two-evaluator analysis that triangulates an independent rubric judge with blinded teaching assistants; and (iv) a reproducible artifact bundle with generation seals, failure logs, aggregate results, and pre-registered follow-up protocols. The paper deliberately makes no claim about student learning gain. Its negative RQ3 result is treated as a design finding: an audit can show that an apparently adaptive route should not yet be over-deployed.

References (37)

  • Eliciting self-explanations improves understanding
  • Mechanisms that generate questions
  • Selfcode: An annotated corpus and a model for automated assessment of self-explanation during source code comprehension
  • Autotutor: A simulation of a human tutor
  • The relative effectiveness of human tutoring, intelligent tutoring systems, and other tutoring systems
  • Chatgpt for good? on opportunities and challenges of large language models for education
  • Computing education in the era of generative ai
  • The robots are coming: Exploring the implications of generative ai for computing education
  • React: Synergizing reasoning and acting in language models
  • Reflexion: Language agents with verbal reinforcement learning
  • Self-refine: Iterative refinement with self-feedback
  • Center for Curriculum Redesign, 2019
  • An Argument for AI in Education
  • Self-explaining expository texts: The dual processes of generating inferences and repairing mental models
  • Training in self-explanation and self-regulation strategies
  • An effective metacognitive strategy: Learning by explaining a worked example
  • The self-explanation principle in multimedia learning
  • Learning from errors
  • Stimulus-response compatibility and mental representations
  • Empirical studies of programming knowledge
  • Mental models and program comprehension: The beginning programmer
  • W. H. Freeman, 1985
  • Using bayesian networks to manage uncertainty in student modeling
  • Knowledge tracing for intelligent tutoring systems
  • Toolformer: Language models can teach themselves to use tools
  • Gorilla: Large language model connected with massive apis
  • Chain-of-thought prompting elicits reasoning in large language models
  • Large language models are zero-shot reasoners
  • Plan-and-solve prompting: Improving zero-shot chain-of-thought reasoning by large language models
  • Generative ai in computing education: Opportunities and risks
  • Retrieval-augmented generation for knowledge-intensive nlp tasks
  • Retrieval-Augmented Generation for Large Language Models: A Survey
  • Self-rag: Learning to retrieve, generate, and critique through self-reflection
  • Main-rag: Multi-agent filtering and consensus for retrieval-augmented generation
  • Rag-critic: Hierarchical error diagnosis for retrieval-augmented generation
  • Mathtutorbench: A benchmark for measuring open-ended pedagogical capabilities of llm tutors
  • Mr-bench: A comprehensive benchmark for evaluating llm tutors