mlsanityData to 7 Oct 2026

FLAG: Finding Line Anomalies (in code) with Generative AI

arXiv 2306.12643 ↗First posted 22 Jun 2023cs.CR cs.AI cs.SEcited by 7

Not on the map. Why?

Abstract (arXiv)

Code contains security and functional bugs. The process of identifying and localizing them is difficult and relies on human labor. In this work, we present a novel approach (FLAG) to assist human debuggers. FLAG is based on the lexical capabilities of generative AI, specifically, Large Language Models (LLMs). Here, we input a code file then extract and regenerate each line within that file for self-comparison. By comparing the original code with an LLM-generated alternative, we can flag notable differences as anomalies for further inspection, with features such as distance from comments and LLM confidence also aiding this classification. This reduces the inspection search space for the designer. Unlike other automated approaches in this area, FLAG is language-agnostic, can work on incomplete (and even non-compiling) code and requires no creation of security properties, functional tests or definition of rules. In this work, we explore the features that help LLMs in this classification and evaluate the performance of FLAG on known bugs. We use 121 benchmarks across C, Python and Verilog; with each benchmark containing a known security or functional weakness. We conduct the experiments using two state of the art LLMs in OpenAI's code-davinci-002 and gpt-3.5-turbo, but our approach may be used by other models. FLAG can identify 101 of the defects and helps reduce the search space to 12-17% of source code.

Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 11 of its 42 references that are in the map. First posted on arXiv 22 Jun 2023.

Builds on

11 of 42 references.

References · 11

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  4. 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
  5. 2021Examining Zero-Shot Vulnerability Repair with Large Language Modelscited by 105
  6. 2022Lost at C: A User Study on the Security Implications of Large Language Model Code Assistantscited by 87
  7. 2018DeepBugs: A Learning Approach to Name-based Bug Detectioncited by 65
  8. 2023Large Language Models are Edge-Case Fuzzers: Testing Deep Learning Libraries via FuzzGPTcited by 36
  9. 2023Fixing Hardware Security Bugs with Large Language Modelscited by 24
  10. 2023Nuances are the Key: Unlocking ChatGPT to Find Failure-Inducing Tests with Differential Promptingcited by 23
  11. 2018Entropy Guided Spectrum Based Bug Localization Using Statistical Language Modelcited by 4

Built on by

Cited by year

Citing papers per year: 2024: 5; 2025: 2.

7 papers.