acceptodds
Under review as a conference paper at ICLR 2027

ASNER: Adaptive Semantic Neighborhoods and Evidence-Grounded Refinement for Software Architecture Recovery

Abstract

Automated software architecture recovery is important for software engineering, especially as large language model (LLM) agents increasingly perform repository-level tasks that require architectural context to understand and modify large codebases. Existing methods combine structural and semantic signals, but the resulting relations do not necessarily reflect architectural responsibility. Files that co-implement one component may appear dissimilar, while related files may merely cooperate across component boundaries. Fixed thresholds or Top-K neighborhoods also ignore repository scale and local similarity distributions, causing missing within-component links or noisy cross-component edges. These errors propagate to community detection, while unconstrained LLM refinement may alter correct assignments without sufficient evidence. Our key insight is that accurate recovery requires responsibility-aware semantic relations that adapt to each repository, followed by evidence-grounded verification of uncertain boundaries. We therefore propose ASNER (Adaptive Semantic Neighborhoods and Evidence-Grounded Refinement for Software Architecture Recovery). ASNER uses an LLM to derive structured file responsibilities, constructs adaptive semantic neighborhoods, and augments a static dependency graph with selected semantic relations and weak directory cues. Community detection recovers the component backbone, after which a Responsibility-Ownership-Aware (ROA) Agent revisits uncertain boundary files using project-level responsibilities and traceable code evidence, changing assignments only when supported. We evaluate ASNER on 12 open-source projects spanning C, C++, Java, and Python. ASNER achieves the best macro-average on all five metrics on the common benchmark, improving ARI and c2c@66 over GAER-GAT by 19.5% and 32.9%, respectively. A downstream evaluation further shows that ASNER-guided LocAgent improves file-, module-, and function-level code localization. These results demonstrate the value of ASNER’s architectural context for repository-level software engineering tasks.

Primary area:
foundation or frontier models, including LLMs
Keywords:
software architecture recovery, semantic code representation, LLM agents, program comprehension, repository-level software engineering

Reviews

Among:
Shape:
1234this paper, Bottom 27%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.00 over 3 reviews, above 27% of the others.
Reviewer_5Q7SOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
3
Soundness
3
Read review
Paper summary

The paper focuses on automated software architecture recovery for large code repositories and proposes ASNER to address issues such as the difficulty of accurately reflecting responsibility ownership through file-level semantic similarity and the limited flexibility of fixed semantic neighborhood selection. The method represents code files by using structured responsibility summaries. It selects the semantic relations to retain through an adaptive semantic neighborhood algorithm and obtains initial components through a community detection algorithm. Besides, it uses ROA Agent to decide whether to adjust the component assignments of suspicious files. The authors evaluate the proposed method on 12 open-source projects, and the results show that ASNER achieves the best macro-averaged results on all five metrics among the compared methods.

Critical strengths

None

Critical weaknesses

None

Questions for authors

The paper focuses on automated software architecture recovery for large code repositories and proposes ASNER to address issues such as the difficulty of accurately reflecting responsibility ownership through file-level semantic similarity and the limited flexibility of fixed semantic neighborhood selection. The method represents code files by using structured responsibility summaries. It selects the semantic relations to retain through an adaptive semantic neighborhood algorithm and obtains initial components through a community detection algorithm. Besides, it uses ROA Agent to decide whether to adjust the component assignments of suspicious files. The authors evaluate the proposed method on 12 open-source projects, and the results show that ASNER achieves the best macro-averaged results on all five metrics among the compared methods. However, the following issues still need further clarification and revision:

  1. SGASN determines the number of neighbors for each file based on project scale and local similarity gaps, and the existing ablation studies provide support for its effectiveness, but comparative experiments with fixed Top-K are still needed.
  2. Equation (1) and the appendix provide the calculation method and parameters for the candidate bound, but the paper does not yet provide a rationale for selecting these parameters and does not report a parameter sensitivity analysis, and I recommend adding both.
  3. Table 2 already specifies the configurations of the first two ablation blocks, but whether “w/o ROA” retains the deterministic split and merge rules still needs to be clarified.
  4. Figure 4 indicates that the same file can appear in multiple reference components, but Appendix F does not clarify how such multiple memberships are handled when calculating ARI and other metrics.
1 comment
AuthorsOpenReview ↗

Response to Reviewer 5Q7S

