Self-Debug Prompting — AI Glossary

Self-debug prompting is a pattern in which the model generates code, an interpreter executes it, and the model receives the execution result — error messages, failed test output, or unexpected values — as additional context for a revised attempt. The loop continues until the code runs correctly or a retry budget is exhausted.