Search

KR-20260067643-A - APPARATUS, METHOD AND COMPUTER PROGRAM FOR GENERATING PROMPT

KR20260067643AKR 20260067643 AKR20260067643 AKR 20260067643AKR-20260067643-A

Abstract

A device for generating a prompt includes a receiving unit that receives an input prompt from a user terminal, a prompt block generating unit that generates a plurality of prompt blocks based on the input prompt, a candidate prompt generating unit that generates a plurality of candidate prompts based on the plurality of prompt blocks, an answer sentence output unit that inputs the plurality of candidate prompts into a language model and outputs a plurality of answer sentences through the language model, and a final prompt determining unit that calculates a score for the plurality of answer sentences and determines a final prompt among the plurality of candidate prompts based on the calculated score.

Inventors

  • 박천용

Assignees

  • 주식회사 케이티

Dates

Publication Date
20260513
Application Date
20241106

Claims (19)

  1. In a device that generates a prompt, A receiver that receives an input prompt from a user terminal; A prompt block generating unit that generates a plurality of prompt blocks based on the above input prompt; A candidate prompt generation unit that generates a plurality of candidate prompts based on the plurality of prompt blocks above; An answer sentence output unit that inputs the above-mentioned plurality of candidate prompts into a language model and outputs a plurality of answer sentences through the language model; and A final prompt determination unit that calculates a score for the plurality of answer sentences and determines a final prompt among the plurality of candidate prompts based on the calculated score. A prompt generating device including
  2. In Article 1, A complexity calculation unit that calculates the complexity for the above input prompt; and A prompt generating device further comprising a search performing unit that performs knowledge search or word search based on the complexity calculated above.
  3. In Article 2, The above complexity calculation unit is, Tokenization unit for tokenizing the above input prompt; A morphological analysis unit that analyzes morphemes included in the above input prompt; and A prompt generation device comprising a mapping unit that generates mapping information through mapping between the above tokenized result and the above morphological analysis result.
  4. In Paragraph 3, The above complexity calculation unit calculates complexity for each morpheme based on the above mapping information, and A prompt generation device in which the search execution unit derives a word corresponding to a complexity greater than or equal to a threshold value as a search target word.
  5. In Article 4, A prompt generating device wherein the plurality of prompt blocks described above include at least one of a prompt type block, a request intent prompt block, an output style prompt block, an additional knowledge prompt block, and a word dictionary prompt block.
  6. In Article 5, The above search performing unit performs a knowledge search on the above search target word when the above search target word corresponds to a noun, and A prompt generation device that stores knowledge information derived through the above knowledge search in an additional knowledge prompt block among the above plurality of prompt blocks.
  7. In Article 5, The above search performing unit searches for the meaning of the above search target word through a word dictionary when the above search target word corresponds to a verb or an adjective, and A prompt generating device that stores the meaning of the search target word searched above in a word dictionary prompt block among the plurality of prompt blocks.
  8. In Article 5, A prompt generation device in which the search performing unit stores typographical information corresponding to the typographical error in an additional knowledge prompt block and a word dictionary prompt block when the word whose complexity is greater than or equal to a threshold value corresponds to a typographical error.
  9. In Article 1, A prompt generation device further comprising a feedback providing unit that inputs a combination of the final prompt and an evaluation prompt for evaluating the final prompt into the language model, and provides to the user terminal a correlation between a prompt block constituting the final prompt and an answer generation result through the language model.
  10. In a method for generating a prompt performed by a prompt generating device, A step of receiving an input prompt from a user terminal; A step of generating a plurality of prompt blocks based on the above input prompt; A step of generating a plurality of candidate prompts based on the plurality of prompt blocks above; A step of inputting the above-mentioned plurality of candidate prompts into a language model and outputting a plurality of answer sentences through the language model; and A step of calculating a score for the plurality of answer sentences and determining a final prompt among the plurality of candidate prompts based on the calculated score A method for generating a prompt that includes
  11. In Article 10, A step of calculating the complexity of the above input prompt; and A prompt generation method further comprising the step of performing a knowledge search or word search based on the complexity calculated above.
  12. In Article 11, The step of calculating the above complexity is, A step of tokenizing the above input prompt; A step of analyzing the morphemes included in the above input prompt; and A prompt generation method comprising the step of generating mapping information through mapping between the above tokenized result and the above morphological analysis result.
  13. In Article 12, The step of calculating the above complexity is, It includes a step of calculating complexity for each morpheme based on the mapping information above, The step of performing the above knowledge search or word search is, A prompt generation method comprising the step of deriving a word whose complexity is greater than or equal to a threshold value as a search target word.
  14. In Article 13, A method for generating prompts, wherein the plurality of prompt blocks described above include at least one of a prompt type block, a request intent prompt block, an output style prompt block, an additional knowledge prompt block, and a word dictionary prompt block.
  15. In Article 14, The step of performing the above knowledge search or word search is, If the above-mentioned search target word corresponds to a noun, a step of performing a knowledge search on the above-mentioned search target word; and A prompt generation method comprising the step of storing knowledge information derived through the above knowledge search in an additional knowledge prompt block among the above plurality of prompt blocks.
  16. In Article 14, The step of performing the above knowledge search or word search is, If the above-mentioned search target word corresponds to a verb or adjective, a step of searching for the meaning of the above-mentioned search target word through a word dictionary; and A prompt generation method comprising the step of storing the meaning of the search target word found above in a word dictionary prompt block among the plurality of prompt blocks.
  17. In Article 14, The step of performing the above knowledge search or word search is, A prompt generation method comprising the step of storing typo information corresponding to the typo in an additional knowledge prompt block and a word dictionary prompt block when a word whose complexity is greater than or equal to a threshold corresponds to a typo.
  18. In Article 10, A prompt generation method further comprising the step of inputting a combination of the final prompt and an evaluation prompt for evaluating the final prompt into the language model, and providing to the user terminal a correlation between a prompt block constituting the final prompt and an answer generation result through the language model.
  19. In a computer program stored on a computer storage medium comprising a sequence of instructions that generate a prompt, When the above computer program is executed by a computing device, Receive an input prompt from a user terminal, Generate a plurality of prompt blocks based on the above input prompt, and Generate a plurality of candidate prompts based on the above plurality of prompt blocks, and Input the above multiple candidate prompts into a language model, and output multiple answer sentences through the language model, A computer program stored on a computer storage medium comprising a sequence of instructions for calculating a score for the plurality of answer sentences and determining a final prompt among the plurality of candidate prompts based on the calculated score.

