LLM Prompting With Formatting Tags for Reliable Text Revision
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing ML-based text revision services fail to preserve formatting in formatted text, leading to inadvertent destruction of desired formatting and loss of contextual information, requiring tedious manual workarounds.
Innovation Solution
A system and method that enables a trained large language model (LLM) to identify formatting tags in the original text and generate a prompt with formatting-specific instructions, allowing the LLM to maintain formatting while revising the text.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If existing ML-based services process formatted text without recognizing formatting tags, then text revision can be performed, but formatting is inadvertently destroyed and contextual information is lost
Solution Approach 1:
The system performs preliminary identification of formatting tags in the input text before processing. By detecting formatting tags (such as HTML tags, Markdown syntax, or other markup) in advance, the system can prepare appropriate processing instructions that preserve these tags throughout the revision process, preventing their accidental modification or removal.
Solution Approach 2:
The system introduces an intermediary formatting tag identification and instruction generation mechanism between the user input and the LLM processing. This intermediary layer analyzes the input text for formatting tags, generates specific preservation instructions, and passes these instructions to the LLM, thereby mediating the interaction to ensure formatting is maintained while still allowing text revision.
2Reliability
If users manually extract unformatted text for ML-based revision, then formatting preservation may be achieved, but user effort increases and contextual information is lost
Solution Approach 1:
The system enables self-service by automatically identifying formatting tags and generating appropriate preservation instructions without requiring user intervention. The LLM processes the complete formatted text autonomously, using the generated instructions to maintain formatting integrity, thereby eliminating the need for users to manually strip formatting before revision.
Solution Approach 2:
The system changes the processing parameters by incorporating formatting tag detection and preservation instructions into the LLM's processing workflow. Instead of treating all text uniformly, the system adjusts processing behavior based on detected formatting tags, modifying how the LLM approaches text revision to preserve structural elements while maintaining natural language processing capabilities.
3Productivity
If existing ML-based services treat formatting tags as text to be revised, then complete text processing is achieved, but formatting structure is destroyed and meaning changes
Solution Approach 1:
The system segments the text processing task by distinguishing between formatting tags and content text. It identifies and separates formatting elements (tags, markup syntax) from the actual text content, applying different processing rules to each segment. This segmentation allows the LLM to revise content while leaving formatting structures intact, maintaining both completeness and precision.
Solution Approach 2:
The system performs preliminary identification and classification of text elements before processing. By detecting formatting tags and categorizing them separately from content text in advance, the system can generate targeted preservation instructions that ensure formatting accuracy is maintained while still allowing complete text processing and revision of the content portions.
Data Source
AI summary
Methods and systems for prompting a large language model (LLM) to generate a revised text passage with formatting are described. A text-editing instruction is received that is related to at least a portion of a text passage having at least one formatting tag. The text passage is processed to identify the at least one formatting tag in the text passage. A prompt to the LLM is generated, to cause the LLM to generate a revised text passage. The prompt includes the text-editing instruction related to at least the portion of the text passage and also includes a formatting-specific instruction to format the revised text passage using the at least one formatting tag in the revised text passage. The revised text passage is received and caused to be displayed based on the formatting tag.


