ConceptioArchiveGoogle Patents
Google Patentsopen access

Methods and systems for prompting large language model to process inputs from … — Shopify Inc. (US20250356111A1)

Shopify Inc. · Google Patents
Google Patents · Patents · License: Open Access
Open Source ↗
shopifyinc.
patent, google patents, intellectual property, US20250356111A1, Shopify Inc., Daniel Beauchamp, en, 2025

ABSTRACT

Abstract

Methods and systems for prompting a large language model (LLM) to process inputs from multiple user elements to generate a revised block of text are described. One or more text-editing instructions related to respective one or more selected text portions in a block of text are received. A prompt is generated for a LLM to generate a revised block of text, the prompt including at least a portion of an annotated block of text, the annotated block of text including each text-editing instruction inserted into the block of text relative to each respective selected text portion. The prompt is provided to the LLM and a revised block of text is received and outputted.

Description

CROSS-REFERENCE TO RELATED APPLICATIONS

The present disclosure is a continuation of U.S. patent application Ser. No. 18/186,472, filed Mar. 20, 2023, entitled “METHODS AND SYSTEMS FOR PROMPTING LARGE LANGUAGE MODEL TO PROCESS INPUTS FROM MULTIPLE USER ELEMENTS”, which claims priority from U.S. provisional patent application No. 63/483,671, filed Feb. 7, 2023, entitled “METHODS AND SYSTEMS FOR PROMPTING LARGE LANGUAGE MODEL TO PROCESS INPUTS FROM MULTIPLE USER ELEMENTS”, and U.S. provisional patent application No. 63/482,406, filed Jan. 31, 2023, entitled “METHODS AND SYSTEMS FOR PROMPTING LARGE LANGUAGE MODEL TO PROCESS INPUTS FROM MULTIPLE USER ELEMENTS”, the entireties of which are hereby incorporated by reference.

FIELD

The present disclosure relates to machine learning, and, more particularly, to generation of prompts to large language models (LLMs), and, yet more particularly, to prompting an LLM to process inputs from multiple user elements to generate text.

BACKGROUND

A large language model (LLM) is a type of machine learning (ML) model that is capable of generating text output, including natural language text output. A LLM may be provided with a prompt, which may be a natural language instruction that instructs the LLM to generate a desired output, including natural language text or other generative output in various desired formats.

SUMMARY

Online services for revising a block of text are provided. Some such services employ machine learning (ML). In some existing machine learning (ML)-based services for revising a block of text, the user is typically limited to providing general instructions for the revision (e.g., simplifying, summarizing, expanding, rephrasing) of the entirety of the block of text. The options for what instructions can be provided for revising the text are also typically limited (e.g., restricted to choosing from a set list of possible instructions like “simplify” or “summarize”) and may be unintuitive to a user.

Conventionally, ML-based text revision services do not allow the user to provide more specific stylistic instructions (e.g., “make this quirkier”). As well, conventionally, each editing instruction from the user is processed by the ML-based service in isolation, which can be inefficient and/or may result in inconsistencies in the revised text. Additionally, providing revision instructions one-by-one may result in poor model performance both in terms of speed (multiple revisions of the text need to be generated by the model) and quality (e.g., on a subsequent revision the model may rewrite a part of the text that reverses a prior editing instruction).

In various examples, the present disclosure describes a technical solution that enables one or more text-editing instructions to be included in a prompt to a large language model (LLM), to output a revised block of text. In some examples, multiple text-editing instructions may be included in a single prompt. By combining multiple editing instructions into a single prompt to the LLM, improved computational efficiency can be achieved. The LLM only needs to process the single prompt, which requires less processing power and less time compared to processing multiple prompts.

Another technical advantage is that by providing context to the editing instructions in a prompt, the LLM may generate text output that is more cohesive and relevant (e.g., in terms of style and content), because the LLM can extract more contextual information from a longer text block. Additionally, when multiple editing instructions are included in the prompt, the LLM may better satisfy the editing instructions (rather than possibly reversing a prior instruction when processing a later instruction).

User interactions may also be improved because there is only one prompt being processed and thus only one latency period to receive the revised text. The user may be able to view all the changes together.

In some examples, the present disclosure provides a text-editing user interface (UI). The UI provided for inputting text-editing instructions by the user may also be more intuitive compared to some existing ML-based text editors.

In some examples, if a block of text is too long to be inputted to the LLM as a single prompt (e.g., the maximum number of tokens accepted by the LLM would be exceeded), windowing can be used to ensure that editing instructions are provided with contextual information in a prompt to the LLM. The skilled person will recognize that a “block” of text, as used in the present disclosure, refers to a sequence of characters. Such a sequence may also be referred to as a run, a span, a paragraph, a segment, a passage, etc. A block of text may comprise one or more (sub-)blocks of text, which may themselves also be blocks of text. Additionally or alternatively, a block of text may contain formatting information (e.g. alignment, font, weight, etc.). Such formatting information may be included in the prompt or otherwise inset in the block of text (e.g. using a markup language such as HTML), may be inputted to the LLM out-of-band (e.g. via an interface that is not a prompt), may be stripped from the block of text before inputted into an LLM, and/or may be constituted or reconstituted in the block of text after it is returned from the LLM. Furthermore, the skilled person will recognize that the relationship between one group of blocks of text and another group of blocks of text may not necessarily be one-to-one. For example, the relationship between “revised” or “annotated” blocks of text and blocks of text (simpliciter) may be a one-to-many, a many-to-one, or a many-to-many relationship.

In various examples, the present disclosure describes a technical solution that may be provided by a platform (e.g., SaaS platform). The platform may serve as an interface layer between a user device and the LLM, to improve accessibility to the LLM.

In an example aspect, the present disclosure describes a computing system including a processing unit configured to execute computer-readable instructions to cause the system to: receive one or more text-editing instructions related to respective one or more selected text portions in a block of text; generate a prompt to a large language model (LLM) to generate a revised block of text, the prompt including at least a portion of an annotated block of text, the annotated block of text including each text-editing instruction inserted into the block of text relative to each respective selected text portion; provide the prompt to the LLM and receive a revised block of text; and output the revised block of text.

In an example of the preceding example system, the processing unit may be configured to execute instructions to further cause the system to: provide, to a user device, a text-editing user interface (UI) for editing the block of text, the text-editing UI enabling user input of the one or more text-editing instructions related to the one or more selected text portions; wherein the one or more text-editing instructions are received from the user device; and wherein the revised block of text is outputted to the user device.

In an example of the preceding example system, the revised block of text may be outputted for display via the text-editing UI.

In an example of any of the preceding example systems, the processing unit may be configured to execute computer-readable instructions to further cause the system to generate the prompt by: parsing the received one or more text-editing instructions to identify one text-editing instruction that is related to a respective selected text portion, the identified text-editing instruction containing a predefined keyword indicating the identified text-editing instruction should be applied elsewhere in the block of text; identifying at least one other text portion in the block of text based on a match with the respective selected text portion that is related to the identified text-editing instructions; annotating both the respective selected text portion that is related to the identified text-editing instructions and the identified at least one other text portion with the identified text-editing instruction; and including the annotated block of text in the prompt.

In an example of any of the preceding example systems, the processing unit may be configured to execute computer-readable instructions to further cause the system to: generate the prompt including at least the portion of the annotated block of text, the prompt also including an instruction to cause the LLM to further annotate the annotated block of text in accordance with at least one inserted text-editing instruction; provide the prompt to the LLM and receive a further annotated block of text; generate a further prompt to the LLM including the further annotated block of text; and provide the further prompt to the LLM and receive the revised block of text.

In an example of any of the preceding example systems, the processing unit may be configured to execute computer-readable instructions to further cause the system to generate the prompt by: selecting the portion of the annotated block of text for inclusion in the prompt, the selected portion including at least one inserted text-editing instruction and a defined amount of text preceding or following the at least one inserted text-editing instruction; and including only the selected portion of the annotated block of text in the prompt.

In an example of the preceding example system, the selected portion of the annotated block of text may be selected using a window defining a maximum number of sentences preceding the at least one inserted text-editing instruction and defining a maximum number of sentences following the at least one inserted text-editing instruction.

