Re-writing text with OpenAI GPT and local LLMs [+Drafting Option Only]

OpenAI GPT and other LLMs do a great job rewriting and correcting English text, so ClaimMaster's patent drafting tools let you store and invoke helpful GPT/LLM prompts for rewriting existing text generated by ClaimMaster other patent drafting tools or any other text in the document.    



For rewriting, ClaimMaster can pass the text via API to either (1) OpenAI's or Microsoft Azure OpenAI's GPT services or (2) to a desktop application running a local LLM, such as Ollama or LM Studio. According to OpenAI API policies and/or Azure OpenAI API policies,  the use of API ensures that your prompts (inputs), completions (outputs), and any other transmitted data will not be available to other customers and will not be used to improve GPT models.  To further enhance your data privacy and use specific GPT models, you can also configure ClaimMaster to use your own API key and endpoint (Azure) to connect to your your private models set up in OpenAI or Azure OpenAI services. If ClaimMaster is configured to access private GPT models using your own API keys, those keys will always be stored in encrypted format on the machine where ClaimMaster is installed. When connecting to a local LLM application, your data remains completely private and is not sent to the cloud for processing


If using a cloud-based GPT service, you are responsible for determining whether OpenAI API policies and/or Azure OpenAI API policies suit your needs, satisfy your organization's security requirements, and assume all risk for using GPT services with your confidential data. All GPT/LLM features in ClaimMaster will only transmit data to GPT/LLM after your explicit command. You control exactly what data is being sent to GPT/LLM.  It's also a good practice to always review GPT/LLM responses for factual correctness, especially if you are using prompts with settings for higher response randomness/creativity.



To access GPT/LLM rewriting tool in ClaimMaster, follow these steps:



Getting Started

  • Option 1 - from any patent drafting tools menu (e.g., generating Abstract, Summary, flowchart descriptions, claim cloning, etc.), click on the Re-write text with GPT/LLM button or right-click on the preview text window and select Re-write selected text with GPT/LLM menu option.  If any text is selected in the window, only that text will be rewritten.  Otherwise, the entire contents of the preview window will be passed to the GPT/LLM prompt for re-writing.



  • Option 2 - alternatively, select any text region in your open Word document, right click with a mouse and select Rewrite selection with GPT/LLM option from the drop-down menu:




Invoking either of these options will open the GPT text rewriting window.



Rewriting text with GPT/LLM window

Once you select the feature from the menu above, the GPT/LLM text rewriting window will come up. The following operations are available for this feature:




    1. Use this drop-down menu to select the specific GPT/LLM rewriting/post-processing prompt template.  For the GPT/LLM prompt template to appear in this list, it must be selected as "post-processing template" in the prompt settings:



    1. Use the filter field to limit the list shown in the template menu to only those templates that at least partially match the filter.  To remove the filter, click on the "Clear" button.


    1. Shows the preview of the final GPT/LLM prompt with the input data inserted. This will be the prompt that will be sent to GPT/LLM. You can make edits/adjustments to this prompt directly in the window.  The beginning of the prompt are the instructions, separated via "###" from the actual text to be rewritten.  For best results, try to be as precise and detailed in your instructions to GPT/LLM as possible. 


    1. Use this slider to make GPT/LLM responses more or less random/deterministic. Corresponds to the temperature setting for the GPT/LLM.  Higher values will make GPT/LLM output more random/creative, while lower values like 0 will make it more focused and deterministic. We recommend setting this field close to 0 for rewriting operations. It's a good practice to always review GPT/LLM responses for factual correctness, especially if you are using GPT prompts with settings for higher response randomness/creativity.


    1. Press this button to send the prompt from the preview window (item 3) to GPT/LLM. As mentioned above, ClaimMaster does not automatically access OpenAI's or Azure OpenAI GPT services using API. You will only send a prompt to GPT when you press this button.


    1. Press this button to open OpenAI's GPT API settings window.




Specifying a local document workspace to be used for the GPT/LLM prompt  (RAG)

This tab allows you to specify a particular local document workspace for the prompt as part of ClaimMaster's RAG architecture. In particular, ClaimMaster uses semantic searching to find contextually relevant data based on the conceptual similarity of the input prompt.  When you send a prompt to GPT/LLM, ClaimMaster will first query its local vector database that contains your workspaces to find the most similar text snippets for your prompt and will then add those snippets to the final prompt of the configured GPT/LLM source to improve its output results. RAG instructions are also a part of the template, so you can tell GPT to use ONLY the provided text snippets when forming a response or supplement the response with the information from the snippets, while also relying on its own knowledge.

The following options are available from the Local Docs window:


    1. Use this drop-down menu to specify the pre-configured local document workspace to be used for the prompt.
    2. Specify which sections of local documents (e.g., Background, Abstract, etc.) should be used when pulling data from the database.
    3. Specify the max # of text snippets that would be pulled from the vector database, so as to limit the amount of data to be sent to GPT/LLM
    4. Press this button to test the current LLM prompt with the specified workspace. When you click this button, ClaimMaster will pull contextually relevant data from the snippet database and show the results in the text window below (item 7).
    5. Press this button to open the document workspace settings.
    6. Check this box to enable debug output of the prompt lookup, which provides additional information about each retrieved snippet (e.g., similarity score, document source, etc.). 
    7. This text window shows the preview or the result of the RAG lookup.  You can also make direct edits to the text in this window and then when you send a prompt to GPT/LLM, the edited contents of this window will be used to generate additional context for the prompt. 



Providing additional examples/context to GPT/LLM for rewriting

To possibly improve the quality of GPT output you can also pass example output or additional context as part of GPT prompts.  Note - you need to edit the contents of this window before sending text prompts to GPT. This additional example/context text would be configured as part of the GPT template - to add example/context, switch to the "Example/Context" tab when editing a GPT prompt:



Reviewing/editing GPT/LLM output

This tab shows the results returned by GPT service based on the provided prompt or any returned error messages, if any. You can make further text modifications to the results directly in this window.


The following options are available from the GPT Output window 



    1. This text field shows the results returned by GPT service based on the provided prompt or any returned error messages. You can make further text modifications to the results directly in this window 


    1. Click this button to see the differences between the text passed to GPT and the rewritten text by GPT.  This is a very helpful feature to pick up on any subtle differences between GPT input and the produced output.



    1. Press this button if you like the results produced by the specific GPT prompt. It will allow you to turn this prompt and associated instructions/example into a template prompt within ClaimMaster.


    1. Press this button to use the output of GPT rewrite as input for another GPT rewrite, possibly with a different prompt template or settings.


    1. Press this button to copy the contents of the preview window (item 1) into the clipboard.
    2. Press this button to insert the contents of the preview window (item 1) into the open Word document at the location of the cursor in the document.
    3. If this checkbox is selected, when text is inserted back into the open Word document, it will be inserted with Track Changes.


    1. Press this button to accept the rewriting edits made by GPT.  If the GPT rewrite feature was invoked from a patent drafting tool (Option 1), then the rewritten text will be placed back into the preview window of that tool.  If the GPT rewrite feature was invoked directly for the selected text in the open Word document (Option 2), then the rewritten text will replace the selected text in the open document (with Track changes enabled by default - see option 16).  


    1. Press this button to cancel the rewriting operation.  The edits made by GPT will be ignored.