Description

Apparatus, Method and Computer Program for Generating a Prompt The present invention relates to an apparatus, a method, and a computer program for generating a prompt. A Large Language Model (LLM) is a type of artificial intelligence program capable of performing tasks such as recognizing and generating text. It is named "Large" because it learns from vast datasets. Large Language Models are based on machine learning, specifically a type of neural network known as a Transformer model. These large language models have begun to be used in generative AI that generates content based on language input prompts. In this regard, prior art Korean Registered Patent No. 10-2570178 discloses a method for generating and utilizing a training dataset for a deep learning-based generative AI system utilizing a super-large AI. Prompt engineering is crucial for improving the response accuracy of large language models. Traditional prompt engineering methods have included providing step-by-step descriptions of a given task, drafting prompts to solve tasks in a sequential manner, and having large language models automatically generate prompts to perform the task. However, attempts to automatically generate prompts had disadvantages, such as a lack of sentence diversity, a risk of semantic alteration, and difficulty for users to grasp the influence and tendencies of the vocabulary used in the prompts on the responses. Additionally, for prompts related to specialized domains, such as special domains, large language models faced the disadvantage of being difficult to automatically generate. FIG. 1 is a configuration diagram of a prompt generation system according to one embodiment of the present invention. FIG. 2 is a configuration diagram of a prompt generation device according to one embodiment of the present invention. FIG. 3 is an exemplary diagram illustrating a process of performing a search based on the complexity of each morpheme of an input prompt according to an embodiment of the present invention. FIG. 4 is an exemplary diagram illustrating the process of exception handling of words with a complexity level below a threshold in an input prompt according to an embodiment of the present invention. FIG. 5 is an exemplary diagram illustrating the process of performing a search when a word with a complexity greater than or equal to a threshold value corresponds to a typo according to one embodiment of the present invention. FIG. 6 is an exemplary drawing for explaining the process of generating a plurality of prompt blocks according to one embodiment of the present invention. FIG. 7 is an exemplary drawing for explaining the process of generating a plurality of candidate prompts according to one embodiment of the present invention. FIG. 8 is an exemplary diagram illustrating a process for providing a correlation between a prompt block constituting a final prompt and an answer generation result using an evaluation prompt according to an embodiment of the present invention. FIG. 9 is a flowchart of a method for generating a prompt performed in a prompt generating device according to one embodiment of the present invention. Embodiments of the present invention are described below with reference to the attached drawings so that those skilled in the art can easily implement the invention. However, the present invention may be embodied in various different forms and is not limited to the embodiments described herein. Furthermore, in order to clearly explain the present invention in the drawings, parts unrelated to the explanation have been omitted, and similar parts throughout the specification are denoted by similar reference numerals. Throughout the specification, when a part is described as being "connected" to another part, this includes not only cases where they are "directly connected" but also cases where they are "electrically connected" with other elements interposed between them. Furthermore, when a part is described as "including" a component, this means that, unless specifically stated otherwise, it does not exclude other components but may include additional components, and it should be understood that this does not preclude the existence or addition of one or more other features, numbers, steps, actions, components, parts, or combinations thereof. In this specification, the term "part" includes a unit realized by hardware, a unit realized by software, and a unit realized using both. Additionally, one unit may be realized using two or more hardware, and two or more units may be realized by one hardware. Some of the operations or functions described in this specification as being performed by a terminal or device may instead be performed by a server connected to said terminal or device. Likewise, some of the operations or functions described as being performed by a server may also be performed by a terminal or device connected to said server. An embodiment of the present invention will be described in detail below with r