Thank you for your suggestions. We have added experiments and clarifications addressing your four questions:

  • Q1: See Comparative performance and hyperparameter sensitivity of SGASN for fixed Top-K, fixed-threshold, and edge-count-matched comparisons across all 12 projects.
  • Q2: See Parameter choices and design rationale for parameter selection, and Comparative performance and hyperparameter sensitivity of SGASN for sensitivity results.
  • Q3: The w/o ROA configuration disables both file moves and deterministic splits and merges. See Stage contributions and reliability of ROA for the two stages' contributions and per-project action counts.

Evaluation of multiple memberships (Q4). Figure 4 displays the original reference architecture, so a file may appear in multiple reference components. ASNER's predictions and numerical evaluation use single-label partitions. The evaluator reads memberships in the reference file's fixed component order; when a file appears more than once, the later label overwrites the earlier one, so each file is counted once. SemArc's public evaluation entry point uses the same procedure. We will clarify in Appendix F that the visualization preserves multiple memberships, whereas scoring uses a single-label reference partition.

Reviewer_miH1OpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

The paper proposes a framework called ASNER for software architecture recovery, which involves partitioning a repository's files into components. ASNER consists of five steps: (1) build a file level dependency graph using ENRE, (2) for each file, prompt an LLM to write a Structured Responsibility Summary (SRS) and then embed it using Qwen3-Embedding-4B., (3) choose semantic neighbors with SGASN, (4) fuse the semantic edges with the dependency graph and a directory prior, followed by modularity-based community detection (5) refine boundary files with an LLM agent (ROA).

On 12 C/C++/Java/Python systems with human reference architectures, ASNER reports the best macro-average on five metrics over the 8 systems shared with all baselines (ARI 51.3 vs 42.9 for GAER-GAT) and outperforms SemArc across all 12. The paper also ablates the main components, tests three generative LLMs, reports token and runtime costs, and shows that exposing the recovered architecture to LocAgent as tools improves localization on 24 LOC-BENCH issues.

Critical strengths
  • The problem of software architecture recovery is important and useful as context for coding agents.
  • Comparison with SemArc, GAER-GAT and SARIF are fare and carefully measured with the same source snapshots, GT mapping and evaluator.
  • Gains over similar LLM based method, SemArc are consistent across all 12 projects.
  • Results hold for various generative LLMs in Table 3.
  • Prompt, decisions traceable to code evidence with an explicit abstain option, and detailed cost reporting are included.
Critical weaknesses
  • The abstract and introduction are hard to follow and do not state the task concretely or elaborating what software architecture recovery entails. The abstract moves straight to the limitations of the existing methods without first establishing that these methods build a graph over files and cluster it, so terms such as structural, semantic signals, fixed thresholds, Top-K neighborhoods and community detection appear without context. Moreover, the input/output definition only appears in Appendix A.1.
  • It appears that the gain over GAER-GAT highlighted in the abstract comes from one project (OODT) which has a different tuning of configurations. From tables 10 and 11, we see that OODT alone contributes 5.2 of 8.4-point macro ARI gain over GAER-GAT. Further section B.2 mentions that this is the only project where community detection resolution is set to 30 instead of 1.7. If we exclude this then the gain is falls to around 3.6 points and GAER-GAT outperforms ASNER on MoJoFM and HDF projects. Some more runs or variance/paired tests per project would help clarify this further.
  • The hyper parameters and certain design choices appear tuned for the evaluation dataset. E.g., the deterministic split rule (source/sink families that each contain .h and .cpp files) seems to be adapted for HDC and contributes significantly towards the observed gains on this project. There are several parameters for which a heuristic is not provided. E.g., SGASN has 4 parameters on top of λL\lambda_L, stability gate, merge thresholds and fixed relation-type weights. A sensitivity analysis to these parameters would help understand their effects on the results.
  • The contributions mentioned seemed to yield a gain of around one point and it is difficult to attribute the gain to them. SRS vs plain summaries result in a gap of 1 point, LLM agent's own contribution vs deterministic rules on HDC is unclear. SemArc and ASNER use different models. Model control when comparing baselines is essential for fair comparison and reduce confounders.
  • Similarly, directory signal needs an ablation too. The statement that directory structure “never determines membership” (section 3.3) is overstated, given that cross-directory edges are down-weighted.
  • The downstream evidence is not rigorous enough to support the abstract's claims. The localization study uses 1 run with 0 temperature over 24 issues with 1 gold file. The gains are from 3 issues at file level and 2 at module and function level, all from Dask.
