Method and electronic device for generating prompt to be inputted into ai model, and recording medium
The electronic device enhances AI response quality by generating tailored prompts using stored templates and user data, addressing the challenge of varied user expertise in crafting effective prompts for AI models.
Patent Information
- Application Number
- PCT/KR2024/020941
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-16
- Filing Date
- 2024-12-23
- Publication Date
- 2025-07-10
AI Technical Summary
Users with varying levels of expertise face challenges in crafting optimal prompts for AI models due to differences in their ability to adjust parameters, leading to suboptimal responses.
An electronic device and method that utilizes stored prompt templates and user data to generate tailored prompts for AI models, enhancing the quality of responses by filling in missing parameters and guiding users for additional input.
Improves the quality and relevance of AI responses by ensuring prompts are well-understood and effectively utilized, catering to individual user capabilities and preferences.
Smart Images

Figure KR2024020941_10072025_PF_FP_ABST
Abstract
Description
A method for generating prompts to be input to an AI model, and an electronic device and recording medium
[0001] The present disclosure relates to electronic devices, and for example, to methods and recording media for generating prompts to be input to an AI model from user input.
[0002] A generative AI model (GAI) is an AI model that learns from various data to generate new information and sentences. Generative AI models (hereafter referred to as AI models) are used in natural language processing, enabling them to understand the context of given information and perform various language tasks.
[0003] A prompt can refer to a command that generates an image or text output from an AI model. For example, a prompt can guide an AI model to perform a desired action. To obtain higher-quality responses from users, it is important to create prompts that the AI model can understand and interact with. For example, clearly defining the response type, tone or reader level, and response length can improve the quality of the AI model's response. In other words, the AI model's response can vary depending on how the user inputs the prompt.
[0004] The above information may be provided as background art to aid in understanding the present disclosure. No claim or determination is made as to whether any of the above is applicable as prior art related to the present disclosure.
[0005] Because AI models can be used by a variety of users, individual prompt writing skills and / or experience may vary. This can make it difficult to create optimal prompts for the desired AI model. For example, general users who are not prompt engineers may find it difficult to utilize prompt engineering techniques such as parameter tuning, chain of through (COT), and few-shot for various types of AI models (or large language models (LLMs)).
[0006] An electronic device according to this disclosure (or specification, invention) may include a memory and a processor operatively connected to the memory.
[0007] According to one embodiment, the memory may store user data associated with a user of the electronic device, and a plurality of prompt templates.
[0008] In one embodiment, the memory may store instructions that are executed by the processor and, when executed, cause the electronic device to receive a user input including a query to an artificial intelligence (AI) model and, based on the user input, select at least one of a plurality of prompt templates stored in the memory.
[0009] According to one embodiment, the memory may store instructions that cause the electronic device to identify at least one input field that can be input using information included in the received user input and at least one input field that cannot be input using information included in the user input among input fields included in the selected prompt template, input at least one input field that can be input using information included in the user input based on the content of the user input for the selected prompt template, and input at least one input field that cannot be input using information included in the user input based on user data stored in the memory, thereby generating a prompt corresponding to the user input, and inputting the generated prompt to the AI model.
[0010] A method performed by an electronic device according to various embodiments of the present document may include: receiving a user input including a query for an artificial intelligence (AI) model; selecting at least one of a plurality of prompt templates based on the user input; identifying at least one input field that is inputtable using information included in the received user input and at least one input field that is not inputtable using information included in the user input among input fields included in the selected prompt template; generating a prompt corresponding to the user input by inputting at least one input field that is inputtable using information included in the user input based on contents of the user input and at least one input field that is not inputtable using information included in the user input based on user data stored in the memory for the selected prompt template; and inputting the generated prompt to the AI model.
[0011] A computer-readable, non-transitory recording medium according to various embodiments of the present document may store instructions that, when executed by an electronic device, cause the electronic device to perform the following operations: receiving a user input including a query for an artificial intelligence (AI) model; selecting at least one of a plurality of prompt templates based on the user input; identifying at least one input field that is inputtable using information included in the received user input and at least one input field that is not inputtable using information included in the user input among input fields included in the selected prompt template; generating a prompt corresponding to the user input by inputting at least one input field that is inputtable using information included in the user input based on the contents of the user input and inputting at least one input field that is not inputtable using information included in the user input based on user data stored in the memory for the selected prompt template; and inputting the generated prompt to the AI model.
[0012] According to various embodiments of the present document, when a user inputs a query to an AI model through an electronic device, even if the user simply inputs a question, a method for generating a prompt to be input to an electronic device and an AI model can be provided that can generate a prompt corresponding to the user's query based on a stored prompt template.
[0013] In connection with the description of the drawings, the same or similar reference numerals may be used for the same or similar components.
[0014] FIG. 1 is a block diagram of an electronic device within a network environment according to various embodiments.
[0015] FIG. 2 is a block diagram illustrating an integrated intelligence system according to one embodiment.
[0016] FIG. 3 is a diagram showing a form in which relationship information between concepts and actions is stored in a database according to one embodiment.
[0017] FIG. 4A is a block diagram of a generative artificial intelligence system according to one embodiment.
[0018] FIG. 4b illustrates a prompt to be input to an AI model according to one embodiment.
[0019] FIG. 5 is a block diagram of a prompt generation system according to one embodiment.
[0020] Figure 6 is a block diagram of an electronic device according to one embodiment.
[0021] Figure 7 is a block diagram of a prompt generation system according to one embodiment.
[0022] Figure 8 illustrates an example of generating a prompt from user input according to one embodiment.
[0023] Figure 9 is a sequence diagram of a prompt generation method according to one embodiment.
[0024] FIG. 10 illustrates a user interface that can set the detail level of a response of an AI model according to one embodiment.
[0025] FIG. 11 illustrates a user interface representing a sample prompt according to one embodiment.
[0026] FIG. 12 illustrates a user interface for setting prompt-related parameters according to one embodiment.
[0027] Figure 13 illustrates an example of generating a prompt from user input according to one embodiment.
[0028] Figure 14 is a table showing examples of prompt levels and prompt templates set by a user according to one embodiment.
[0029] Figure 15 illustrates an example of generating a prompt from user input according to one embodiment.
[0030] Figure 16 illustrates an example of generating a prompt from user input according to one embodiment.
[0031] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the drawings so that those skilled in the art can easily implement the present disclosure. However, the present disclosure may be implemented in various different forms and is not limited to the embodiments described herein. In connection with the description of the drawings, the same or similar reference numerals may be used for identical or similar components. Furthermore, in the drawings and related descriptions, descriptions of well-known functions and configurations may be omitted for clarity and conciseness.
[0032] FIG. 1 is a block diagram of an electronic device (101) within a network environment (100) according to various embodiments.
[0033] Referring to FIG. 1, in a network environment (100), an electronic device (101) may communicate with an electronic device (102) via a first network (198) (e.g., a short-range wireless communication network), or may communicate with at least one of an electronic device (104) or a server (108) via a second network (199) (e.g., a long-range wireless communication network). In one embodiment, the electronic device (101) may communicate with the electronic device (104) via the server (108). According to one embodiment, the electronic device (101) may include a processor (120), a memory (130), an input module (150), an audio output module (155), a display module (160), an audio module (170), a sensor module (176), an interface (177), a connection terminal (178), a haptic module (179), a camera module (180), a power management module (188), a battery (189), a communication module (190), a subscriber identification module (196), or an antenna module (197). In some embodiments, the electronic device (101) may omit at least one of these components (e.g., the connection terminal (178)), or may have one or more other components added. In some embodiments, some of these components (e.g., the sensor module (176), the camera module (180), or the antenna module (197)) may be integrated into one component (e.g., the display module (160)).
[0034] The processor (120) may, for example, execute software (e.g., a program (140)) to control at least one other component (e.g., a hardware or software component) of the electronic device (101) connected to the processor (120) and perform various data processing or operations. According to one embodiment, as at least a part of the data processing or operations, the processor (120) may store commands or data received from other components (e.g., a sensor module (176) or a communication module (190)) in a volatile memory (132), process the commands or data stored in the volatile memory (132), and store result data in a non-volatile memory (134). According to one embodiment, the processor (120) may include a main processor (121) (e.g., a central processing unit or an application processor) or an auxiliary processor (123) (e.g., a graphics processing unit, a neural processing unit (NPU), an image signal processor, a sensor hub processor, or a communication processor) that can operate independently or together with the main processor (121). For example, when the electronic device (101) includes the main processor (121) and the auxiliary processor (123), the auxiliary processor (123) may be configured to use less power than the main processor (121) or to be specialized for a given function. The auxiliary processor (123) may be implemented separately from the main processor (121) or as a part thereof.
[0035] The auxiliary processor (123) may control at least a portion of functions or states associated with at least one component (e.g., a display module (160), a sensor module (176), or a communication module (190)) of the electronic device (101), for example, on behalf of the main processor (121) while the main processor (121) is in an inactive (e.g., sleep) state, or together with the main processor (121) while the main processor (121) is in an active (e.g., application execution) state. In one embodiment, the auxiliary processor (123) (e.g., an image signal processor or a communication processor) may be implemented as a part of another functionally related component (e.g., a camera module (180) or a communication module (190)). In one embodiment, the auxiliary processor (123) (e.g., a neural network processing unit) may include a hardware structure specialized for processing artificial intelligence models. The artificial intelligence models may be generated through machine learning. This learning can be performed, for example, on the electronic device (101) itself where the artificial intelligence model is executed, or can be performed through a separate server (e.g., server (108)). The learning algorithm can include, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but is not limited to the examples described above. The artificial intelligence model can include multiple artificial neural network layers.The artificial neural network may be one of a deep neural network (DNN), a convolutional neural network (CNN), a recurrent neural network (RNN), a restricted Boltzmann machine (RBM), a deep belief network (DBN), a bidirectional recurrent deep neural network (BRDNN), a deep Q-network, or a combination of two or more of the above, but is not limited to the examples described above. In addition to, or alternatively to, a hardware structure, an artificial intelligence model may include a software structure.
[0036] The memory (130) can store various data used by at least one component (e.g., processor (120) or sensor module (176)) of the electronic device (101). The data can include, for example, software (e.g., program (140)) and input data or output data for commands related thereto. The memory (130) can include volatile memory (132) or non-volatile memory (134).
[0037] The program (140) may be stored as software in the memory (130) and may include, for example, an operating system (142), middleware (144), or an application (146).
[0038] The input module (150) can receive commands or data to be used in a component of the electronic device (101) (e.g., a processor (120)) from an external source (e.g., a user) of the electronic device (101). The input module (150) can include, for example, a microphone, a mouse, a keyboard, a key (e.g., a button), or a digital pen (e.g., a stylus pen).
[0039] The audio output module (155) can output audio signals to the outside of the electronic device (101). The audio output module (155) can include, for example, a speaker or a receiver. The speaker can be used for general purposes, such as multimedia playback or recording playback. The receiver can be used to receive incoming calls. In one embodiment, the receiver can be implemented separately from the speaker or as part of the speaker.
[0040] The display module (160) can visually provide information to an external party (e.g., a user) of the electronic device (101). The display module (160) may include, for example, a display, a holographic device, or a projector and a control circuit for controlling the device. According to one embodiment, the display module (160) may include a touch sensor configured to detect a touch, or a pressure sensor configured to measure the intensity of a force generated by the touch.
[0041] The audio module (170) can convert sound into an electrical signal, or vice versa, convert an electrical signal into sound. According to one embodiment, the audio module (170) can acquire sound through the input module (150), output sound through the sound output module (155), or an external electronic device (e.g., electronic device (102)) (e.g., speaker or headphone) directly or wirelessly connected to the electronic device (101).
[0042] The sensor module (176) can detect the operating status (e.g., power or temperature) of the electronic device (101) or the external environmental status (e.g., user status) and generate an electrical signal or data value corresponding to the detected status. According to one embodiment, the sensor module (176) can include, for example, a gesture sensor, a gyro sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a grip sensor, a proximity sensor, a color sensor, an IR (infrared) sensor, a biometric sensor, a temperature sensor, a humidity sensor, or an illuminance sensor.
[0043] The interface (177) may support one or more designated protocols that may be used to directly or wirelessly connect the electronic device (101) with an external electronic device (e.g., the electronic device (102)). In one embodiment, the interface (177) may include, for example, a high definition multimedia interface (HDMI), a universal serial bus (USB) interface, an SD card interface, or an audio interface.
[0044] The connection terminal (178) may include a connector through which the electronic device (101) may be physically connected to an external electronic device (e.g., electronic device (102)). According to one embodiment, the connection terminal (178) may include, for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (e.g., a headphone connector).
[0045] The haptic module (179) can convert electrical signals into mechanical stimuli (e.g., vibration or movement) or electrical stimuli that a user can perceive through tactile or kinesthetic sensations. According to one embodiment, the haptic module (179) can include, for example, a motor, a piezoelectric element, or an electrical stimulation device.
[0046] The camera module (180) can capture still images and videos. According to one embodiment, the camera module (180) may include one or more lenses, image sensors, image signal processors, or flashes.
[0047] The power management module (188) can manage power supplied to the electronic device (101). According to one embodiment, the power management module (188) can be implemented as, for example, at least a part of a power management integrated circuit (PMIC).
[0048] A battery (189) may power at least one component of the electronic device (101). In one embodiment, the battery (189) may include, for example, a non-rechargeable primary battery, a rechargeable secondary battery, or a fuel cell.
[0049] The communication module (190) may support the establishment of a direct (e.g., wired) communication channel or a wireless communication channel between the electronic device (101) and an external electronic device (e.g., electronic device (102), electronic device (104), or server (108)), and the performance of communication through the established communication channel. The communication module (190) may operate independently from the processor (120) (e.g., application processor) and may include one or more communication processors that support direct (e.g., wired) communication or wireless communication. According to one embodiment, the communication module (190) may include a wireless communication module (192) (e.g., a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module (194) (e.g., a local area network (LAN) communication module, or a power line communication module). Among these communication modules, the corresponding communication module can communicate with an external electronic device (104) via a first network (198) (e.g., a short-range communication network such as Bluetooth, wireless fidelity (WiFi) direct, or infrared data association (IrDA)) or a second network (199) (e.g., a long-range communication network such as a legacy cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (e.g., a LAN or WAN)). These various types of communication modules can be integrated into a single component (e.g., a single chip) or implemented as multiple separate components (e.g., multiple chips). The wireless communication module (192) can verify or authenticate the electronic device (101) within a communication network such as the first network (198) or the second network (199) by using subscriber information (e.g., an international mobile subscriber identity (IMSI)) stored in the subscriber identification module (196).
[0050] The wireless communication module (192) can support 5G networks and next-generation communication technologies following the 4G network, such as NR access technology (new radio access technology). The NR access technology can support high-speed transmission of high-capacity data (eMBB (enhanced mobile broadband)), minimization of terminal power and connection of multiple terminals (mMTC (massive machine type communications)), or high reliability and low latency (URLLC (ultra-reliable and low-latency communications)). The wireless communication module (192) can support, for example, a high-frequency band (e.g., mmWave band) to achieve a high data transmission rate. The wireless communication module (192) can support various technologies for securing performance in a high-frequency band, such as beamforming, massive multiple-input and multiple-output (MIMO), full dimensional MIMO (FD-MIMO), array antenna, analog beam-forming, or large scale antenna. The wireless communication module (192) can support various requirements specified in the electronic device (101), an external electronic device (e.g., the electronic device (104)), or a network system (e.g., the second network (199)). According to one embodiment, the wireless communication module (192) can support a peak data rate (e.g., 20 Gbps or more) for eMBB realization, a loss coverage (e.g., 164 dB or less) for mMTC realization, or a U-plane latency (e.g., 0.5 ms or less for downlink (DL) and uplink (UL), or 1 ms or less for round trip) for URLLC realization.
[0051] The antenna module (197) can transmit or receive signals or power to or from an external device (e.g., an external electronic device). In one embodiment, the antenna module (197) may include an antenna including a radiator formed of a conductor or a conductive pattern formed on a substrate (e.g., a PCB). In one embodiment, the antenna module (197) may include a plurality of antennas (e.g., an array antenna). In this case, at least one antenna suitable for a communication method used in a communication network, such as the first network (198) or the second network (199), may be selected from the plurality of antennas, for example, by the communication module (190). A signal or power may be transmitted or received between the communication module (190) and an external electronic device via the at least one selected antenna. In some embodiments, in addition to the radiator, another component (e.g., a radio frequency integrated circuit (RFIC)) may be additionally formed as a part of the antenna module (197).
[0052] According to various embodiments, the antenna module (197) may form a mmWave antenna module. In one embodiment, the mmWave antenna module may include a printed circuit board, an RFIC disposed on or adjacent a first side (e.g., a bottom side) of the printed circuit board and capable of supporting a designated high-frequency band (e.g., a mmWave band), and a plurality of antennas (e.g., an array antenna) disposed on or adjacent a second side (e.g., a top side or a side side) of the printed circuit board and capable of transmitting or receiving signals in the designated high-frequency band.
[0053] At least some of the above components can be interconnected and exchange signals (e.g., commands or data) with each other via a communication method between peripheral devices (e.g., a bus, GPIO (general purpose input and output), SPI (serial peripheral interface), or MIPI (mobile industry processor interface)).
[0054] According to one embodiment, commands or data may be transmitted or received between the electronic device (101) and an external electronic device (104) via a server (108) connected to a second network (199). Each of the external electronic devices (102 or 104) may be the same or a different type of device as the electronic device (101). According to one embodiment, all or part of the operations executed in the electronic device (101) may be executed in one or more of the external electronic devices (102, 104, or 108). For example, when the electronic device (101) is to perform a certain function or service automatically or in response to a request from a user or another device, the electronic device (101) may, instead of or in addition to executing the function or service itself, request one or more external electronic devices to perform the function or at least a part of the service. One or more external electronic devices that receive the request may execute at least a portion of the requested function or service, or an additional function or service related to the request, and transmit the result of the execution to the electronic device (101). The electronic device (101) may process the result as is or additionally and provide it as at least a portion of a response to the request. For this purpose, cloud computing, distributed computing, mobile edge computing (MEC), or client-server computing technology may be used, for example. The electronic device (101) may provide an ultra-low latency service by using distributed computing or mobile edge computing, for example. In one embodiment, the external electronic device (104) may include an Internet of Things (IoT) device. The server (108) may be an intelligent server utilizing machine learning and / or a neural network. According to one embodiment, the external electronic device (104) or the server (108) may be included in the second network (199).The electronic device (101) can be applied to intelligent services (e.g., smart home, smart city, smart car, or healthcare) based on 5G communication technology and IoT-related technology.
[0055] FIG. 2 is a block diagram illustrating an integrated intelligence system according to various embodiments.
[0056] Referring to FIG. 2, according to one embodiment, the integrated intelligence system may include an electronic device (210) (e.g., electronic device (101) of FIG. 1), an intelligent server (230) (e.g., server (108) of FIG. 1), and a service server (250) (e.g., server (108) of FIG. 1).
[0057] According to one embodiment, the electronic device (210) may be a terminal device (or electronic device) that can connect to the Internet, for example, a mobile phone, a smart phone, a personal digital assistant (PDA), a laptop computer, a TV, white goods, a wearable device, an HMD, or a smart speaker.
[0058] According to the illustrated embodiment, the electronic device (210) may include a communication interface (213) (e.g., the interface (177) of FIG. 1), a microphone (212) (e.g., the input module (150) of FIG. 1), a speaker (216) (e.g., the audio output module (155) of FIG. 1), a display module (211) (e.g., the display module (160) of FIG. 1), a memory (215) (e.g., the memory (130) of FIG. 1), or a processor (214) (e.g., the processor (120) of FIG. 1). The components listed above may be operatively or electrically connected to each other. The electronic device (210) may include at least some of the configurations and / or functions of the electronic device (101) of FIG. 1.
[0059] In one embodiment, the communication interface (213) may be configured to connect to an external device and transmit and receive data. In one embodiment, the microphone (212) may receive sound (e.g., user speech) and convert it into an electrical signal. In one embodiment, the speaker (216) may output the electrical signal as sound (e.g., voice).
[0060] In one embodiment, the display module (211) may be configured to display an image or video. In one embodiment, the display module (211) may also display a graphical user interface (GUI) of a running app (or application program). In one embodiment, the display module (211) may receive a touch input via a touch sensor. For example, the display module (211) may receive a text input via a touch sensor in an on-screen keyboard area displayed within the display module (211).
[0061] According to one embodiment, the memory (215) may store a client module (218), a software development kit (SDK) (217), and a plurality of apps (219a, 219b). The client module (218) and the SDK (217) may constitute a framework (or solution program) for performing general-purpose functions. In addition, the client module (218) or the SDK (217) may constitute a framework for processing user input (e.g., voice input, text input, touch input).
[0062] According to one embodiment, the plurality of apps (219a, 219b) stored in the memory (215) may be programs for performing a specified function. According to one embodiment, the plurality of apps may include a first app (219a) and a second app (219b). According to one embodiment, each of the plurality of apps (219a, 219b) may include a plurality of operations for performing a specified function. For example, the apps (219a, 219b) may include an alarm app, a message app, and / or a schedule app. According to one embodiment, the plurality of apps (219a, 219b) may be executed by the processor (214) to sequentially execute at least some of the plurality of operations.
[0063] According to one embodiment, the processor (214) can control the overall operation of the electronic device (210). For example, the processor (214) can be electrically connected to a communication interface (213), a microphone (212), a speaker (216), and a display module (211) to perform a specified operation.
[0064] According to one embodiment, the processor (214) may also execute a program stored in the memory (215) to perform a designated function. For example, the processor (214) may execute at least one of the client module (218) or the SDK (217) to perform the following operations for processing user input. The processor (214) may control the operations of a plurality of apps (219a, 219b), for example, through the SDK (217). The following operations described as operations of the client module (218) or the SDK (217) may be operations executed by the processor (214).
[0065] According to one embodiment, the client module (218) can receive user input. For example, the client module (218) can receive a voice signal corresponding to a user utterance detected through the microphone (212). Alternatively, the client module (218) can receive a touch input detected through the display module (211). Alternatively, the client module (218) can receive a text input detected through a keyboard or a visual keyboard. In addition, the client module (218) can receive various forms of user input detected through an input module included in the electronic device (210) or an input module connected to the electronic device (210). The client module (218) can transmit the received user input to the intelligent server (230). The client module (218) can transmit status information of the electronic device (210) together with the received user input to the intelligent server (230). The status information can be, for example, execution status information of an app.
[0066] In one embodiment, the client module (218) may receive a result corresponding to the received user input. For example, the client module (218) may receive a result corresponding to the received user input if the intelligent server (230) can produce a result corresponding to the received user input. The client module (218) may display the received result on the display module (211). Additionally, the client module (218) may output the received result as audio through the speaker (216).
[0067] According to one embodiment, the client module (218) can receive a plan corresponding to the received user input. The client module (218) can display the results of executing multiple operations of the app according to the plan on the display module (211). For example, the client module (218) can sequentially display the results of executing multiple operations on the display module (211) and output audio through the speaker (216). The electronic device (210) can, for another example, display only some results of executing multiple operations (e.g., the result of the last operation) on the display module (211) and output audio through the speaker (216).
[0068] In one embodiment, the client module (218) may receive a request from the intelligent server (230) to obtain information necessary to produce a result corresponding to the voice input. In one embodiment, the client module (218) may transmit the necessary information to the intelligent server (230) in response to the request.
[0069] According to one embodiment, the client module (218) may transmit result information of executing multiple operations according to a plan to the intelligent server (230). The intelligent server (230) may use the result information to confirm that the received user input has been processed correctly.
[0070] In one embodiment, the client module (218) may include a voice recognition module. In one embodiment, the client module (218) may recognize voice inputs that perform limited functions through the voice recognition module. For example, the client module (218) may execute an intelligent app that processes voice inputs to perform organic actions based on a specified input (e.g., "Wake up!").
[0071] According to one embodiment, the intelligent server (230) can receive information related to a user voice input from an electronic device (210) via a communication network. According to one embodiment, the intelligent server (230) can convert data related to the received voice input into text data. According to one embodiment, the intelligent server (230) can generate a plan for performing a task corresponding to the user voice input based on the text data.
[0072] In one embodiment, the plan may be generated by an artificial intelligence (AI) system. The AI system may be a rule-based system, a neural network-based system (e.g., a feedforward neural network (FNN) or a recurrent neural network (RNN)), or a combination of the above or another AI system. In one embodiment, the plan may be selected from a set of predefined plans or may be generated in real time in response to a user request. For example, the AI system may select at least one plan from a plurality of predefined plans.
[0073] According to one embodiment, the intelligent server (230) may transmit the results according to the generated plan to the electronic device (210), or transmit the generated plan to the electronic device (210). According to one embodiment, the electronic device (210) may display the results according to the plan on the display module (211). According to one embodiment, the electronic device (210) may display the results of executing an operation according to the plan on the display module (211).
[0074] According to one embodiment, the intelligent server (230) may include a front end (231), a natural language platform (232), a capsule database (238), an execution engine (233), an end user interface (234), a management platform (235), a big data platform (236), or an analytic platform (237).
[0075] According to one embodiment, the front end (231) can receive user input from the electronic device (210). The front end (231) can transmit a response corresponding to the user input.
[0076] According to one embodiment, the natural language platform (232) may include an automatic speech recognition module (ASR module) (232a), a natural language understanding module (NLU module) (232b), a planner module (232c), a natural language generator module (NLG module) (232d), or a text to speech module (TTS module) (232e).
[0077] According to one embodiment, the automatic speech recognition module (232a) can convert voice input received from the electronic device (210) into text data. According to one embodiment, the natural language understanding module (232b) can use the text data of the voice input to determine the user's intent. For example, the natural language understanding module (232b) can perform syntactic analysis or semantic analysis on user input in the form of text data to determine the user's intent. According to one embodiment, the natural language understanding module (232b) can use linguistic features (e.g., grammatical elements) of morphemes or phrases to determine the meaning of words extracted from the voice input, and can match the meaning of the determined words to the intent to determine the user's intent. The natural language understanding module (223b) can obtain intent information corresponding to the user's utterance. The intent information can be information indicating the user's intent determined by interpreting text data. The intent information can include information indicating an action or function that the user intends to execute using the device.
[0078] According to one embodiment, the planner module (232c) can generate a plan using the intent and parameters determined by the natural language understanding module (232b). According to one embodiment, the planner module (232c) can determine a plurality of domains necessary to perform a task based on the determined intent. The planner module (232c) can determine a plurality of operations included in each of the plurality of domains determined based on the intent. According to one embodiment, the planner module (232c) can determine parameters necessary to execute the determined plurality of operations or result values output by the execution of the plurality of operations. The parameters and the result values can be defined as concepts of a specified format (or class). Accordingly, the plan can include a plurality of operations and a plurality of concepts determined by the user's intent. The planner module (232c) can determine the relationships between the plurality of operations and the plurality of concepts in a stepwise (or hierarchical) manner. For example, the planner module (232c) can determine the execution order of a plurality of actions based on the user's intention based on a plurality of concepts. In other words, the planner module (232c) can determine the execution order of a plurality of actions based on parameters required for the execution of the plurality of actions and results output by the execution of the plurality of actions. Accordingly, the planner module (232c) can generate a plan including association information (e.g., ontology) between the plurality of actions and the plurality of concepts. The planner module (232c) can generate the plan using information stored in a capsule database that stores a set of relationships between concepts and actions.
[0079] According to one embodiment, the natural language generation module (232d) can convert specified information into text format. The information converted into text format may be in the form of natural language speech. According to one embodiment, the text-to-speech conversion module (232e) can convert text-to-speech information into speech information.
[0080] According to one embodiment, some or all of the functions of the natural language platform (232) may also be implemented in the electronic device (210).
[0081] The capsule database may store information about the relationships between multiple concepts and actions corresponding to multiple domains. According to one embodiment, the capsule may include multiple action objects (or action information) and concept objects (or concept information) included in the plan. According to one embodiment, the capsule database may store multiple capsules in the form of a concept action network (CAN). According to one embodiment, the multiple capsules may be stored in a function registry included in the capsule database.
[0082] The capsule database may include a strategy registry that stores strategy information necessary for determining a plan corresponding to a user input. The strategy information may include reference information for determining a single plan when there are multiple plans corresponding to the user input. According to one embodiment, the capsule database may include a follow-up registry that stores information on follow-up actions for suggesting follow-up actions to a user in a given situation. The follow-up actions may include, for example, follow-up utterances. According to one embodiment, the capsule database may include a layout registry that stores layout information of information output through the electronic device (210). According to one embodiment, the capsule database may include a vocabulary registry that stores vocabulary information included in the capsule information. According to one embodiment, the capsule database may include a dialog registry that stores information on dialogue (or interaction) with the user. The capsule database may update stored objects through a developer tool. The developer tool may include, for example, a function editor for updating action objects or concept objects. The developer tool may include a vocabulary editor for updating vocabulary. The developer tool may include a strategy editor for creating and registering strategies that determine plans. The developer tool may include a dialog editor for creating conversations with users.The developer tool may include a follow-up editor that activates follow-up goals and allows editing of follow-up utterances that provide hints. The follow-up goals may be determined based on the currently set goals, user preferences, or environmental conditions. In one embodiment, the capsule database may also be implemented within the electronic device (210).
[0083] In one embodiment, the execution engine (233) can use the generated plan to produce a result. The end user interface (234) can transmit the produced result to the electronic device (210). Accordingly, the electronic device (210) can receive the result and provide the received result to the user. In one embodiment, the management platform (235) can manage information used in the intelligent server (230). In one embodiment, the big data platform (236) can collect user data. In one embodiment, the analysis platform (237) can manage the quality of service (QoS) of the intelligent server (230). For example, the analysis platform (237) can manage the components and processing speed (or efficiency) of the intelligent server (230).
[0084] According to one embodiment, the service server (250) may provide a service (e.g., food ordering or hotel reservation) specified to the electronic device (210). According to one embodiment, the service server (250) may be a server operated by a third party. According to one embodiment, the service server (250) may provide information for generating a plan corresponding to the received voice input to the intelligent server (230). The provided information may be stored in a capsule database. In addition, the service server (250) may provide result information according to the plan to the intelligent server (230). The service server (250) may include a plurality of service providers (e.g., CP Service A (251), CP Service B (252), CP Service C (253)), and each of the service providers (251, 252, 253) may provide a function for a domain associated with each capsule stored in the capsule database (238) of the intelligent server (230).
[0085] In the integrated intelligence system described above, the electronic device (210) can provide various intelligent services to the user in response to user input. The user input may include, for example, input via a physical button, touch input, or voice input.
[0086] According to one embodiment, the electronic device (210) may provide a voice recognition service through an intelligent app (or voice recognition app) stored within the device. In this case, for example, the electronic device (210) may recognize a user utterance or voice input received through the microphone (212) and provide the user with a service corresponding to the recognized voice input.
[0087] According to one embodiment, the electronic device (210) may perform a designated operation based on the received voice input, either alone or together with the intelligent server (230) and / or the service server (250). For example, the electronic device (210) may execute an app corresponding to the received voice input and perform a designated operation through the executed app.
[0088] According to one embodiment, when an electronic device (210) provides a service together with an intelligent server (230) and / or a service server (250), the electronic device (210) may detect a user's speech using the microphone (212) and generate a signal (or voice data) corresponding to the detected user's speech. The electronic device (210) may transmit the voice data to the intelligent server (230) via a network (240) using a communication interface (213).
[0089] In one embodiment, an intelligent server (230) may generate a plan for performing a task corresponding to a voice input received from an electronic device (210), or a result of performing an operation according to the plan, in response to the voice input. The plan may include, for example, a plurality of operations for performing a task corresponding to a user's voice input, and a plurality of concepts related to the plurality of operations. The concept may define parameters input to the execution of the plurality of operations, or result values output by the execution of the plurality of operations. The plan may include association information between the plurality of operations and the plurality of concepts.
[0090] According to one embodiment, the electronic device (210) can receive the response using the communication interface (213). The electronic device (210) can output a voice signal generated within the electronic device (210) to the outside using the speaker (216), or can output an image generated within the electronic device (210) to the outside using the display module (211).
[0091] Although FIG. 2 describes an example in which voice recognition of user input received from an electronic device (210), natural language understanding and generation, and calculation of results using a plan are performed on an intelligent server (230), the various embodiments of the present document are not limited thereto. For example, at least some components of the intelligent server (230) (e.g., natural language platform (232), execution engine (233), capsule database (238)) may be embedded in the electronic device (210) (or the electronic device (101) of FIG. 1), so that the operations may be performed by the electronic device (210).
[0092] FIG. 3 is a diagram showing a form in which relationship information between concepts and actions is stored in a database according to various embodiments.
[0093] According to one embodiment, a capsule database (e.g., capsule database (238) of FIG. 2) of an intelligent server (e.g., intelligent server (230) of FIG. 2) may store capsules in the form of a CAN (concept action network) (300). The capsule database may store operations for processing tasks corresponding to a user's voice input and parameters necessary for the operations in the form of a CAN (concept action network).
[0094] According to one embodiment, the capsule database may store a plurality of capsules (capsule (A) (310), capsule (B) (320)) corresponding to each of a plurality of domains (e.g., applications). According to one embodiment, one capsule (e.g., capsule (A) (310)) may correspond to one domain (e.g., location (geo), application). In addition, one capsule may correspond to at least one service provider (e.g., CP 1 (331) or CP 2 (332)) for performing a function for a domain related to the capsule. According to one embodiment, one capsule may include at least one operation (350) and at least one concept (360) for performing a specified function.
[0095] In one embodiment, a natural language platform (e.g., the natural language platform (232) of FIG. 2) can generate a plan for performing a task corresponding to a received speech input using capsules stored in a capsule database. For example, a planner module of the natural language platform (e.g., the planner module (232c) of FIG. 2) can generate a plan using capsules stored in a capsule database. For example, a plan can be generated using actions (311, 313) and concepts (312, 314) of capsule A (310) and actions (321) and concepts (322) of capsule B (320).
[0096] FIG. 4A is a block diagram of a generative artificial intelligence system according to one embodiment.
[0097] Referring to FIG. 4A, a generative artificial intelligence system (400) may include a generative AI model (450), an AI framework (440), a user query / response interface (410), an application / service component (430), and a knowledge repository (420). The AI framework (440) may include a prompt design component (442), an API / plugin management component (444), and an output modification component (446).
[0098] According to one embodiment, a user query / response interface (410) may receive a user's input. The user's input may be in the form of natural language, images, and / or videos. In addition, context information may also be transmitted when the user's input is transmitted. The context information may include various additional information at the time of the user's input. For example, the context information may include information related to the user or the electronic device, such as information about the application the user is currently using or information about the user's location. In addition, the user's input may also be in a form that mixes the aforementioned natural language, images, sounds, and context information. In addition, the user's input may also be in a non-natural language form, such as selecting a menu.
[0099] In one embodiment, the user question / response interface (410) may output the results of the generative artificial intelligence system (400) to the user. The output may be in the form of natural language or specific content, and may also be provided in the form of an action requested by the user.
[0100] According to one embodiment, the AI framework (440) can receive user input and coordinate and control each component necessary to perform the user's intention based on the user's query.
[0101] In one embodiment, user input received from the user question / response interface (410) may be transmitted to a prompt design component (442). The prompt design component (442) may be used to generate prompts suitable for inputting the user input into a large language model (LLM) or a large multimodal model (LMM). The prompt design component (442) may be an AI component that uses a machine learning algorithm or a neural network to develop better prompts over time. The prompt design component (442) may access a knowledge repository (420) containing user preference data, a prompt library, and prompt examples based on the user input to obtain and generate prompts, and may transmit the generated prompts to the LLM or LMM.
[0102] In one embodiment, the API / plug-in management component (444) may communicate with external information when there is a request for additional information when passing user input as input to the generative model. The API / plug-in management component (444) may establish a channel for communicating with the outside of the AI interface through the API, and may enable access to various data sources through the established channel. In addition, the API / plug-in management component (444) may request an action through the API that ultimately performs the user input, rather than an intermediate result, when the application or service needs to perform the action. Information obtained from the outside may be used to generate a prompt in the prompt design component (442) together with the user input, or may be passed as input to the generative model.
[0103] In one embodiment, the output modification component (446) (or refiner component) can fine-tune the output from the generative model. For example, the output modification component (446) can verify that the content generated through the LLM and / or LMM is not irrelevant, does not contain biased content, or does not contain harmful content. In addition, the output modification component (446) can determine to what extent the content matches the result desired by the user and, if necessary, can perform additional processing. The output modification component (446) can additionally configure and provide the user with hints to avoid undesired output.
[0104] According to one embodiment, a generative AI model (450) may generally refer to an artificial intelligence neural network that creates new types of data based on user input information. The generative AI model (450) may include a model that generates images and / or a model that generates languages. Representative models for generating images include a generative adversarial network (GAN) and a variational auto encoder (VAE), and examples include a Diffusion-based generative model that uses a VAE and a Transformer structure. A model for generating languages is a model that is trained to statistically output the most appropriate output based on input values, and representative examples include models such as CHAT-GPT 3 and CHAT-GPT 4. In addition, there are also LMMs (large multimodal models) that can recognize various types of data input such as text, images, and voices and generate new data corresponding thereto.
[0105] FIG. 4b illustrates a prompt to be input to an AI model according to one embodiment.
[0106] A generative AI model (e.g., the generative AI model (450) of FIG. 4a) may be an artificial intelligence model that learns various data to generate new information and sentences. In this document, a generative AI model may also be referred to as an AI model or a large language model (LLM).
[0107] In one embodiment, a user may input user input, including a query, to obtain desired information through an AI model. For example, the user may input the query via text input using a keypad or keyboard, or via voice input using a microphone. User input to the AI model may be input as a prompt. A prompt is a command for the AI model to generate a response, and may serve to guide the AI model to perform a desired action by the user.
[0108] In one embodiment, to obtain the desired response from an AI model, a user may need to create prompts that the AI model can understand and operate on. For example, parameters required for an AI model's response include information such as reader level, response length, respondent's perspective, output format, and output language. If these parameters are entered into the prompt through user input, the AI model can clearly understand the user's query and provide the desired response.
[0109] Referring to FIG. 4b, a prompt (490) created based on user input may include information related to the question, "What is the cutest animal among tigers and animals?" and "reader level, length, perspective, format, answer me in English" defining parameters. When the prompt (490) with various parameters created in this way is input into an AI model (or LLM), the AI model can output a response in English, in a dialogue format, from a marketer's perspective, and within 500 characters at an elementary school level, as defined in the prompt.
[0110] Since AI models can be used by a variety of users, the ability / level of writing prompts for AI models may vary from person to person, making it difficult to write the optimal prompt for the AI model you want to use.
[0111] Below, we describe various embodiments for generating prompts to be input into an AI model from user input based on pre-stored prompt templates and user data, even when the user inputs only brief information.
[0112] FIG. 5 is a block diagram of a prompt generation system according to one embodiment.
[0113] According to one embodiment, the prompt generation system may include a voice assistant (590), a prompt manager (500), and an AI model (550).
[0114] According to one embodiment, a voice assistant (590) may include AI (artificial intelligence)-based hardware and / or software modules that understand the content of a voice input by a user and process actions according to a user's request. For example, the voice assistant (590) may analyze a voice signal using speech recognition technology (automatic speech recognition, ASR) to convert it into text, interpret the content of the converted text, and process various actions such as executing and controlling an application requested by the user, controlling device settings, and searching and providing information based on the interpretation of the text.
[0115] According to one embodiment, a user input to a voice assistant (590) may include a question (or query) requesting the AI model (550) to perform a task and respond, and the voice assistant (590) may transmit the user input including the question to the AI model (550), obtain a response to the question from the AI model (550), and provide the response to the question to the user.
[0116] According to one embodiment, the AI model (550) may include a generative AI model (550) (e.g., the generative AI model (450) of FIG. 4a) or a large language model (LLM), which is an artificial intelligence model that learns various data to generate new information and sentences. For example, the AI model (550) may include an on-device AI model implemented on an electronic device (e.g., the electronic device (101) of FIG. 1, the electronic device (210) of FIG. 2) and a server AI model implemented by an external server (e.g., the intelligent server (230) of FIG. 2), and the server AI model may be implemented and operated on a server of a manufacturer of the electronic device, or 3 rd It can be implemented and operated by a party. The electronic device can transmit user input by selecting an AI model (550) set by the user among available AI models (550), and / or can transmit user input by selecting an AI model (550) that requests a response based on the type or content of the query of the user input.
[0117] According to one embodiment, the prompt manager (500) can perform various operations to generate a prompt (or secondary prompt) from user input (or primary prompt). For example, the prompt manager (500) can receive a user input including a query for the AI model (550), verify the user input based on the number of parameters included in the user input, and if the user input fails the verification, generate a prompt based on a prompt template and pre-stored user data. The prompt generated by the prompt manager (500) includes various information compared to the initial user input, and since the included information is based on user data, when input to the AI model (550), the AI model (550) can provide more accurate and detailed information desired by the user as a response.
[0118] According to one embodiment, the prompt manager (500) may be implemented on an electronic device to generate a prompt in response to a user input and then provide the prompt to the AI model (550), or may be implemented on a server-type AI model to generate a prompt in response to a user input inputted to the AI model (550), and / or may be implemented on a separate server device to receive a user input over a network and then generate a prompt and then provide the prompt to the AI model (550).
[0119] Hereinafter, the prompt manager (500) that evaluates user input and generates a new prompt is described as being implemented on an electronic device that obtains user input; however, the various embodiments of this document are not limited thereto, and the embodiments described below may be provided by various devices such as a server device other than the electronic device.
[0120] Figure 6 is a block diagram of an electronic device according to one embodiment.
[0121] Referring to FIG. 6, the electronic device (600) may include a communication module (640), a display (630), a microphone (650), a processor (610), and a memory (620). In various embodiments of the present document, some of the illustrated components may be omitted or replaced. The electronic device (600) may include at least some of the components and / or functions of the electronic device (101) of FIG. 1 and / or the electronic device (210) of FIG. 2. At least some of the respective components of the illustrated (or not illustrated) electronic device (600) may be operatively, functionally, and / or electrically connected to each other.
[0122] In one embodiment, the hardwares of the electronic device (600) being operatively, functionally and / or electrically connected may mean that a direct connection, or an indirect connection, is established between the hardwares, either wired or wireless, such that the second hardware is controlled by the first hardware among the hardwares.
[0123] According to one embodiment, the display (630) can display various images provided from the processor (610). For example, the display (630) can be implemented as any one of a liquid crystal display (LCD), a light-emitting diode (LED) display, an organic light-emitting diode (OLED) display, a micro electro mechanical systems (MEMS) display, or an electronic paper display, but is not limited thereto. The display (630) can be configured as a touch screen that detects touch and / or proximity touch (or hovering) input using a part of a user's body (e.g., a finger) or an input device (e.g., a stylus pen). The display (630) can include at least some of the configurations and / or functions of the display module (160) of FIG. 1.
[0124] According to one embodiment, the display (630) may provide various screens provided by a voice assistant (e.g., the voice assistant (590) of FIG. 5) in the form of an interactive user interface (UI). For example, the display (630) may display a response (e.g., text, photo) including a task performance result of an AI model (e.g., the AI model (550) of FIG. 5, the generative AI model (450) of FIG. 4A) in response to a user input, a prompt template (or sample prompt) selected in response to the user input, and / or a prompt generated by a prompt manager (e.g., the prompt manager (500) of FIG. 5).
[0125] According to one embodiment, the microphone (650) can pick up external sounds, such as a user's voice, and convert them into voice signals, which are digital data. According to one embodiment, the electronic device (600) may include a microphone in a part of a housing (not shown), or may receive voice signals picked up from an external microphone connected wired or wirelessly. According to one embodiment, the voice signal acquired from the microphone (650) is transmitted to the processor (610), and the processor (610) (or voice assistant) can convert the voice signal into text information through automatic speech recognition (ASR) and perform an operation corresponding to the text information.
[0126] According to one embodiment, the communication module (640) may support wireless communication with an external device using cellular wireless communication (e.g., 4G long term evolution (LTE), 5G new radio (NR)) and / or short-range wireless communication (e.g., WiFi). For example, the electronic device (600) may use the communication module (640) to communicate with an external server (e.g., the intelligent server (230) of FIG. 2) that provides a voice assistant function through a network. The communication module (640) may include at least some of the configurations and / or functions of the communication module (190) of FIG. 1 and / or the communication interface (213) of FIG. 2.
[0127] According to one embodiment, the memory (620) may temporarily or permanently store various data, including volatile memory and non-volatile memory. The memory (620) may include at least a portion of the configuration and / or function of the memory (130) of FIG. 1 and / or the memory (215) of FIG. 2, and may store the program (140) of FIG. 1. The memory (620) may store various applications (e.g., the first app (219a) and the second app (219b) of FIG. 2) and program modules supporting intelligent services (e.g., the client module (218) of FIG. 2).
[0128] According to one embodiment, the memory (620) may store various instructions that may be performed by the processor (610). Such instructions may include control commands such as arithmetic and logical operations, data movement, and / or input / output that may be recognized by the processor (610).
[0129] According to one embodiment, the processor (610) may be configured as one or more processors capable of performing calculations or data processing related to control and / or communication of each component of the electronic device (600). The processor (610) may include at least some of the configurations and / or functions of the processor (120) of FIG. 1 and / or the processor (214) of FIG. 2.
[0130] According to one embodiment, there is no limitation to the computational and data processing functions that the processor (610) may implement on the electronic device (600), but this document will describe various embodiments that generate prompts based on prompt templates and user data in response to user input. The operations of the processor (610) described below may be performed by loading instructions stored in the memory (620).
[0131] In this document, the description that the processor (610) can perform a certain operation (or function, work, task) may be interpreted to mean substantially the same as that an instruction (or command, computer program) that causes the electronic device (600) (or the processor (610)) to perform the corresponding operation is stored in the memory (620) (e.g., non-volatile memory, storage). In addition, the description that the processor (610) can perform a certain operation may be interpreted to mean substantially the same as that at least one processor, without specifying the operation, can perform the corresponding operation.
[0132] According to one embodiment, the memory (620) may store user data related to a user of the electronic device (600). For example, the user data may include personal information such as the user's name, gender, age, and occupation, location information, call / message records, schedules, application usage history, a user profile set by the user (e.g., name, gender, age, and occupation), and / or device information of the electronic device (600). According to one embodiment, the processor (610) may store a predetermined type of data among data obtained from each application or data input by the user in the memory (620) as user data, and may update the user data when the user data changes (e.g., when the location of the electronic device (600) moves).
[0133] According to one embodiment, the memory (620) may store various prompt templates. Here, the prompt templates define the formats of text provided as input when using the AI model and may include examples of information that enable the AI model to provide higher quality responses. The prompt templates may also be referred to as sample prompts. According to another embodiment, the prompt templates may be stored in an external server (e.g., the intelligent server (230) of FIG. 2), and the electronic device (600) may receive at least one of the prompt templates from the external server via the communication module (640).
[0134] In one embodiment, each prompt template may include at least one input field. Here, the input field may refer to a portion of a sentence where a specific word can be inserted. For example, a prompt template related to the topic of travel may be something like, "Recommend a travel destination to (location) during (time period). Express it in (output language)." Here, the time period, location, and output language may be designated as input fields, respectively.
[0135] In one embodiment, prompt templates may include persona templates, task-specific templates, and few-shot templates. Persona templates may include prompt templates that define the role of a respondent to a query entered in an interactive session. Task-specific templates may include prompt templates that indicate the format or computational process required for an AI model to perform a specific task. Few-shot templates may include predefined few-shot examples that may work well for a specific task.
[0136] In one embodiment, the processor (610) may analyze the text of the user input to determine whether a new prompt needs to be generated. For example, the processor (610) may determine, based on information contained in the text of the user input, whether to input the user input directly into the AI model or to generate a new prompt based on a prompt template and then input it into the AI model.
[0137] According to one embodiment, the processor (610) may check the number of parameters included in the user input among a plurality of predetermined parameters. Here, the parameters may include information such as reader level, response length, respondent's perspective, output format, and output language. According to one embodiment, if the number of parameters checked in the user input is less than a reference number, the processor (610) may determine that the user's intended response cannot be obtained through the AI model. If the number of parameters checked in the user input is greater than or equal to the reference number, the processor (610) may determine that the user's intended response can be obtained through the AI model.
[0138] In one embodiment, the processor (610) may analyze the query included in the user input to determine parameters necessary for the evaluation. For example, if the user input includes a travel-related query, the processor may determine parameters such as sentence length, location, date, period, members, and the presence or absence of emphasis, and determine whether the user's query includes these parameters.
[0139] According to one embodiment, if the number of parameters identified in the user input is greater than or equal to a reference number, the processor (610) may transmit the user input to the AI model without performing an operation of generating a prompt based on the prompt template and user data.
[0140] According to one embodiment, the processor (610) may generate a prompt using a prompt template and user data when the number of parameters identified in the user input is less than a reference number.
[0141] According to one embodiment, the processor (610) may calculate a score of the user input based on parameters included in the user input, and compare the calculated score with a reference value to determine whether to generate a prompt.
[0142] In one embodiment, the processor (610) may select at least one of a plurality of prompt templates stored in the memory (620) based on user input. For example, the processor (610) may analyze sentences or words in the user input to determine the topic of the user's query and select a prompt template corresponding to the determined topic (e.g., travel, weather, translation).
[0143] According to one embodiment, the processor (610) may identify at least one input field that can be input using information included in the user input among the input fields included in the selected prompt template. For example, each of the prompt templates includes input fields into which words can be input, and the processor (610) may identify words that can be input into each input field among the words included in the user input. The processor (610) may input the word included in the user input into the input field.
[0144] According to one embodiment, the processor (610) may identify at least one input field that is not inputtable using information included in the user input among the input fields included in the selected prompt template. For example, the processor (610) may identify at least one input field that is not inputtable using words included in the user input.
[0145] According to one embodiment, the processor (610) may fill in at least one input field that is not inputtable based on user data stored in the memory (620) using information included in the user input. For example, if the user input query relates to travel recommendations, the input field may be filled in based on a travel schedule obtained from a calendar application, the number of travelers obtained from an SNS or messaging application, the user's preferred travel destination, and / or the user's personal information.
[0146] According to one embodiment, the processor (610) may provide a guide UI through the display (630) that instructs the user to enter additional user input for input fields that cannot be entered from user data. For example, if information related to a user input query, a respondent's role, a departure date, and an output language cannot be obtained from pre-stored user data among the input fields of the prompt template, the processor (610) may guide the user to enter the corresponding information. Based on the additional input from the user in response to the guide UI, the processor (610) may additionally input the input fields of the prompt template to generate a completed prompt.
[0147] In one embodiment, the processor (610) may input a generated prompt based on the selected prompt template and user data into the AI model. Because the generated prompt includes a more detailed query than the user input, the AI model's response may include more detailed information, reflecting the user's intent.
[0148] In one embodiment, the processor (610) may provide at least one selected prompt template to the user via the display (630). In this case, the processor (610) may not generate a new prompt based on stored user data, but may allow the user to directly enter new user input based on the prompt template, or may provide a prompt template and a prompt generated based on the prompt template and user data via the display (630).
[0149] According to one embodiment, the processor (610) may provide a user interface via the display (630) that can set a detail level indicating the level of detail in the AI model's response. For example, if the detail level is set high (or high level), the processor (610) may add a lot of content to the input field of the prompt and set the response length to a high level so that the AI model can include detailed information. If the detail level is set low (or low level), the processor (610) may add only some essential content to the input field of the prompt and set the response length to a low level so that the AI model can include brief information.
[0150] According to one embodiment, the processor (610) may determine whether a new prompt needs to be generated in response to a user input based on a detail level set through a user interface. For example, when the detail level is set to high, the processor (610) may set a high reference number to increase the frequency of prompt generation using a prompt template. That is, when the detail level is set to high, the user input can be used as input to the AI model as is only when the user input contains relatively more information, and when the detail level is set to low, the reference number is set low so that the user input can be input to the AI model without generating a prompt even if the user input contains relatively brief information.
[0151] Instructions for performing the operations of the electronic device (600) (or processor (610)) described above may be stored on a computer-readable recording medium. The recording medium may be tangible and non-transitory. The recording medium may store one or more computer programs including the instructions.
[0152] Figure 7 is a block diagram of a prompt generation system according to one embodiment.
[0153] According to one embodiment, the prompt generation system (700) may include a voice assistant client (790), a prompt manager (500), and an AI selection module (760). Each of the modules illustrated in FIG. 7 may be configured as separate hardware or may be a software module that can be executed by an electronic device (600) (e.g., a processor (610)).
[0154] According to one embodiment, the voice assistant client (790) may obtain a user profile (564) or user data (562) from an electronic device (e.g., the electronic device (600) of FIG. 6) and transmit the same to the prompt manager (500). For example, the voice assistant client (790) may obtain a user profile set by a user, text stored on the electronic device, image data, application information, and / or activity information, and transmit the same to the prompt manager (500).
[0155] According to one embodiment, the user profile (564) may include personal information and device information set by the user on the electronic device, such as the user's name, gender, age, and occupation.
[0156] According to one embodiment, user data (562) is data recorded according to the use of an application of an electronic device, and may include, for example, data such as location information, call / message records, schedules, and application usage history. In this document, a user profile (564) and user data (562) are not distinguished, and user-related data recorded in the memory of an electronic device (e.g., memory (620) of FIG. 6) may also be referred to as user data (562).
[0157] In one embodiment, the prompt manager (500) may store various prompt templates (550) (or sample prompts), or may obtain prompt templates (550) stored on an external server. For example, the prompt templates (550) may include persona templates (552), task specific templates (554), and few shot templates (556).
[0158] In one embodiment, the persona template (552) may include prompt templates that define the role of a respondent to a query entered in an interactive session. For example, if a user asks a travel-related question, the user may enter "You are a travel agent" in the prompt to specify the role of the respondent. Or, if a user asks a translation-related question, the user may enter "You are a translator who translates Korean into English" in the prompt to specify the role of the AI model. The persona template (552) may include prompt templates that specify the roles of respondent of the AI model for various types of queries.
[0159] In one embodiment, the task-specific templates (554) may include prompt templates that indicate the format or computational process required for an AI model to perform a specific task. For example, when a user asks a math-related question, they may enter something like "Output should be in Latex format?" to request that the AI model respond with a complex equation in a specified format. The task-specific templates may include prompt templates that can elicit responses from the AI model on various topics.
[0160] In one embodiment, the few shot template (556) may include predefined few shot examples that may work well for a specific task. For example, using the contents of a newspaper article A and a summary S of the newspaper article, an example of a task that a user wishes to perform may be input into the AI model, such as "input (A), output (S)". The few shot template (556) may include templates of prompts that include few shot examples that can be input into the AI model in relation to queries on various topics.
[0161] In one embodiment, the prompt manager (500) may perform various operations to generate prompts from user input. For example, the prompt manager (500) may receive user input including a query for an AI model, validate the user input based on the number of parameters included in the user input, and if the user input fails validation, generate a prompt based on a prompt template and a pre-stored user profile (564) and user data (562).
[0162] In one embodiment, the prompt manager (500) can receive user input. For example, the user input may include text input using a keypad or keyboard or voice input via a microphone. If the user input includes voice input, the voice assistant client (790) can convert the voice data into text data through automatic speech recognition (ASR) and transmit it to the prompt manager (500).
[0163] According to one embodiment, the prompt manager (500) includes a session check module (510), a prompt classification module (520), a prompt evaluation module (530), and a prompt generation module (540), and the prompt manager (500) of each of the above modules can manage a work flow. In addition, the prompt manager (500) can store user data (562), a user profile (564), and various prompt templates (550), and / or obtain user data (562), a user profile (564), and various prompt templates (550) stored in memory.
[0164] In one embodiment, the session check module (510) (or session checker) may analyze the content of the user input to determine whether to maintain the current session for question-and-answer with the AI model or to establish a new session. Here, the session may be divided into a series of units in which interactions between the user and the AI model occur. In one embodiment, the session check module (510) may include a similarity check module (512) (or similarity checker) that compares the content of the current user input with a list of previous user inputs (or prompts) in the current session to determine whether the content of the current user input is similar to previous user inputs.
[0165] In one embodiment, the prompt classification module (520) (or prompt classifier) can distinguish which type of prompt generation module (540) should be used for which input sentence of the user input. For example, the prompt classification module (520) can classify the current user input according to the topic of the query (e.g., travel, weather, translation), and the prompt generation module (540) can call the user data (562) and the prompt template according to the topic classified by the prompt classification module (520) to generate a new prompt.
[0166] In one embodiment, the prompt evaluation module (530) (or prompt evaluator) may evaluate whether the AI model's response can obtain the quality result intended by the user when inputting the user input into the AI model. For example, the prompt evaluation module (530) may check the number of parameters included in the user input among a plurality of predetermined parameters. Here, the parameters may include information such as reader level, response length, respondent's perspective, output format, and output language. In one embodiment, the prompt evaluation module (530) may determine that the user's intended response cannot be obtained through the AI model if the number of parameters identified in the user input is less than a reference number, and may determine that the user's intended response can be obtained through the AI model if the number of parameters is greater than or equal to the reference number.
[0167] In one embodiment, the prompt evaluation module (530) can determine parameters necessary for evaluation based on a user's query. For example, if the user input includes a travel-related query, parameters such as sentence length, location, date, period, member, and presence or absence of emphasis can be determined, and it can be verified whether the user's query includes these parameters.
[0168] In one embodiment, the prompt generation module (540) may generate a prompt to be input into the AI model based on a user profile (564), user data (562), and at least one prompt template in response to a user input. In one embodiment, the prompt generation module (540) may include an initialization module (542), a normalization module (544), an optimization module (548), a prompt filter (546), and a dynamic prompt selection module (549).
[0169] In one embodiment, the initialization module (542) (or initializer) may generate a prompt using a prompt template for user input. For example, the initialization module (542) may select at least one prompt template related to a query of the user input from among a plurality of prompt templates, and input an input field of the prompt template using words and / or user data (562) included in the user input.
[0170] In one embodiment, the normalization module (544) (or normalize) may normalize input text that is deemed unnecessary for the AI model to perform its task. For example, the normalization module (544) may distinguish between information necessary for the AI model to generate a response and information unnecessary among the text of the user input, and filter out the unnecessary information.
[0171] According to one embodiment, the optimization module (548) (or optimizer) may shorten the length of the prompt generated by the initialization module (542) or change it to a prompt format optimized for the task in order to lower the calling cost of the AI model.
[0172] According to one embodiment, the prompt filter module (546) (or prompt filter) may filter out sensitive information (e.g., harmful words, discriminatory content, sexual content) or content not supported by the AI model from the generated prompt.
[0173] In one embodiment, the dynamic prompt selection module (549) (or dynamic prompt selector) may add examples to the prompt, such as a few shot example required for the prompt.
[0174] According to one embodiment, the AI selection module (760) (or AI selector) may determine at least one of the AI models (752, 754, 756) to which the generated prompt will be delivered via the prompt manager (500). For example, the generated prompt, based on the selection of the AI selection module (760), may be delivered to an on-device AI model (752), a server AI model (754), or a third AI model (756). rd At least one of the party AI models (756) may be transmitted, and the AI model may receive the prompt, perform a task associated with the user's query, and provide a response including the result value to the electronic device.
[0175] Figure 8 illustrates an example of generating a prompt from user input according to one embodiment.
[0176] According to one embodiment, an electronic device (e.g., the electronic device (600) of FIG. 6) may receive a user input (810) including a query via text input or voice input. For example, the user input may include a text input such as "Recommend a travel destination." According to one embodiment, the electronic device may determine the text of the user input (810) as an initial prompt (or primary prompt), and perform an evaluation and a new prompt (or secondary prompt) generation operation by a prompt manager (e.g., the prompt manager (500) of FIG. 7) from the initial prompt.
[0177] According to one embodiment, a prompt evaluation module (or prompt evaluator) (820) (e.g., the prompt evaluation module (530) of FIG. 7) can evaluate whether an intended response result can be generated when a user input is input to an AI model. The prompt evaluation module (820) can check the number of parameters included in the user input among a plurality of predetermined parameters and compare the number with a reference number to evaluate the user input. For example, the prompt evaluation module (820) can check the sentence style, length, whether it corresponds to a corresponding category sample, language format, and / or the presence or absence of emphasis from the user input. In the case of the text of the user input (810), "Recommend a travel destination" belongs to the travel category, but does not include parameters required for the travel category, such as a location or time zone, so the AI model can recommend a travel destination more comprehensively. The prompt evaluation module (820) may determine that a new prompt needs to be created based on the evaluation results and may pass user input to the prompt classification module (830) or the prompt generation module (840).
[0178] In one embodiment, a prompt classifier module (830) (e.g., the prompt classifier module (520) of FIG. 7) can determine which type of prompt generation module (840) should be used for an input sentence of user input. For example, the prompt classifier module (830) can analyze the subject of the query from the user input text as travel and load a prompt template (or sample prompt) related to travel from among pre-stored prompt templates (850).
[0179] According to one embodiment, the prompt classification module (830) may call at least one prompt template corresponding to a level set by the user among the prompt templates (850). For example, the prompt classification module (830) may determine categories for responses based on the user's intent, such as travel recommendations, weather recommendations, and music recommendations, and load prompt templates based on each category to provide guidance to the user, or may find prompt templates of an appropriate level based on a level setting value set by the user through the user interface and pass the same to the prompt generation module (840).
[0180] According to one embodiment, the prompt generation module (840) (e.g., the prompt generation module (540) of FIG. 7) may generate a prompt based on a prompt template. The prompt generation module (840) may input input fields of the loaded prompt template based on user data. Referring to FIG. 8, when the detail level is set to a low level, a prompt template with a low level set may be loaded, and by inputting information, such as natural scenery and travel schedule for August, which are the user's interests identified from the user data, into input fields, a first prompt (862) may be generated, such as "Recommend three overseas travel destinations with beautiful natural scenery that are good to visit in August." When the detail level is set to a medium level, a prompt template with a medium level set may be loaded, and by inputting information into input fields based on the user data, a second prompt (864) may be generated, such as "Recommend 5 places where families can enjoy activities in August and recommend places with good activities and natural environments." When the Detail level is set to High, the prompt template with the Medium level is loaded and based on the user data, the input fields are filled with information such as Traveler Family, Number of Family Members, and Age of Children, and the third prompt (866) is displayed as "I'm going on a trip with my family. There are three people. In my family and we have an 8 years old child.“Recommend 5 places where families can enjoy activities in August and recommend places with good activities and natural environments” can be created.
[0181] In one embodiment, the user interface may allow the user to set a lower level as the detail level of the prompt, in which case the prompt may be generated using a prompt template corresponding to the lower level. As a result, the electronic device may determine the first prompt (862) generated using the prompt template corresponding to the lower level as a new prompt (870) corresponding to the user input (810), and input the new prompt (870) into an AI model (e.g., the generative AI model of FIG. 4A, the AI model (550) of FIG. 5).
[0182] Figure 9 is a sequence diagram of a prompt generation method according to one embodiment.
[0183] In the following embodiments, the operations may be performed sequentially, but are not necessarily performed sequentially. For example, the order of the operations may be changed, and at least two operations may be performed in parallel. According to one embodiment, the prompt manager (500) (e.g., the prompt manager (500) of FIG. 7) may receive user input for an AI model (e.g., the AI models (752, 754, 756) of FIG. 7). The prompt manager (500) may generate text information of the user input as prompt 1.
[0184] According to one embodiment, in operation 912, the prompt manager (500) may analyze the query of the user input (or prompt 1) to determine whether it is related to the conversation content of the previous session through the session check module (510) (e.g., the session check module (510) of FIG. 7). In operation 914, the session check module (510) may compare the similarity between the query of the user input and the conversation content of the previous session with a threshold value and return the similarity (or isRelated) to the prompt manager (500). The similarity may be determined as true or false.
[0185] According to one embodiment, if the query of the user input is not related to the conversation content of the previous session, at operation 914, the session check module (510) (the session check module (510) of FIG. 7) may return “isRelated == false” to the prompt manager (500). In this case, at operation 922, the prompt manager (500) may request the creation of a new session, and at operation 924, may obtain new session information.
[0186] According to one embodiment, if the query of the user input is related to the conversation content of the previous session, at operation 912, the session check module (510) may return "isRelated == true" to the prompt manager (500). In this case, at operation 928, the prompt manager (500) may obtain existing session information and perform a prompt generation operation based on a prompt template in response to the user input within the existing session.
[0187] In one embodiment, at operation 932, the prompt manager (500) may call classifyPrompt(prompt 1) to the prompt classification module (520) to determine the type of task that the user input (or prompt 1) is intended to perform. At operation 934, the prompt classification module (520) may classify the user input into a task with the highest similarity among the tasks that the prompt manager (500) may generate, and return the corresponding prompt type to the prompt manager (500). For example, the prompt classification module (520) may classify the current user input according to the topic of the query (e.g., travel, weather, translation).
[0188] According to one embodiment, at operation 942, the prompt manager (500) may call evaluatePrompt (Prompt 1) to the prompt evaluation module (530) to determine whether generation of an additional prompt is required for the user input (or prompt 1). At operation 944, the prompt evaluation module (530) may evaluate the user input according to predefined criteria and return an evaluateScore to the prompt manager (500). For example, the prompt evaluation module (530) may check the number of parameters included in the user input among a plurality of predetermined parameters, and if the number is less than the criteria number, determine that generation of an additional prompt is required, and if the number is greater than the criteria number, determine that generation of an additional prompt is not required. Here, the criteria number may be determined based on the type of the user input, the amount of information included, and / or the detail level set by the user.
[0189] In one embodiment, if the evaluateScore is greater than or equal to the reference value, the prompt manager (500) determines that no additional prompts need to be generated, and in operation 952, the user input (or prompt 1) can be input directly into the AI model. In operation 954, the AI model can process a query regarding the user input and respond to the prompt manager (500).
[0190] In one embodiment, if the evaluateScore is less than the threshold value, the prompt manager (500) determines that generation of an additional prompt is necessary, and in operation 962, calls makePrompt (Prompt 1) in the prompt generation module (540) (e.g., the prompt generation module (540) of FIG. 7) to generate a new prompt.
[0191] According to one embodiment, in operation 964, the prompt generation module (540) calls getPromptTemplate() to obtain a prompt template corresponding to the user input among the pre-stored prompt templates (550), and in operation 966, at least one prompt template among the pre-stored prompt templates can be obtained.
[0192] In one embodiment, the prompt generation module (540) may generate a new prompt (or prompt 2) by reconfiguring a prompt based on at least one acquired prompt template. In one embodiment, in response to a user input, a prompt to be input into the AI model may be generated based on a user profile, user data, and at least one prompt template. For example, the prompt generation module (540) may input an input field of a loaded prompt template based on words included in the user input and / or user data previously stored on the electronic device. In operation 968, the prompt generation module (540) may transmit the generated prompt to the prompt manager (500).
[0193] According to one embodiment, in operation 970, the prompt manager (500) inputs the prompt generated by the prompt generation module (540) into the AI model (or LLM (large language model)), and in operation 972, obtains a response corresponding to the prompt from the AI model.
[0194] FIG. 10 illustrates a user interface that can set the detail level of a response of an AI model according to one embodiment.
[0195] According to one embodiment, the electronic device (600) (e.g., the electronic device (600) of FIG. 6) may provide a user interface through a display (e.g., the display (630) of FIG. 6) that allows a user to set a detail level of a response of an AI model. Here, the detail level may match the amount or level of detail of information provided in a response of an AI model (e.g., an on-device AI model (752), a server-type AI model (754)) for an input prompt. According to one embodiment, the electronic device (600) may determine information included in the prompt to induce a response of the AI model according to the detail level set through the user interface.
[0196] According to one embodiment, the electronic device (600) can provide examples (1040, 1050) of responses that can be provided by the AI model according to the detail level for the example sentence (1030) through the user interface.
[0197] Referring to FIG. 10, an example of a response from an AI model is shown when a user queries (1030) “How is the weather today?” As shown in FIG. 10, when a user sets a low detail level through a user interface (1010), the electronic device (600) (or prompt manager) can create a prompt and input it to the AI model by adding only a small number of input fields of the prompt template and / or setting a short response length so that the AI model provides brief information (1040) as a response, such as the temperature and precipitation of the current area.
[0198] In contrast, when the user sets the detail level to a high level through the user interface (1020), the electronic device (600) (or prompt manager) can generate a prompt and input it to the AI model by adding a large number of input fields of the prompt template and / or setting the response length to a long value so that the AI model provides detailed information (1050) related to the user's query, such as probability of precipitation, humidity, wind speed, probability of precipitation by day of the week, and probability of precipitation by hour, as a response.
[0199] FIG. 11 illustrates a user interface representing a sample prompt according to one embodiment.
[0200] According to one embodiment, an electronic device (600) (e.g., the electronic device (600)) may, in response to a user input, extract at least one prompt template related to a query of the user input from among a plurality of prompt templates pre-stored in the electronic device or an external server, and provide the extracted at least one prompt template to the user through a display. In this case, the electronic device (600) may display example phrases of an input field required for prompt generation so as to be distinguished from other words.
[0201] Referring to (a) of FIG. 11, a user can input the query "Recommend a travel destination" using a voice assistant. The electronic device can convert the input user's voice into text and display the converted user input text (1110) on the display.
[0202] According to one embodiment, the electronic device (600) (e.g., the prompt classification module) may, in response to the user input, identify a prompt template (or sample prompt) (1122) with the title "Create a Road Trip Route" as shown in (b) of FIG. 11 and provide it through a display. In this case, the electronic device (600) may display information corresponding to an input field requiring input by the user, such as "Western United States, 7 days, LAX, Seattle Airport, National Parks and Scenic Spots," using a distinguishing symbol such as parentheses.
[0203] Alternatively, the electronic device (600) may provide the user with a prompt template (1124) with the title “Create Off-Peak Season Travel Plan” as in (c) of FIG. 11, or a prompt template (1126) with the title “Create Custom Travel Itinerary” as in (d) of FIG. 11, by displaying the prompt template.
[0204] In this way, when guiding a user with a prompt template (1122, 1124, 1126), the user can view the template and input the information necessary to obtain a high-quality AI response result in text or voice.
[0205] According to one embodiment, the electronic device (600) may generate a prompt using the selected prompt template when a user input for one of the prompt templates is received while displaying at least one prompt template on the display. For example, when the prompt template of FIG. 11 (b) is selected by the user, the electronic device (600) may check information such as a travel destination, period, and departure / arrival airport from user data stored in the electronic device (600) and input the information into an input field to generate a prompt.
[0206] FIG. 12 illustrates a user interface for setting prompt-related parameters according to one embodiment.
[0207] According to one embodiment, an electronic device (600) (e.g., the electronic device (600) of FIG. 6) may provide a user interface (1210, 1220, 1230, 1240) through a display that allows the user to set parameters required for generating a prompt. The electronic device (600) may generate a prompt text according to the criteria set through the user interface (1210, 1220, 1230, 1240) and input the prompt text into an AI model.
[0208] Referring to (a) of FIG. 12, the electronic device (600) may provide a user interface (1210) that allows the user to set the tone of the AI model's responses. The user interface (1210) may include an adjustment bar that allows the user to select a tone level between friendly and formal. The electronic device (600) may set an input field related to the tone in the prompt based on the level set by the user in the user interface (1210).
[0209] Referring to (b) of FIG. 12, the electronic device (600) may provide a user interface (1220) that can set the style of an AI model's response. The user interface (1220) may include an adjustment bar that allows the user to select a level between a simple and detailed style. The electronic device (600) may set an input field related to the style of the response in the prompt according to the level set by the user in the user interface (1220).
[0210] Referring to (c) of FIG. 12, the electronic device (600) may provide a user interface (1230) that allows the user to set a reader level. The user interface (1230) may include an adjustment bar that allows the user to select a level between beginner and expert levels (or between child and adult levels). The electronic device (600) may set an input field related to the reader level in a prompt based on the level set by the user in the user interface (1230).
[0211] Referring to (d) of FIG. 12, the electronic device (600) may provide a user interface (1240) that can set the output format of the AI model's response. The user interface (1240) may include an adjustment bar that can select a level between text and picture. The electronic device (600) may set an input field related to the output format in a prompt according to the level set by the user in the user interface (1240).
[0212] Figure 13 illustrates an example of generating a prompt from user input according to one embodiment.
[0213] Referring to FIG. 13, a user can input "Recommend a 4-night, 5-day Southeast Asian travel destination" as user input to an AI model via text or voice using a voice assistant. At operation 1310, the electronic device can convert the user input into text data via automatic speech recognition (ASR) to obtain the user input text.
[0214] According to one embodiment, in operation 1320, an electronic device (e.g., electronic device (600) of FIG. 6) (or prompt classification module (520), prompt classifier) may analyze the content of a query of a user input and classify it into a travel category.
[0215] According to one embodiment, at operation 1330, when a user input is input to an AI model, the electronic device may evaluate whether the AI model's response can achieve the result intended by the user. The electronic device may evaluate the user input by comparing the number of parameters included in the user input among a plurality of parameters with a reference number.
[0216] In one embodiment, the electronic device can determine parameters necessary for evaluation based on the content of the user input query. For example, the electronic device can check whether the input data includes role assignment, sentence length, location, date, period, members, and emphasis as parameters for the travel category, and whether the AI model's response includes output language, output format, and output style as requested.
[0217] According to one embodiment, in operation 1340, the electronic device determines that the user input does not include information about role assignment, date, emphasis, output language, output format, and output style as a result of checking whether the user input includes the above parameters, and thus falls short of the standard number, and thus determines the level of information included in the user input as low. If the user sets the prompt level to middle, the electronic device may determine that reinforcement of the prompt based on the prompt template or creation of a new prompt is necessary because the level of the current user input is low.
[0218] According to one embodiment, the electronic device inputs user input to a prompt generation module (or prompt generator) (540), the prompt generation module (540) obtains a prompt template corresponding to a travel category of the user input, and inputs input fields (e.g., role assignment, date) not included in the user input from the prompt template based on user data stored in the electronic device to generate a prompt.
[0219] Figure 14 is a table showing examples of prompt levels and prompt templates set by a user according to one embodiment.
[0220] According to one embodiment, an electronic device (e.g., electronic device (600) of FIG. 6) may store a plurality of prompt templates and select at least one prompt template corresponding to a prompt level set by a user among the plurality of prompt templates.
[0221] For example, if user input related to travel recommendations is being entered, a prompt template set to prompt level low might consist of a relatively short text containing input fields for period, location, and output language.
[0222] A prompt template set to prompt level middle can consist of relatively longer text than a prompt template set to prompt level low, which includes roles, departure date, travel duration, location, number of people, and output language.
[0223] A prompt template set to prompt level high can consist of relatively longer text than a prompt template set to prompt level low and prompt level middle, which includes role, departure date, travel duration, location, number of people, emphasis, format, two output languages, and output style.
[0224] Figure 15 illustrates an example of generating a prompt from user input according to one embodiment.
[0225] Referring to the examples of FIGS. 13 and 14, an electronic device (e.g., electronic device (600) of FIG. 6) may evaluate user input to determine that a prompt needs to be generated and call a prompt template at a middle level of the travel category.
[0226] A user can input "Recommend a 4-night, 5-day trip to a couple's destination in Southeast Asia" as user input to the AI model via text or voice using a voice assistant. At step 1510, the electronic device can convert the user input into text data using automatic speech recognition (ASR) to obtain the user input text.
[0227] According to one embodiment, in operation 1520, the electronic device may identify input fields that can be input from a user input query among input fields of the prompt template. For example, the travel period among input fields may be input from the words "4 nights and 5 days" in the input data, the location may be input from "Southeast Asia," and the number of people may be input from "couples."
[0228] According to one embodiment, at operation 1530, the electronic device may generate a partial prompt by inputting at least some of the input fields of the prompt template from words in the user input. Referring to the partial prompt of FIG. 15, input fields that cannot be filled in from input data may include a role, a departure date, and an output language.
[0229] In one embodiment, the electronic device can input at least one input field not entered by the user based on user data in a partial prompt. For example, the electronic device can obtain information such as a travel departure date from applications such as a calendar, messaging, or social networking services, and obtain the output language of the AI model based on the user's language.
[0230] According to one embodiment, at operation 1540, the electronic device may request additional questions from the user for input fields that cannot be entered from user data. For example, if the electronic device cannot obtain information related to the respondent's role, departure date, or output language from the user input query or pre-stored user data among the input fields of the prompt template, the electronic device may guide the user to enter the corresponding information.
[0231] According to one embodiment, at operation 1550, the electronic device may generate a completed prompt by adding input fields of the prompt template based on additional input from the user.
[0232] Figure 16 illustrates an example of generating a prompt from user input according to one embodiment.
[0233] According to one embodiment, when an electronic device (e.g., the electronic device (600) of FIG. 6) inputs a user input to an AI model, it can evaluate whether the AI model's response can produce a quality result intended by the user. For example, the prompt evaluation module can check the number of parameters included in the user input among a plurality of predetermined parameters, and if the number of checked parameters is less than a reference number, it can determine that a prompt needs to be generated. If the number is greater than or equal to the reference number, it can determine to input the user input as is into the AI model.
[0234] In one embodiment, a user may input user input including detailed inquiries related to travel plans. In operation 1610, the electronic device may convert the user input into text data via automatic speech recognition (ASR) to obtain the user input text.
[0235] According to one embodiment, at operation 1620, the electronic device may analyze the content of the user input text to determine a travel category.
[0236] According to one embodiment, at operation 1630, when inputting user input to an AI model, the electronic device may evaluate whether the AI model's response can achieve the user's intended result. For example, the electronic device may compare the number (or score) of parameters included in the user input with a reference number (or reference score).
[0237] In one embodiment, the electronic device can determine parameters necessary for evaluation based on the content of the user input query. For example, the electronic device can check whether the input data includes role assignment, sentence length, location, date, period, members, and emphasis as parameters for the travel category, and whether the AI model's response includes output language, output format, and output style as requested.
[0238] According to one embodiment, at operation 1640, the electronic device may determine that all parameters are included in the user input based on the evaluation result, and determine the level of information contained in the user input to be high. If the user sets the prompt level to middle, the electronic device may determine that reinforcement of the prompt based on the prompt template is not necessary, since the current user input level is high.
[0239] In one embodiment, the electronic device may determine that the number of parameters included in the user input is greater than or equal to a reference number and may not perform a prompt generation process using a prompt template. The electronic device may use the user input as an input prompt for the AI model and input it into the AI model.
[0240] An electronic device according to various embodiments of the present document may include a memory and a processor operatively connected to the memory.
[0241] According to one embodiment, the memory may store user data associated with a user of the electronic device, and a plurality of prompt templates.
[0242] According to one embodiment, the memory may store instructions that are executable by at least one processor and, when executed, cause the electronic device to receive a user input including a query to an artificial intelligence (AI) model and, based on the user input, select at least one of a plurality of prompt templates stored in the memory.
[0243] According to one embodiment, the memory may store instructions that cause the electronic device to identify at least one input field that can be input using information included in the received user input and at least one input field that cannot be input using information included in the user input among input fields included in the selected prompt template, input at least one input field that can be input using information included in the user input based on the content of the user input for the selected prompt template, and input at least one input field that cannot be input using information included in the user input based on user data stored in the memory, thereby generating a prompt corresponding to the user input, and inputting the generated prompt to the AI model.
[0244] According to one embodiment, the memory may store instructions that cause the electronic device to provide a guide UI that instructs the user to enter additional user input when there is an input field among the input fields of the selected prompt template that cannot be entered using the user input and the user data stored in the memory.
[0245] According to one embodiment, the memory may store instructions that cause the electronic device to input at least one of the input fields included in the selected prompt template using words included in the received user input.
[0246] According to one embodiment, the memory may store instructions that cause the electronic device to determine a subject of a query from the user's input and select at least one prompt template corresponding to the determined subject from among a plurality of templates stored in the memory.
[0247] According to one embodiment, the memory may store instructions that cause the electronic device to check the number of parameters included in the user input among a plurality of predetermined parameters, and, if the number of the checked parameters is less than a reference number, generate the prompt using the prompt template and the user data.
[0248] According to one embodiment, the memory may store instructions that cause the electronic device to input the user input into the AI model when the number of the identified parameters is greater than or equal to the reference number.
[0249] In one embodiment, the reference number can be set by the user via a user interface.
[0250] According to one embodiment, the electronic device further includes a display, and the memory can store instructions that cause the electronic device to display, through the display, at least one of the selected template or the generated prompt.
[0251] According to one embodiment, the memory may store instructions that cause the electronic device to input at least one input field from information set by a user through a user interface.
[0252] A method performed by an electronic device according to various embodiments of the present document may include: receiving a user input including a query for an artificial intelligence (AI) model; selecting at least one of a plurality of prompt templates based on the user input; identifying at least one input field that is inputtable using information included in the received user input and at least one input field that is not inputtable using information included in the user input among input fields included in the selected prompt template; generating a prompt corresponding to the user input by inputting at least one input field that is inputtable using information included in the user input based on contents of the user input and at least one input field that is not inputtable using information included in the user input based on user data stored in the memory for the selected prompt template; and inputting the generated prompt to the AI model.
[0253] According to one embodiment, the method may further include an operation of providing a guide UI that instructs the user to enter additional user input when there is an input field among the input fields of the selected prompt template that cannot be entered using the user input and the user data stored in the memory.
[0254] In one embodiment, the act of generating the prompt may include an act of entering at least one of input fields included in the selected prompt template using words included in the received user input.
[0255] According to one embodiment, the operation of selecting at least one prompt template may include an operation of determining a topic of a query from the user's input and selecting at least one prompt template corresponding to the determined topic from among a plurality of templates stored in the memory.
[0256] According to one embodiment, the method may include an operation of checking the number of parameters included in the user input among a plurality of predetermined parameters, and an operation of generating the prompt using the prompt template and the user data when the number of the checked parameters is less than a reference number.
[0257] According to one embodiment, the method may include an operation of inputting the user input into the AI model when the number of the identified parameters is greater than or equal to the reference number.
[0258] In one embodiment, the reference number can be set by the user via a user interface.
[0259] According to one embodiment, the method may include an action of displaying at least one of the selected at least one template or the generated prompt.
[0260] According to one embodiment, the method may include an action of inputting at least one input field from information set by a user through a user interface.
[0261] A computer-readable, non-transitory recording medium according to various embodiments of the present document may store instructions that, when executed by an electronic device, cause the electronic device to perform the following operations: receiving a user input including a query for an artificial intelligence (AI) model; selecting at least one of a plurality of prompt templates based on the user input; identifying at least one input field that is inputtable using information included in the received user input and at least one input field that is not inputtable using information included in the user input among input fields included in the selected prompt template; generating a prompt corresponding to the user input by inputting at least one input field that is inputtable using information included in the user input based on the contents of the user input and inputting at least one input field that is not inputtable using information included in the user input based on user data stored in the memory for the selected prompt template; and inputting the generated prompt to the AI model.
[0262] Electronic devices according to the various embodiments disclosed in this document may take various forms. Electronic devices may include, for example, portable communication devices (e.g., smartphones), computer devices, portable multimedia devices, portable medical devices, cameras, wearable devices, or home appliances. Electronic devices according to the embodiments of this document are not limited to the aforementioned devices.
[0263] The various embodiments of this document and the terminology used therein are not intended to limit the technical features described in this document to specific embodiments, but should be understood to include various modifications, equivalents, or substitutes of the embodiments. In connection with the description of the drawings, similar reference numerals may be used for similar or related components. The singular form of a noun corresponding to an item may include one or more of the items, unless the context clearly indicates otherwise. In this document, each of the phrases "A or B", "at least one of A and B", "at least one of A or B", "A, B, or C", "at least one of A, B, and C", and "at least one of A, B, or C" can include any one of the items listed together in the corresponding phrase among those phrases, or all possible combinations thereof. Terms such as "first," "second," or "first" or "second" may be used merely to distinguish one component from another, and do not limit the components in any other respect (e.g., importance or order). When a component (e.g., a first component) is referred to as "coupled" or "connected" to another (e.g., a second component), with or without the terms "functionally" or "communicatively," it means that the component can be connected to the other component directly (e.g., wired), wirelessly, or through a third component.
[0264] The term "module" used in various embodiments of this document may include a unit implemented in hardware, software, or firmware, and may be used interchangeably with terms such as logic, logic block, component, or circuit. A module may be an integral component, or a minimum unit or part of such a component that performs one or more functions. For example, according to one embodiment, a module may be implemented in the form of an application-specific integrated circuit (ASIC).
[0265] Various embodiments of the present document may be implemented as software (e.g., a program (140)) including one or more instructions stored in a storage medium (e.g., an internal memory (136) or an external memory (138)) readable by a machine (e.g., an electronic device (101)). For example, a processor (e.g., a processor (120)) of the machine (e.g., an electronic device (101)) may call at least one instruction among the one or more instructions stored from the storage medium and execute it. This enables the machine to operate to perform at least one function according to the at least one called instruction. The one or more instructions may include code generated by a compiler or code executable by an interpreter. The machine-readable storage medium may be provided in the form of a non-transitory storage medium. Here, 'non-transitory' simply means that the storage medium is a tangible device and does not contain signals (e.g., electromagnetic waves), and the term does not distinguish between cases where data is stored semi-permanently or temporarily on the storage medium.
[0266] According to one embodiment, the method according to various embodiments disclosed in this document may be provided as a computer program product. The computer program product may be traded between sellers and buyers as a product. The computer program product may be distributed in the form of a device-readable storage medium (e.g., compact disc read-only memory (CD-ROM)) or may be provided through an application store (e.g., Play Store). TM ) or directly between two user devices (e.g., smart phones), online distribution (e.g., downloading or uploading). In the case of online distribution, at least a portion of the computer program product may be at least temporarily stored or temporarily created in a machine-readable storage medium, such as the memory of a manufacturer's server, an application store's server, or an intermediary server.
[0267] According to various embodiments, each component (e.g., a module or a program) of the above-described components may include one or more entities, and some of the entities may be separated and arranged in other components. According to various embodiments, one or more components or operations of the aforementioned components may be omitted, or one or more other components or operations may be added. Alternatively or additionally, a plurality of components (e.g., a module or a program) may be integrated into a single component. In such a case, the integrated component may perform one or more functions of each of the plurality of components identically or similarly to those performed by the corresponding component among the plurality of components prior to the integration. According to various embodiments, the operations performed by a module, program, or other component may be executed sequentially, in parallel, iteratively, or heuristically, or one or more of the operations may be executed in a different order, omitted, or one or more other operations may be added.
Claims
1. In electronic devices, memory; and comprising a processor operatively connected to said memory; The above memory is, Stores user data related to a user of an electronic device, and a plurality of prompt templates; The above memory is executable by at least one processor, and when executed, the electronic device: Receive user input containing a query to an AI (artificial intelligence) model, Based on the user's input, at least one of a plurality of prompt templates stored in the memory is selected, Among the input fields included in the above-mentioned selected prompt template, at least one input field that can be entered using information included in the received user input and at least one input field that cannot be entered using information included in the user input are identified, Generating a prompt corresponding to the user input by inputting at least one input field that can be input using information included in the user input based on the contents of the user input and by inputting at least one input field that cannot be input using information included in the user input based on user data stored in the memory, and An electronic device storing instructions for inputting the generated prompt into the AI model.
2. In paragraph 1, The above memory, the electronic device, An electronic device storing instructions for providing a guide UI that instructs a user to enter additional user input when there is an input field among the input fields of the selected prompt template that cannot be entered using the user input and the user data stored in the memory.
3. In paragraph 1 or 2, The above memory, the electronic device, An electronic device storing instructions for causing at least one of the input fields included in the selected prompt template to be entered using words included in the received user input.
4. In any one of paragraphs 1 to 3, The above memory, the electronic device, An electronic device storing instructions for determining a topic of a query from the user's input and selecting at least one prompt template corresponding to the determined topic from among a plurality of templates stored in the memory.
5. In any one of paragraphs 1 to 4, The above memory, the electronic device, Check the number of parameters included in the user input among multiple predefined parameters, An electronic device storing instructions for generating the prompt using the prompt template and the user data when the number of the above-determined parameters is less than a reference number.
6. In paragraph 5, The above memory, the electronic device, An electronic device storing instructions for inputting the user input into the AI model when the number of the above-mentioned verified parameters is greater than or equal to the above-mentioned standard number.
7. In paragraph 5, An electronic device wherein the above criteria number can be set by the user through the user interface.
8. In any one of paragraphs 1 to 7, Including more displays, The above memory, the electronic device, An electronic device storing instructions causing the display to display at least one of the selected templates or the generated prompts.
9. In any one of paragraphs 1 to 8, The above memory, the electronic device, An electronic device storing instructions for causing a user to enter at least one input field from information set by the user through a user interface.
10. In a method performed by an electronic device, An action that receives user input that includes a query to an AI (artificial intelligence) model; An action of selecting at least one of a plurality of prompt templates based on said user input; An operation of checking at least one input field that can be entered using information included in the received user input and at least one input field that cannot be entered using information included in the user input among input fields included in the selected prompt template; An operation of generating a prompt corresponding to the user input by inputting at least one input field that can be input using information included in the user input based on the contents of the user input and at least one input field that cannot be input using information included in the user input based on user data stored in the memory for the selected prompt template; and A method comprising the action of inputting the generated prompt into the AI model.
11. In paragraph 10, A method further comprising an action of providing a guide UI that instructs the user to enter additional user input when there is an input field among the input fields of the selected prompt template that cannot be entered using the user input and the user data stored in the memory.
12. In clause 10 or 11, The action that generates the above prompt is: A method comprising an action of entering at least one of input fields included in the selected prompt template using words included in the received user input.
13. In any one of paragraphs 10 to 12, The action of selecting at least one prompt template above, A method comprising: determining a topic of a query from the user's input, and selecting at least one prompt template corresponding to the determined topic from among a plurality of templates stored in the memory.
14. In any one of paragraphs 10 to 13, An operation of checking the number of parameters included in the user input among a plurality of predetermined parameters; If the number of the above-mentioned confirmed parameters is less than the standard number, an operation of generating the prompt using the above-mentioned prompt template and the above-mentioned user data; and A method including an action of inputting the user input into the AI model when the number of the above-mentioned verified parameters is greater than or equal to the above-mentioned standard number.
15. When executed by an electronic device, said electronic device: An action that receives user input that includes a query to an AI (artificial intelligence) model; An action of selecting at least one of a plurality of prompt templates based on said user input; An operation of checking at least one input field that can be entered using information included in the received user input and at least one input field that cannot be entered using information included in the user input among input fields included in the selected prompt template; An operation of generating a prompt corresponding to the user input by inputting at least one input field that can be input using information included in the user input based on the contents of the user input and at least one input field that cannot be input using information included in the user input based on user data stored in the memory for the selected prompt template; and A computer-readable, non-transitory storage medium storing instructions that cause an operation of inputting the generated prompt into the AI model.
Citation Information
Patent Citations
System and method for conversation-based information search
JP2018077858A
Personalized vocabulary for digital assistant
KR1020120120316A
Intelligent automated assistant in a media environment
KR1020170036805A
Parameter collection and automatic dialog generation in dialog systems
KR102112814B1
Support bar for battery packaging and the assembly using it
KR102674874B1