Dynamic prompt adjustment of machine learning model inputs

Dynamic prompt adjustment optimizes language model inputs for specific tasks by varying position, length, and pool selection, enhancing performance without extensive retraining, addressing inefficiencies in fine-tuning large-scale models.

JP2026502908APending Publication Date: 2026-01-27NEC LABORATORIES AMERICA INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2025537992
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-02-29
Filing Date
2024-03-01
Publication Date
2026-01-27

Smart Images

  • Figure 2026502908000001_ABST
    Figure 2026502908000001_ABST
Patent Text Reader

Abstract

A method and system for prompt tailoring includes training (204) a tailoring function for setting a prompt position, a prompt length, or a prompt pool based on a language processing task. The tailoring function is applied (224) to an input query to generate a combined input having a prompt length and prompt text selected according to the prompt pool and added to the input query at the prompt position. The combined input is applied (226) to a language model.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] Related Application Information This application claims priority to U.S. Patent Application No. 63 / 487,642, filed March 1, 2023, and U.S. Patent Application No. 18 / 591,838, filed February 29, 2024, each of which is incorporated by reference in its entirety. [Background technology]

[0002] The present invention relates to language models, and more particularly to adjusting prompts for language models. 2. Description of Related Art

[0003] Large-scale language models are versatile tools that can address diverse natural language processing tasks, including natural language understanding and natural language generation. Furthermore, language models can be pre-trained on large sets of unsupervised data and then undergo supervised learning on smaller datasets to fine-tune them to specific tasks. However, fine-tuning an entire pre-trained language model, which may have billions to trillions of parameters, can be inefficient. Summary of the Invention

[0004] A method for prompt tailoring includes training a tailoring function to set a prompt position, a prompt length, or a prompt pool based on a language processing task. The tailoring function is applied to an input query to generate a combined input having a prompt length and having prompt text selected according to the prompt pool and added to the input query at the prompt position. The combined input is applied to a language model.

[0005] A system for prompt tailoring includes a hardware processor and a memory that stores a computer program that, when executed by the hardware processor, causes the computer program to train a tailoring function to set a prompt position, a prompt length, or a prompt pool based on a language processing task, apply the tailoring function to an input query to generate a combined input having a prompt length and having prompt text selected according to the prompt pool and added to the input query at the prompt position, and apply the combined input to a language model.

[0006] These and other features and advantages will become apparent from the following detailed description of illustrative embodiments thereof, which is to be read in connection with the accompanying drawings. [Brief explanation of the drawings]

[0007] The present disclosure provides details in the following description of preferred embodiments with reference to the following figures.

[0008] [Figure 1] FIG. 1 is a block / flow diagram of dynamic prompt adjustment of a language model according to one embodiment of the present invention.

[0009] [Figure 2] FIG. 2 is a block / flow diagram of a method for training and using a prompt adjustment function according to one embodiment of the present invention.

[0010] [Figure 3] FIG. 1 is a block diagram of the use of a language model with prompt adjustment in the context of a healthcare facility, according to one embodiment of the present invention.

[0011] [Figure 4] FIG. 1 is a block diagram of a computing system in which prompt adjustment functionality can be trained and used, according to one embodiment of the present invention.

[0012] [Figure 5] FIG. 1 is a diagram of an exemplary neural network architecture that may be used to implement portions of the prompt adjustment functionality, according to one embodiment of the present invention.

[0013] [Figure 6] FIG. 1 is a diagram of an exemplary neural network architecture that may be used to implement portions of the prompt adjustment functionality, according to one embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0014] To tune a language model for a specific task, you can use prompt tailoring, where prompts are added to specific inputs and the language model provides results adapted to the task. You can choose dynamic prompts that vary by position, length, and prompt pool to get better results from a pre-trained language model.

[0015] Referring now to FIG. 1 , dynamic prompt adjustment for a natural language task is illustrated. Input text 102 is provided, for example, by a user's input, according to some natural language task. In some cases, the natural language task may include natural language understanding, in which a model determines the meaning of the input text 102. In some cases, the natural language task may include natural language generation, in which a model generates natural language output according to some input. In some cases, the task may include both natural language understanding and natural language generation, such as when a language model is prompted to generate output text having characteristics specified by the natural language input. While the present embodiment is described with particular reference to text prompts, it should be understood that other types of prompts and inputs, such as visual prompts having visual features, may alternatively be used.

