SeqRankFL: Sequence-Aware Ranking of LLM-Based Code Representations for Statement-Level Fault Localization
Software reliability is an important part of reliability assurance for complex engineering systems, and timely fault diagnosis supports safe and continuous operation. After a test failure, statement-level fault localization ranks source-code lines for early inspection. Representation-based approaches can operate without a coverage matrix by extracting line-level hidden states from a frozen large language model for code (code LLM), but their downstream readout and training objective are not necessarily aligned with source-window ranking and buggy-version-level evaluation. We propose SeqRankFL, a sequence-aware ranker for LLM-based code representations. It combines a bidirectional long short-term memory network (BiLSTM), which follows code order within a source window, with a Hybrid objective that joins binary cross-entropy (BCE) and the listwise learning-to-rank loss ListNet. On the source-window ranking task using windows of at most 128 physical lines within known buggy files from BugsInPy and Defects4J, relative to a matched LLMAO-style Transformer+BCE reference that shares the same representations, splits, and evaluation protocol, SeqRankFL raises the equally weighted Top-1 from 51.31% to 58.58%, an absolute gain of 7.27 percentage points, with consistent improvements on both datasets. Further controlled analyses show that multi-depth layer mixing and syntax scope mainly improve average ranks, whereas control-flow/data-flow graphs and failure behavior have condition-dependent effects across models, languages, and project partitions. The controlled results identify the listwise objective as the primary driver of the Top-1 improvement, with the BiLSTM readout providing an additional architecture-dependent gain under the ranking-aware objective.
Authors
- Liandie Zhu
- Shihai Wang (ORCID: https://orcid.org/0000-0002-0241-0009)
- Bin Liu (ORCID: https://orcid.org/0009-0007-1991-360X)
- Dong An
Institutions
- Guizhou Electromechanical Research and Design Institute (CN)
- Quality and Reliability (Greece) (GR)
- Beijing Jingshida Electromechanical Equipment Research Institute (CN)
- Beihang University (CN)
Publication Details
- Journal
- Mathematics
- Published
- 2026-09-11
- DOI
- https://doi.org/10.3390/math14183297
- Primary Topic
- Software Engineering Research
- Type
- article
- Field-Weighted Citation Impact
- 0.00