- Rating
- 5
- Clarity
- 3
- Confidence
- 4
- Originality
- 3
- Quality
- 4
- Significance
- 3
Read review
Summary
This paper points out a critical question in documentation generation from LLM-based coding agents. The basic idea to evaluate whether the documentation is correct is to see if the LLM can generate the correct code based on this documentation. This paper formulates agent-based documentation optimization question as a rewarding based search problem, where rewards come from test passing rates for each entity in the documentation. It proposes SpecForge, which performs a dependency guided search: it maintains a Pareto archive of documentation states, selects entities based on dependency order, and refine candidates by a diverse subsets of failing tests. From the evaluation on DEVEVAL+, SpecForge can improve a lot on different kinds of baselines. The paper also studies on 2 downstream use cases and shows that SpecForge can be transferred into real-world software engineering tasks.
Strengths and weaknesses
Strength:
- The paper studies a novel and timely research question in the current era of increasingly capable coding agents. Documentation can be important for agents to understand and act on codebases. Evaluating whether documentation is accurate and complete enough for downstream code generation is an important and practical problem.
- The evaluation results are strong. SpecForge substantially outperforms a wide range of baselines, including static documentation methods, prompt optimization methods and commercial coding agents, which shows the usefulness of their method. The paper also provides a broad analysis on convergence of their method, cost efficiency and ablation studies on the main components. The ablation results suggest that the main components of the method contribute to the performance.
- The 2 downstream evaluations suggests that the optimized documentation may be useful beyond documenting the original code, and can serve as a behavioral interface for other software engineering tasks like code translation and code generation.
- The overall method design is solid and well motivated for the proposed problem. The idea of Pareto frontier + dependency-aware entity selection + error-diversified expansion is a reasonable approache for handling dependency structure and refinement noise, although there may be additional factors that the method does not fully consider.
Weakness:
- The basic idea to verify the documentation is to generate code based on the doc and see if test can pass. However, the paper does not distinguish documentation errors from code-generation errors, and the refinement prompts largely attribute failed tests as evidence of missing or ambiguous documentation. It's also possible that even a documentation itself is accurate and complete enough, based on the nature of LLM code generator, it can still have mistakes that not faithfully generate the code from the documentation. The paper needs more analysis quantifying how often failures are documentation-limited versus generator-limited.
- The iterative process treat doc of each entity as an unconstrainted format, which can introduce some short-path issues. Although the paper explicitly targets downstream code-generation correctness rather than human readability, I think it's still necessary to analyze the document artifacts to see if it's still a behavior specification instead of raw code segment. Maybe something like document length, inline code content (code as a part of documentation), or human judgments of whether the optimized documentation remains useful as documentation would help. In an extreme scenario, the documentation can directly include reference source code from the original implementation, so that the doc-to-code task can directly copy the reference code to pass the tests. Such a documentation can have a high score but the quality is uncertain.
- The comparability of test feedback across baselines should be clarified. It's uncertain that other baselines will share the same test suite during the iteration process in the evaluation part. For example, if SpecForge iterate on test suite with high coverage, while baselines like Claude Code is iterating on some self-proposed low coverage tests, then the comparison may partly reflect differences in the quality of feedback rather than only the effectiveness of the proposed search algorithm.
Questions
- As stated in limitation 3, could the authors clarify how commercial +Test baselines like Claude Code propose tests or do they use the same pseudo-test suite as SpecForge? And how comparable are those tests in coverage?
- In the Dependency-Constrained Entity Selection, how does SpecForge handle cyclic dependencies? I.e. In entity A, it calls B; while in entity B it also calls A?
- Could the author clarify more about why output coupling is a issue? Specifically, why the code generator must condition on the full documentation? It's also possible that code can be generated by per-entity documentation or dependency-based local documentation. In that case, code that not generated in this round won't be touched and there won't be output coupling?
Limitations
The authors mention that limitation is in Broader Impact section, but I can not find the detailed limitation discussion in that section. That section mainly describes potential societal impact and the need for human oversight, rather than technical limitations of the proposed method. I encourage the authors add more explicit discussion of the method's technical limitations.
Paper formatting concerns
N/A
Final justification
During the rebuttal, the authors responded substantively to my main concerns with targeted analyses and controlled experiments. In particular, they measured the effect of code-generation instability, evaluated documentation length and source-code leakage, conducted a human assessment of documentation quality, and compared Claude Code+Topo+Test under the same validated pseudo-test suite as SpecForge. The last experiment shows that feedback quality explains only part of the performance gap, while a substantial gap remains under identical test feedback.
I also discussed the cyclic call graphs issue with the authors. During the rebuttal, they proposed a new SCC contraction to address this and an external benchmark containing cyclic modules, where it substantially improved performance and brought cyclic-module results close to the acyclic control. The authors committed to including this new implementation and evaluation in the final version of the paper, which addresses my concern about the handling of cyclic call graphs.
Overall, the authors have made significant efforts to address the concerns raised, so I decide to raise my score from 4 to 5.
We thank the reviewer for the thoughtful review.
W1: Distinguishing documentation errors from code-generation errors
This is a very insightful comment, and we provide a full measurement of this decomposition.
The scorer is one fixed, shared instrument. Every number in Tables 1-5 comes from the same code-generation agent, prompt template, and whole-module protocol, decoding greedily (temperature 0), so it cannot create the ordering between methods, which is therefore fair by construction.
Measuring generator error. We detect it by self-consistency sampling: holding the document fixed, the module is regenerated k=5 times, and every entity is re-scored under any-k (solved if at least one regeneration passes all its tests) and majority-k (more than half). A single-draw failure that any-k (or majority-k) marks solved is exactly the reviewer's case: correct documentation, missed by the agent. Auditing the 22 unsolved entities out of 247 (GPT-4o, DevEval+): 2 (9.1%) flip to correct under any-k and 1 (4.5%) under majority-k. Conversely, only 1.5% of solved entities fail a majority vote, so lucky draws are not credited either.
Filtered scores. Dropping generator-error entities from the denominator (Table 1), SpecForge moves from ∣S∣ 90.8 / ϕˉ 93.3 to 91.2 / 93.6 (majority-k) and 91.6 / 93.9 (any-k). The correction is at most 2.3% for any method, and since it scales with the mass of failures it lifts the baselines more than us: the ∣S∣ gap to the strongest baseline moves 28.0% (reported) to 27.3% (majority-k) to 26.6% (any-k). Every conclusion holds under both rules.
Table 1: Scores with generator-error entities removed (GPT-4o, DevEval+).
W2: Unconstrained format and the short-path risk of embedding raw code
The short path the reviewer hypothesizes is closed by construction, and we verified this empirically along three lines.
(1) Format is constrained by construction. The refinement prompt contains an explicit rule, which we will add to App. F: "IMPORTANT: Write natural-language documentation, NOT pseudocode. Do NOT include fenced code blocks with implementation code, lambda expressions, or copy-pasted source lines. Describe behavior and contracts, not implementation details." (
prompts/prescription.txt:22) The search cannot exploit code embedding, because the refinement operator is forbidden from producing it.(2) Size and leakage, measured directly (Table 2). SpecForge's maximum common token sequence with the source averages 16.2 tokens, lower than every agentic and iterative baseline (16.8–22.7) and 2.5× lower than ACE (40.8). The only two methods with less overlap, MIPROv2 and GEPA, write far shorter documents at 43–44% lower φ̄. A span audit shows the matched spans are 57% interface-signature skeletons (
class/defheaders, no bodies) and 43% permitted variable literals, i.e., zero implementation lines in any optimized document.Table 2: Documentation size and code leakage (Claude-4.5-Sonnet, DevEval+).
(3) Human judgment (Table 3). We conducted a paired human evaluation: 30 entities across 6 modules, rated by 5 CS-background annotators on five 1–5 Likert dimensions. Optimized documentation improves on all five dimensions. The decisive dimension for this concern is Clarity, which rises from 2.88 to 4.42. If the search were converging toward embedded raw code, human readability would degrade. Instead, annotators judge the refined text as more, not less, readable as documentation. It reads as a behavioral specification, not a code fragment.
Table 3: Paired human evaluation of initial vs. optimized documentation (30 entities, 6 modules, 5 annotators, 1–5 Likert; Krippendorff's ordinal α ≥ 0.71).
W3 + Q1: Do commercial +Test baselines share the pseudo-test suite, and how comparable is coverage?
Thank you for raising this point: it isolates the right confound, and we ran the experiment it calls for.
The commercial "+Test" baselines self-propose their tests, with explicit instructions to generate tests and refine against execution feedback, a deliberately strengthened protocol. We kept test generation on the baseline side for a principled reason: constructing the validated pseudo-test suite (LLM-proposed inputs executed on the reference implementation, coverage-filtered) is itself part of SpecForge's method design, so handing our suite to baselines conflates the method with its ablation. To isolate the feedback-quality factor cleanly, we equip Claude Code+Topo+Test with SpecForge's shared validated suite (same tests, same harness; Table 4).
Table 4: Claude Code+Topo+Test with self-proposed vs. shared test suites. (Claude-4.5-Sonnet, DevEval+)
(1) Feedback quality accounts for a modest part of the gap: the shared suite raises coverage from 62.0% to 91.2%, and ϕˉ by +5.0%. (2) The remaining 19.6% gap persists under identical feedback. With the same tests and harness, the baseline still exhibits the whack-a-mole failure mode: without dependency-constrained selection and Pareto archiving, better feedback alone does not prevent refinement interference.
Q2: How are cyclic dependencies handled (A calls B, B calls A)?
By a simple addition: SCC contraction into meta-entities. We compute strongly connected components of the call graph and contract each multi-member SCC into a meta-entity. The search operates on refinement units: single entities or meta-entities. The condensation graph is a DAG by construction, so topological traversal and the callee-resolved eligibility gate apply unchanged. A meta-entity is refined jointly: the prompt presents all member sources and documents, states they are mutually recursive, and requires a complete replacement document per member. We will add this to future revision.
Q3: Why condition the generator on full documentation? Would per-entity generation eliminate output coupling?
Generating documentation on a per-entity basis is viable, for example by masking a single entity at a time, providing the remaining source code as context, and proceeding in dependency order. Such a protocol optimizes entity-level documentation: each document is generated under the assumption that the implementations of all other entities are already correct. Consequently, the resulting documentation only needs to be sufficient for reproducing the target entity in the presence of the remaining source code. However, this is fundamentally different from our objective. Our goal is to produce a module-level documentation that serves as a natural-language replacement for the source code completely, enabling an agent to understand the repository and support downstream tasks such as code generation, cross-language translation, and feature implementation. As a result, the quality of an individual entity's documentation cannot be evaluated in isolation. What ultimately matters is whether the entire collection of documentation forms a globally consistent behavioral specification that can collectively replace the original codebase. Optimizing entities independently does not guarantee that the concatenated documentation will faithfully reproduce the complete module or provide coherent guidance for downstream applications. Moreover, per-entity generation would be prohibitively expensive. Instead of a single module-level generation call, it requires n sequential generation calls, each conditioned on its dependency context.
On Limitations
The Broader Impact section follows the NeurIPS convention of discussing societal impact. We will add an explicit Technical Limitations section on the genuine boundary conditions of the studied setting: (1) Executable reference implementation required: pseudo-tests are validated by executing LLM-proposed inputs on the reference module. (2) Per-repository environment configuration: each module needs resolved dependencies, an isolated sandbox, and a test harness. (3) Inference cost scales with search budget and backbone pricing: each of the B rounds performs refinement, regeneration, and test execution; per-module cost accumulates for very large codebases.
We thank the reviewer again for concerns that measurably improved the paper, and we welcome further questions during the discussion period.