LLM Patch Analysis for Security Rule Guided Bug Detection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current methods are unable to autonomously interpret and utilize patches to update software, and static/dynamic code analysis is limited in detecting bugs due to path explosion and hardware restrictions, respectively.

Innovation Solution

A processor set uses a large language model to analyze patches, identify security rules, and generate prompts for target code segments to detect bugs autonomously, leveraging machine learning to identify affected code contexts and potential vulnerabilities.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If static code analysis is used to detect bugs, then comprehensive code coverage is achieved, but path explosion occurs making analysis intractable

Engineering Contradiction:
Improvebug detection capabilityVSAvoidanalysis complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent segments the codebase into function-level units and uses hierarchical analysis, where the LLM first identifies security rules at the function level, then applies them to specific target code segments. This segmentation prevents path explosion by analyzing code in manageable chunks rather than attempting exhaustive whole-program analysis.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces security rules as an intermediary layer between the LLM and the code analysis process. The LLM generates security rules from patch descriptions, which then serve as intermediaries to guide the detection of vulnerable code patterns, reducing the complexity of direct code analysis.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If dynamic code analysis is used to detect bugs, then execution paths are tested, but hardware restrictions limit coverage

Engineering Contradiction:
Improvebug detection capabilityVSAvoidcomputational resources
Core Design Contradiction:
Measurement precisionVSQuantity of substance

Solution Approach 1:

The patent performs preliminary action by using the LLM to generate security rules and identify vulnerable patterns before actual code execution. This allows the system to pinpoint specific high-risk code segments that need dynamic testing, reducing the overall computational resources required compared to exhaustive dynamic analysis.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent applies partial action by focusing dynamic analysis only on identified vulnerable code segments rather than executing all possible paths. The LLM identifies a subset of critical code segments that require detailed examination, reducing hardware requirements while maintaining effective bug detection.

Inventive Principle:
Principle #16Partial or excessive action

3Reliability

If manual patch interpretation is used, then security expertise is applied, but automation is lost requiring human intervention

Engineering Contradiction:
Improvesecurity analysis accuracyVSAvoidautonomous bug detection
Core Design Contradiction:
ReliabilityVSExtent of automation

Solution Approach 1:

The patent implements self-service by enabling the LLM to autonomously generate security rules from patch descriptions and automatically apply these rules to identify vulnerable code segments. The system serves itself by using the patch information to create its own detection criteria without requiring manual rule creation or human intervention at each step.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent uses feedback by training the LLM on patch descriptions and security rules, where the outcomes of bug detection feed back into improving the rule generation process. The system learns from identified vulnerabilities and refines its security rules, increasing both automation capability and reliability over time.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS20260017174A1Detecting bugs using large language models
Publication Date: 2026.01.15 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US20260017174A1 patent drawing
  • US20260017174A1 patent drawing
  • US20260017174A1 patent drawing

AI summary

A computer-implemented method for detecting bugs in an application. A processor set receives a patch for fixing one or more bugs in the application. The processor set analyzes the patch to identify security rules violated by the one or more bugs using a large language model. The processor set identifies code contexts associated with code segments in the patch. The code segments are responsible for the one or more bugs in the application. The processor set identifies a number of target code segments in the application that are potentially affected by the one or more bugs. The processor set generates a prompt for the large language model for each target code segment in the number of target code segments to detect other bugs in the application. The prompt is generated based on security rules, the code contexts, and the number of target code segments in the application.