Use Fine Tuning or Prompt Engineering or both?

We have a dataset of legal cases, academic papers etc which we will load into a vector database. We want to develop an agent that will allow a user to enter a specific legal issue, the agent then will search for all related documents (or portions of documents) and provide the user with a summary of each along with the citation. The responses should only be based on our domain.
Can this be done with prompt engineering? Would fine-tuning help the quality of the responses? Anything else I should be investigating? TIA

1 Like

Hi @gill.metcalf

Welcome to the OpenAI community.

IMO fine-tuning isn’t required for this use-case.

According to my understanding of your requirements, you are trying to get the summary and citation of relevant docs based on the user’s query. Here’s an outline of the process:

  1. Retrieve the relevant docs from your vector DB.
  2. Generate a prompt programmatically with the doc to be summarized. This can be done per doc, or for all the docs in one go, depending on your requirements and docs size. Use gpt-3.5-turbo to minimize token costs.
  3. Generate the user reply programmatically by concatenating response(s) from the model along with the retrieved docs to be cited.
2 Likes