[0016] Before input text 102 is applied to a pre-trained language model 106, dynamic prompt adjustment 104 is performed. Dynamic prompt adjustment 104 adds a dynamic prompt to input text 102. The dynamic prompt varies depending on its position 112 relative to the input text 102, its length 114, and / or a pool of prompt options 116 that are selected. The modified prompt is used as an input to pre-trained model 106 to generate output text 108. The prompt is selected so that the output text 108 is a better response to the natural language task than would be generated using the input text 102 alone.

[0017] For position 112, the prompt may be added as a prefix (at the beginning of the input text 102) or a postfix (at the end of the input text 102).

number

number

number

number

number

number

number

number

[0018] By matrix decomposition,

number

number

number

number

number

number

[0019] A sequence x is a set of n tokens x={x1,...,x n}. The pre-trained language model 106 can be used to

number

[0020] However, using a prefix prompt P1 is not always optimal. While prefixes intuitively provide extra information to the input sequence and offer avenues for optimization, they are not always sufficient. Therefore, the position of the prompt can be chosen dynamically, and positional parameters can be learned for different tasks and instances. For this reason, prompts are often used in conjunction with P prefix =[P1,P2,...,P dpos ] and P postfix =[P dpos+1 ,...,P l ]. Thus, the new input to the language model 106 is: X'=[P prefix ;X;P postfix ] where dpos∈[0,l] is the integer to learn, and dpos=l corresponds to a prompt that is entirely prefixed. Since dpos is categorical, the function POS θ and can be optimized using Gumbel-Softmax. θ can generate vectors with lengths corresponding to different positions of the prompt (e.g., 2). The Gumbel-Softmax approach optimizes the output so that if a given dimension of the output of Gumbel-Softmax is "1", the value corresponding to that dimension is selected as the position. Given the output of a neural network,

number

[0021] For example, to determine dpos, we choose from (l+1) positions, with values ​​{α0,...,α l} is the logarithmic probability of different insertion positions {log(p0),...,log(p l )}, and

number

number

[0022] The argmax operation is non-differentiable, but softmax can be used as a continuously differentiable approximation to it. The temperature τ controls the discreteness. Thus, using argmax allows for discrete selection in the forward pass while approximating it using softmax in the backward pass.

[0023] An example of a binarization function is {α0,α1,...,α l}, but this approach is non-differential. The gradient can be propagated through discrete nodes, for example using Gumbel-Softmax sampling. logit=Gumbel-Softmax(POS θ (x),τ) where τ is the annealing temperature adjusted by all training steps. logit is a (l+1)-dimensional binary vector with exactly one element equal to 1 and all other elements equal to 0.

[0024] The length of the prompt can be chosen to suit a particular model or task, but there tends to be little benefit in going beyond 20 tokens. Therefore, in most cases, a prompt length of l=20 can be used. Additional parameters are θ This instance-dependent position selection can be understood here as adaptive position in instance-level selection (adapt_ins_pos). In contrast, learning the optimal position for all instances in a task is achieved by the vector

number

[0025] Prompt length 114 provides further options for tailoring the prompt. Attention masks can also be used.

number

number

[0026] The length 114 of the prompt can be dynamically learned.

number

number

number

number

[0027] The prompts are generated from a prompt pool 116. For example, the set of prompt pools Pool={P (1) ,...,P (k)}, where k is the number of pools. Given an arbitrary input x, a small network

number

number

[0028] In contrast to hard prompts, which are predefined text strings, sequences of vectors are sometimes used as soft prompts. The input text is converted into an embedded vector before being sent to the first transformation layer. A prompt vector is added before or after the input token vector before that input occurs. The attention score comes from a neural network that takes the input sequence and outputs a weight vector. There is not one global prompt vector, but rather K distinct prompt vectors of a given size. This pool of K distinct prompt vectors is randomly initialized, and the vector weights are learned, with the initial random vector values ​​also included in the optimization.