In an example of some of the preceding example systems, the processing unit may be configured to execute computer-readable instructions to further cause the system to: calculate an estimated token number for the annotated block of text; and responsive to the estimated token number exceeding a defined maximum token number, generate the prompt using the selecting and including.

In an example of any of the preceding example systems, the processing unit may be configured to execute computer-readable instructions to further cause the system to generate the prompt by: parsing the received one or more text-editing instructions to identify one text-editing instruction that is indicated as a high priority instruction related to a respective selected text portion; annotating the block of text to insert the high priority instruction relative to the respective selected text portion and include a defined annotation to indicate higher priority; and including the annotated block of text in the prompt.

In another example aspect, the present disclosure describes a computer-implemented method including: receiving one or more text-editing instructions related to respective one or more selected text portions in a block of text; generating a prompt to a large language model (LLM) to generate a revised block of text, the prompt including at least a portion of an annotated block of text, the annotated block of text including each text-editing instruction inserted into the block of text relative to each respective selected text portion; providing the prompt to the LLM and receive a revised block of text; and outputting the revised block of text.

In an example of the preceding example method, the method may include: providing, to a user device, a text-editing user interface (UI) for editing the block of text, the text-editing UI enabling user input of the one or more text-editing instructions related to the one or more selected text portions; wherein the one or more text-editing instructions are received from the user device; and wherein the revised block of text is outputted to the user device.

In an example of the preceding example method, the revised block of text may be outputted for display via the text-editing UI.

In an example of any of the preceding example methods, generating the prompt may include: parsing the received one or more text-editing instructions to identify one text-editing instruction that is related to a respective selected text portion, the identified text-editing instruction containing a predefined keyword indicating the identified text-editing instruction should be applied elsewhere in the block of text; identifying at least one other text portion in the block of text based on a match with the respective selected text portion that is related to the identified text-editing instructions; annotating both the respective selected text portion that is related to the identified text-editing instructions and the identified at least one other text portion with the identified text-editing instruction; and including the annotated block of text in the prompt.

In an example of any of the preceding example methods, the method may include: generating the prompt including at least the portion of the annotated block of text, the prompt also including an instruction to cause the LLM to further annotate the annotated block of text in accordance with at least one inserted text-editing instruction; providing the prompt to the LLM and receive a further annotated block of text; generating a further prompt to the LLM including the further annotated block of text; and providing the further prompt to the LLM and receive the revised block of text.

In an example of any of the preceding example methods, generating the prompt may include: selecting the portion of the annotated block of text for inclusion in the prompt, the selected portion including at least one inserted text-editing instruction and a defined amount of text preceding or following the at least one inserted text-editing instruction; and including only the selected portion of the annotated block of text in the prompt.

In an example of the preceding example method, the selected portion of the annotated block of text may be selected using a window defining a maximum number of sentences preceding the at least one inserted text-editing instruction and defining a maximum number of sentences following the at least one inserted text-editing instruction.

In an example of some of the preceding example methods, the method may include: calculating an estimated token number for the annotated block of text; and responsive to the estimated token number exceeding a defined maximum token number, generating the prompt using the selecting and including.

In an example of any of the preceding example methods, generating the prompt may include: parsing the received one or more text-editing instructions to identify one text-editing instruction that is indicated as a high priority instruction related to a respective selected text portion; annotating the block of text to insert the high priority instruction relative to the respective selected text portion and include a defined annotation to indicate higher priority; and including the annotated block of text in the prompt.

In another example aspect, the present disclosure describes a non-transitory computer readable medium storing computer-executable instructions thereon, wherein the instructions are executable by a processing unit of a system to cause the system to: receive one or more text-editing instructions related to respective one or more selected text porti

CROSS-REFERENCE TO RELATED APPLICATIONS

The present disclosure is a continuation of U.S. patent application Ser. No. 18/186,472, filed Mar. 20, 2023, entitled “METHODS AND SYSTEMS FOR PROMPTING LARGE LANGUAGE MODEL TO PROCESS INPUTS FROM MULTIPLE USER ELEMENTS”, which claims priority from U.S. provisional patent application No. 63/483,671, filed Feb. 7, 2023, entitled “METHODS AND SYSTEMS FOR PROMPTING LARGE LANGUAGE MODEL TO PROCESS INPUTS FROM MULTIPLE USER ELEMENTS”, and U.S. provisional patent application No. 63/482,406, filed Jan. 31, 2023, entitled “METHODS AND SYSTEMS FOR PROMPTING LARGE LANGUAGE MODEL TO PROCESS INPUTS FROM MULTIPLE USER ELEMENTS”, the entireties of which are hereby incorporated by reference.

FIELD

The present disclosure relates to machine learning, and, more particularly, to generation of prompts to large language models (LLMs), and, yet more particularly, to prompting an LLM to process inputs from multiple user elements to generate text.

BACKGROUND

A large language model (LLM) is a type of machine learning (ML) model that is capable of generating text output, including natural language text output. A LLM may be provided with a prompt, which may be a natural language instruction that instructs the LLM to generate a desired output, including natural language text or other generative output in various desired formats.

SUMMARY

Online services for revising a block of text are provided. Some such services employ machine learning (ML). In some existing machine learning (ML)-based services for revising a block of text, the user is typically limited to providing general instructions for the revision (e.g., simplifying, summarizing, expanding, rephrasing) of the entirety of the block of text. The options for what instructions can be provided for revising the text are also typically limited (e.g., restricted to choosing from a set list of possible instructions like “simplify” or “summarize”) and may be unintuitive to a user.

Conventionally, ML-based text revision services do not allow the user to provide more specific stylistic instructions (e.g., “make this quirkier”). As well, conventionally, each editing instruction from the user is processed by the ML-based service in isolation, which can be inefficient and/or may result in inconsistencies in the revised text. Additionally, providing revision instructions one-by-one may result in poor model performance both in terms of speed (multiple revisions of the text need to be generated by the model) and quality (e.g., on a subsequent revision the model may rewrite a part of the text that reverses a prior editing instruction).

In various examples, the present disclosure describes a technical solution that enables one or more text-editing instructions to be included in a prompt to a large language model (LLM), to output a revised block of text. In some examples, multiple text-editing instructions may be included in a single prompt. By combining multiple editing instructions into a single prompt to the LLM, improved computational efficiency can be achieved. The LLM only needs to process the single prompt, which requires less processing power and less time compared to processing multiple prompts.

Another technical advantage is that by providing context to the editing instructions in a prompt, the LLM may generate text output that is more cohesive and relevant (e.g., in terms of style and content), because the LLM can extract more contextual information from a longer text block. Additionally, when multiple editing instructions are included in the prompt, the LLM may better satisfy the editing instructions (rather than possibly reversing a prior instruction when processing a later instruction).

User interactions may also be improved because there is only one prompt being processed and thus only one latency period to receive the revised text. The user may be able to view all the changes together.

In some examples, the present disclosure provides a text-editing user interface (UI). The UI provided for inputting text-editing instructions by the user may also be more intuitive compared to some existing ML-based text editors.

In some examples, if a block of text is too long to be inputted to the LLM as a single prompt (e.g., the maximum number of tokens accepted by the LLM would be exceeded), windowing can be used to ensure that editing instructions are provided with contextual information in a prompt to the LLM. The skilled person will recognize that a “block” of text, as used in the present disclosure, refers to a sequence of characters. Such a sequence may also be referred to as a run, a span, a paragraph, a segment, a passage, etc. A block of text may comprise one or more (sub-)blocks of text, which may themselves also be blocks of text. Additionally or alternatively, a block of text may contain formatting information (e.g. alignment, font, weight, etc.). Such formatting information may be included in the prompt or otherwise inset in the block of text (e.g. using a markup language such as HTML), may be inputted to the LLM out-of-band (e.g. via an interface that is not a prompt), may be stripped from the block of text before inputted into an LLM, and/or may be constituted or reconstituted in the block of text after it is returned from the LLM. Furthermore, the skilled person will recognize that the relationship between one group of blocks of text and another group of blocks of text may not necessarily be one-to-one. For example, the relationship between “revised” or “annotated” blocks of text and blocks of text (simpliciter) may be a one-to-many, a many-to-one, or a many-to-many relationship.

