IP Library Granted Patent US 12675630
Granted Patent B2
US 12675630 · App. 18/186,472 · Granted Jul 7, 2026

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

Inventor: Daniel Beauchamp (Toronto, CA)
Assignee: Shopify Inc.
G06F40/166G06F40/205G06F40/40
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12675630
App. No.
18/186,472
Granted
Jul 7, 2026
Kind
B2
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.

Claims (89)

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

receive two or more text-editing instructions related to 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 to the LLM including at least a portion of an annotated block of text, the annotated block of text including each text-editing instruction of the two or more text-editing instructions inserted into the block of text relative to each respective selected text portion of the one or more selected text portions;

provide the prompt to the LLM and receive a revised block of text; and

output the 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, a text-editing user interface (UI) for editing the block of text, the text-editing UI enabling user input of the two or more text-editing instructions related to the one or more selected text portions;

wherein the two or more text-editing instructions are received from the user device; and

wherein the revised block of text is outputted to the user device.

3 . The system of claim 2 , wherein the revised block of text is outputted for display via the text-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 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 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 the portion of the annotated block of text, 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 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.

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 portion of the annotated block of text for inclusion in the prompt to the LLM, 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 to the LLM.

7 . The system of claim 6 , wherein the selected portion of the annotated block of text is 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.

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 annotated 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 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 to the LLM.

10 . A method comprising:

receiving two or more text-editing instructions related to 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 to the LLM including at least a portion of an annotated block of text, the annotated block of text including each text-editing instruction of the two or more text-editing instructions inserted into the block of text relative to each respective selected text portion of the one or more selected text portions;

providing the prompt to the LLM and receiving a revised block of text; and

outputting the revised block of text.

11 . The method of claim 10 , further comprising:

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 two or more text-editing instructions related to the one or more selected text portions;

wherein the two or more text-editing instructions are received from the user device; and

wherein the revised block of text is outputted to the user device.

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

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

parsing the received two 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 to the LLM.

14 . The method of claim 10 , further comprising:

generating the prompt to the LLM including at least the portion of the annotated block of text, 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 text-editing instruction;

providing the prompt to the LLM and receiving 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.

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

selecting the portion of the annotated block of text for inclusion in the prompt to the LLM, 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 to the LLM.

16 . The method of claim 15 , wherein the selected portion of the annotated block of text is 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.

17 . The method of claim 15 , further comprising:

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 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 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 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 text-editing instructions related to 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 to the LLM including at least a portion of an annotated block of text, the annotated block of text including each text-editing instruction of the two or more text-editing instructions inserted into the block of text relative to each respective selected text portion of the one or more selected text portions;

provide the prompt to the LLM and receive a revised block of text; and

output the 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, a text-editing user interface (UI) for editing the block of text, the text-editing UI enabling user input of the two or more text-editing instructions related to the one or more selected text portions;

wherein the two or more text-editing instructions are received from the user device; and

wherein the revised block of text is outputted 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 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 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 the portion of the annotated block of text, 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 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.

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 portion of the annotated block of text for inclusion in the prompt to the LLM, 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 to the LLM.

24 . The non-transitory computer readable medium of claim 23 , wherein the selected portion of the annotated block of text is 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.

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 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 to the LLM.