[0029] The prompt position 112, length 114, and pool 116 selections are combined in dynamic prompt adjustment 104 to tailor the prompt to the particular input x and the task being performed. For example, the dynamic position 112 and prompt pool 116 may be updated together, referred to herein as adaptive instance vector positions. In another example, the dynamic position 112 may be used to first learn the optimal task-level position, represented as an adaptive position instance vector, so that the instance-level prompt pool 116 is updated.

[0030] 2, a method for training and using prompt adjustments is shown. The overall method includes training prompt adjustments 200, deploying prompt adjustments 210, processing input 220, and performing response actions 230. These actions may be performed in different physical locations using different computing hardware, although in some embodiments, one or more of these steps may be performed on a single computing system.

[0031] Training 200 for prompt adjustment involves determining 202 training examples for prompt adjustment and supervised learning 204 of a prompt adjustment function. The training examples can include a set of labeled examples of prompts that vary in length, position, and pool, thereby training the adjustment function to generate values ​​for these adjustment variables that reflect the given task. For example, if the task is sentiment classification, the input is a sentence, and the output is a sentiment classification (e.g., 0 for negative sentiment and 1 for positive sentiment), the training examples may include sentence-classification pairs. Training 204 identifies the length, position, and pooling parameters that cause the language model to provide superior performance for the given language processing task. To train these parameters, sentences from the examples are sent to the model, and the output is compared to the classification of the associated example. A loss function is used to guide gradient descent to adjust the prompt parameters and improve the model's performance.

[0032] Once the prompt function has been trained, the prompt function is deployed 210. Deployment 210 can include implementing a language model for a particular language processing task along with a prompt tailoring system. When processing input 220, the input is received 222 in the form of text, e.g., as a natural language query to the language model. For example, the language model can represent a chatbot in a medical or healthcare context, where a medical professional uses the chatbot to gather information from a patient or perform a diagnosis. In such a case, the input may be directed to the language model in the form of a question to elicit a particular type of information or a response to a question from the chatbot.

[0033] Before the input reaches the language model, a tailored prompt is devised and applied to the input 224. This tailoring includes any combination of prompt location 112, prompt length 114, and prompt pool 116. Applying the tailored prompt involves adding the text of the tailored prompt to the input at a given prompt location 112 to form a combined input. The combined input is applied to the language model 226 to generate an output.

[0034] Based on the output of the language model, block 230 executes a responsive action. For example, a medical professional can make a decision regarding the patient's treatment based on the language model's response. In some cases, the input to the language model may prompt the language model to take some automated action, for example, when it receives a command or instruction.

[0035] 3, an illustration of a review summary is shown in the context of a healthcare facility 300. The prompt-adjusted language model 308 can be used to guide the decision-making of a healthcare professional 302, for example, in determining which healthcare products are appropriate for treating a given patient or for use in the healthcare facility 300. The prompt-adjusted language model 308 can also be used to provide medical consultations to patients so that they can obtain information about their condition and treatment without taking up the healthcare professional's 302 time.

[0036] The healthcare facility may include one or more healthcare professionals 302 who review information from a patient's medical record 306 to determine the patient's healthcare and treatment needs. The medical record 306 may further be made available to a language model with prompt tailoring so that questions related to the patient's specific case can be considered. The treatment system 304 may further be designed to monitor the patient's condition to generate the medical record 306 and automatically manage and modify treatment as needed. The medical record 306 may be provided as input to the language model to inform the language model's responses to queries. This allows the patient to ask the language model 308 questions about their specific medical history or current medical condition.

[0037] Based on information from the medical records 306 and the treatment system 304, the prompt-adjusted language model 308 can converse with the patient or medical professional 302 and provide information about the patient. The tailored prompts can serve to adapt a pre-trained language model to the medical context without fine-tuning the model itself. The medical professional 302 can then make decisions about the patient's health care based on the output of the language model. In some cases, the prompt-adjusted language model 308 can automatically provide instructions to the treatment system, for example, if the patient's input indicates an urgent need.

