AI Code Generation Using Symbol Graphs and Code Skeletons

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing AI platforms generate code hallucinations due to limited understanding of codebase semantics and structure, leading to inaccuracies, inefficiencies, and reduced reliability.

Innovation Solution

Utilize dynamically constructed symbol graphs and code skeletons to enhance AI model understanding by providing grounding context, selecting relevant symbols, and generating code that accurately reflects requested functionality.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If LLMs are used to generate code from complex or unique codebases, then code generation capability is provided, but hallucinations occur due to limited understanding of codebase semantics and structure

Engineering Contradiction:
Improvecode generation capabilityVSAvoidaccuracy of generated code
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The system performs preliminary analysis of the codebase to construct a symbol graph and extract code skeletons before code generation. This preliminary action provides the LLM with structured context about the codebase semantics and relationships, enabling more accurate code generation without hallucinations.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces an intermediary processing layer between the LLM and the codebase. This layer constructs symbol graphs and extracts code skeletons that serve as mediators, translating complex codebase structures into formats the LLM can understand and use for accurate code generation.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If more context from the codebase is provided to the AI model, then understanding of semantics and structure improves, but processing time and computational resources increase

Engineering Contradiction:
Improveunderstanding of codebase semanticsVSAvoidcode generation time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system extracts only the essential and relevant information from the codebase - specifically symbol relationships and code skeletons - rather than providing the entire codebase context. This extraction provides sufficient semantic understanding while minimizing processing time and computational overhead.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The codebase context is segmented into discrete, meaningful units (symbol graphs and code skeletons) rather than providing raw, unprocessed code. This segmentation organizes information efficiently, allowing the AI model to process only the essential structural and semantic relationships needed for accurate code generation.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentEP4647896A1Ai-based code generation using a dynamically constructed symbol graph and code skeletons
Publication Date: 2025.11.12 MICROSOFT TECHNOLOGY LICENSING LLC
  • EP4647896A1 patent drawingFigure 1
  • EP4647896A1 patent drawingFigure 2
  • EP4647896A1 patent drawingFigure 3

AI summary

Techniques are described herein that are capable of performing AI-based code generation using a dynamically constructed symbol graph and code skeletons. A query, which requests code, is received. A symbol graph, which maps relationships between subsets of a symbol corpus, is dynamically constructed. Symbols are selected from the symbol corpus based on relevancy to the user-generated query. Code skeletons associated with the symbols are retrieved. An AI model is caused to generate at least a portion of the code from at least a subset of the symbols by providing an AI prompt, which requests the code, together with the code skeletons as inputs to the AI model. A response to the AI prompt, including at least the portion of the code, is received from the AI model. Presentation of a response to the query is triggered. The response to the query includes at least the portion of the code.