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

US12561512B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-12561512-B2
Application numberUS-202318491370-A
CountryUS
Kind codeB2
Filing dateOct 20, 2023
Priority dateMar 14, 2023
Publication dateFeb 24, 2026
Grant dateFeb 24, 2026

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

The present disclosure describes a technical solution that enables a trained large language model (LLM) to generate a revised text in a manner that enables the LLM to preserve formatting that was present in the original text. When a text-editing instruction is received for a text passage having a formatting tag, the text passage is processed to identify the formatting tag in the text passage. The LLM is prompted to generate a revised text passage, using a prompt that includes the text-editing instruction and that also includes a formatting-specific instruction to format the revised text passage using the formatting tag in the revised text passage. The revised text passage is received and caused to be displayed based on the formatting tag, such that the formatting of the original text is maintained.

First claim

Opening claim text (preview).

The invention claimed is: 1 . A system comprising: a processing unit configured to execute computer-readable instructions to cause the system to: receive at least one text-editing instruction related to at least a portion of a text passage having at least one formatting tag; process the text passage to identify the at least one formatting tag in the text passage, and to identify a category of a text related to the at least one formatting tag; generate a formatting example by: retrieving, from a text database, an example text belonging to the identified category; and applying the at least one formatting tag to the example text; generate a first prompt to a large language model (LLM) to generate a revised text passage, the first prompt including the text-editing instruction related to at least the portion of the text passage, the first prompt further including a formatting-specific instruction to format the revised text passage using the at least one formatting tag in the revised text passage, the formatting-specific instruction including the formatting example; cause the LLM to generate the revised text passage, using the first prompt as input to the LLM; receive the revised text passage generated based on the first prompt; and cause the revised text passage to be displayed by causing rendering of the at least one formatting tag to the revised text passage. 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 user interface (UI) for inputting the at least one text-editing instruction and the text passage having the at least one formatting tag; wherein the at least one text-editing instruction and the text passage are received from the user device; and wherein the revised text passage is outputted to the user device and the user device is caused to display the revised text passage via the UI. 3 . The system of claim 1 , wherein the processing unit is configured to execute computer-readable instructions to further cause the system to process the text passage by: parsing the text passage to identify the at least one formatting tag; wherein the formatting-specific instruction is included in the first prompt responsive to the at least one formatting tag being identified by the parsing. 4 . The system of claim 3 , wherein the processing unit is configured to execute computer-readable instructions to further cause the system to process the text passage by: parsing the text passage to identify a formatting language of the at least one formatting tag; wherein the formatting-specific instruction includes the identified formatting language. 5 . The system of claim 1 , wherein the processing unit is configured to execute computer-readable instructions to further cause the system to process the text passage by: processing the text passage using trained classifier that has been trained to classify text formatting, the trained classifier outputting a class label identifying a formatting language of the at least one formatting tag; wherein the formatting-specific instruction includes the identified formatting language. 6 . The system of claim 5 , wherein the trained classifier has been further trained to annotate formatting tags belonging to the identified formatting language, wherein the trained classifier further outputs an annotated text passage annotating the at least one formatting tag; wherein the formatting-specific instruction further includes an instruction to format the revised text passage using the annotated at least one formatting tag in the revised text passage. 7 . The system of claim 1 , wherein the processing unit is configured to execute computer-readable instructions to further cause the system to process the text passage by: generating a second prompt to the LLM including the text passage, the second prompt also including an instruction to cause the LLM to annotate the text passage to identify the at least one formatting tag; wherein the formatting-specific instruction includes the annotated text passage and an instruction to format the revised text passage using the annotated at least one formatting tag in the revised text passage. 8 . A method comprising: receiving at least one text-editing instruction related to at least a portion of a text passage having at least one formatting tag; processing the text passage to identify the at least one formatting tag in the text passage, and to identify a category of a text related to the at least one formatting tag; generating a formatting example by: retrieving, from a text database, an example text belonging to the identified category; and applying the at least one formatting tag to the example text; generating a first prompt to a large language model (LLM) to generate a revised text passage, the first prompt including the text-editing instruction related to at least the portion of the text passage, the first prompt further including a formatting-specific instruction to format the revised text passage using the at least one formatting tag in the revised text passage, the formatting-specific instruction including the formatting example; causing the LLM to generate the revised text passage, using the first prompt as input to the LLM; receiving the revised text passage generated based on the first prompt; and causing the revised text passage to be displayed by causing rendering of the at least one formatting tag to the revised text passage. 9 . The method of claim 8 , further comprising: providing, to a user device, a user interface (UI) for inputting the at least one text-editing instruction and the text passage having the at least one formatting tag; wherein the at least one text-editing instruction and the text passage are received from the user device; and wherein the revised text passage is outputted to the user device and the user device is caused to display the revised text passage via the UI. 10 . The method of claim 8 , wherein processing the text passage comprises: parsing the text passage to identify the at least one formatting tag; wherein the formatting-specific instruction is included in the first prompt responsive to the at least one formatting tag being identified by the parsing. 11 . The method of claim 10 , wherein processing the text passage comprises: parsing the text passage to identify a formatting language of the at least one formatting tag; wherein the formatting-specific instruction includes the identified formatting language. 12 . The method of claim 8 , wherein processing the text passage comprises: processing the text passage using trained classifier that has been trained to classify text formatting, the trained classifier outputting a class label identifying a formatting language of the at least one formatting tag; wherein the formatting-specific instruction includes the identified formatting language. 13 . The method of claim 12 , wherein the trained classifier has been further trained to annotate formatting tags belonging to the identified formatting language, wherein the trained classifier further outputs an annotated text passage annotating the at least one formatting tag; wherein the formatting-specific instruction further includes an instruction to format the revised text passage using the annotated at least one formatting tag in the revised text passage. 14 . The method of claim 8 , wherein processing the text passage comprises: generating a second prompt to the LLM including the text passage, the second prompt also including an instruction to cause the LLM to anno

Assignees

Inventors

Classifications

  • Annotation, e.g. comment data or footnotes · CPC title

  • Parsing · CPC title

  • Formatting, i.e. changing of presentation of documents (automatic justification G06F40/189; automatic line break hyphenation G06F40/191) · CPC title

  • Editing, e.g. inserting or deleting · CPC title

  • G06F40/106Primary

    Display of layout of documents; Previewing · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US12561512B2 cover?
The present disclosure describes a technical solution that enables a trained large language model (LLM) to generate a revised text in a manner that enables the LLM to preserve formatting that was present in the original text. When a text-editing instruction is received for a text passage having a formatting tag, the text passage is processed to identify the formatting tag in the text passage. T…
Who is the assignee on this patent?
Shopify Inc
What technology area does this patent fall under?
Primary CPC classification G06F40/106. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Feb 24 2026 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 5 related publications on this page (citations in our corpus or others sharing the same primary CPC).