[0038] The various elements of the healthcare facility 300 can communicate with each other via a network 310, for example, using any suitable wired or wireless communication protocol and medium. In this manner, the prompt-adjusted language model 308 transmits responses to the patient and medical professional 302, who can make healthcare decisions in the context of the patient's medical record 306. In some cases, the prompt-adjusted language model 308 can be integrated with an automated treatment system 304 to automatically initiate changes in the patient's treatment in response to information gained from the conversation. For example, if the patient exhibits discomfort or negative side effects from a particular treatment, the treatment system 304 can automatically discontinue the treatment until the medical professional 302 can review the decision.

[0039] 4, computing device 400 illustratively includes a processor 410, an input / output subsystem 420, a memory 430, a data storage device 440, and a communications subsystem 450, and / or other components and devices typically found in a server or similar computing device. In other embodiments, computing device 400 may include other or additional components (e.g., various input / output devices) such as those typically found in a server computer. Furthermore, in some embodiments, one or more of the illustrative components may be incorporated into or otherwise form part of another component. For example, memory 430, or portions thereof, may be incorporated into processor 410 in some embodiments.

[0040] The processor 410 may be embodied as any type of processor capable of performing the functions described herein, and may be embodied as a single processor, multiple processors, a central processing unit (CPU), a graphics processing unit (GPU), a single or multi-core processor, a digital signal processor, a microcontroller, or other processor or processing / control circuitry.

[0041] Memory 430 may be embodied as any type of volatile or non-volatile memory or data storage capable of performing the functions described herein. During operation, memory 430 may store various data and software used during operation of computing device 400, such as an operating system, applications, programs, libraries, and drivers. Memory 430 is communicatively coupled to processor 410 via I / O subsystem 420 and may be embodied as circuits and / or components for facilitating input / output operations with processor 410, memory 430, and other components of computing device 400. For example, I / O subsystem 420 may be embodied as or otherwise include a memory controller hub, an input / output control hub, a platform controller hub, integrated control circuitry, firmware devices, communication links (e.g., point-to-point links, bus links, wires, cables, light guides, printed circuit board traces, etc.), and / or other components and subsystems for facilitating input / output operations. In some embodiments, the I / O subsystem 420 may form part of a system-on-chip (SOC) and be integrated with the processor 410, memory 430, and other components of the computing device 400 on a single integrated circuit chip.

[0042] The data storage device 440 may be embodied as any type of device or apparatus configured for short-term or long-term storage of data, such as, for example, a memory device and circuit, a memory card, a hard disk drive, a solid-state drive, or other data storage device. The data storage device 440 may store program code 440A for training a prompt function, program code 440B for performing prompt adjustments, and / or program code 440C for performing automated response behaviors to a language model. The communications subsystem 450 of the computing device 400 may be embodied as any network interface controller or other communications circuitry, device, or collection thereof capable of enabling communications between the computing device 400 and other remote devices over a network. The communications subsystem 450 may be configured to achieve such communications using any one or more communications technologies (e.g., wired or wireless communications) and associated protocols (e.g., Ethernet, InfiniBand, Bluetooth, Wi-Fi, WiMAX, etc.).

[0043] As shown, computing device 400 may also include one or more peripheral devices 460. Peripheral devices 460 may include any number of additional input / output devices, interface devices, and / or other peripheral devices. For example, in some embodiments, peripheral devices 460 may include a display, a touch screen, graphics circuitry, a keyboard, a mouse, a speaker system, a microphone, a network interface, and / or other input / output devices, interface devices, and / or peripheral devices.

[0044] Of course, computing device 400 may include other elements (not shown) or omit certain elements, as would readily occur to one skilled in the art. For example, various other sensors, input devices, and / or output devices may be included in computing device 400, depending on the particular implementation of the same, as would be readily understood by one skilled in the art. For example, various types of wireless and / or wired input and / or output devices may be used. Furthermore, additional processors, controllers, memory, etc. may be utilized in a variety of configurations. These and other variations of processing system 400 will be readily contemplated by one skilled in the art in view of the teachings of the present invention provided herein.

[0045] Reference is now made to Figures 5 and 6, which illustrate exemplary neural network architectures that can be used to implement portions of the present model, such as prompt adjustments 502 and 602. Neural networks are generalized systems whose functionality and accuracy improve with exposure to additional empirical data. Neural networks learn by exposure to empirical data. During training, the neural network stores and adjusts weights that are applied to input empirical data. Applying the adjusted weights to the data can identify that data belongs to a specific predefined class from a set of classes and output the probability that the input data belongs to each class.

[0046] Empirical data (also called training data) from a set of examples is formatted as a string of values ​​and fed to the input of a neural network. Each example is associated with a known outcome or output. Each column is represented as an (x,y) pair, where x represents the input data and y represents the known output. The input data can be of various data types and contain multiple different values. The network can have one input node for each value that makes up the example input data, and a separate weight can be applied to each input value. The input data can be formatted, for example, as a vector, array, or string, depending on the architecture of the neural network being built and trained.

[0047] Neural networks "learn" by comparing neural network outputs generated from input data with known values ​​from examples and adjusting stored weights to minimize the difference between the output value and the known value. Adjustments can be made to the stored weights through backpropagation, where the weight's influence on the output value is determined by calculating a mathematical gradient and adjusting the weight in a way that shifts the output toward the minimum difference. This optimization, called gradient descent, is a non-limiting example of how training occurs. A subset of examples with known values ​​that were not used in training can be used to test and validate the accuracy of the neural network.

[0048] During operation, a trained neural network can be used on new data not previously used for training or validation through generalization. The adjusted neural network weights can be applied to the new data, and the weights estimate the function developed from the training examples. The parameters of the estimated function, captured by the weights, are based on statistical inference.

[0049] In a layered neural network, nodes are arranged in layers. An exemplary simple neural network has an input layer 520 of source nodes 522 and a single computational layer 530 with one or more computational nodes 532 that also function as output nodes, with a single computational node 532 for each possible category into which an input example may be classified. The input layer 520 may have a number of source nodes 522 equal to the number of data values ​​512 in the input data 510. The data values ​​512 in the input data 510 may be represented as a column vector. Each computational node 532 in the computational layer 530 generates a weighted linear combination of values ​​from the input data 510 provided to the input node 520 and applies a differentiable nonlinear activation function to the sum. An exemplary simple neural network can perform classification on linearly separable examples (e.g., patterns).

[0050] A deep neural network, such as a multilayer perceptron, may have an input layer 520 of source nodes 522, one or more computational layers 530 with one or more computational nodes 532, and an output layer 540 with one output node 542 for each possible category into which an input example may fall. The input layer 520 may have a number of source nodes 522 equal to the number of data values ​​512 in the input data 510. The computational nodes 532 in the computational layer 530 are also referred to as hidden layers because they are located between the source nodes 522 and the output nodes 542 and are not directly observed. Each node 532, 542 in the computational layer generates a weighted linear combination of values ​​from the values ​​output by the nodes in the previous layer and applies a nonlinear activation function that is differentiable over the range of the linear combination. The weights applied to the values ​​from each previous node may be, for example, w1, w2, ... w n-1 ,w n The output layer provides the network's overall response to the input data. Deep neural networks can be fully connected, where each node in a computational layer is connected to every node in the previous layer, or the connections between layers can have other configurations. If links between nodes are missing, the network is said to be partially connected.

[0051] Training a deep neural network involves two phases: a forward phase, in which the weights of each node are fixed and inputs are propagated through the network, and a backward phase, in which error values ​​are propagated back through the network and the weight values ​​are updated.

[0052] Computational nodes 532 in one or more computational (hidden) layers 530 perform nonlinear transformations on the input data 512 to generate a feature space. Classes or categories may be more easily separated in the feature space than in the original data space.

[0053] The embodiments described herein may be entirely hardware, entirely software, or contain both hardware and software elements. In a preferred embodiment, the invention is implemented in software, which includes but is not limited to firmware, resident software, microcode, etc.

[0054] Embodiments may include a computer program product accessible from a computer-usable or computer-readable medium providing program code for use by or in connection with a computer or any instruction execution system. A computer-usable or computer-readable medium may include any apparatus that stores, communicates, propagates, or transports a program for use by or in connection with an instruction execution system, apparatus, or device. The medium may be a magnetic, optical, electronic, electromagnetic, infrared, or semiconductor system (or apparatus or device) or propagation medium. The medium may include computer-readable storage media such as semiconductor or solid-state memory, magnetic tape, removable computer diskettes, random access memory (RAM), read-only memory (ROM), rigid magnetic disks, and optical disks.

[0055] Each computer program can be tangibly stored on a machine-readable storage medium or device (e.g., program memory or magnetic disk) readable by a general-purpose or special-purpose programmable computer to configure and control the operation of the computer when the storage medium or device is read by the computer to perform the procedures described herein. The system of the present invention can also be considered to be embodied in a computer-readable storage medium configured with a computer program, where the configured storage medium causes the computer to operate in a particular, predetermined manner to perform the functions described herein.

[0056] A data processing system suitable for storing and / or executing program code may include at least one processor coupled directly or indirectly to memory elements via a system bus. The memory elements may include local memory employed during the actual execution of the program code, bulk storage, and cache memory that provides temporary storage of at least some program code to reduce the number of times the code is retrieved from bulk storage during execution. Input / output or I / O devices (including but not limited to keyboards, displays, pointing devices, etc.) may be coupled to the system either directly or through intervening I / O controllers.

[0057] Network adapters may also be coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modems, and Ethernet cards are just a few of the types of network adapters currently available.

[0058] As employed herein, the terms “hardware processor subsystem” or “hardware processor” can refer to a processor, memory, software, or combination thereof that cooperate to perform one or more specific tasks. In useful embodiments, a hardware processor subsystem may include one or more data processing elements (e.g., logic circuits, processing circuits, instruction execution devices, etc.). The data processing elements may be included in a central processing unit, a graphics processing unit, and / or a separate processor- or computing element-based controller (e.g., logic gates, etc.). A hardware processor subsystem may include one or more on-board memories (e.g., cache, dedicated memory array, read-only memory, etc.). In some embodiments, a hardware processor subsystem may include one or more memories (e.g., ROM, RAM, basic input / output system (BIOS), etc.) that may be on-board or off-board or dedicated for use by the hardware processor subsystem.

[0059] In some embodiments, the hardware processor subsystem may include and execute one or more software elements, which may include an operating system and / or one or more applications and / or specific code for achieving a specified result.

[0060] In other embodiments, the hardware processor subsystem may include dedicated, specialized circuitry that performs one or more electronic processing functions to achieve a specified result. Such circuitry may include one or more application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), and / or programmable logic arrays (PLAs).

[0061] These and other variations of the hardware processor subsystem are also contemplated in accordance with embodiments of the present invention.

[0062] References herein to "one embodiment" or "one embodiment" of the present invention, as well as other variations thereof, mean that a particular feature, structure, characteristic, etc. described in connection with an embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrase "in one embodiment" or "in one embodiment," as well as any other variations thereof, in various places throughout this specification do not necessarily all refer to the same embodiment. However, it should be understood that features of one or more embodiments may be combined given the teachings of the present invention provided herein.

[0063] For example, in the case of "A / B," the use of any of the following " / ," "and / or," "at least one," such as "A and / or B" or "at least one of A and B" will be understood to be intended to encompass the selection of only the first listed alternative (A), or the selection of only the second listed alternative (B), or the selection of both alternatives (A and B). As a further example, in the case of "A, B, and / or C" and "at least one of A, B, and C," such language is intended to encompass the selection of only the first listed alternative (A), or the selection of only the second listed alternative (B), or the selection of only the third listed alternative (C), or the selection of only the first and second listed alternatives (A and B), the selection of only the first and third listed alternatives (A and C), the selection of only the second and third listed alternatives (B and C), or the selection of all three alternatives (A, B, and C). This can be expanded as many times as there are listed items.

