arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.06185cs.SEcs.AIcs.CL
收藏

注意力机制与启发式方法:基于多头自注意力的上下文感知文件排序

Attention Mechanism and Heuristic Approach: Context-Aware File Ranking Using Multi-Head Self-Attention

Persistent System(Persistent Systems公司)

Pradeep Kumar Sharma, Shantanu Godbole, Sarada Prasad Jena, Hritvik Shrivastava

AI总结:

本文提出基于多头自注意力机制的上下文感知文件排序方法,通过动态调整特征重要性提升召回率,改进仓库感知的努力估计

摘要:

在软件仓库中识别和排序受影响的文件是变更影响分析中的关键挑战。现有的确定性方法结合了启发式信号、语义相似性度量和基于图的中心性度量,已在缩小候选搜索空间方面表现出有效性,但其召回率趋于平缓。这一限制源于将特征视为线性独立贡献者的处理方式,忽略了特征之间以及度量之间的上下文依赖性和关系,这些关系刻画了专家的推理模式。为了解决这一限制,我们提出将多头自注意力机制作为后确定性评分细化机制的应用。我们的方法学习特征之间的上下文加权,根据候选文件集中的关系行为动态调整每个文件的重要性级别。注意力机制产生的上下文感知调整与确定性评分相加,保留了可解释性,同时使推理能力接近专家在审查变更表面时所进行的推理。我们关注召回率而非精确率,因为遗漏受影响的文件(假阴性)的成本远高于误判无关文件(假阳性)的成本。在200个测试用例上的实证评估表明,引入自注意力机制使Top-50的召回率从约62-65%提高到78-82%,具体取决于仓库的复杂性和结构,达到Top-50文件的80%召回率。专家验证显示,主观准确性对齐从6.5/10提高到8.6/10。这种转变弥合了确定性自动化与专家判断之间的推理能力差距,提高了仓库感知的努力估计的召回率。

英文摘要:

The identification and ranking of impacted files within software reposi-tories is a key challenge in change impact analysis. Existing deterministic approaches that combine heuristic signals, semantic similarity measures, and graph-based centrality metrics have demonstrated effectiveness in nar-rowing candidate search spaces, yet their recall plateaus. This limitation stems from the treatment of features as linearly independent contributors, ignoring contextual dependencies and relationships between metrics that characterize expert reasoning patterns. To address this limitation, we propose the application of Multi-Head Self-Attention as a post-deterministic scoring refinement mechanism. Our approach learns contextual weighting between features, dynamically adjust-ing importance levels per file based on relational behavior exhibited across candidate file sets. The attention mechanism produces context-aware adjustments that are additively combined with deterministic scores, pre-serving interpretability while enabling reasoning similar to that performed by experts when reviewing change surfaces. We focus on recall rather than precision, as false negatives (missing impacted files) are far more costly than false positives (irrelevant files that can be quickly dismissed during review). Empirical evaluation on 200 test cases demonstrates that the introduc-tion of self-attention improves Top-50 recall from approximately 62-65% to between 78-82% depending on repository complexity and structure, achiev-ing 80% recall at Top-50 files. Expert validation yields improvement from 6.5/10 to 8.6/10 in subjective accuracy alignment. This transformation bridges the reasoning capability gap between deterministic automation and expert judgment, improving recall in repository-aware effort estimation.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