Answers.Body: <p>Apply the <a href="https://www.promptingguide.ai/techniques/fewshot" rel="nofollow noreferrer">Few-Shot Prompting</a> technique: Give the LLM a few (you need to experiment with the exact number) of poems and use the same instruction for all of them:</p>
  <pre><code>{&quot;prompt&quot;: &quot;Write a poem&quot;, &quot;completion&quot;: &quot;&lt;poem 1&gt;&quot;}
  {&quot;prompt&quot;: &quot;Write a poem&quot;, &quot;completion&quot;: &quot;&lt;poem 2&gt;&quot;}
  {&quot;prompt&quot;: &quot;Write a poem&quot;, &quot;completion&quot;: &quot;&lt;poem 3&quot;}
  ...
  </code></pre>
  <p>To further improve the answers, it can be helpful to start the conversation with a <a href="https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/system-message" rel="nofollow noreferrer">system message</a> specific to your needs.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-06-02T19:41:41.823Z
Answers.LastActivityDate: 2024-06-02T19:41:41.823Z
Answers.UserDisplayName: Basil
Body: <p>I have a collection of poems in text data. I'd like to generate a new similar poem using LLM and fine tuning. How should I format the data for it?</p>
  <p>If it's questions and answers, the data format should be:</p>
  <pre><code>{&quot;prompt&quot;: &quot;&lt;prompt text&gt;&quot;, &quot;completion&quot;: &quot;&lt;ideal generated text&gt;&quot;}
  {&quot;prompt&quot;: &quot;&lt;prompt text&gt;&quot;, &quot;completion&quot;: &quot;&lt;ideal generated text&gt;&quot;}
  {&quot;prompt&quot;: &quot;&lt;prompt text&gt;&quot;, &quot;completion&quot;: &quot;&lt;ideal generated text&gt;&quot;}
  ...
  </code></pre>
  <p>But in my case, there is no prompt. only completions. The raw format I have now is:</p>
  <pre><code>[
    &quot;poem, poem, poem,\npoem, poem, poem,\npoem, poem, poem,\n&quot;,
    &quot;poem, poem, poem,\npoem, poem, poem,\npoem, poem, poem,\n&quot;,
    &quot;poem, poem, poem,\npoem, poem, poem,\npoem, poem, poem,\n&quot;,
  ...
  ]
  </code></pre>
  <p>I google &quot;llm fine tuning text generation&quot; but unfortunately no useful results were found.</p>
  <p>Does anybody know how to solve this?</p>
  
Tags: <large-language-models>
Title: The format of data for text generation using LLM
UserDisplayName: dixhom
ThreadText: # The format of data for text generation using LLM
  
  (Asked by: username_0 on 2024-06-02)
  
  I have a collection of poems in text data. I'd like to generate a new similar poem using LLM and fine tuning. How should I format the data for it?
  If it's questions and answers, the data format should be:
  {"prompt": "", "completion": ""}
  {"prompt": "", "completion": ""}
  {"prompt": "", "completion": ""}
  ...
  
  But in my case, there is no prompt. only completions. The raw format I have now is:
  [
    "poem, poem, poem,\npoem, poem, poem,\npoem, poem, poem,\n",
    "poem, poem, poem,\npoem, poem, poem,\npoem, poem, poem,\n",
    "poem, poem, poem,\npoem, poem, poem,\npoem, poem, poem,\n",
  ...
  ]
  
  I google "llm fine tuning text generation" but unfortunately no useful results were found.
  Does anybody know how to solve this?
  
  **Tags:** large-language-models
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-06-02. Score: 1 | Accepted answer
  
  Apply the Few-Shot Prompting technique: Give the LLM a few (you need to experiment with the exact number) of poems and use the same instruction for all of them:
  {"prompt": "Write a poem", "completion": ""}
  {"prompt": "Write a poem", "completion": ""}
  {"prompt": "Write a poem", "completion": "
  To further improve the answers, it can be helpful to start the conversation with a system message specific to your needs.
  
  
  ---
  
  