acceptodds
Under review as a conference paper at ICLR 2027

TrustTrace: Code Generation and Revision with Hierarchical Program Knowledge

Abstract

Code generation requires algorithmic knowledge about a task and the computations that implement a solution. A central challenge is to preserve the relation between a solution's global strategy, the responsibilities of its components, and their executable behavior. We present TrustTrace, a framework for code generation and revision based on hierarchical program knowledge. We organize a solution into task strategies, module descriptions, and code implementations. Module descriptions specify what each component computes, while interfaces and dependencies determine how components work together. We use this structure to learn from complete solutions and to examine the behavior of individual modules when revising a program. During learning, we assign each structured response a quality weight that determines its contribution to training. During revision, we compare observed module inputs and outputs with the responsibilities stated in the descriptions. This connects the organization of algorithmic knowledge with the execution of the resulting program. Experiments show that quality weighting raises Test whole-problem accuracy over ordinary modular SFT from 62.05% to 63.05% with supplied plans and from 17.93% to 20.92% without plans, while module traces with corresponding guidance raise revision success over score-and-error feedback from 66.50% to 67.51% with five candidates.

Then back it, or bet against it.

Related papers

Open the market on this paper to see 7 more related papers.