Questions for authors
  • Is the gain over GAER-GAT still visible at community detection resolution of 1.7? Why is it 30 for OODT?
  • How were r,Kmin⁡,Kmax⁡,β,λLr, K_{\min}, K_{\max}, \beta, \lambda_L, 0.97 stability gate, γ\gamma, the merge/split thresholds and the Table 6 relation weights chosen? Were any selected by looking at scores on the 12 evaluation projects?
  • How were the 24 LOC-BENCH issues sampled, and why are they only from Dask and pypdf?
  • How many ROA moves are accepted per project? On which projects do the split and merge rules fire?
2 comments
AuthorsOpenReview ↗

Response to Reviewer miH1

Thank you for your comments. Please see Role and benefits of structured responsibility summaries (SRS) for SRS; Stage contributions and reliability of ROA for HDC and per-project actions (W4/Q4); Parameter choices and design rationale and Comparative performance and hyperparameter sensitivity of SGASN for parameter choices and sensitivity (W3/Q2); and Downstream benefits of ASNER architectural artifacts for the expanded downstream evaluation (W6).

1. Task background and inputs/outputs (W1). We revised the abstract and introduction to explain component organization and dependencies, how graph-based methods represent file relations and recover components through clustering, and then the limitations addressed by ASNER. Section 3.1 now defines the task and inputs/outputs; Appendix A.1 retains the details.

2. OODT resolution and comparisons (W2/Q1). Our main experiments follow SemArc: γ=30 for OODT and 1.7 for other projects, as stated on page 349 of its published version. SARIF found that its default resolution recovered only 28 OODT components versus 216 reference components, and increased resolution for finer-grained recovery. Thus, SemArc supplies the parameter values, while SARIF explains the granularity issue (SemArc; SARIF §5.3.1).

At γ=1.7, OODT's ARI is 16.1717 without ROA and 16.2930 with ROA, versus 45.6899 and 46.1584 at γ=30. Replacing only OODT's final result in the eight-project comparison gives the following macro-averages (all metrics ×100):

ConfigurationMoJoFMa2aARIa2aadja2a_{\mathrm{adj}}c2c@66
ASNER, original72.7489.7251.3062.1840.22
ASNER, OODT γ=1.769.1888.8147.5760.4539.26
GAER-GAT, submitted Table 172.3087.7042.9054.8030.30

ASNER retains a 4.67-point ARI advantage, but MoJoFM is 3.12 points lower.

3. Split/merge rationale (W3/Q2). These empirical rules reflect responsibility separation in C++ stream processing: source/sink implementations may share workflows and vocabulary but perform different endpoint roles, such as reading and writing. Examples include Boost.Iostreams' Source/Sink concepts and GNU Radio's separate file_source_impl/file_sink_impl.

Splitting requires a shared naming family, with headers, implementation files, and internal static links on each side, avoiding splits based only on different names.

Merging also uses empirical eligibility constraints: a stable path scope must cover at least 70% of a component's files, alongside at least two cross-component relation records and bidirectional static links. Widely shared path segments do not justify merging. These conditions restrict the modification scope. Appendix E.2 gives the conditions; Stage contributions and reliability of ROA separately reports rule and LLM-move contributions.

4. Relation weights (W3/Q2). We adopt SARIF's weights, obtained by iteratively testing relation-type weights, clustering the weighted dependency graph, and optimizing modularity. We did not re-search them on our 12 projects. During graph construction, type weights combine with endpoint-entity importance and accumulate into file-level dependency weights.

5. Directory information (W5). The original claim that directories never determine membership was too strong. Directory names are not component labels, but directory information affects edge weights, semantic fusion, and location reranking. Removing all these directory inputs before ROA yields:

ConfigurationMoJoFMa2aARIa2aadja2a_{\mathrm{adj}}c2c@66
Default76.1490.9154.3365.3643.56
No directory information46.1084.8820.9340.357.75

ARI falls on all 12 projects. This measures the combined effect of removing all directory inputs.

6. Original issue sampling (W6/Q3). To study architectural context across issues within a project, we filtered LOC-BENCH for projects where multiple issues concerned the same file, numbered eligible projects, and randomly sampled two project IDs: Dask and pypdf. The evaluation comprised 20 Dask and four pypdf issues. Expanded coverage, multi-file issues, and repeated runs are reported in Downstream benefits of ASNER architectural artifacts.

Model control (W4). To control for the model, all methods requiring LLM-generated file descriptions in the main experiments use DeepSeek-V4.1-Flash, including SemArc and ASNER.