In various examples, the present disclosure describes a technical solution that may be provided by a platform (e.g., SaaS platform). The platform may serve as an interface layer between a user device and the LLM, to improve accessibility to the LLM.

In an example aspect, the present disclosure describes a computing system including a processing unit configured to execute computer-readable instructions to cause the system to: receive one or more text-editing instructions related to respective one or more selected text portions in a block of text; generate a prompt to a large language model (LLM) to generate a revised block of text, the prompt including at least a portion of an annotated block of text, the annotated block of text including each text-editing instruction inserted into the block of text relative to each respective selected text portion; provide the prompt to the LLM and receive a revised block of text; and output the revised block of text.

In an example of the preceding example system, the processing unit may be configured to execute instructions to further cause the system to: provide, to a user device, a text-editing user interface (UI) for editing the block of text, the text-editing UI enabling user input of the one or more text-editing instructions related to the one or more selected text portions; wherein the one or more text-editing instructions are received from the user device; and wherein the revised block of text is outputted to the user device.

In an example of the preceding example system, the revised block of text may be outputted for display via the text-editing UI.

In an example of any of the preceding example systems, the processing unit may be configured to execute computer-readable instructions to further cause the system to generate the prompt by: parsing the received one or more text-editing instructions to identify one text-editing instruction that is related to a respective selected text portion, the identified text-editing instruction containing a predefined keyword indicating the identified text-editing instruction should be applied elsewhere in the block of text; identifying at least one other text portion in the block of text based on a match with the respective selected text portion that is related to the identified text-editing instructions; annotating both the respective selected text portion that is related to the identified text-editing instructions and the identified at least one other text portion with the identified text-editing instruction; and including the annotated block of text in the prompt.

In an example of any of the preceding example systems, the processing unit may be configured to execute computer-readable instructions to further cause the system to: generate the prompt including at least the portion of the annotated block of text, the prompt also including an instruction to cause the LLM to further annotate the annotated block of text in accordance with at least one inserted text-editing instruction; provide the prompt to the LLM and receive a further annotated block of text; generate a further prompt to the LLM including the further annotated block of text; and provide the further prompt to the LLM and receive the revised block of text.

In an example of any of the preceding example systems, the processing unit may be configured to execute computer-readable instructions to further cause the system to generate the prompt by: selecting the portion of the annotated block of text for inclusion in the prompt, the selected portion including at least one inserted text-editing instruction and a defined amount of text preceding or following the at least one inserted text-editing instruction; and including only the selected portion of the annotated block of text in the prompt.

In an example of the preceding example system, the selected portion of the annotated block of text may be selected using a window defining a maximum number of sentences preceding the at least one inserted text-editing instruction and defining a maximum number of sentences following the at least one inserted text-editing instruction.

In an example of some of the preceding example systems, the processing unit may be configured to execute computer-readable instructions to further cause the system to: calculate an estimated token number for the annotated block of text; and responsive to the estimated token number exceeding a defined maximum token number, generate the prompt using the selecting and including.

In an example of any of the preceding example systems, the processing unit may be configured to execute computer-readable instructions to further cause the system to generate the prompt by: parsing the received one or more text-editing instructions to identify one text-editing instruction that is indicated as a high priority instruction related to a respective selected text portion; annotating the block of text to insert the high priority instruction relative to the respective selected text portion and include a defined annotation to indicate higher priority; and including the annotated block of text in the prompt.

In another example aspect, the present disclosure describes a computer-implemented method including: receiving one or more text-editing instructions related to respective one or more selected text portions in a block of text; generating a prompt to a large language model (LLM) to generate a revised block of text, the prompt including at least a portion of an annotated block of text, the annotated block of text including each text-editing instruction inserted into the block of text relative to each respective selected text portion; providing the prompt to the LLM and receive a revised block of text; and outputting the revised block of text.

In an example of the preceding example method, the method may include: providing, to a user device, a text-editing user interface (UI) for editing the block of text, the text-editing UI enabling user input of the one or more text-editing instructions related to the one or more selected text portions; wherein the one or more text-editing instructions are received from the user device; and wherein the revised block of text is outputted to the user device.

In an example of the preceding example method, the revised block of text may be outputted for display via the text-editing UI.

In an example of any of the preceding example methods, generating the prompt may include: parsing the received one or more text-editing instructions to identify one text-editing instruction that is related to a respective selected text portion, the identified text-editing instruction containing a predefined keyword indicating the identified text-editing instruction should be applied elsewhere in the block of text; identifying at least one other text portion in the block of text based on a match with the respective selected text portion that is related to the identified text-editing instructions; annotating both the respective selected text portion that is related to the identified text-editing instructions and the identified at least one other text portion with the identified text-editing instruction; and including the annotated block of text in the prompt.

In an example of any of the preceding example methods, the method may include: generating the prompt including at least the portion of the annotated block of text, the prompt also including an instruction to cause the LLM to further annotate the annotated block of text in accordance with at least one inserted text-editing instruction; providing the prompt to the LLM and receive a further annotated block of text; generating a further prompt to the LLM including the further annotated block of text; and providing the further prompt to the LLM and receive the revised block of text.

In an example of any of the preceding example methods, generating the prompt may include: selecting the portion of the annotated block of text for inclusion in the prompt, the selected portion including at least one inserted text-editing instruction and a defined amount of text preceding or following the at least one inserted text-editing instruction; and including only the selected portion of the annotated block of text in the prompt.

In an example of the preceding example method, the selected portion of the annotated block of text may be selected using a window defining a maximum number of sentences preceding the at least one inserted text-editing instruction and defining a maximum number of sentences following the at least one inserted text-editing instruction.

In an example of some of the preceding example methods, the method may include: calculating an estimated token number for the annotated block of text; and responsive to the estimated token number exceeding a defined maximum token number, generating the prompt using the selecting and including.

In an example of any of the preceding example methods, generating the prompt may include: parsing the received one or more text-editing instructions to identify one text-editing instruction that is indicated as a high priority instruction related to a respective selected text portion; annotating the block of text to insert the high priority instruction relative to the respective selected text portion and include a defined annotation to indicate higher priority; and including the annotated block of text in the prompt.

In another example aspect, the present disclosure describes a non-transitory computer readable medium storing computer-executable instructions thereon, wherein the instructions are executable by a processing unit of a system to cause the system to: receive one or more text-editing instructions related to respective one or more selected text portions in a block of text; generate a prompt to a large language model (LLM) to generate a revised block of text, the prompt including at least a portion of an annotated block of text, the annotated block of text including each text-editing instruction inserted into the block of text relative to each respective selected text portion; provide the prompt to the LLM and receive a revised block of text; and output the revised block of text.

In an example of the preceding example non-transitory computer readable medium, the instructions may be executable by the processing unit to further cause the system to: provide, to a user device, a text-editing user interface (UI) for editing the block of text, the text-editing UI enabling user input of the one or more text-editing instructions related to the one or more selected text portion; wherein the one or more text-editing instructions are received from the user device; and wherein the revised block of text is outputted to the user device.

In an example of the preceding example non-transitory computer readable medium, the revised block of text may be outputted for display via the text-editing UI.

In an example of any of the preceding example non-transitory computer readable media, the instructions may be executable by the processing unit to further cause the system to generate the prompt by: parsing the received one or more text-editing instructions to identify one text-editing instruction that is related to a respective selected text portion, the identified text-editing instruction containing a predefined keyword indicating the identified text-editing instruction should be applied elsewhere in the block of text; identifying at least one other text portion in the block of text based on a match with the respective selected text portion that is related to the identified text-editing instructions; annotating both the respective selected text portion that is related to the identified text-editing instructions and the identified at least one other text portion with the identified text-editing instruction; and including the annotated block of text in the prompt.

