A Pipeline for Assessing Metacognitive Reasoning in Energy-Based Transformers while Generating Code

Published: 04 Nov 2025, Last Modified: 13 Nov 2025MetaGenAI2025 PosterEveryoneRevisionsBibTeXCC BY 4.0
Keywords: Code Generation, Metacognition, Generative Artificial Intelligence, Human Computer Interaction
TL;DR: We propose a pipeline for assessing the ability of Energy-Based Transformers to exhibit metacognitive reasoning ability while generating code.
Abstract: While LLMs excel at generating code snippets, they often fall short in agentic programming scenarios that require sustained, iterative interaction with a development environment. This shortcoming persists even in massive-scale models with explicit reasoning capabilities such as Claude Sonnet-4.5-Thinking and GPT-5-Codex, suggesting a fundamental gap in metacognitive capabilities: the ability to self-assess, deliberate, and correct course during a complex task. Energy-Based Transformers (EBT) have recently been proposed as a method of improving scaling performance on complex tasks that require thinking and deliberation. EBTs perform multiple forward passes at inference while modeling uncertainty and validating predictions, in an attempt to mimic human System 2 thinking, which is related to deliberate and effortful metacognitive reasoning. In this work we propose a framework for assessing the metacognitive reasoning capabilities of EBTs for code generation tasks. Our core contribution is a feedback-aware inference mechanism that dynamically scales the model's "thinking depth" (number of forward passes) based on external feedback. Our proposed framework supports an optional human-in-the-loop mode where code engineers can interact with the model and control the degree of forward pass reasoning through feedback. This proposed approach has the potential to allow LLMs to interact with human programmers as another member of the code engineering team, and dramatically improve the speed and quality of human generated code by interacting with an LLM agent.
Submission Number: 6
Loading