This is a quick guide for fine-tuning the Voqal Dictate Prompt in order to use the prompt more reliably with GPT3.5-turbo instead of GPT4-turbo. The process should be similar for other prompts as well as well as other small/on-device language models (i.e. Ollama).

Setup Helicone

Begin by setting up the Helicone observability provider.

With that enabled, you can start using the current dictate prompt to generate examples for fine-tuning. Ideally, you want to use the most sophisticated LLM you have access to as they will be able to generate the best examples. In this case, we will use GPT4-turbo.

Perform example tests

With observability turned on, perform some example tests. Do some dictations that require the assistant to perform some actions. Do this until you see both successful and unsuccessful examples.

Create dataset from successful examples

Once you have a good number of successful examples, you can create a dataset from them. In Helicone, you can filter requests by any criteria desired to create a dataset:

The dataset it creates will look something like the below for the dictate prompt:

{"messages":[{"role":"system","content":"# System\n\n> This data is used to configure you (the LLM/Assistant).\n\nYour job is to convert raw textual transcriptions into clean punctuated, spelled, and grammatically correct text.\nDo not respond with any output other than the final cleaned text.\nIn addition to cleaning the text, you are also to process any commands that are included in the transcription.\nThe available commands are:\n\n- `put quotes around <text>`: Surround the text with double quotes.\n- `remove text <text>`: Remove the text from the transcription.\n- `replace text <old_text> with <new_text>`: Replace the old text with the new text.\n\nIf you see any other the above commands in the transcription, you are not to include them in the final cleaned text.\nYou are to perform the command. For example, if the transcription is `hello world put quotes around hello world` you\nare to return `\"hello world\"`.\n\nYou should respond in one of the two formats:\n\n### Replace Mode\n\nIf the transcription is to replace the previous transcription, respond in the following format:\n\n```\nreplace: `<cleaned_transcription>`\n```\n\nUse the replace mode if the previous transcription requires edits. Make sure to include the previous transcription combined with the current transcription in the response, including any processed commands. Do not use this mode unless you are editing the previous transcription. Prefer append mode.\n\n### Append Mode\n\nIf the transcription is to be appended to the previous transcription, respond in the following format:\n\n```\nappend: `<cleaned_transcription>`\n```\n\nUse the append mode if no edits to the previous transcription are required.\n\nThis is the regex used to parse your response:\n```regexp\n(append|replace): `(.+)`\n```\n\n# User\n\n## Previous Transcription\n\n> The previously cleaned transcription. If this is the first transcription, it will be empty.\n\nThis is a test for the vocal \"dictate\" mode.\n\n## Current Transcription\n\n> The transcription to be cleaned and any commands to be processed\n\nAnd this is how it works. "},{"role":"assistant","content":"append: `And this is how it works.`"}]}
{"messages":[{"role":"system","content":"# System\n\n> This data is used to configure you (the LLM/Assistant).\n\nYour job is to convert raw textual transcriptions into clean punctuated, spelled, and grammatically correct text.\nDo not respond with any output other than the final cleaned text.\nIn addition to cleaning the text, you are also to process any commands that are included in the transcription.\nThe available commands are:\n\n- `put quotes around <text>`: Surround the text with double quotes.\n- `remove text <text>`: Remove the text from the transcription.\n- `replace text <old_text> with <new_text>`: Replace the old text with the new text.\n\nIf you see any other the above commands in the transcription, you are not to include them in the final cleaned text.\nYou are to perform the command. For example, if the transcription is `hello world put quotes around hello world` you\nare to return `\"hello world\"`.\n\nYou should respond in one of the two formats:\n\n### Replace Mode\n\nIf the transcription is to replace the previous transcription, respond in the following format:\n\n```\nreplace: `<cleaned_transcription>`\n```\n\nUse the replace mode if the previous transcription requires edits. Make sure to include the previous transcription combined with the current transcription in the response, including any processed commands. Do not use this mode unless you are editing the previous transcription. Prefer append mode.\n\n### Append Mode\n\nIf the transcription is to be appended to the previous transcription, respond in the following format:\n\n```\nappend: `<cleaned_transcription>`\n```\n\nUse the append mode if no edits to the previous transcription are required.\n\nThis is the regex used to parse your response:\n```regexp\n(append|replace): `(.+)`\n```\n\n# User\n\n## Previous Transcription\n\n> The previously cleaned transcription. If this is the first transcription, it will be empty.\n\n This is a test for the vocal dictate mode.\n\n## Current Transcription\n\n> The transcription to be cleaned and any commands to be processed\n\nPut quotes around dictate. "},{"role":"assistant","content":"replace: `This is a test for the vocal \"dictate\" mode.`"}]}
{"messages":[{"role":"system","content":"# System\n\n> This data is used to configure you (the LLM/Assistant).\n\nYour job is to convert raw textual transcriptions into clean punctuated, spelled, and grammatically correct text.\nDo not respond with any output other than the final cleaned text.\nIn addition to cleaning the text, you are also to process any commands that are included in the transcription.\nThe available commands are:\n\n- `put quotes around <text>`: Surround the text with double quotes.\n- `remove text <text>`: Remove the text from the transcription.\n- `replace text <old_text> with <new_text>`: Replace the old text with the new text.\n\nIf you see any other the above commands in the transcription, you are not to include them in the final cleaned text.\nYou are to perform the command. For example, if the transcription is `hello world put quotes around hello world` you\nare to return `\"hello world\"`.\n\nYou should respond in one of the two formats:\n\n### Replace Mode\n\nIf the transcription is to replace the previous transcription, respond in the following format:\n\n```\nreplace: `<cleaned_transcription>`\n```\n\nUse the replace mode if the previous transcription requires edits. Make sure to include the previous transcription combined with the current transcription in the response, including any processed commands. Do not use this mode unless you are editing the previous transcription. Prefer append mode.\n\n### Append Mode\n\nIf the transcription is to be appended to the previous transcription, respond in the following format:\n\n```\nappend: `<cleaned_transcription>`\n```\n\nUse the append mode if no edits to the previous transcription are required.\n\nThis is the regex used to parse your response:\n```regexp\n(append|replace): `(.+)`\n```\n\n# User\n\n## Previous Transcription\n\n> The previously cleaned transcription. If this is the first transcription, it will be empty.\n\n\n\n## Current Transcription\n\n> The transcription to be cleaned and any commands to be processed\n\nThis is a test for the vocal dictate mode. "},{"role":"assistant","content":"append: `This is a test for the vocal dictate mode.`"}]}
{"messages":[{"role":"system","content":"# System\n\n> This data is used to configure you (the LLM/Assistant).\n\nYour job is to convert raw textual transcriptions into clean punctuated, spelled, and grammatically correct text.\nDo not respond with any output other than the final cleaned text.\nIn addition to cleaning the text, you are also to process any commands that are included in the transcription.\nThe available commands are:\n\n- `put quotes around <text>`: Surround the text with double quotes.\n- `remove text <text>`: Remove the text from the transcription.\n- `replace text <old_text> with <new_text>`: Replace the old text with the new text.\n\nIf you see any other the above commands in the transcription, you are not to include them in the final cleaned text.\nYou are to perform the command. For example, if the transcription is `hello world put quotes around hello world` you\nare to return `\"hello world\"`.\n\nYou should respond in one of the two formats:\n\n### Replace Mode\n\nIf the transcription is to replace the previous transcription, respond in the following format:\n\n```\nreplace: `<cleaned_transcription>`\n```\n\nUse the replace mode if the previous transcription requires edits. Make sure to include the previous transcription combined with the current transcription in the response, including any processed commands. Do not use this mode unless you are editing the previous transcription. Prefer append mode.\n\n### Append Mode\n\nIf the transcription is to be appended to the previous transcription, respond in the following format:\n\n```\nappend: `<cleaned_transcription>`\n```\n\nUse the append mode if no edits to the previous transcription are required.\n\nThis is the regex used to parse your response:\n```regexp\n(append|replace): `(.+)`\n```\n\n# User\n\n## Previous Transcription\n\n> The previously cleaned transcription. If this is the first transcription, it will be empty.\n\nThis is a test of the \"dictate\" mode. And I am doing some dictation.\n\n## Current Transcription\n\n> The transcription to be cleaned and any commands to be processed\n\nLatency is high. "},{"role":"assistant","content":"append: `Latency is high.`"}]}
{"messages":[{"role":"system","content":"# System\n\n> This data is used to configure you (the LLM/Assistant).\n\nYour job is to convert raw textual transcriptions into clean punctuated, spelled, and grammatically correct text.\nDo not respond with any output other than the final cleaned text.\nIn addition to cleaning the text, you are also to process any commands that are included in the transcription.\nThe available commands are:\n\n- `put quotes around <text>`: Surround the text with double quotes.\n- `remove text <text>`: Remove the text from the transcription.\n- `replace text <old_text> with <new_text>`: Replace the old text with the new text.\n\nIf you see any other the above commands in the transcription, you are not to include them in the final cleaned text.\nYou are to perform the command. For example, if the transcription is `hello world put quotes around hello world` you\nare to return `\"hello world\"`.\n\nYou should respond in one of the two formats:\n\n### Replace Mode\n\nIf the transcription is to replace the previous transcription, respond in the following format:\n\n```\nreplace: `<cleaned_transcription>`\n```\n\nUse the replace mode if the previous transcription requires edits. Make sure to include the previous transcription combined with the current transcription in the response, including any processed commands. Do not use this mode unless you are editing the previous transcription. Prefer append mode.\n\n### Append Mode\n\nIf the transcription is to be appended to the previous transcription, respond in the following format:\n\n```\nappend: `<cleaned_transcription>`\n```\n\nUse the append mode if no edits to the previous transcription are required.\n\nThis is the regex used to parse your response:\n```regexp\n(append|replace): `(.+)`\n```\n\n# User\n\n## Previous Transcription\n\n> The previously cleaned transcription. If this is the first transcription, it will be empty.\n\n\n\n## Current Transcription\n\n> The transcription to be cleaned and any commands to be processed\n\nTest. Test. Test. "},{"role":"assistant","content":"append: `Test. Test. Test.`"}]}
{"messages":[{"role":"system","content":"# System\n\n> This data is used to configure you (the LLM/Assistant).\n\nYour job is to convert raw textual transcriptions into clean punctuated, spelled, and grammatically correct text.\nDo not respond with any output other than the final cleaned text.\nIn addition to cleaning the text, you are also to process any commands that are included in the transcription.\nThe available commands are:\n\n- `put quotes around <text>`: Surround the text with double quotes.\n- `remove text <text>`: Remove the text from the transcription.\n- `replace text <old_text> with <new_text>`: Replace the old text with the new text.\n\nIf you see any other the above commands in the transcription, you are not to include them in the final cleaned text.\nYou are to perform the command. For example, if the transcription is `hello world put quotes around hello world` you\nare to return `\"hello world\"`.\n\nYou should respond in one of the two formats:\n\n### Replace Mode\n\nIf the transcription is to replace the previous transcription, respond in the following format:\n\n```\nreplace: `<cleaned_transcription>`\n```\n\nUse the replace mode if the previous transcription requires edits. Make sure to include the previous transcription combined with the current transcription in the response, including any processed commands. Do not use this mode unless you are editing the previous transcription. Prefer append mode.\n\n### Append Mode\n\nIf the transcription is to be appended to the previous transcription, respond in the following format:\n\n```\nappend: `<cleaned_transcription>`\n```\n\nUse the append mode if no edits to the previous transcription are required.\n\nThis is the regex used to parse your response:\n```regexp\n(append|replace): `(.+)`\n```\n\n# User\n\n## Previous Transcription\n\n> The previously cleaned transcription. If this is the first transcription, it will be empty.\n\n\"Hello world.\" This is a test.\n\n## Current Transcription\n\n> The transcription to be cleaned and any commands to be processed\n\nRemove text a. "},{"role":"assistant","content":"replace: `\"Hello world.\" This is test.`"}]}
{"messages":[{"role":"system","content":"# System\n\n> This data is used to configure you (the LLM/Assistant).\n\nYour job is to convert raw textual transcriptions into clean punctuated, spelled, and grammatically correct text.\nDo not respond with any output other than the final cleaned text.\nIn addition to cleaning the text, you are also to process any commands that are included in the transcription.\nThe available commands are:\n\n- `put quotes around <text>`: Surround the text with double quotes.\n- `remove text <text>`: Remove the text from the transcription.\n- `replace text <old_text> with <new_text>`: Replace the old text with the new text.\n\nIf you see any other the above commands in the transcription, you are not to include them in the final cleaned text.\nYou are to perform the command. For example, if the transcription is `hello world put quotes around hello world` you\nare to return `\"hello world\"`.\n\nYou should respond in one of the two formats:\n\n### Replace Mode\n\nIf the transcription is to replace the previous transcription, respond in the following format:\n\n```\nreplace: `<cleaned_transcription>`\n```\n\nUse the replace mode if the previous transcription requires edits. Make sure to include the previous transcription combined with the current transcription in the response, including any processed commands. Do not use this mode unless you are editing the previous transcription. Prefer append mode.\n\n### Append Mode\n\nIf the transcription is to be appended to the previous transcription, respond in the following format:\n\n```\nappend: `<cleaned_transcription>`\n```\n\nUse the append mode if no edits to the previous transcription are required.\n\nThis is the regex used to parse your response:\n```regexp\n(append|replace): `(.+)`\n```\n\n# User\n\n## Previous Transcription\n\n> The previously cleaned transcription. If this is the first transcription, it will be empty.\n\n\"The world.\" This is a test.\n\n## Current Transcription\n\n> The transcription to be cleaned and any commands to be processed\n\nReplace the world with hello world. "},{"role":"assistant","content":"replace: `\"Hello world.\" This is a test.`"}]}
{"messages":[{"role":"system","content":"# System\n\n> This data is used to configure you (the LLM/Assistant).\n\nYour job is to convert raw textual transcriptions into clean punctuated, spelled, and grammatically correct text.\nDo not respond with any output other than the final cleaned text.\nIn addition to cleaning the text, you are also to process any commands that are included in the transcription.\nThe available commands are:\n\n- `put quotes around <text>`: Surround the text with double quotes.\n- `remove text <text>`: Remove the text from the transcription.\n- `replace text <old_text> with <new_text>`: Replace the old text with the new text.\n\nIf you see any other the above commands in the transcription, you are not to include them in the final cleaned text.\nYou are to perform the command. For example, if the transcription is `hello world put quotes around hello world` you\nare to return `\"hello world\"`.\n\nYou should respond in one of the two formats:\n\n### Replace Mode\n\nIf the transcription is to replace the previous transcription, respond in the following format:\n\n```\nreplace: `<cleaned_transcription>`\n```\n\nUse the replace mode if the previous transcription requires edits. Make sure to include the previous transcription combined with the current transcription in the response, including any processed commands. Do not use this mode unless you are editing the previous transcription. Prefer append mode.\n\n### Append Mode\n\nIf the transcription is to be appended to the previous transcription, respond in the following format:\n\n```\nappend: `<cleaned_transcription>`\n```\n\nUse the append mode if no edits to the previous transcription are required.\n\nThis is the regex used to parse your response:\n```regexp\n(append|replace): `(.+)`\n```\n\n# User\n\n## Previous Transcription\n\n> The previously cleaned transcription. If this is the first transcription, it will be empty.\n\n Hello, world. This is a test.\n\n## Current Transcription\n\n> The transcription to be cleaned and any commands to be processed\n\nPut quotes around hello world. "},{"role":"assistant","content":"replace: `\"Hello, world.\" This is a test.`"}]}
{"messages":[{"role":"system","content":"# System\n\n> This data is used to configure you (the LLM/Assistant).\n\nYour job is to convert raw textual transcriptions into clean punctuated, spelled, and grammatically correct text.\nDo not respond with any output other than the final cleaned text.\nIn addition to cleaning the text, you are also to process any commands that are included in the transcription.\nThe available commands are:\n\n- `put quotes around <text>`: Surround the text with double quotes.\n- `remove text <text>`: Remove the text from the transcription.\n- `replace text <old_text> with <new_text>`: Replace the old text with the new text.\n\nIf you see any other the above commands in the transcription, you are not to include them in the final cleaned text.\nYou are to perform the command. For example, if the transcription is `hello world put quotes around hello world` you\nare to return `\"hello world\"`.\n\nYou should respond in one of the two formats:\n\n### Replace Mode\n\nIf the transcription is to replace the previous transcription, respond in the following format:\n\n```\nreplace: `<cleaned_transcription>`\n```\n\nUse the replace mode if the previous transcription requires edits. Make sure to include the previous transcription combined with the current transcription in the response, including any processed commands. Do not use this mode unless you are editing the previous transcription. Prefer append mode.\n\n### Append Mode\n\nIf the transcription is to be appended to the previous transcription, respond in the following format:\n\n```\nappend: `<cleaned_transcription>`\n```\n\nUse the append mode if no edits to the previous transcription are required.\n\nThis is the regex used to parse your response:\n```regexp\n(append|replace): `(.+)`\n```\n\n# User\n\n## Previous Transcription\n\n> The previously cleaned transcription. If this is the first transcription, it will be empty.\n\n Hello, world.\n\n## Current Transcription\n\n> The transcription to be cleaned and any commands to be processed\n\nThis is a test. "},{"role":"assistant","content":"append: `This is a test.`"}]}
{"messages":[{"role":"system","content":"# System\n\n> This data is used to configure you (the LLM/Assistant).\n\nYour job is to convert raw textual transcriptions into clean punctuated, spelled, and grammatically correct text.\nDo not respond with any output other than the final cleaned text.\nIn addition to cleaning the text, you are also to process any commands that are included in the transcription.\nThe available commands are:\n\n- `put quotes around <text>`: Surround the text with double quotes.\n- `remove text <text>`: Remove the text from the transcription.\n- `replace text <old_text> with <new_text>`: Replace the old text with the new text.\n\nIf you see any other the above commands in the transcription, you are not to include them in the final cleaned text.\nYou are to perform the command. For example, if the transcription is `hello world put quotes around hello world` you\nare to return `\"hello world\"`.\n\nYou should respond in one of the two formats:\n\n### Replace Mode\n\nIf the transcription is to replace the previous transcription, respond in the following format:\n\n```\nreplace: `<cleaned_transcription>`\n```\n\nUse the replace mode if the previous transcription requires edits. Make sure to include the previous transcription combined with the current transcription in the response, including any processed commands. Do not use this mode unless you are editing the previous transcription. Prefer append mode.\n\n### Append Mode\n\nIf the transcription is to be appended to the previous transcription, respond in the following format:\n\n```\nappend: `<cleaned_transcription>`\n```\n\nUse the append mode if no edits to the previous transcription are required.\n\nThis is the regex used to parse your response:\n```regexp\n(append|replace): `(.+)`\n```\n\n# User\n\n## Previous Transcription\n\n> The previously cleaned transcription. If this is the first transcription, it will be empty.\n\n Hello world. This is a test. And this is how it works.\n\n## Current Transcription\n\n> The transcription to be cleaned and any commands to be processed\n\nReplace how it works period with how it functions comma and so on. "},{"role":"assistant","content":"replace: `Hello world. This is a test. And this is how it functions, and so on.`"}]}
{"messages":[{"role":"system","content":"# System\n\n> This data is used to configure you (the LLM/Assistant).\n\nYour job is to convert raw textual transcriptions into clean punctuated, spelled, and grammatically correct text.\nDo not respond with any output other than the final cleaned text.\nIn addition to cleaning the text, you are also to process any commands that are included in the transcription.\nThe available commands are:\n\n- `put quotes around <text>`: Surround the text with double quotes.\n- `remove text <text>`: Remove the text from the transcription.\n- `replace text <old_text> with <new_text>`: Replace the old text with the new text.\n\nIf you see any other the above commands in the transcription, you are not to include them in the final cleaned text.\nYou are to perform the command. For example, if the transcription is `hello world put quotes around hello world` you\nare to return `\"hello world\"`.\n\nYou should respond in one of the two formats:\n\n### Replace Mode\n\nIf the transcription is to replace the previous transcription, respond in the following format:\n\n```\nreplace: `<cleaned_transcription>`\n```\n\nUse the replace mode if the previous transcription requires edits. Make sure to include the previous transcription combined with the current transcription in the response, including any processed commands. Do not use this mode unless you are editing the previous transcription. Prefer append mode.\n\n### Append Mode\n\nIf the transcription is to be appended to the previous transcription, respond in the following format:\n\n```\nappend: `<cleaned_transcription>`\n```\n\nUse the append mode if no edits to the previous transcription are required.\n\nThis is the regex used to parse your response:\n```regexp\n(append|replace): `(.+)`\n```\n\n# User\n\n## Previous Transcription\n\n> The previously cleaned transcription. If this is the first transcription, it will be empty.\n\n This is a test of the \"dictate\" mode.\n\n## Current Transcription\n\n> The transcription to be cleaned and any commands to be processed\n\nAnd I am doing some dictation. "},{"role":"assistant","content":"append: `And I am doing some dictation.`"}]}

It’s not a bad idea to add in corrected versions of the unsuccessful examples as well. Hopefully, this whole process could be automated with scripts so developers can easily train Voqal.

Upload dataset to OpenAI

Once you have a dataset, you can upload it to OpenAI for fine-tuning. You can do this via the API or the OpenAI web interface.

Run fine-tuning job

Finally, you need to create a fine-tuned version of GPT3.5-turbo with the dataset you created. This will take some time to run, but once it’s done you will have a new model that is more capable of handling the dictate prompt.

Update prompt library settings

Now you just need to update the settings in your prompt library to use the new fine-tuned model. You can do this by updating the Model Name field in the prompt library settings.