In an example of any of the preceding example non-transitory computer readable media, the instructions may be executable by the processing unit to further cause the system to: generate the prompt including at least the portion of the annotated block of text, the prompt also including an instruction to cause the LLM to further annotate the annotated block of text in accordance with at least one inserted text-editing instruction; provide the prompt to the LLM and receive a further annotated block of text generate a further prompt to the LLM including the further annotated block of text; and provide the further prompt to the LLM and receive the revised block of text.

In an example of any of the preceding example non-transitory computer readable media, the instructions may be executable by the processing unit to further cause the system to generate the prompt by: selecting the portion of the annotated block of text for inclusion in the prompt, the selected portion including at least one inserted text-editing instruction and a defined amount of text preceding or following the at least one inserted text-editing instruction; and including only the selected portion of the annotated block of text in the prompt.

In an example of the preceding example non-transitory computer readable medium, the selected portion of the annotated block of text may be selected using a window defining a maximum number of sentences preceding the at least one inserted text-editing instruction and defining a maximum number of sentences following the at least one inserted text-editing instruction.

In an example of some of the preceding example non-transitory computer readable media, the instructions may be executable by the processing unit to further cause the system to: calculate an estimated token number for the annotated block of text; and responsive to the estimated token number exceeding a defined maximum token number, generate the prompt using the selecting and including.

In an example of any of the preceding example non-transitory computer readable media, the instructions are executable by the processing unit to further cause the system to generate the prompt by: parsing the received one or more text-editing instructions to identify one text-editing instruction that is indicated as a high priority instruction related to a respective selected text portion; annotating the block of text to insert the high priority instruction relative to the respective selected text portion and include a defined annotation to indicate higher priority; and including the annotated block of text in the prompt.

BRIEF DESCRIPTION OF THE DRAWINGS

Reference will now be made, by way of example, to the accompanying drawings which show example embodiments of the present application, and in which:

FIG. 1 A is a block diagram of a simplified convolutional neural network, which may be used in examples of the present disclosure;

FIG. 1 B is a block diagram of a simplified transformer neural network, which may be used in examples of the present disclosure;

FIG. 2 is a block diagram of an example computing system, which may be used to implement examples of the present disclosure;

FIG. 3 is an example text-editing UI that may be provided in accordance with examples of the present disclosure;

FIG. 4 is a flowchart illustrating an example method for prompting a LLM, in accordance with examples of the present disclosure;

FIG. 5 is a block diagram of an example e-commerce platform, which may be an example implementation of the examples disclosed herein; and

FIG. 6 is an example homepage of an administrator, which may be accessed via the e-commerce platform of FIG. 5 .

Similar reference numerals may have been used in different figures to denote similar components.

DETAILED DESCRIPTION

To assist in understanding the present disclosure, some concepts relevant to neural networks and machine learning (ML) are first discussed.

Generally, a neural network comprises a number of computation units (sometimes referred to as “neurons”). Each neuron receives an input value and applies a function to the input to generate an output value. The function typically includes a parameter (also referred to as a “weight”) whose value is learned through the process of training. A plurality of neurons may be organized into a neural network layer (or simply “layer”) and there may be multiple such layers in a neural network. The output of one layer may be provided as input to a subsequent layer. Thus, input to a neural network may be processed through a succession of layers until an output of the neural network is generated by a final layer. This is a simplistic discussion of neural networks and there may be more complex neural network designs that include feedback connections, skip connections, and/or other such possible connections between neurons and/or layers, which need not be discussed in detail here.

A deep neural network (DNN) is a type of neural network having multiple layers and/or a large number of neurons. The term DNN may encompass any neural network having multiple layers, including convolutional neural networks (CNNs), recurrent neural networks (RNNs), and multilayer perceptrons (MLPs), among others.

DNNs are often used as ML-based models for modeling complex behaviors (e.g., human language, image recognition, object classification, etc.) in order to improve accuracy of outputs (e.g., more accurate predictions) such as, for example, as compared with models with fewer layers. In the present disclosure, the term “ML-based model” or more simply “ML model” may be understood to refer to a DNN. Training a ML model refers to a process of learning the values of the parameters (or weights) of the neurons in the layers such that the ML model is able to model the target behavior to a desired degree of accuracy. Training typically requires the use of a training dataset, which is a set of data that is relevant to the target behavior of the ML model. For example, to train a ML model that is intended to model human language (also referred to as a language model), the training dataset may be a collection of text documents, referred to as a text corpus (or simply referred to as a corpus). The corpus may represent a language domain (e.g., a single language), a subject domain (e.g., scientific papers), and/or may encompass another domain or domains, be they larger or smaller than a single language or subject domain. For example, a relatively large, multilingual and non-subject-specific corpus may be created by extracting text from online webpages and/or publicly available social media posts. In another example, to train a ML model that is intended to classify images, the training dataset may be a collection of images. Training data may be annotated with ground truth labels (e.g. each data entry in the training dataset may be paired with a label), or may be unlabeled.

Training a ML model generally involves inputting into an ML model (e.g. an untrained ML model) training data to be processed by the ML model, processing the training data using the ML model, collecting the output generated by the ML model (e.g. based on the inputted training data), and comparing the output to a desired set of target values. If the training data is labeled, the desired target values may be, e.g., the ground truth labels of the training data. If the training data is unlabeled, the desired target value may be a reconstructed (or otherwise processed) version of the corresponding ML model input (e.g., in the case of an autoencoder), or may be a measure of some target observable effect on the environment (e.g., in the case of a reinforcement learning agent). The parameters of the ML model are updated based on a difference between the generated output value and the desired target value. For example, if the value outputted by the ML model is excessively high, the parameters may be adjusted so as to lower the output value in future training iterations. An objective function is a way to quantitatively represent how close the output value is to the target value. An objective function represents a quantity (or one or more quantities) to be optimized (e.g., minimize a loss or maximize a reward) in order to bring the output value as close to the target value as possible. The goal of training the ML model typically is to minimize a loss function or maximize a reward function.

The training data may be a subset of a larger data set. For example, a data set may be split into three mutually exclusive subsets: a training set, a validation (or cross-validation) set, and a testing set. The three subsets of data may be used sequentially during ML model training. For example, the training set may be first used to train one or more ML models, each ML model, e.g., having a particular architecture, having a particular training procedure, being describable by a set of model hyperparameters, and/or otherwise being varied from the other of the one or more ML models. The validation (or cross-validation) set may then be used as input data into the trained ML models to, e.g., measure the performance of the trained ML models and/or compare performance between them. Where hyperparameters are used, a new set of hyperparameters may be determined based on the measured performance of one or more of the trained ML models, and the first step of training (i.e., with the training set) may begin again on a different ML model described by the new set of determined hyperparameters. In this way, these steps may be repeated to produce a more performant trained ML model. Once such a trained ML model is obtained (e.g., after the hyperparameters have been adjusted to achieve a desired level of performance), a third step of collecting the output generated by the trained ML model applied to the third subset (the testing set) may begin. The output generated from the testing set may be compared with the corresponding desired target values to give a final assessment of the trained ML model's accuracy. Other segmentations of the larger data set and/or schemes for using the segments for training one or more ML models are possible.

Backpropagation is an algorithm for training a ML model. Backpropagation is used to adjust (also referred to as update) the value of the parameters in the ML model, with the goal of optimizing the objective function. For example, a defined loss function is calculated by forward propagation of an input to obtain an output of the ML model and comparison of the output value with the target value. Backpropagation calculates a gradient of the loss function with respect to the parameters of the ML model, and a gradient algorithm (e.g., gradient descent) is used to update (i.e., “learn”) the parameters to reduce the loss function. Backpropagation is performed iteratively, so that the loss function is converged or minimized. Other techniques for learning the parameters of the ML model may be used. The process of updating (or learning) the parameters over many iterations is referred to as training. Training may be carried out iteratively until a convergence condition is met (e.g., a predefined maximum number of iterations has been performed, or the value outputted by the ML model is sufficiently converged with the desired target value), after which the ML model is considered to be sufficiently trained. The values of the learned parameters may then be fixed and the ML model may be deployed to generate output in real-world applications (also referred to as “inference”).

