Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to optimize only a part of instruction? #1165

Open
YunpengZhai opened this issue Jun 18, 2024 · 2 comments
Open

How to optimize only a part of instruction? #1165

YunpengZhai opened this issue Jun 18, 2024 · 2 comments

Comments

@YunpengZhai
Copy link

Hi,

How can I customize the prompt structure in DSPy and use teleprompter to optimize only a specific part of it? For example, my custom prompt is:

## Task
(this is the task description)

## Tips
(Tips: 1. xxxx; 2. xxxx)

How can I use an optimizer, such as copro, to optimize only the Tips section?

Thank you!

@timothyvinzent
Copy link

Im having a similar challenge when adding few shot examples. Specifically I have inputs to the model that are always identical and I would like to hide them from the examples that are provided to the LM during inference and training, since it costs a lot of tokens having unnecessary inputs be used during training (multiplied by number of examples showed). Would be nice to be able to specify which parameters should be "tuned".

@okhat
Copy link
Collaborator

okhat commented Jun 27, 2024

@YunpengZhai consider passing the task description as a field, that way you control it, and the optimizer can't change it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants