# US 2023/0419036 A1 · Random token segmentation for training next token prediction models

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0419036 A1
- Document ID: US20230419036A1
- Status: Published application
- Kind: A1
- Application number: 17/847,118
- Filed: 2022-06-22
- Published: 2023-12-28
- Earliest claimed: 2022-06-22
- Assignees: Amazon Technologies, Inc.
- Applicants: Amazon Technologies, Inc.
- Inventors: Zijian Wang; Yuchen Tian; Mingyue Shang; Praphruetpong Athiwaratkun; Ming Tan; Parminder Bhatia; Andrew Oliver Arnold; Ramesh M Nallapati; Sudipta Sengupta; Bing Xiang; Atul Deo; Ankur Deepak Desai
- Web page: https://patentgrep.com/patent/US20230419036A1

## CPC

- G06F 8/33: Intelligent editors
- G06F 40/284: Lexical analysis, e.g. tokenisation or collocates
- G06F 8/30: Creation or generation of source code
- G06F 8/427: {Parsing}
- G06F 8/75: Structural analysis for program understanding
- G06F 40/279: Recognition of textual entities
- G06N 3/0455: Auto-encoder networks; Encoder-decoder networks
- G06N 3/0475: Generative networks
- G06N 3/08: Learning methods
- G06N 20/00: Machine learning
- G06N 3/0442: characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

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.

## Claims

### Claim 1

A system, comprising:
at least one processor; and
a memory, storing program instructions that when executed by the at least one processor, cause the at least one processor to implement a machine learning system, configured to:
receive programming code for training a machine learning model to predict a next programming code token given input programming code tokens;
parse the programming code to determine a plurality of tokens from the programming code;
randomly segment different ones of the plurality of tokens into respective pluralities of sub-tokens; and
train the machine learning model to predict the next programming code token given the programming code token inputs using the plurality of tokens including the respective pluralities of sub-tokens as a training data set.

### Claim 2 (depends on 1)

The system of claim 1, wherein the random segmentation of different ones of the token is performed according to a sub-word regularization technique.

### Claim 3 (depends on 1)

The system of claim 1, wherein the machine learning model is a pre-trained machine learning model.

### Claim 4 (depends on 1)

The system of claim 1, wherein the machine learning system is implemented as part of a code development service offered by a provider network to train the machine learning model for generating code suggestions.

### Claim 5

A method, comprising:
receiving, at a machine learning system, text data for training a machine learning model to predict a next text token given input text tokens;
determining, by the machine learning system, a plurality of tokens from the text data;
randomly, by the machine learning system, segmenting different ones of the plurality of tokens into respective pluralities of sub-tokens; and
training, by the machine learning system, the machine learning model to predict the next text token given the input text tokens using the plurality of tokens including the respective pluralities of sub-tokens as a training data set.

### Claim 6 (depends on 5)

The method of claim 5, wherein the random segmentation of different ones of the token is performed according to a sub-word regularization technique.

### Claim 7 (depends on 5)

The method of claim 5, wherein the machine learning model is a pre-trained machine learning model.

### Claim 8 (depends on 5)

The method of claim 5, wherein the text data is code written in a programming language and wherein the next text token and input text tokens are respective programming code tokens.

### Claim 9 (depends on 8)

The method of claim 8, wherein the determining the plurality of tokens from the text data and the randomly segmenting different ones of the plurality of tokens into respective pluralities of sub-tokens are performed by a tokenizer, wherein the tokenizer is applicable for training a second machine learning model for predicting next code tokens in a second programming language.

### Claim 10 (depends on 5)

The method of claim 5, further comprising storing the trained machine learning model in a location specified in request to train the machine learning model.

### Claim 11 (depends on 5)

The method of claim 5, further comprising causing the trained machine learning model to be deployed as part of an auto-completion application.

### Claim 12 (depends on 5)

The method of claim 5, wherein the machine learning system is implemented as part of a code development service offered by a provider network to train the machine learning model for generating code suggestions.

### Claim 13

One or more non-transitory, computer-readable storage media, storing program instructions that when executed on or across one or more computing devices cause the one or more computing devices to implement:
receiving a text data for training a machine learning model to predict a next text token given input text tokens;
determining a plurality of tokens from the text data;
randomly segmenting different ones of the plurality of tokens into respective pluralities of sub-tokens; and
causing training of the machine learning model to predict the next text token given the input text tokens using the plurality of tokens including the respective pluralities of sub-tokens as a training data set.

### Claim 14 (depends on 13)

The one or more non-transitory, computer-readable storage media of claim 13, wherein the random segmentation of different ones of the token is performed according to a sub-word regularization technique.

### Claim 15 (depends on 13)

The one or more non-transitory, computer-readable storage media of claim 13, wherein the machine learning model is a pre-trained machine learning model.

### Claim 16 (depends on 13)

The one or more non-transitory, computer-readable storage media of claim 13, wherein the text data is code written in a programming language and wherein the next text token and input text tokens are respective programming code tokens.

### Claim 17 (depends on 16)

The one or more non-transitory, computer-readable storage media of claim 16, wherein the determining the plurality of tokens from the text data and the randomly segmenting different ones of the plurality of tokens into respective pluralities of sub-tokens are performed by a tokenizer, wherein the tokenizer is applicable for training a second machine learning model for predicting next code tokens in a second programming language.

### Claim 18 (depends on 13)

The one or more non-transitory, computer-readable storage media of claim 13, storing further program instructions that when executed on or across the one or more computing devices, cause the one or more computing devices to further implement storing the trained machine learning model in a location specified in request to train the machine learning model.

### Claim 19 (depends on 13)

The one or more non-transitory, computer-readable storage media of claim 13, storing further program instructions that when executed on or across the one or more computing devices, cause the one or more computing devices to further implement causing the trained machine learning model to be deployed as part of an auto-completion application.

### Claim 20 (depends on 13)

The one or more non-transitory, computer-readable storage media of claim 13, wherein the machine learning system is implemented as part of a code development service offered by a provider network to train the machine learning model for generating code suggestions.
