Abstract Syntax Tree Node Scoring for ML Explainability

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing machine learning explainability techniques face challenges in generating concise, user-friendly, and unambiguous natural language explanations for complex source code, particularly for large abstract syntax trees, due to the need to process irrelevant nodes and maintain syntactic context, which is computationally inefficient and often requires training generative models.

Innovation Solution

A framework that generates textual explanations by analyzing relevance scores and syntactic structures of abstract syntax trees, involving node scoring, grouping, and contextualization, to produce a simplified graph and natural language explanations without requiring training a generative model, focusing on relevant nodes and syntactic groups.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of information

If all nodes in a large abstract syntax tree are processed to generate explanations, then completeness of explanation is improved, but computational efficiency deteriorates

Engineering Contradiction:
Improvecompleteness of explanationVSAvoidcomputational efficiency
Core Design Contradiction:
Loss of informationVSProductivity

Solution Approach 1:

The patent segments the abstract syntax tree into syntactic groups (e.g., SELECT clause, FROM clause, WHERE clause) and processes each group separately. This allows the system to focus computational resources on relevant portions of the query rather than processing every node uniformly, thereby maintaining explanation completeness while improving computational efficiency.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent extracts and identifies relevant nodes within the abstract syntax tree that significantly contribute to the machine learning model's inference. By taking out only these relevant nodes and their corresponding syntactic groups for detailed processing, the system avoids the computational overhead of processing all nodes while preserving the essential explanatory information.

Inventive Principle:
Principle #2Taking out (Extraction)

2Productivity

If irrelevant nodes are filtered out to improve computational efficiency, then productivity is improved, but explanation quality may deteriorate

Engineering Contradiction:
Improvecomputational efficiencyVSAvoidexplanation quality
Core Design Contradiction:
ProductivityVSLoss of information

Solution Approach 1:

The patent employs relevance scores that provide feedback on the importance of each node in the abstract syntax tree. These scores are used to guide the filtering process, ensuring that nodes with high relevance (those that significantly contribute to the model's inference) are retained for explanation generation, while low-relevance nodes are efficiently filtered out. This feedback mechanism preserves explanation quality while improving computational efficiency.

Inventive Principle:
Principle #23Feedback

3Ease of operation

If syntactic context is maintained for all nodes, then interpretability is improved, but device complexity increases

Engineering Contradiction:
ImproveinterpretabilityVSAvoidsystem complexity
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The patent segments the abstract syntax tree into meaningful syntactic groups (such as SELECT clause, FROM clause, WHERE clause, JOIN clauses) and maintains context at this grouped level rather than at the individual node level. This segmentation approach preserves the syntactic context necessary for interpretability while reducing the overall system complexity by working with fewer, more manageable units.

Inventive Principle:
Principle #1Segmentation

4Loss of information

If generative models are trained to produce explanations, then explanation quality is improved, but loss of time and resources increases

Engineering Contradiction:
Improveexplanation qualityVSAvoidtraining time
Core Design Contradiction:
Loss of informationVSLoss of time

Solution Approach 1:

Instead of training complex generative models, the patent uses a rule-based approach that copies and templates predefined explanation patterns based on the identified syntactic groups and relevant nodes. This copying mechanism generates high-quality explanations by reusing proven explanation templates, avoiding the time-consuming and resource-intensive process of training generative models while maintaining explanation quality.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS12260306B2Textual explanations for abstract syntax trees with scored nodes
Publication Date: 2025.03.25 ORACLE INT CORP
  • US12260306B2 patent drawing
  • US12260306B2 patent drawing
  • US12260306B2 patent drawing

AI summary

Herein is a machine learning (ML) explainability (MLX) approach in which a natural language explanation is generated based on analysis of a parse tree such as for a suspicious database query or web browser JavaScript. In an embodiment, a computer selects, based on a respective relevance score for each non-leaf node in a parse tree of a statement, a relevant subset of non-leaf nodes. The non-leaf nodes are grouped in the parse tree into groups that represent respective portions of the statement. Based on a relevant subset of the groups that contain at least one non-leaf node in the relevant subset of non-leaf nodes, a natural language explanation of why the statement is anomalous is generated.