Axiomatic Reasoning for LLMs

The Potential of Deep Coding

1. Overview

This report synthesizes a structured methodology for collaborative software development, referred to as Deep Coding. Unlike conventional AI-assisted coding, where the AI responds to isolated prompts, Deep Coding establishes a continuous loop of objective specification, iterative summarization, and recursive refinement. The human defines a clear objective function and guides the process through phased checkpoints, while the AI executes incremental implementation, self-verification, and integration.

The methodology was demonstrated through the development of a browser-based side-scrolling shooter game. The final output—a self-contained HTML file with a stage editor, slow-motion control, and enhanced visual effects—serves as an artifact of the process. This report describes the methodology in technical terms, abstracting it into a reusable framework.


2. Core Methodology

2.1 Objective Function Specification

The process begins with an objective function defined by the human collaborator. This function is not a rigid specification but a directional principle—for example, “create a functional horizontal shooter game using only HTML/CSS/JS, with extensibility for custom stage editing.” This function acts as the invariant anchor, preventing scope drift during iterative refinement.

2.2 Phased Execution with Recursive Refinement

The overall task is decomposed into a sequence of phases (typically 4–7). Each phase produces a demonstrable increment, and its output becomes the starting point for the next phase.

Phase Focus Output
1 Core engine: game loop, player controls, background scrolling Functional canvas loop with key input handling
2 Bullets and enemies: collision detection, basic spawn logic Playable prototype with core mechanics
3 Scoring, lives, bombs, game over, and restart Full game loop with player progression
4 Stage editor: UI for defining enemy attributes, local storage JSON-based stage definition system
5 Data-driven gameplay: engine reads stage JSON, shape-based rendering Fully customizable enemy behavior
6 Integration and optimization: visual polish, performance tuning Complete, distributable HTML file

Each phase is executed with the following substeps:

  1. Planning: The AI proposes a detailed plan for the phase, referencing prior outputs.
  2. Investigation: The AI retrieves relevant technical information (APIs, algorithms, best practices).
  3. Implementation: Code is generated incrementally, building on the existing codebase.
  4. Self-verification: The AI performs reasoning steps and counterfactual checks to ensure correctness.
  5. Checkpoint: The phase output is presented, and the human authorizes continuation with “next.”

2.3 Summarization as a Stability Mechanism

After each phase, the AI produces a structured summary of key design decisions, implementation details, and verification steps. This summary is not merely documentation; it serves as a fixed premise for the next phase, preventing context collapse and ensuring that incremental changes remain consistent with earlier architectural choices.

2.4 Recursive Refinement and Feature Expansion

When the human requests additional features (e.g., “add slow-motion on SHIFT”), the methodology does not discard the existing architecture. Instead, the request is integrated as a new objective, and the existing codebase is refactored through the same phased process. This recursion allows features to be layered without degrading the core structure.


3. Operational Principles

3.1 Human Role: Director

The human is responsible for:

3.2 AI Role: Executor

The AI is responsible for:

3.3 Communication Protocol

The interaction follows a tightly constrained protocol:


4. Empirical Demonstration: Side-Scrolling Shooter

The methodology was applied to develop a browser game with the following final features:

Feature Implementation Methodological Contribution
Core mechanics Canvas-based game loop, player movement, bullet firing, enemy spawning Phase 1–2: established stable foundation
Player state Score, lives, bomb count, invincibility frames Phase 3: added progression system without breaking core loop
Stage editor JSON export/import, localStorage, shape-based enemy attributes Phase 4: introduced data-driven design as an extension
Shape-based enemies Circle, triangle, square rendering; point-in-triangle collision Phase 5: refactored enemy logic to depend on external JSON
Slow-motion SHIFT key reduces timeScale; affects movement, cooldowns, spawn timers Phase 6 (intermediate): added as additional control without disrupting existing balance
Visual polish Gradient backgrounds, particle stars, bullet trails, pulsing animations Phase 6 (final): integrated high-visibility effects with performance optimization

Each phase preserved the work of previous phases, and new features were added without rewriting the core engine. The final output is a single HTML file with no external dependencies.


5. Advantages and Constraints

5.1 Advantages

5.2 Constraints


6. Conclusion

Deep Coding is a structured methodology for human-AI collaborative software development. It transforms the typical “prompt-response” interaction into a controlled loop of objective specification, phased execution, and recursive refinement. By treating the AI as an executor that operates within fixed premises defined by human direction, the methodology enables the construction of complex, feature-rich applications with minimal risk of context collapse or architectural drift.

The side-scrolling shooter game developed through this process serves as a case study: it began with a minimal core and accumulated editor, data-driven behavior, slow-motion, and visual enhancements, all while maintaining functional integrity. The final output is not merely a game but a demonstration of how recursive collaboration can produce software that balances extensibility with robustness.

This methodology is replicable across domains where iterative development, human oversight, and structured refinement are priorities. It does not replace conventional development practices but offers a template for leveraging AI as a disciplined coding partner rather than an unpredictable assistant.