I thank the authors for their new results and for their efforts in addressing my comments. The new abstract is clearer now and my concern about Model control vs SemArc is now stated in section 4.1. However, some of my major concerns remain unresolved and I additionally have some new concerns with these updates. I also feel some of the new results weaken the claim.

  • Based on table 13's six validation projects, I still see that ASNER’s MoJoFM is a tie (74.12 vs 74.05). So if we exclude OODT, the ASNER's ARI lead on MoJoFM lead drops to about 3.1. This weakens the claims about ASNER.
  • It seems that SGASN’s advantage comes entirely from the development projects as in table 17 SGASN gets an average of -0.33 ARI in eight validation projects. The same holds against a leave-one-project-out threshold: −0.30 on validation. On held-out projects, SGASN is no better than a properly selected fixed Top-K, so the paper’s main algorithmic contribution doesn’t generalize beyond its tuning set.
  • The new ablation on 'primary responsibility only' doesn't seem like a clean test of the structured format. It also drops the fallback text, which causes some files to lose their semantic description entirely (Appendix C.2, Table 7). Hence, part of its larger drop seems to come from missing information, not from the absence of the extra fields. The better comparison is SRS versus the plain free-text summary (Table 2), where we see that gap is small. So, it remains unclear what the structured format adds beyond a good free-text summary.
  • In Table 2, we see that the LLM’s file moves barely change the results. All of the refinement gain seems to come from the deterministic split and merge rules, which fire on only two projects (Table 22). The conclusion still says the ablations confirm ROA’s contribution. This claim should clearly state what the agent actually changes since the evidence-grounded agent is presented as a main contribution..
  • The abstract calls directory information a “weak” cue. But removing it causes recovery quality to collapse on every project (Appendix C.7, Tables 18–19). Directory structure is one of the main drivers of performance, not a minor aid. The paper also still lacks a directory-only baseline, such as the fixed-depth directory partition the method already computes internally. Without it, we can’t tell how much ASNER adds beyond the repository’s existing folder layout.

In summary, each claimed contribution now shows little effect on held-out data. Most of the performance comes from directory signals and SemArc’s existing pipeline, while the abstract and conclusion still overclaim.

Reviewer_eZ2rOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
1
Soundness
1
Read review
Paper summary

This paper presents an approach to recovering software architecture from a code repository. To improve the accuracy of existing methods, this work considers repository-specific characteristics and evidence-based verification of component boundaries. Specifically, the proposed approach incorporates LLM to obtain a summary of a source file, which is used to design a so-called SGASN algorithm for refining the file graph. Then some community detection method is employed to extract the initial components of the software. Finally, an agent called ROA is designed to refine the architecture. A set of experiments was conducted to evaluate the effectiveness of the proposed approach in comparison with existing methods.

Critical strengths
  • The paper addresses an important problem in architecture recovery, and clearly articulates its motivation and the significance of the problem from two perspectives: the ambiguity of the semantic information used by current methods and the omissions caused by fixed thresholds.

  • The experimental results are commendable. In the ablation experiments across 12 projects, the full SGASN improves MoJoFM, ARI, and c2c@66 by 3.65, 5.97, and 10.79 percentage points, respectively (Table 2), compared with the fixed 0.5 similarity threshold configuration adopted in the paper. This provides meaningful evidence for the importance of semantic neighborhood construction.

  • The paper provides implementation details such as parameters and prompts, and attempts to connect architecture recovery quality with the downstream code localization task, employing LocAgent to demonstrate the supportive role of architecture in software code localization.

