Systems and methods of prompt engineering for neural network interactions
AssigneePromptFlow Technologies LLC
InventorTyler Friddle
Life of this patent
Estimating the term…
Abstract
A self-improving code/prompt system (e.g., an operating system or a process layer) for generating and/or reusing code/prompt processes is provided. Code/prompt processes include a sequence of prompts for a model, such as an LLM and traditional logic (code) which augments the input/output to the LLM and orchestrates interaction with other third party processes. The system includes an interpreter for managing the execution of code/prompt processes and corresponding interactions with external models, system processes, a process database (e.g., of existing code/prompt processes), and other sources.
Claims8
A system for abstracting, re-using, and dynamically applying code/prompt sequences, the system comprising:
- a non-transitory computer-readable storage medium configured to store a database of existing code/prompt processes, associated metadata, and representative embeddings;
- and
- at least one hardware processor configured to perform operations comprising:
- receiving a user input from a user for a code/prompt process data structure, wherein the code/prompt process data structure includes:
- 1) a plurality of prompts that are executable against one or more neural networks, and 2) a plurality of logical code segments;
- executing an interpreter process using the code/prompt process data structure received from the user;
- generating at least a first prompt based on modifying at least one prompt of the plurality of prompts using at least one logical code segment of the plurality of logical code segments;
- executing at least the first prompt against an external model;
- receiving, based on the execution of the first prompt against the external model, a responsive output;
- generating an augmented output based on modifying the responsive output using at least one logical code segment of the plurality of logical code segments;
- generating an embedding based on at least in part on the augmented output;
- executing a find process to perform, against the database and using the embedding, a search operation to retrieve at least one existing code/prompt process of the existing code/prompt processes;
- adapting the at least one existing code/prompt process of the existing code/prompt processes into an executing code/prompt process to generate a modified version of the at least one existing code/prompt process of the existing code/prompt processes;
- and
- continue executing the interpreter process with the modified version of the at least one existing code/prompt process of the existing code/prompt processes and returning an execution result of the modified version of the at least one existing code/prompt process of the existing code/prompt processes to the user.
A method of operating a computer system by allowing user interaction with the computer system by providing a light instruction to an interpreter process in the form of a process request and/or other input data, the method comprising:
- receiving, at a client interpreter process and from a user, a user input and a process request;
- generating a query that is based on the process request received from the user and communicating the query to a microservice;
- executing the microservice to interact with a remote private interpreter process which runs a find/adapt code/prompt process against one or more neural networks;
- executing a find process to perform a first search operation for relevant existing code/prompt processes;
- based on the first search operation failing to find an exact match for the relevant existing code/prompt processes, executing an adaptation process that assembles code/prompt processes returned by a second search operation into a new process that meets the process request received from the user and generates steps in the new process that are identified as missing in the new process;
- returning the adaptation process to the client interpreter process for execution;
- and
- executing the adaptation process by the client interpreter process and returning an execution result of the adaptation process to the user.
Dependencies are inferred from the claim text.