In some examples, a trained ML model may be fine-tuned, meaning that the values of the learned parameters may be adjusted slightly in order for the ML model to better model a specific task. Fine-tuning of a ML model typically involves further training the ML model on a number of data samples (which may be smaller in number/cardinality than those used to train the model initially) that closely target the specific task. For example, a ML model for generating natural language that has been trained generically on publicly-available text corpuses may be, e.g., fine-tuned by further training using the complete works of Shakespeare as training data samples (e.g., where the intended use of the ML model is generating a scene of a play or other textual content in the style of Shakespeare).

FIG. 1 A is a simplified diagram of an example CNN 10 , which is an example of a DNN that is commonly used for image processing tasks such as image classification, image analysis, object segmentation, etc. An input to the CNN 10 may be a 2D RGB image 12 .

The CNN 10 includes a plurality of layers that process the image 12 in order to generate an output, such as a predicted classification or predicted label for the image 12 . For simplicity, only a few layers of the CNN 10 are illustrated including at least one convolutional layer 14 . The convolutional layer 14 performs convolution processing, which may involve computing a dot product between the input to the convolutional layer 14 and a convolution kernel. A convolutional kernel is typically a 2D matrix of learned parameters that is applied to the input in order to extract image features. Different convolutional kernels may be applied to extract different image information, such as shape information, color information, etc.

The output of the convolution layer 14 is a set of feature maps 16 (sometimes referred to as activation maps). Each feature map 16 generally has smaller width and height than the image 12 . The set of feature maps 16 encode image features that may be processed by subsequent layers of the CNN 10 , depending on the design and intended task for the CNN 10 . In this example, a fully connected layer 18 processes the set of feature maps 16 in order to perform a classification of the image, based on the features encoded in the set of feature maps 16 . The fully connected layer 18 contains learned parameters that, when applied to the set of feature maps 16 , outputs a set of probabilities representing the likelihood that the image 12 belongs to each of a defined set of possible classes. The class having the highest probability may then be outputted as the predicted classification for the image 12 .

In general, a CNN may have different numbers and different types of layers, such as multiple convolution layers, max-pooling layers and/or a fully connected layer, among others. The parameters of the CNN may be learned through training, using data having ground truth labels specific to the desired task (e.g., class labels if the CNN is being trained for a classification task, pixel masks if the CNN is being trained for a segmentation task, text annotations if the CNN is being trained for a captioning task, etc.), as discussed above.

Some concepts in ML-based language models are now discussed. It may be noted that, while the term “language model” has been commonly used to refer to a ML-based language model, there could exist non-ML language models. In the present disclosure, the term “language model” may be used as shorthand for ML-based language model (i.e., a language model that is implemented using a neural network or other ML architecture), unless stated otherwise. For example, unless stated otherwise, “language model” encompasses LLMs.

A language model may use a neural network (typically a DNN) to perform natural language processing (NLP) tasks such as language translation, image captioning, grammatical error correction, and language generation, among others. A language model may be trained to model how words relate to each other in a textual sequence, based on probabilities. A language model may contain hundreds of thousands of learned parameters or in the case of a large language model (LLM) may contain millions or billions of learned parameters or more.

In recent years, there has been interest in a type of neural network architecture, referred to as a transformer, for use as language models. For example, the Bidirectional Encoder Representations from Transformers (BERT) model, the Transformer-XL model and the Generative Pre-trained Transformer (GPT) models are types of transformers. A transformer is a type of neural network architecture that uses self-attention mechanisms in order to generate predicted output based on input data that has some sequential meaning (i.e., the order of the input data is meaningful, which is the case for most text input). Although transformer-based language models are described herein, it should be understood that the present disclosure may be applicable to any ML-based language model, including language models based on other neural network architectures such as recurrent neural network (RNN)-based language models.

FIG. 1 B is a simplified diagram of an example transformer 50 , and a simplified discussion of its operation is now provided. The transformer 50 includes an encoder 52 (which may comprise one or more encoder layers/blocks connected in series) and a decoder 54 (which may comprise one or more decoder layers/blocks connected in series). Generally, the encoder 52 and the decoder 54 each include a plurality of neural network layers, at least one of which may be a self-attention layer. The parameters of the neural network layers may be referred to as the parameters of the language model.

The transformer 50 may be trained on a text corpus that is labelled (e.g., annotated to indicate verbs, nouns, etc.) or unlabelled. LLMs may be trained on a large unlabelled corpus. Some LLMs may be trained on a large multi-language, multi-domain corpus, to enable the model to be versatile at a variety of language-based tasks such as generative tasks (e.g., generating human-like natural language responses to natural language input).

An example of how the transformer 50 may process textual input data is now described. Input to a language model (whether transformer-based or otherwise) typically is in the form of natural language as may be parsed into tokens. It should be appreciated that the term “token” in the context of language models and NLP has a different meaning from the use of the same term in other contexts such as data security. Tokenization, in the context of language models and NLP, refers to the process of parsing textual input (e.g., a character, a word, a phrase, a sentence, a paragraph, etc.) into a sequence of shorter segments that are converted to numerical representations referred to as tokens (or “compute tokens”). Typically, a token may be an integer that corresponds to the index of a text segment (e.g., a word) in a vocabulary dataset. Often, the vocabulary dataset is arranged by frequency of use. Commonly occurring text, such as punctuation, may have a lower vocabulary index in the dataset and thus be represented by a token having a smaller integer value than less commonly occurring text. Tokens frequently correspond to words, with or without whitespace appended. In some examples, a token may correspond to a portion of a word. For example, the word “lower” may be represented by a token for [low] and a second token for [er]. In another example, the text sequence “Come here, look!” may be parsed into the segments [Come], [here], [,], [look] and [!], each of which may be represented by a respective numerical token. In addition to tokens that are parsed from the textual sequence (e.g., tokens that correspond to words and punctuation), there may also be special tokens to encode non-textual information. For example, a [CLASS] token may be a special token that corresponds to a classification of the textual sequence (e.g., may classify the textual sequence as a poem, a list, a paragraph, etc.), a [EOT] token may be another special token that indicates the end of the textual sequence, other tokens may provide formatting information, etc.

In FIG. 1 B , a short sequence of tokens 56 corresponding to the text sequence “Come here, look!” is illustrated as input to the transformer 50 . Tokenization of the text sequence into the tokens 56 may be performed by some pre-processing tokenization module such as, for example, a byte pair encoding tokenizer (the “pre” referring to the tokenization occurring prior to the processing of the tokenized input by the LLM), which is not shown in FIG. 1 B for simplicity. In general, the token sequence that is inputted to the transformer 50 may be of any length up to a maximum length defined based on the dimensions of the transformer 50 (e.g., such a limit may be 2048 tokens in some LLMs). Each token 56 in the token sequence is converted into an embedding vector 60 (also referred to simply as an embedding). An embedding 60 is a learned numerical representation (such as, for example, a vector) of a token that captures some semantic meaning of the text segment represented by the token 56 . The embedding 60 represents the text segment corresponding to the token 56 in a way such that embeddings corresponding to semantically-related text are closer to each other in a vector space than embeddings corresponding to semantically-unrelated text. For example, assuming that the words “look”, “see”, and “cake” each correspond to, respectively, a “look” token, a “see” token, and a “cake” token when tokenized, the embedding 60 corresponding to the “look” token will be closer to another embedding corresponding to the “see” token in the vector space, as compared to the distance between the embedding 60 corresponding to the “look” token and another embedding corresponding to the “cake” token. The vector space may be defined by the dimensions and values of the embedding vectors. Various techniques may be used to convert a token 56 to an embedding 60 . For example, another trained ML model may be used to convert the token 56 into an embedding 60 . In particular, another trained ML model may be used to convert the token 56 into an embedding 60 in a way that encodes additional information into the embedding 60 (e.g., a trained ML model may encode positional information about the position of the token 56 in the text sequence into the embedding 60 ). In some examples, the numerical value of the token 56 may be used to look up the corresponding embedding in an embedding matrix 58 (which may be learned during training of the transformer 50 ).