Critical weaknesses
  1. The independent contributions of the three method designs require clearer evidence. SGASN appears to be the most clearly defined algorithmic contribution of this paper. The other two components are useful, but their independent roles are relatively limited in the current ablation experiments: after replacing plain summaries with structured responsibility descriptions, the average metric change across the 12 projects is around 1 point, and the overall change is not substantial. Meanwhile, the resulting graph still relies to a considerable extent on functional similarity. It is suggested that the authors further clarify what this representation specifically adds relative to existing semantic architecture recovery methods such as SemArc, rather than treating the structured LLM description itself as the decisive difference. The average gains associated with ROA are also small: approximately 0.15 points for MoJoFM, 0.99 points for ARI, and 0.79 points for c2c@66 (Table 2). It remains unclear whether ROA can stably make beneficial revisions across different projects and repeated LLM runs, nor is it clear how much of the final improvement comes from the subsequent deterministic split-and-merge rules. In addition, SemRef is a related work: it likewise uses dependency analysis to identify potentially misplaced files, then relies on LLM judgment to revise the architecture, and also studies module splitting, merging, and iterative revision. It is suggested that the authors explain ROA's distinctive aspects in terms of candidate selection, evidence verification, decision rules, or revision scope. If conditions permit, a targeted comparison could be conducted on the same initial partitioning and evaluation file set.

  2. SGASN requires more sufficient neighborhood controls and parameter analysis. The existing ablation supports that SGASN outperforms the fixed 0.5 threshold chosen in the paper, demonstrating its effectiveness. However, a single threshold is insufficient to fully substantiate the novelty of this algorithm, and in my view the novelty is mainly concentrated in this algorithm. I therefore hope the authors can conduct further experiments, including further analysis of SGASN's sensitivity to parameters such as the size cap, the local drop rule, and β, as well as analysis of changes in algorithmic operation. Such targeted experiments could more fully support the rationality of the algorithm design.

  3. The downstream experiments have not yet distinguished the unique value of ASNER's architecture information. Providing architecture information to LocAgent is a valuable application validation. However, the current experiments cannot yet determine the specific source of the gains or what distinguishes ASNER from other SAR tools. It is therefore suggested to explicitly list which ASNER artifacts LocAgent actually receives, and to compare, under the same tool interface and token budget, against direct code retrieval or repository documentation retrieval, as well as architecture results from other SAR methods, so as to demonstrate whether the component structure recovered by ASNER provides additional value over code RAG or repository Wiki-style retrieval.

Questions for authors

I acknowledge the experimental coverage of the paper and consider SGASN a promising contribution. My current score is 2 (weak reject), mainly because the existing evidence does not yet sufficiently demonstrate the specific role of SGASN, the independent and stable contribution of ROA, and that the downstream gains indeed stem from the recovered architecture. If the authors can provide targeted analyses using the existing experiments, I am willing to reconsider this judgment.

Q1. How does SGASN perform compared with tuned neighborhood rules or neighborhood rules with controlled edge counts? How sensitive are the results to β and γ?

Q2. How much do the file moves accepted by ROA contribute relative to the deterministic post-processing? Are the decisions stable across multiple runs? Under the same initial partitioning, how does ROA differ from SemRef?

Q3. Under the same retrieval capability and token budget, which ASNER artifact brings the improvement to LocAgent? What is it that other architecture recovery tools cannot achieve?

Q4. Why is Project ITK excluded in the cross-model generalization experiment?

Q5. In the experiment, which LLM is used for SemArc? Still GPT-3.5-turbo?

1 comment
AuthorsOpenReview ↗

Response to Reviewer eZ2r

Thank you for your detailed suggestions. Our thematic responses address the main concerns as follows:

  • W1: See Role and benefits of structured responsibility summaries (SRS) for SRS, and Stage contributions and reliability of ROA for ROA's stage contributions, repeatability, and comparison with SemRef.
  • W2/Q1: See Comparative performance and hyperparameter sensitivity of SGASN for neighborhood comparisons, edge-count-matched controls, and sensitivity; see Parameter choices and design rationale for parameter selection.
  • W3/Q3: See Downstream benefits of ASNER architectural artifacts for the artifacts provided, comparisons under matched tools and budgets, and the responsibility ablation.
  • Q2: See Stage contributions and reliability of ROA for the contributions of moves and deterministic rules, per-project action counts, and repeated runs.

ITK in the cross-model evaluation (Q4). ITK was originally excluded because its large size makes responsibility generation token-intensive and costly. We have now completed the ITK experiments with GLM-5.2 and Qwen3.8-27B. All five metrics are multiplied by 100:

ModelMoJoFMa2aARIa2aadja2a_{\mathrm{adj}}c2c@66
GLM-5.282.3287.4137.7551.8416.28
Qwen3.8-27B80.8686.8534.2849.7614.58

SemArc's model (Q5). Some baselines originally used earlier LLM versions. To control for the model, all methods requiring LLM-generated file descriptions in our main experiments use DeepSeek-V4.1-Flash. SemArc therefore does not use its original GPT-3.5-turbo configuration. Each method retains its own description organization and subsequent recovery procedure.

Local gap rule (W2). In addition to the sensitivity analysis in our thematic response, removing the local gap rule in the original Table 2 reduces macro-average ARI by 2.97 points, providing separate ablation evidence for this mechanism.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.