atlas

Research map / Architectures and efficiency / Attention and transformers

BERT-Based Code Learning for Exception Localization and Type Prediction

AAAI 2025 · Architectures and efficiency › Attention and transformers · approach: Long-context KV and memory attention · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes CodeHunter, a BERT-based (CodeT5+) model with Bi-LSTM sequence labeling and self-attention weighting that localizes exception-raising code lines and predicts exception types in Java, evaluated on Nexgen, D-REX and Neurex datasets.

Problem

Identifying which lines of code may raise exceptions (exception localization) and which exception types may be raised (exception type prediction) in Java programs, which manual exception handling often gets wrong.

Approach

Casts exception localization as line-level sequence labeling over CodeT5+ embeddings with Bi-LSTM, enriched by AST-based tags and variable-name substitution; for type prediction, encodes pre-try and try-block code separately and combines them with learned self-attention weights before classification.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
use CodeHunter instead of Nexgen baselineexception localization · Nexgenaccuracy: 76.6% -> 79.7%Helped
use CodeHunter instead of Neurex baselineexception localization · Neurexaccuracy: 87.4% -> 98.6%Helped
use CodeHunter instead of D-REXexception type prediction · D-REXTop-1 accuracy: 81.09% -> 87.26%Helped
use CodeHunter instead of CodeHunter(AST) without AST parsing (ablation)exception type prediction · NexgenTop-1 accuracy: 89.21% -> 93.86%Helped
add AST parsing to Nexgen (ablation)exception localization · Nexgenaccuracy: 75.3% -> 76.6%Helped
add variable-name substitution to Nexgen (ablation)exception localization · Nexgenaccuracy: 74.7% -> 75.3%Helped
add AST parsing and variable-name substitution to Nexgen (ablation)exception localization · Nexgenaccuracy: 74.7% -> 76.6%Helped
add AST parsing to CodeHunter (ablation)exception localization · Nexgenaccuracy: 76.9% -> 79.7%Helped

Surprising findings

Limitations

Experimental setup

Datasets: Nexgen D-REX Neurex

Benchmarks: Nexgen D-REX Neurex

Metrics: accuracy precision recall F1 Top-K accuracy

Baselines: D-REX Nexgen M-E-F Neurex CodeHunter(AST)

Builds on: CodeT5+ Bi-LSTM Deep Structured Semantic Model

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy