Random Token Segmentation for Partial-Token Code Prediction

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing code development tools face challenges in providing high-quality and timely code suggestions due to latency issues and inefficiencies in training data sets, particularly when dealing with partial tokens and sub-word scenarios, which disrupt user workflow and compromise suggestion accuracy.

Innovation Solution

Implementing techniques such as proactive validation of code suggestions, constrained pre-fix matching, random token segmentation, and high-quality evaluation data set generation to enhance the accuracy and speed of code suggestions, including the use of Generative Pre-trained Transformer models and pagination to manage latency.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If traditional tokenization methods are used for training data sets, then the model can process complete tokens, but it fails to handle partial tokens and sub-word scenarios effectively, reducing suggestion accuracy

Engineering Contradiction:
Improvesuggestion accuracyVSAvoidhandling partial token scenarios
Core Design Contradiction:
Measurement precisionVSAdaptability or versatility

Solution Approach 1:

The patent applies segmentation by dividing tokens into sub-word units using techniques like Word Piece tokenization. This allows the model to process partial tokens and sub-word scenarios by breaking down complete tokens into smaller, manageable segments that can be recombined during code suggestion generation, thereby improving both accuracy and adaptability to partial input scenarios

Inventive Principle:
Principle #1Segmentation

2Speed

If code suggestions are generated in real-time, then user workflow is maintained, but latency issues arise that compromise suggestion quality and timeliness

Engineering Contradiction:
Improvesuggestion delivery speedVSAvoidsuggestion quality
Core Design Contradiction:
SpeedVSReliability

Solution Approach 1:

The patent implements preliminary action by proactively generating and validating code suggestions before the user actually needs them. The system pre-computes suggestions during idle periods or when context allows, validates them in advance, and stores them for immediate retrieval. This approach maintains real-time responsiveness while ensuring high-quality, pre-validated suggestions are delivered without compromising either speed or reliability

Inventive Principle:
Principle #10Preliminary action

3Measurement precision

If comprehensive training data sets are used to improve model accuracy, then suggestion quality increases, but training time and computational resources increase, affecting productivity

Engineering Contradiction:
Improvemodel accuracyVSAvoidtraining efficiency
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent applies the extraction principle by selectively filtering and curating training data to extract only the most relevant and high-quality code examples. Instead of using comprehensive but noisy data sets, the system extracts refined subsets of training data that maintain model accuracy while significantly reducing training time and computational resource requirements, thereby improving training efficiency without sacrificing suggestion quality

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS12530527B2Random token segmentation for training next token prediction models
Publication Date: 2026.01.20 AMAZON TECH INC
  • US12530527B2 patent drawing
  • US12530527B2 patent drawing
  • US12530527B2 patent drawing

AI summary

Random token segmentation may be implemented for next token prediction. Text data may be received for training a machine learning model to predict a next token given input text tokens. Multiple tokens may be determined from the text data. Different ones of the multiple token may be randomly segmented in to sub-tokens. The machine learning model may then be trained using the multiple tokens including the respective sub-tokens as a training data set.