LLM-Finetuning-Toolkit icon indicating copy to clipboard operation
LLM-Finetuning-Toolkit copied to clipboard

How do you handle history?

Open angeliney opened this issue 1 year ago • 2 comments

Some of my examples of historical chat logs. How should I incorporate this into the input ideally?

angeliney avatar Apr 08 '24 15:04 angeliney

Hi @angeliney, do you have a couple example rows of data?

benjaminye avatar Apr 08 '24 15:04 benjaminye

These are some sample ones that chatGPT created. Basically, any cases where the final answer needs information from the history to be able to answer the question.

Example 1

{
  "history": [
    {
      "role": "user",
      "content": "What happened in the stock market today?"
    },
    {
      "role": "assistant",
      "content": "Today, the Dow Jones Industrial Average fell by 1.2%, primarily due to investor concerns about inflation."
    }
  ],
  "input": "Did tech stocks also perform poorly?",
  "output": {
    "text": "Yes, tech stocks also saw a downturn. The NASDAQ, which is heavily weighted with technology companies, dropped by 1.5%."
  }
}

Example 2:

{
  "history": [
    {
      "role": "user",
      "content": "I need help understanding Shakespeare's 'Macbeth'."
    },
    {
      "role": "assistant",
      "content": "Sure, 'Macbeth' is a play about ambition and its destructive consequences. Would you like to start with the plot summary or characters?"
    }
  ],
  "input": "Could you explain the significance of the witches?",
  "output": {
    "text": "The witches in 'Macbeth' symbolize the dark forces that can influence human behavior. Their prophecies spark Macbeth’s ambitions and contribute to his moral downfall, representing fate and supernatural influences in human life."
  }
}

Example 3:

{
  "history": [
    {
      "role": "user",
      "content": "Can you tell me about the French Revolution?"
    },
    {
      "role": "assistant",
      "content": "The French Revolution was a period of significant social and political upheaval in France that lasted from 1789 until 1799. It resulted in the downfall of the monarchy and led to the rise of Napoleon Bonaparte."
    }
  ],
  "input": "What role did the Estates-General play in it?",
  "output": {
    "text": "The Estates-General was a crucial trigger for the French Revolution. Convened in 1789 for the first time since 1614, it exposed the deep divisions within the French social classes and ultimately led to the Third Estate declaring itself the National Assembly, setting the stage for revolutionary change."
  }
}

angeliney avatar Apr 09 '24 13:04 angeliney