[0064] The foregoing is understood in all respects to be illustrative and exemplary, but not restrictive, and the scope of the invention disclosed herein is to be determined not from the detailed description, but from the claims which are interpreted in accordance with the full breadth permitted by the patent laws. It will be understood that the embodiments shown and described herein are merely exemplary of the invention, and that those skilled in the art could make various modifications without departing from the scope and spirit of the invention. Various other feature combinations could be implemented by those skilled in the art without departing from the scope and spirit of the invention. Having thus described aspects of the invention with the detail and particularity required by the patent laws, what is desired to be claimed and protected by Letters Patent is set forth in the appended claims.

Claims

1. 1. A computer-implemented method for adjusting a prompt, comprising: training (204) an adjustment function for setting prompt location, prompt length, or prompt pool based on a language processing task; applying (224) the adjustment function to the input query to generate a combined input having the length of the prompt and having prompt text selected according to the prompt pool and added to the input query at the prompt position; and applying (226) the combined input to a language model.

2. 10. The method of claim 1, A method in which training the adjustment function selects a prompt prefix length and a prompt postfix length such that the prompt text includes a prefix portion that is added to the beginning of the input query and a postfix portion that is added to the end of the input query.

3. 10. The method of claim 1, The method wherein training the adjustment function selects the length of the prompt text by minimizing a loss function of the language model.

4. 10. The method of claim 1, The method wherein training the tuning function selects the prompt text according to a weighted sum of prompts in a prompt pool.

5. 10. The method of claim 1, The language model is a method for implementing a chatbot that can access patient information for medical decision making in a healthcare environment.

6. 6. The method of claim 5, The input query is from a medical professional regarding a patient's condition or treatment, and the method further includes performing an action responsive to an output of the language model.

7. 6. The method of claim 5, The input query is from a patient regarding a patient's condition or treatment, and the method further includes automatically modifying the patient's treatment based on an output of the language model.

8. 6. The method of claim 5, The patient information includes medical history information and treatment information.

9. 10. The method of claim 1, The method, wherein the language model is a pre-trained language model based on a transformer.

10. 10. The method of claim 1, The training of the adjustment function is performed by supervised learning based on a set of training examples of the language processing task.

11. 1. A system for prompt coordination, comprising: a hardware processor (410); When executed by the hardware processor, it causes the hardware processor to: training (204) an adjustment function for setting prompt location, prompt length, or prompt pool based on a language processing task; applying (224) the adjustment function to the input query to generate a combined input having the length of the prompt and having prompt text selected according to the prompt pool and added to the input query at the prompt position; and a memory (440) storing a computer program for applying (226) the combined input to a language model.

12. 12. The system of claim 11, The system wherein training the adjustment function selects a prompt prefix length and a prompt postfix length such that the prompt text includes a prefix portion that is added to the beginning of the input query and a postfix portion that is added to the end of the input query.

13. 12. The system of claim 11, The computer program further causes the hardware processor to select a length of the prompt text by minimizing a loss function of the language model.

14. 12. The system of claim 11, The computer program further causes the hardware processor to select the prompt text according to a weighted sum of prompts in a prompt pool.

15. 12. The system of claim 11, The language model implements a chatbot that can access patient information for medical decision making in a healthcare environment.

16. 16. The system of claim 15, The input query is from a medical professional regarding a patient's condition or treatment, and the system further includes performing an action responsive to an output of the language model.

17. 16. The system of claim 15, The input query is from a patient regarding a patient's condition or treatment, and the system further includes automatically modifying the patient's treatment based on an output of the language model.

18. 16. The system of claim 15, The patient information includes medical history information and treatment information.

19. 12. The system of claim 11, The system wherein the language model is a pre-trained language model based on a transformer.

20. 12. The system of claim 11, The computer program further causes the hardware processor to perform supervised learning of the adjustment function based on a set of training examples of the language processing task.

Citation Information

Patent Citations

  • Parameter Efficient Prompt Tuning for Efficient Models at Scale

    US20230325725A1

  • Systems and methods for ensembling soft prompts in few-shot fine-tuning of language models

    US20240070394A1