Deep Learning SQL Inference with Compacted Sequence Reconstruction
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Transformers-based models like T5 run very slow in CPU environments due to decoder operations proportional to the number of characters in the output SQL query, leading to longer inference and processing times for deep learning applications.
Innovation Solution
Develop a compacted sequence to train the deep learning model, using a post-processing method to create an uncompacted version of the predicted sequence, and implement a Short-SQL-Transform process to shorten SQL queries by removing the FROM clause and replacing column names and values with shorter alternatives.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If Transformers-based models like T5 are used for Text-2-SQL translation, then model accuracy is improved, but CPU inference time increases significantly
Solution Approach 1:
The patent segments the SQL query generation process into two distinct stages: a compacted sequence generation stage during training, and an uncompacted sequence reconstruction stage during inference. This segmentation allows the model to process simplified representations during training while reconstructing full queries during inference, resolving the contradiction between accuracy and inference time.
Solution Approach 2:
The patent applies preliminary action by pre-compacting SQL queries into pseudo-SQL format during the training phase. This preliminary transformation creates a compressed representation that the model can process efficiently, and then a post-processing step reconstructs the full SQL query from the compacted form, thereby reducing inference time while maintaining accuracy.
2Measurement precision
If the decoder runs multiple times proportional to output sequence length, then translation accuracy is improved, but processing time increases
Solution Approach 1:
The patent changes the parameter of sequence length by transforming full SQL queries into compacted pseudo-SQL sequences with significantly fewer characters. This parameter transformation reduces the number of decoder iterations required during inference, thereby increasing processing speed while maintaining translation accuracy through the post-processing reconstruction step.
3Reliability
If full SQL queries are processed directly, then query completeness is maintained, but inference time increases
Solution Approach 1:
The patent extracts and removes unnecessary components from full SQL queries to create compacted pseudo-SQL sequences. Specifically, it extracts only the essential relational information while omitting redundant elements like the FROM clause and full table schemas. This extraction reduces inference time while the post-processing step ensures query completeness is restored.
Solution Approach 2:
The patent creates a simplified copy of the SQL query in pseudo-SQL format for processing during training and inference. This copy retains the essential structural and semantic information while using a more compact representation. After processing, the full SQL query is reconstructed from this copy, thereby maintaining query completeness while reducing inference time.
Data Source
AI summary
Various embodiments are provided herein for decreasing a central processing unit (CPU) inference time, thereby shortening processing time of a deep learning model for which run-time complexity is proportional to an output sequence length. A compacted sequence is developed that is used to train the deep learning model. An output of the trained model becomes the compacted sequence on which a post-processing method operates to create an uncompacted version of a predicted sequence.