The generated embeddings 60 are input into the encoder 52 . The encoder 52 serves to encode the embeddings 60 into feature vectors 62 that represent the latent features of the embeddings 60 . The encoder 52 may encode positional information (i.e., information about the sequence of the input) in the feature vectors 62 . The feature vectors 62 may have very high dimensionality (e.g., on the order of thousands or tens of thousands), with each element in a feature vector 62 corresponding to a respective feature. The numerical weight of each element in a feature vector 62 represents the importance of the corresponding feature. The space of all possible feature vectors 62 that can be generated by the encoder 52 may be referred to as the latent space or feature space.

Conceptually, the decoder 54 is designed to map the features represented by the feature vectors 62 into meaningful output, which may depend on the task that was assigned to the transformer 50 . For example, if the transformer 50 is used for a translation task, the decoder 54 may map the feature vectors 62 into text output in a target language different from the language of the original tokens 56 . Generally, in a generative language model, the decoder 54 serves to decode the feature vectors 62 into a sequence of tokens. The decoder 54 may generate output tokens 64 one by one. Each output token 64 may be fed back as input to the decoder 54 in order to generate the next output token 64 . By feeding back the generated output and applying self-attention, the decoder 54 is able to generate a sequence of output tokens 64 that has sequential meaning (e.g., the resulting output text sequence is understandable as a sentence and obeys grammatical rules). The decoder 54 may generate output tokens 64 until a special [EOT] token (indicating the end of the text) is generated. The resulting sequence of output tokens 64 may then be converted to a text sequence in post-processing. For example, each output token 64 may be an integer number that corresponds to a vocabulary index. By looking up the text segment using the vocabulary index, the text segment corresponding to each output token 64 can be retrieved, the text segments can be concatenated together and the final output text sequence (in this example, “Viens ici, regarde!”) can be obtained.

Although a general transformer architecture for a language model and its theory of operation have been described above, this is not intended to be limiting. Existing language models include language models that are based only on the encoder of the transformer or only on the decoder of the transformer. An encoder-only language model encodes the input text sequence into feature vectors that can then be further processed by a task-specific layer (e.g., a classification layer). BERT is an example of a language model that may be considered to be an encoder-only language model. A decoder-only language model accepts embeddings as input and may use auto-regression to generate an output text sequence. Transformer-XL and GPT-type models may be language models that are considered to be decoder-only language models.

Because GPT-type language models tend to have a large number of parameters, these language models may be considered LLMs. An example GPT-type LLM is GPT-3. GPT-3 is a type of GPT language model that has been trained (in an unsupervised manner) on a large corpus derived from documents available to the public online. GPT-3 has a very large number of learned parameters (on the order of hundreds of billions), is able to accept a large number of tokens as input (e.g., up to 2048 input tokens), and is able to generate a large number of tokens as output (e.g., up to 2048 tokens). GPT-3 has been trained as a generative model, meaning that it can process input text sequences to predictively generate a meaningful output text sequence. ChatGPT is built on top of a GPT-type LLM, and has been fine-tuned with training datasets based on text-based chats (e.g., chatbot conversations). ChatGPT is designed for processing natural language, receiving chat-like inputs and generating chat-like outputs.

A computing system may access a remote language model (e.g., a cloud-based language model), such as ChatGPT or GPT-3, via a software interface (e.g., an application programming interface (API)). Additionally or alternatively, such a remote language model may be accessed via a network such as, for example, the Internet. In some implementations such as, for example, potentially in the case of a cloud-based language model, a remote language model may be hosted by a computer system as may include a plurality of cooperating (e.g., cooperating via a network) computer systems such as may be in, for example, a distributed arrangement. Notably, a remote language model may employ a plurality of processors (e.g., hardware processors such as, for example, processors of cooperating computer systems). Indeed, processing of inputs by an LLM may be computationally expensive/may involve a large number of operations (e.g., many instructions may be executed/large data structures may be accessed from memory) and providing output in a required timeframe (e.g., real-time or near real-time) may require the use of a plurality of processors/cooperating computing devices as discussed above.

Inputs to an LLM may be referred to as a prompt, which is a natural language input that includes instructions to the LLM to generate a desired output. A computing system may generate a prompt that is provided as input to the LLM via its API. As described above, the prompt may optionally be processed or pre-processed into a token sequence prior to being provided as input to the LLM via its API. A prompt can include one or more examples of the desired output, which provides the LLM with additional information to enable the LLM to better generate output according to the desired output. Additionally or alternatively, the examples included in a prompt may provide inputs (e.g., example inputs) corresponding to/as may be expected to result in the desired outputs provided. A one-shot prompt refers to a prompt that includes one example, and a few-shot prompt refers to a prompt that includes multiple examples. A prompt that includes no examples may be referred to as a zero-shot prompt.

FIG. 2 illustrates an example computing system 400 , which may be used to implement examples of the present disclosure, such as a prompt generation engine to generate prompts to be provided as input to a language model such as an LLM. Additionally or alternatively, one or more instances of the example computing system 400 may be employed to execute the LLM. For example, a plurality of instances of the example computing system 400 may cooperate to provide output using an LLM in manners as discussed above.

The example computing system 400 includes at least one processing unit, such as a processor 402 , and at least one physical memory 404 . The processor 402 may be, for example, a central processing unit, a microprocessor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a dedicated logic circuitry, a dedicated artificial intelligence processor unit, a graphics processing unit (GPU), a tensor processing unit (TPU), a neural processing unit (NPU), a hardware accelerator, or combinations thereof. The memory 404 may include a volatile or non-volatile memory (e.g., a flash memory, a random access memory (RAM), and/or a read-only memory (ROM)). The memory 404 may store instructions for execution by the processor 402 , to the computing system 400 to carry out examples of the methods, functionalities, systems and modules disclosed herein.

The computing system 400 may also include at least one network interface 406 for wired and/or wireless communications with an external system and/or network (e.g., an intranet, the Internet, a P2P network, a WAN and/or a LAN). A network interface may enable the computing system 400 to carry out communications (e.g., wireless communications) with systems external to the computing system 400 , such as a language model residing on a remote system.

The computing system 400 may optionally include at least one input/output (I/O) interface 408 , which may interface with optional input device(s) 410 and/or optional output device(s) 412 . Input device(s) 410 may include, for example, buttons, a microphone, a touchscreen, a keyboard, etc. Output device(s) 412 may include, for example, a display, a speaker, etc. In this example, optional input device(s) 410 and optional output device(s) 412 are shown external to the computing system 400 . In other examples, one or more of the input device(s) 410 and/or output device(s) 412 may be an internal component of the computing system 400 .

