Icon

Open AI Model Fine-tuning

<p>This workflow demonstrates how to <strong>improve a chat model's performance by applying fine-tuning.</strong> </p><p>Ultimately, we compare the output of the 'Just KNIME it!' challenge descriptions, designed to test chat models' accuracy, based on our input: Title: UEFA Euro 2024 Winner Prediction and Level: Hard.</p><p>You can download and run the workflow locally. For optimal performance, please use the latest version of the KNIME Analytics Platform.</p><p></p><p>Workflow Step-by-Step</p><ol><li><p><strong>Prepare Fine-Tuning Data</strong></p><ul><li><p><strong>Parse PDF Files</strong>: Extract the challenge descriptions and levels of difficulty from the PDF files containing all challenges from the first two seasons of "Just KNIME it!" (see the output of the "Extract Challenges" metanode).</p></li><li><p><strong>Format Data</strong>: Prepare the data for the Fine-Tuning input port as the OpenAI Chat Model Fine-Tuner requires. The data should be presented across three columns:</p><ul><li><p>A column specifying a conversation ID.</p></li><li><p>A column representing the role of a message (system, assistant, and user).</p></li><li><p>A column for the content of the message.</p></li></ul></li><li><p>Ensure the table includes at least ten conversations, each containing at least one system message (see the Prepare Conversations metanode output).</p></li></ul></li><li><p><strong>Fine-Tune the Chat Model</strong></p><ul><li><p>Pass the fine-tuning data to the OpenAI Chat Model Fine-Tuner node and execute it. This process can take some time.</p></li></ul></li><li><p><strong>Generate Challenge Descriptions</strong></p><ul><li><p>Use two Chat Model Prompter nodes: one connected directly to the OpenAI Chat Model Connector node and the other to the OpenAI Chat Model Fine-Tuner node.</p></li><li><p>Use the same system message for both nodes: "You are a Just KNIME it challenge generator. As input, you receive a difficulty level and a title for the challenge, and your task is to create a description for the challenge."</p></li><li><p>Provide the same input message: "Title: UEFA Euro 2024 Winner Prediction Level: Hard."</p></li></ul></li><li><p><strong>Visualize and Compare Outputs</strong></p><ul><li><p>Click the lens icon in the component to open the visualization and compare the responses from the untuned vs. fine-tuned chat model prompters. The fine-tuned Chat Model Prompter response should be very close to the real "Just KNIME it!" challenge descriptions.</p></li></ul></li></ol>

URL: Just KNIME it! https://www.knime.com/just-knime-it

Nodes

Extensions

Links