{"id":1603,"date":"2024-10-04T10:40:42","date_gmt":"2024-10-04T08:40:42","guid":{"rendered":"https:\/\/guillaume-guerard.com\/?page_id=1603"},"modified":"2024-10-04T15:45:28","modified_gmt":"2024-10-04T13:45:28","slug":"generated-knowledge-prompting","status":"publish","type":"page","link":"https:\/\/guillaume-guerard.com\/en\/cours-de-methodologie\/generated-knowledge-prompting\/","title":{"rendered":"Generated Knowledge Prompt"},"content":{"rendered":"<div data-elementor-type=\"wp-page\" data-elementor-id=\"1603\" class=\"elementor elementor-1603\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-4ea54bc elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4ea54bc\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-0eca658\" data-id=\"0eca658\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a1bc875 elementor-align-justify elementor-widget elementor-widget-button\" data-id=\"a1bc875\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-button-wrapper\">\n\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/guillaume-guerard.com\/en\/\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">Welcome<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-2de5256\" data-id=\"2de5256\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-4eaa520 elementor-align-justify elementor-widget elementor-widget-button\" data-id=\"4eaa520\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-button-wrapper\">\n\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/complex-systems-ai.com\/\" target=\"_blank\" rel=\"noopener\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">Data Science<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-a9ef770 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"a9ef770\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ba5a08d\" data-id=\"ba5a08d\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-bc40c79 elementor-widget elementor-widget-heading\" data-id=\"bc40c79\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Page contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Contents\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/guillaume-guerard.com\/en\/cours-de-methodologie\/generated-knowledge-prompting\/#Generated_Knowledge_le_prompt_nourrit_le_prompt\" >Generated Knowledge, the prompt feeds the prompt<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/guillaume-guerard.com\/en\/cours-de-methodologie\/generated-knowledge-prompting\/#Fonctionnement_general\" >General operation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/guillaume-guerard.com\/en\/cours-de-methodologie\/generated-knowledge-prompting\/#Approche_des_connaissances_generees_par_une_invite_unique\" >Approach to knowledge generated by a single prompt<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/guillaume-guerard.com\/en\/cours-de-methodologie\/generated-knowledge-prompting\/#Approche_a_double_invite\" >Dual-prompt approach<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/guillaume-guerard.com\/en\/cours-de-methodologie\/generated-knowledge-prompting\/#Generation_de_connaissance_pour_la_resolution_logique\" >Knowledge generation for logic solving<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/guillaume-guerard.com\/en\/cours-de-methodologie\/generated-knowledge-prompting\/#Generation_pour_decomposer_le_probleme_CoT\" >Generation to decompose the problem (CoT)<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"elementor-heading-title elementor-size-default\"><span class=\"ez-toc-section\" id=\"Generated_Knowledge_le_prompt_nourrit_le_prompt\"><\/span>Generated Knowledge, the prompt feeds the prompt<span class=\"ez-toc-section-end\"><\/span><\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-a0927fc elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"a0927fc\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-6afb886\" data-id=\"6afb886\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-bb75c4f elementor-widget elementor-widget-text-editor\" data-id=\"bb75c4f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>The idea behind the generated knowledge approach is to ask the LLM to generate potentially useful information about a given question\/prompt before generating a final answer.<\/p><p><img decoding=\"async\" class=\"alignnone wp-image-49 size-full\" src=\"http:\/\/guillaume-guerard.com\/wp-content\/uploads\/2023\/07\/logo_sc.png\" alt=\"generated knowledge\" width=\"238\" height=\"203\" \/><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-4dd153e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4dd153e\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3d93f79\" data-id=\"3d93f79\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-9d240ce elementor-widget elementor-widget-heading\" data-id=\"9d240ce\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\"><span class=\"ez-toc-section\" id=\"Fonctionnement_general\"><\/span>General operation<span class=\"ez-toc-section-end\"><\/span><\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-9db2cb9 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"9db2cb9\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ae8689f\" data-id=\"ae8689f\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-746c89c elementor-widget elementor-widget-text-editor\" data-id=\"746c89c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>The content below covers the more technical context in which the approach was introduced. It follows the model of the two intermediate steps (knowledge generation and integration) that we saw above.<\/p><p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-1618 size-full\" src=\"http:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge7.webp\" alt=\"generated knowledge\" width=\"1018\" height=\"242\" srcset=\"https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge7.webp 1018w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge7-300x71.webp 300w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge7-768x183.webp 768w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge7-18x4.webp 18w\" sizes=\"(max-width: 1018px) 100vw, 1018px\" \/><\/p><p>In the knowledge generation step, the LLM is prompted to generate a set of facts about the question. The LLM is prompted to respond in a few-shot prompting fashion, as shown below. M different completions are generated using this same prompt (similar to the self-consistency approach).<\/p><p><img decoding=\"async\" class=\"alignnone wp-image-1619 size-large\" src=\"http:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge8-1024x391.webp\" alt=\"generated knowledge\" width=\"1024\" height=\"391\" srcset=\"https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge8-1024x391.webp 1024w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge8-300x114.webp 300w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge8-768x293.webp 768w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge8-18x7.webp 18w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge8.webp 1122w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p><p>Then we generate <a href=\"https:\/\/guillaume-guerard.com\/en\/cours-de-methodologie\/definir-les-questions-scientifiques\/\">questions<\/a> \u201caugmented knowledge\u201d and encourage the LLM to get final answers. The easiest way to understand this is through an example.<\/p><p>Suppose we are trying to answer the question &quot;Most kangaroos have limbs.&quot; &quot;. Let&#039;s assume that at the knowledge generation stage, we have generated 2 pieces of knowledge (M=2):<\/p><p>Knowledge 1: Kangaroos are marsupials that live in Australia.<\/p><p>Knowledge 2: Kangaroos are marsupials that have 5 limbs.<\/p><p>Now we chain each knowledge with the question to generate knowledge-enhanced questions:<\/p><p>Augmented Knowledge Question 1: Most kangaroos have limbs. Kangaroos are marsupials that live in Australia.<\/p><p>Augmented Knowledge Question 2: Most kangaroos have limbs. . Kangaroos are marsupials that have 5 limbs.<\/p><p>We then ask the LLM these knowledge-enriched questions and obtain the final answer proposals:<\/p><p>Answer 1: 4<\/p><p>Answer 2: 5<\/p><p>We select the answer with the highest probability as the final answer. The highest probability can be the softmax probability of the answer token or the log probability of the answer token(s).<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-0ed5c48 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"0ed5c48\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1993723\" data-id=\"1993723\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-4e60ee6 elementor-widget elementor-widget-heading\" data-id=\"4e60ee6\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\"><span class=\"ez-toc-section\" id=\"Approche_des_connaissances_generees_par_une_invite_unique\"><\/span>Approach to knowledge generated by a single prompt<span class=\"ez-toc-section-end\"><\/span><\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-802af82 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"802af82\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2ad0bee\" data-id=\"2ad0bee\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-815bd26 elementor-widget elementor-widget-text-editor\" data-id=\"815bd26\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>For example, let&#039;s say you want to write a short blog post about an animal, like Spirit Bears. Before you ask the LLM to write the blog post, you can ask it to generate some information about Spirit Bears. This will help the LLM to <a href=\"https:\/\/guillaume-guerard.com\/en\/cours-de-methodologie\/rediger-un-papier-scientifique\/\">write<\/a> a more informative blog post. There are two easy ways to do this.<\/p><p>The first approach asks the LLM to generate knowledge and then write the message, all with a single prompt.<\/p><pre>Generate 4 facts about the Kermode bear, then use these facts to write a short blog post using the information:<\/pre><p>Here is the answer:<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1612 size-large\" src=\"http:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knwoledge1-1024x309.jpg\" alt=\"generated knowledge prompting\" width=\"1024\" height=\"309\" srcset=\"https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knwoledge1-1024x309.jpg 1024w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knwoledge1-300x91.jpg 300w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knwoledge1-768x232.jpg 768w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knwoledge1-18x5.jpg 18w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knwoledge1.jpg 1027w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-d34a430 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"d34a430\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-e71e6ff\" data-id=\"e71e6ff\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-3296383 elementor-widget elementor-widget-heading\" data-id=\"3296383\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\"><span class=\"ez-toc-section\" id=\"Approche_a_double_invite\"><\/span>Dual-prompt approach<span class=\"ez-toc-section-end\"><\/span><\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-1da947e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"1da947e\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-07dc378\" data-id=\"07dc378\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-1b45dfc elementor-widget elementor-widget-text-editor\" data-id=\"1b45dfc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>In this approach, we first invite the LLM to generate facts about the bear:<\/p><pre>Generate 4 facts about the Kermode bear:<\/pre><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1613 size-full\" src=\"http:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge2.jpg\" alt=\" generated knowledge\" width=\"1009\" height=\"156\" srcset=\"https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge2.jpg 1009w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge2-300x46.jpg 300w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge2-768x119.jpg 768w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge2-18x3.jpg 18w\" sizes=\"(max-width: 1009px) 100vw, 1009px\" \/><\/p><p>Then we feed this information into another prompt to write the blog post:<\/p><pre>1. The Kermode bear, also known as the Spirit Bear, is a rare subspecies of the American black bear found in British Columbia, Canada. 2. The Kermode bear has a unique white or cream-colored coat, which is caused by a recessive gene. 3. The Kermode bear is a symbol of hope and renewal for the First Nations people of British Columbia. 4. The Kermode bear is a protected species and is listed as a species of special concern by the Committee on the Status of Endangered Wildlife in Canada. Use the above facts to write a one paragraph blog post about the Kermode bear:<\/pre><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1614 size-full\" src=\"http:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge3.jpg\" alt=\"generated knowledge\" width=\"1022\" height=\"90\" srcset=\"https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge3.jpg 1022w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge3-300x26.jpg 300w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge3-768x68.jpg 768w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge3-18x2.jpg 18w\" sizes=\"(max-width: 1022px) 100vw, 1022px\" \/><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-ef2e4e0 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"ef2e4e0\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-21d1df6\" data-id=\"21d1df6\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-49afa41 elementor-widget elementor-widget-heading\" data-id=\"49afa41\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\"><span class=\"ez-toc-section\" id=\"Generation_de_connaissance_pour_la_resolution_logique\"><\/span>Knowledge generation for logic solving<span class=\"ez-toc-section-end\"><\/span><\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-2295cb4 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"2295cb4\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b1d5feb\" data-id=\"b1d5feb\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2a84499 elementor-widget elementor-widget-text-editor\" data-id=\"2a84499\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>The generated knowledge approach was actually introduced for a completely different task, that of answering difficult questions. Consider the following question, which the LLM answers incorrectly:<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1615 size-full\" src=\"http:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge4.jpg\" alt=\"generated knowledge\" width=\"969\" height=\"140\" srcset=\"https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge4.jpg 969w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge4-300x43.jpg 300w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge4-768x111.jpg 768w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge4-18x3.jpg 18w\" sizes=\"(max-width: 969px) 100vw, 969px\" \/><\/p><p>If we first ask the LLM to generate facts about Congo and South Africa, we can then use this information to answer the question correctly. In theory, this is similar to the CoT prompt, since we are effectively asking the LLM to generate intermediate reasoning in the form of related facts.<\/p><p>Let&#039;s start with the first step, knowledge generation. We can ask the LLM to generate facts about Congo and South Africa:<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1616 size-full\" src=\"http:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge5.jpg\" alt=\"generated knowledge\" width=\"1017\" height=\"302\" srcset=\"https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge5.jpg 1017w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge5-300x89.jpg 300w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge5-768x228.jpg 768w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge5-18x5.jpg 18w\" sizes=\"(max-width: 1017px) 100vw, 1017px\" \/><\/p><p>Next, let&#039;s use this knowledge to answer the question correctly. This is the knowledge integration step:<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1617 size-full\" src=\"http:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge6.jpg\" alt=\"generated knowledge\" width=\"999\" height=\"298\" srcset=\"https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge6.jpg 999w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge6-300x89.jpg 300w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge6-768x229.jpg 768w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge6-18x5.jpg 18w\" sizes=\"(max-width: 999px) 100vw, 999px\" \/><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-7bcfe2b elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"7bcfe2b\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-87c4283\" data-id=\"87c4283\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-d14c061 elementor-widget elementor-widget-heading\" data-id=\"d14c061\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\"><span class=\"ez-toc-section\" id=\"Generation_pour_decomposer_le_probleme_CoT\"><\/span>Generation to decompose the problem (CoT)<span class=\"ez-toc-section-end\"><\/span><\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-a3564f0 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"a3564f0\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d5dc270\" data-id=\"d5dc270\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-b8c48ff elementor-widget elementor-widget-text-editor\" data-id=\"b8c48ff\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Here is an example where knowledge generation allows us to break down the problem and therefore answer the question:<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1636 size-full\" src=\"http:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge9.jpg\" alt=\"generated-knowledge\" width=\"762\" height=\"709\" srcset=\"https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge9.jpg 762w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge9-300x279.jpg 300w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge9-13x12.jpg 13w\" sizes=\"(max-width: 762px) 100vw, 762px\" \/><\/p><p>So the following prompt, the llm keeps in memory the breakdown of the problem, and will therefore check the different points cited during its response:<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1637 size-full\" src=\"http:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge10.jpg\" alt=\"generated-knowledge\" width=\"585\" height=\"594\" srcset=\"https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge10.jpg 585w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge10-295x300.jpg 295w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge10-12x12.jpg 12w, https:\/\/guillaume-guerard.com\/wp-content\/uploads\/2024\/10\/generated-knowledge10-70x70.jpg 70w\" sizes=\"(max-width: 585px) 100vw, 585px\" \/><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>Home Data Science Generated Knowledge, the prompt feeds the prompt The idea behind the generated knowledge approach is to \u2026 <\/p>","protected":false},"author":1,"featured_media":0,"parent":47,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_header_footer","meta":{"footnotes":""},"class_list":["post-1603","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/guillaume-guerard.com\/en\/wp-json\/wp\/v2\/pages\/1603","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/guillaume-guerard.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/guillaume-guerard.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/guillaume-guerard.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/guillaume-guerard.com\/en\/wp-json\/wp\/v2\/comments?post=1603"}],"version-history":[{"count":10,"href":"https:\/\/guillaume-guerard.com\/en\/wp-json\/wp\/v2\/pages\/1603\/revisions"}],"predecessor-version":[{"id":1640,"href":"https:\/\/guillaume-guerard.com\/en\/wp-json\/wp\/v2\/pages\/1603\/revisions\/1640"}],"up":[{"embeddable":true,"href":"https:\/\/guillaume-guerard.com\/en\/wp-json\/wp\/v2\/pages\/47"}],"wp:attachment":[{"href":"https:\/\/guillaume-guerard.com\/en\/wp-json\/wp\/v2\/media?parent=1603"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}