A computing system, such as the computing system 400 of FIG. 2 , may access a remote system (e.g., a cloud-based system) to communicate with a remote language model or LLM hosted on the remote system such as, for example, using an application programming interface (API) call. The API call may include an API key to enable the computing system to be identified by the remote system. The API call may also include an identification of the language model or LLM to be accessed and/or parameters for adjusting outputs generated by the language model or LLM, such as, for example, one or more of a temperature parameter (which may control the amount of randomness or “creativity” of the generated output) (and/or, more generally some form of random seed as serves to introduce variability or variety into the output of the LLM), a minimum length of the output (e.g., a minimum of 10 tokens) and/or a maximum length of the output (e.g., a maximum of 1000 tokens), a frequency penalty parameter (e.g., a parameter which may lower the likeli

CLAIMS

Claims ( 25 )

1 . A system comprising a processing unit configured to execute computer-readable instructions to cause the system to:

receive two or more editing instructions related to one or more identified portions in a block of text; generate a prompt to a large language model (LLM) to generate a revised block of text, the prompt to the LLM including at least a part of the block of text and the two or more editing instructions related to the one or more identified portions; provide the prompt to the LLM; and obtain a revised block of text.

2 . The system of claim 1 , wherein the processing unit is configured to execute instructions to further cause the system to:

provide, to a user device, an editing user interface (UI) for editing the block of text, the editing UI enabling user input of the two or more editing instructions related to the one or more identified portions; wherein the two or more editing instructions are received from the user device; and output the revised block of text to the user device.

3 . The system of claim 2 , wherein the revised block of text is outputted for display via the editing UI.

4 . The system of claim 1 , wherein the processing unit is configured to execute computer-readable instructions to further cause the system to generate the prompt to the LLM by:

parsing the received two or more editing instructions to identify one editing instruction that is related to a respective identified portion, the identified editing instruction containing a predefined keyword indicating the identified editing instruction should be applied elsewhere in the block of text; identifying at least one other portion in the block of text based on a match with the respective identified portion that is related to the identified editing instruction; and including the identified editing instruction in relation to the at least one other portion in the prompt to the LLM.

5 . The system of claim 1 wherein the processing unit is configured to execute computer-readable instructions to further cause the system to:

generate the prompt to the LLM including at least a portion of an annotated block of text including the two or more editing instructions inserted into the block of text relative to the one or more identified portions, the prompt to the LLM also including an instruction to cause the LLM to further annotate the annotated block of text in accordance with at least one inserted editing instruction;

provide the prompt to the LLM and obtain a further annotated block of text;

generate a further prompt to the LLM including the further annotated block of text; and

provide the further prompt to the LLM and obtain the revised block of text.

6 . The system of claim 1 , wherein the processing unit is configured to execute computer-readable instructions to further cause the system to generate the prompt to the LLM by:

selecting the part of the block of text for inclusion in the prompt to the LLM, the selected part including at least one of the one or more identified portions and at least one editing instruction related to the at least one of the one or more identified portions, and a defined amount of text preceding or following the at least one editing instruction; and including only the selected part of the block of text in the prompt to the LLM.

7 . The system of claim 6 , wherein the selected part of the block of text is selected using a window defining a maximum number of sentences preceding the at least one editing instruction and defining a maximum number of sentences following the at least one editing instruction.

8 . The system of claim 6 , wherein the processing unit is configured to execute computer-readable instructions to further cause the system to:

calculate an estimated token number for the block of text; and responsive to the estimated token number exceeding a defined maximum token number, generate the prompt to the LLM using the selecting and including.

9 . The system of claim 1 , wherein the processing unit is configured to execute computer-readable instructions to further cause the system to generate the prompt to the LLM by:

parsing the received two or more editing instructions to identify one editing instruction that is indicated as a high priority instruction related to a respective identified portion; wherein the high priority instruction is indicated as higher priority in the prompt to the LLM.

10 . A method comprising:

receiving two or more editing instructions related to one or more identified portions in a block of text; generating a prompt to a large language model (LLM) to generate a revised block of text, the prompt to the LLM including at least a part of the block of text and the two or more editing instructions related to the one or more identified portions; providing the prompt to the LLM; and obtaining a revised block of text.

11 . The method of claim 10 , further comprising:

providing, to a user device, an editing user interface (UI) for editing the block of text, the editing UI enabling user input of the two or more editing instructions related to the one or more identified portions; wherein the two or more editing instructions are received from the user device; and outputting the revised block of text to the user device.

12 . The method of claim 11 , wherein the revised block of text is outputted for display via the editing UI.

13 . The method of claim 10 , wherein generating the prompt to the LLM comprises:

parsing the received two or more editing instructions to identify one editing instruction that is related to a respective identified portion, the identified editing instruction containing a predefined keyword indicating the identified editing instruction should be applied elsewhere in the block of text; identifying at least one other portion in the block of text based on a match with the respective identified portion that is related to the identified editing instruction; and including the identified editing instructions in relation to the at least one other portion in the prompt to the LLM.

14 . The method of claim 10 , further comprising:

generating the prompt to the LLM including at least a portion of an annotated block of text including the two or more editing instructions inserted into the block of text relative to the one or more identified portions, the prompt to the LLM also including an instruction to cause the LLM to further annotate the annotated block of text in accordance with at least one inserted editing instruction; providing the prompt to the LLM and obtaining a further annotated block of text; generating a further prompt to the LLM including the further annotated block of text; and providing the further prompt to the LLM and obtaining the revised block of text.

15 . The method of claim 10 , wherein generating the prompt to the LLM comprises:

selecting the part of the block of text for inclusion in the prompt to the LLM, the selected part including at least one of the one or more identified portions and at least one editing instruction related to the at least one of the one or more identified portions and a defined amount of text preceding or following the at least one editing instruction; and including only the selected part of the block of text in the prompt to the LLM.

16 . The method of claim 15 , wherein the selected part of the block of text is selected using a window defining a maximum number of sentences preceding the at least one editing instruction and defining a maximum number of sentences following the at least one editing instruction.

17 . The method of claim 15 , further comprising:

calculating an estimated token number for the block of text; and responsive to the estimated token number exceeding a defined maximum token number, generating the prompt to the LLM using the selecting and including.

18 . The method of claim 10 , wherein generating the prompt to the LLM comprises:

parsing the received two or more editing instructions to identify one editing instruction that is indicated as a high priority instruction related to a respective identified portion; wherein the high priority instruction is indicated as higher priority in the prompt to the LLM.

19 . A non-transitory computer readable medium storing computer-executable instructions thereon, wherein the instructions are executable by a processing unit of a system to cause the system to:

receive two or more editing instructions related to one or more identified portions in a block of text; generate a prompt to a large language model (LLM) to generate a revised block of text, the prompt to the LLM including at least a part of the block of text and the two or more editing instructions related to the one or more identified portions; provide the prompt to the LLM; and obtain a revised block of text.

20 . The non-transitory computer readable medium of claim 19 , wherein the instructions are executable by the processing unit to further cause the system to:

provide, to a user device, an editing user interface (UI) for editing the block of text, the editing UI enabling user input of the two or more editing instructions related to the one or more identified portions; wherein the two or more editing instructions are received from the user device; and output the revised block of text to the user device.

21 . The non-transitory computer readable medium of claim 19 , wherein the instructions are executable by the processing unit to further cause the system to generate the prompt to the LLM by:

parsing the received two or more editing instructions to identify one editing instruction that is related to a respective identified portion, the identified editing instruction containing a predefined keyword indicating the identified editing instruction should be applied elsewhere in the block of text; identifying at least one other portion in the block of text based on a match with the respective identified portion that is related to the identified editing instruction; and including the identified editing instructions in relation to the at least one other portion in the prompt to the LLM.

22 . The non-transitory computer readable medium of claim 19 , wherein the instructions are executable by the processing unit to further cause the system to:

generate the prompt to the LLM including at least a portion of an annotated block of text including the two or more editing instructions inserted into the block of text relative to the one or more identified portions, the prompt to the LLM also including an instruction to cause the LLM to further annotate the annotated block of text in accordance with at least one inserted editing instruction; provide the prompt to the LLM and obtain a further annotated block of text; generate a further prompt to the LLM including the further annotated block of text; and provide the further prompt to the LLM and obtain the revised block of text.

23 . The non-transitory computer readable medium of claim 19 , wherein the instructions are executable by the processing unit to further cause the system to generate the prompt to the LLM by:

selecting the part of the block of text for inclusion in the prompt to the LLM, the selected part including at least one of the one or more identified portions and at least one editing instruction related to the at least one of the one or more identified portions and a defined amount of text preceding or following the at least one editing instruction; and including only the selected part of the block of text in the prompt to the LLM.

24 . The non-transitory computer readable medium of claim 23 , wherein the selected part of the block of text is selected using a window defining a maximum number of sentences preceding the at least one editing instruction and defining a maximum number of sentences following the at least one editing instruction.

25 . The non-transitory computer readable medium of claim 19 , wherein the instructions are executable by the processing unit to further cause the system to generate the prompt to the LLM by:

parsing the received two or more editing instructions to identify one editing instruction that is indicated as a high priority instruction related to a respective identified portion; wherein the high priority instruction is indicated as higher priority in the prompt to the LLM.

US19/283,968

2023-01-31

2025-07-29

Methods and systems for prompting large language model to process inputs from multiple user elements

Pending

US20250356111A1

( en )

Priority Applications (1)

Application Number

Priority Date

Filing Date

Title

US19/283,968

US20250356111A1

( en )

2023-01-31

2025-07-29

Methods and systems for prompting large language model to process inputs from multiple user elements

Applications Claiming Priority (4)

Application Number

Priority Date

Filing Date

Title

US202363482406P

2023-01-31

2023-01-31

US202363483671P

2023-02-07

2023-02-07

US18/186,472

US20240256762A1

( en )

2023-01-31

2023-03-20

Methods and systems for prompting large language model to process inputs from multiple user elements

US19/283,968

US20250356111A1

( en )

2023-01-31

2025-07-29

Methods and systems for prompting large language model to process inputs from multiple user elements

Related Parent Applications (1)

Application Number

Title

Priority Date

Filing Date

US18/186,472

Continuation

US20240256762A1

( en )

2023-01-31

2023-03-20

Methods and systems for prompting large language model to process inputs from multiple user elements

Publications (1)

Publication Number

Publication Date

US20250356111A1

true

US20250356111A1 ( en )

2025-11-20

Family

ID=91963294

Family Applications (2)

Application Number

Title

Priority Date

Filing Date

US18/186,472

Pending

US20240256762A1

( en )

2023-01-31

2023-03-20

Methods and systems for prompting large language model to process inputs from multiple user elements

US19/283,968

Pending

US20250356111A1

( en )

2023-01-31

2025-07-29

Methods and systems for prompting large language model to process inputs from multiple user elements

Family Applications Before (1)

Application Number

Title

Priority Date

Filing Date

US18/186,472

Pending

US20240256762A1

( en )

2023-01-31

2023-03-20

Methods and systems for prompting large language model to process inputs from multiple user elements

Country Status (4)

Country

Link

US

( 2 )

US20240256762A1

( en )

EP

( 1 )

EP4634817A1

( en )

AU

( 1 )

AU2023428048A1

( en )

WO

( 1 )

WO2024159296A1

( en )

Families Citing this family (15)

* Cited by examiner, † Cited by third party

Publication number

Priority date

Publication date

Assignee

Title

US12566926B2

( en )

*

2022-09-27

2026-03-03

Samsung Electronics Co., Ltd.

System and method for efficient language model editing using contextual prompt generator

US12608548B2

( en )

2023-02-03

2026-04-21

Shopify Inc.

Methods and systems for parsing a mix of features and instructions into a prompt

US12412199B2

( en )

*

2023-02-13

2025-09-09

The DGC Group

Artificial intelligence coach for providing customer service feedback to employees

US12566916B2

( en )

*

2023-02-15

2026-03-03

Microsoft Technology Licensing, Llc

Generative collaborative publishing system

US12541638B2

( en )

2023-02-15

2026-02-03

Microsoft Technology Licensing, Llc

Generative collaborative publishing system

US12493740B2

( en )

2023-02-15

2025-12-09

Microsoft Technology Licensing, Llc

Generative collaborative publishing system

US20240281472A1

( en )

*

2023-02-17

2024-08-22

Snowflake Inc.

Interactive interface with generative artificial intelligence

US20240289540A1

( en )

*

2023-02-24

2024-08-29

The Regents Of The University Of Colorado, A Body Corporate

Academic Editing Engine(s) For Attribution And Revision Of Scholarly Authoring

KR20250169277A

( en )

*

2023-05-09

2025-12-02

구글 엘엘씨

Language model support provided by the operating system

US12468894B2

( en )

*

2023-09-08

2025-11-11

Maplebear Inc.

Using language model to generate recipe with refined content

US12597421B1

( en )

*

2023-11-15

2026-04-07

Amazon Technologies, Inc.

Event timeline system

US12608563B2

( en )

*

2023-11-20

2026-04-21

Microsoft Technology Licensing, Llc.

Guided dynamic construction of large language model (LLM) prompts

US20250238851A1

( en )

*

2024-01-24

2025-07-24

Maplebear Inc.

Personalizing recipes using a large language model

TWI886039B

( en )

*

2024-09-04

2025-06-01

宏碁股份有限公司

Method for operating large language model and electronic device using the same

WO2026090923A1

( en )

*

2024-10-30

2026-05-07

Siemens Aktiengesellschaft

Method, system, apparatus, device, and medium for protecting sensitive information

Family Cites Families (3)

* Cited by examiner, † Cited by third party

Publication number

Priority date

Publication date

Assignee

Title

US20220036153A1

( en )

*

2020-07-29

2022-02-03

Thayermahan, Inc.

Ultra large language models as ai agent controllers for improved ai agent performance in an environment

KR20250080920A

( en )

*

2021-05-21

2025-06-05

구글 엘엘씨

Machine-learned language models which generate intermediate textual analysis in service of contextual text generation

US11481545B1

( en )

*

2021-06-28

2022-10-25

Orbis Technologies, Inc.

Conditional processing of annotated documents for automated document generation

2023

2023-03-20

US

US18/186,472

patent/US20240256762A1/en

active

Pending

2023-08-18

AU

AU2023428048A

patent/AU2023428048A1/en

active

Pending

2023-08-18

WO

PCT/CA2023/051099

patent/WO2024159296A1/en

not_active

Ceased

2023-08-18

EP

EP23918921.0A

patent/EP4634817A1/en

active

Pending

2025

2025-07-29

US

US19/283,968

patent/US20250356111A1/en

active

Pending

Also Published As

Publication number

Publication date

WO2024159296A1

( en )

2024-08-08

US20240256762A1

( en )

2024-08-01

AU2023428048A1

( en )

2025-07-31

EP4634817A1

( en )

2025-10-22

Similar Documents

Publication

Publication Date

Title

US20240256762A1

( en )

2024-08-01

Methods and systems for prompting large language model to process inputs from multiple user elements

US12182506B2

( en )

2024-12-31

Systems and methods for dynamic large language model prompt generation

US12468878B2

( en )

2025-11-11

Methods and systems for generation of text using large language model with indications of unsubstantiated information

US20240256792A1

( en )

2024-08-01

Methods and systems for dynamic generation of personalized text using large language model

US12561512B2

( en )

2026-02-24

Methods and systems for prompting large language model to generate formatted output

US12608548B2

( en )

2026-04-21

Methods and systems for parsing a mix of features and instructions into a prompt

US12411699B2

( en )

2025-09-09

Dynamic generation of user interface controls

US12579377B2

( en )

2026-03-17

Summary of reviews generated by a generative language model

US20240311192A1

( en )

2024-09-19

Methods and systems for indicating resource usage parameter for prompting a large language model (llm)

US20220414741A1

( en )

2022-12-29

Systems and methods for managing a personalized online experience

US20240256793A1

( en )

2024-08-01

Methods and systems for generating text with tone or diction corresponding to stylistic attributes of images

US12596876B2

( en )

2026-04-07

Systems and methods for improving textual descriptions using large language models

US20240354710A1

( en )

2024-10-24

Methods and systems for the creation of parsers using large language models

US20210182730A1

( en )

2021-06-17

Systems and methods for detecting non-causal dependencies in machine learning models

US11657107B2

( en )

2023-05-23

Systems and methods for using keywords extracted from reviews

US20250165228A1

( en )

2025-05-22

Generation of grammar-compliant programming language code using machine learning

US11188967B2

( en )

2021-11-30

Systems and methods for using keywords extracted from reviews

US20240386477A1

( en )

2024-11-21

Methods and systems for providing context for generating an online store

US20240354176A1

( en )

2024-10-24

Notification messages generated by a generative language model

US20250166037A1

( en )

2025-05-22

Embedding-based search of an item store

US20250165125A1

( en )

2025-05-22

Methods and devices for exploring an n-dimensional embedding space using a navigation-based recommender

US20240354830A1

( en )

2024-10-24

System and Method for Identifying Complementary Objects from Images

AU2023476117A1

( en )

2026-04-23

Methods and systems for resolving and providing context for client-permissioned content

US20250148191A1

( en )

2025-05-08

Keyword extraction to generate subject lines

US20250148003A1

( en )

2025-05-08

System and Method for Modifying Search Metrics Based on Features of Interest Determined from Interactions with Images

Legal Events

Date

Code

Title

Description

2025-08-13

STPP

Information on status: patent application and granting procedure in general

Free format text : DOCKETED NEW CASE - READY FOR EXAMINATION

Related documents

Record · ID 607532
Conceptio Open Knowledge Archive — every document is proof-bundled with source, license, and retrieval metadata.