Symbol Graph and Code Skeletons for Reliable AI Code Generation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

AI platforms often generate hallucinations when asked to create code due to limited understanding of the semantics and structure of a codebase, leading to inaccurate, unreliable, and inefficient code generation.

Innovation Solution

Utilize dynamically constructed symbol graphs and code skeletons to enhance the AI model's understanding of the codebase by providing grounding context, allowing it to generate code more accurately and reliably.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If an AI platform uses large language models to generate code, then the code generation speed is improved, but the accuracy and reliability deteriorate due to hallucinations

Engineering Contradiction:
Improvecode generation speedVSAvoidcode accuracy
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent introduces an intermediary processing system between the LLM and the codebase. This system constructs a symbol graph that maps relationships between code symbols and retrieves relevant code skeletons, serving as a mediator that guides the LLM to generate accurate code by providing structured context about the codebase semantics and structure

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system performs preliminary actions by constructing the symbol graph and retrieving relevant code skeletons before the LLM generates code. This pre-processing step prepares the contextual information about code symbols, relationships, and existing code structures, enabling the LLM to generate more accurate code with reduced hallucinations

Inventive Principle:
Principle #10Preliminary action

2Device complexity

If the AI model has limited understanding of codebase semantics and structure, then the system complexity is reduced, but the code generation quality deteriorates

Engineering Contradiction:
Improvesystem complexityVSAvoidcode generation quality
Core Design Contradiction:
Device complexityVSManufacturing precision

Solution Approach 1:

The patent segments the code understanding task into distinct components: symbol identification, relationship mapping through the symbol graph, and relevant code skeleton retrieval. This segmentation allows the system to progressively build understanding of codebase semantics and structure without overwhelming complexity, while improving code generation quality through structured information provision

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS20250348287A1Ai-based code generation using a dynamically constructed symbol graph and code skeletons
Publication Date: 2025.11.13 MICROSOFT TECHNOLOGY LICENSING LLC
  • US20250348287A1 patent drawing
  • US20250348287A1 patent drawing
  • US20250348287A1 patent drawing

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.