LLM Prompting for Formatted Text Revision Without Tag Loss

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing machine learning-based text revision services fail to preserve formatting in the original text, leading to unintended changes in lists, tables, and other structured content, and require manual user intervention to maintain formatting, which is tedious and inefficient.

Innovation Solution

A system and method that utilizes a trained large language model (LLM) to identify formatting tags in the input text and generate a prompt with formatting-specific instructions, enabling the LLM to maintain the original formatting while revising the text.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If existing ML-based services process formatted text without recognizing formatting tags, then the text revision function is provided, but the formatting is inadvertently destroyed

Engineering Contradiction:
Improvetext revision functionVSAvoidformatting preservation
Core Design Contradiction:
Ease of operationVSManufacturing precision

Solution Approach 1:

The system performs preliminary action by identifying and extracting formatting tags from the input text before processing it through the language model. The extracted formatting information is stored and then applied to the revised text after generation, ensuring formatting is preserved throughout the revision process.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system segments the input text into formatted portions (containing formatting tags) and unformatted portions. This segmentation allows the language model to process the text content while the formatting structure is separately maintained and recombined, resolving the contradiction between text revision and formatting preservation.

Inventive Principle:
Principle #1Segmentation

2Manufacturing precision

If users manually extract unformatted text for ML processing, then formatting is preserved, but user effort increases and contextual information is lost

Engineering Contradiction:
Improveformatting preservationVSAvoiduser effort
Core Design Contradiction:
Manufacturing precisionVSLoss of time

Solution Approach 1:

The system implements self-service by automatically identifying, extracting, and managing formatting tags without requiring user intervention. The system autonomously separates formatted and unformatted portions, processes them appropriately, and recombines them, eliminating the need for manual text extraction by users.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system introduces an intermediary component that automatically extracts and manages formatting information between the user input and the language model processing. This intermediary layer preserves formatting while maintaining full contextual information, avoiding both manual user effort and information loss.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Manufacturing precision

If formatting tags are included in the prompt to the LLM, then formatting is preserved in output, but prompt complexity increases

Engineering Contradiction:
Improveformatting preservationVSAvoidprompt structure
Core Design Contradiction:
Manufacturing precisionVSDevice complexity

Solution Approach 1:

The system extracts formatting tags from the input text and handles them separately from the main text content. By removing formatting tags from the prompt sent to the LLM and instead applying them after text generation, the prompt complexity is reduced while formatting preservation is maintained through the separate extraction and reapplication process.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS12561512B2Methods and systems for prompting large language model to generate formatted output
Publication Date: 2026.02.24 SHOPIFY INC
  • US12561512B2 patent drawing
  • US12561512B2 patent drawing
  • US12561512B2 patent drawing

AI summary

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.