Skip to content

Fine Tune LLM - Anthropic Claude model - Bedrock

0

Hi All

I am following this article to understand how to fine-tune the Haiku model using bedrock. The dataset is in JSONL format.

https://aws.amazon.com/blogs/aws/fine-tuning-for-anthropics-claude-3-haiku-model-in-amazon-bedrock-is-now-generally-available/#:~:text=Amazon%20Bedrock%20is%20the%20only,generative%20AI%20for%20your%20business.

Question: Is it possible to fine-tune PDF documents using similar steps? or it is a way to fine-tune PDF documents.

Thanks

2 Answers
1

Hello.

As stated in re:Post Agent's answer, it cannot be used as a PDF, so it needs to be converted to JSONL format.
Conversion is required to the format described in the document below.
https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-prepare.html#model-customization-dataset-prep

{"system": "<system message>","messages":[{"role": "user", "content": "<user query>"},{"role": "assistant", "content": "<expected generated text>"}]}
EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

0

While the article you mentioned specifically discusses fine-tuning the Claude 3 Haiku model using JSONL formatted data, it is not directly possible to fine-tune the model using PDF documents in their raw format. However, you can still use PDF documents as a source for fine-tuning by following these steps:

  1. Extract the text content from your PDF documents.
  2. Process and structure the extracted text into the required JSONL format for fine-tuning.
  3. Ensure that each line in your JSONL file contains a system prompt and a message, as required by the fine-tuning process for Claude 3 Haiku.

The fine-tuning process in Amazon Bedrock requires the training data to be in a specific JSONL format, with each line containing a system prompt and a message. The total size of the training data should not exceed 10GB, and the validation data should not exceed 1GB.

To use PDF documents for fine-tuning, you would need to develop a preprocessing pipeline that:

  1. Extracts text from PDFs
  2. Structures the extracted information appropriately
  3. Formats the data into the required JSONL structure

This approach allows you to leverage the content of your PDF documents for fine-tuning while adhering to the format requirements of the Claude 3 Haiku model in Amazon Bedrock. Remember that the quality and relevance of the extracted and formatted data will significantly impact the success of your fine-tuning process.
Sources
Fine-tuning for Anthropic’s Claude 3 Haiku model in Amazon Bedrock is now generally available | AWS News Blog
Best practices and lessons for fine-tuning Anthropic’s Claude 3 Haiku on Amazon Bedrock | AWS Machine Learning Blog

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.