paper-with-me

Papers

Retrofitting Code Using LLMs to Support Exceptional Behavior

2026-09-09 · Linghan Zhong, Jiyang Zhang, Jayanth Srinivasa, Junyi Jessy Li, Milos Gligoric arxiv

Exception Related Code (ERC), which includes throw statements, conditions (if statements) that guard those throw statements, and try/catch blocks, is an essential component of software systems, allowing developers to detect and handle exceptional states that deviate from the expected program behavior. However, manually writing ERC across large codebases is tedious. We propose a novel task: retrofitting existing code with ERC. Namely, given code (without ERC) and Exceptional Behavior Tests (EBTs) (e.g., check if method throws InvalidArgumentException if null is given as the value to the argument) we aim to automatically generate missing ERC, such that the given tests pass. We design and implement Exception Coder (EXCODER) that performs context engineering to help Large Language Models (LLMs) tackle this task. EXCODER integrates static and dynamic program analysis with LLMs by providing the extracted contextual information to the LLMs. To evaluate EXCODER, we build a benchmark constructed from GitHub Java repositories, where we systematically remove ERC in 304 methods from 75 projects. Our results demonstrate that EXCODER provides an effective, though imperfect, solution to this problem in automated code generation, offering developers the first way to implement ERC following test-driven development. When combined with Qwen 2.5 Coder 32b, EXCODER achieves pass@1, 5, and 10 rates of 85.92% (12.56 percentage points over baseline), 86.18% (12.82 p.p. over baseline), and 86.51% (13.15 p.p. over baseline), respectively, on developer-written test suites. Our manual inspection of the generated code further reveals limitations of EXCODER, pointing to directions for future work.

📄 PDF Abstract BibTeX arXiv:2609.10397

Code (0)

등록된 구현이 없습니다.

Tasks

Code Generation

Similar Papers 제목 키워드 기반

Evolutionary Retrofitting

2024-10-15 · Mathurin Videau, Mariia Zameshina, Alessandro Leite, Laurent Najman 외

AfterLearnER (After Learning Evolutionary Retrofitting) consists in applying non-differentiable optimization, including evolutionary methods, to refine fully-trained machine learning models by optimizing a set of careful…

Code TranslationImage Generation

Mitigating Large Language Model Hallucinations via Autonomous Knowledge Graph-based Retrofitting

2023-11-22 · Xinyan Guan, Yanjiang Liu, Hongyu Lin, Yaojie Lu 외

Incorporating factual knowledge in knowledge graph is regarded as a promising approach for mitigating the hallucination of large language models (LLMs). Existing methods usually only use the user's input to query the kno…

HallucinationLanguage ModelingLanguage ModellingLarge Language Model

Retrofitting Distributional Embeddings to Knowledge Graphs with Functional Relations

2017-08-01 · COLING 2018 8 · Benjamin J. Lengerich, Andrew L. Maas, Christopher Potts

Knowledge graphs are a versatile framework to encode richly structured data relationships, but it can be challenging to combine these graphs with unstructured data. Methods for retrofitting pre-trained entity representat…

Knowledge Graph CompletionKnowledge Graphs

Exploiting Semantic Scene Reconstruction for Estimating Building Envelope Characteristics

2024-10-29 · Chenghao Xu, Malcolm Mielle, Antoine Laborde, Ali Waseem 외

Achieving the EU's climate neutrality goal requires retrofitting existing buildings to reduce energy use and emissions. A critical step in this process is the precise assessment of geometric building envelope characteris…

3D geometryIndoor Scene ReconstructionSurface Reconstruction

Embedding Retrofitting: Data Engineering for better RAG

2026-01-06 · Anantha Sharma arxiv

Embedding retrofitting adjusts pre-trained word vectors using knowledge graph constraints to improve domain-specific retrieval. However, the effectiveness of retrofitting depends critically on knowledge graph quality, wh…