-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
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
[Request] Gemini 模型现在已经支持 system role prompt(systemInstruction) #2553
Comments
👀 @m-guo Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. |
现在的 system message 是会作为 role=user 注入的,理论上也是有 instruction 的效果。 你能给出相同 prompt 下,按照 system Instruction 来改的话,效果会比 role=user 好的案例吗? 不然感觉改了好像意义不大 |
The current system message will be injected as role=user, which theoretically also has the effect of instruction. Can you give an example of how the effect will be improved if it is modified according to the system instructions? Otherwise, it feels like the change doesn’t mean much. |
这个对个人来说很难验证吧,严格的证明需要跑大量的case。 个人认为既然 Gemini 提供的这个参数他们肯定会对使用这个参数的输出做优化吧,不仅仅是对齐其他AI厂商的API。 |
This is difficult for individuals to verify. Strict proof requires running a large number of cases. Personally, I think that since Gemini provides this parameter, they will definitely optimize the output using this parameter, not just align it with the APIs of other AI manufacturers. |
你只要给出几个你自己用的 case ,能给我证明是效果更好的即可。如果你自己用下来都没啥区别,那我也没有改的必要对吧
不一定,gemini 本身吹的天花乱坠,但我实测下来效果拉的一批。 Google 在大模型领域挺草台的,还是得看实际效果 |
You just need to give a few cases that you use yourself and prove to me that it is more effective. If you don’t see any difference after using it yourself, then there’s no need for me to change it, right? |
根据gpt-4o的回复,系统角色和用户角色对大模型的影响是不同的,gemini即使差到比不过国内大模型,它提供了参数,现在看不出来,也会在以后参数影响,作者现在不该不强求,但建议标记成待开发 |
In the OpenAI API, putting prompt words into the system role and putting them into the user role will have significantly different effects on the generated results. Here are the main differences between the two:
1. **System Role**:
- **Definition and Purpose**: System roles are used to set the behavior and tone of the model. It is often used to provide background information or set the overall tone of the conversation.
- **Impact**: The prompt words of the system role will affect the context of the entire dialogue and the way the model behaves. For example, if the system role prompt is "You are a friendly assistant," the model will maintain a friendly and helpful tone throughout the conversation.
- **Usage Scenarios**: Suitable for scenarios where you need to set the conversation style, tone or provide background information.
2. **User Role**:
- **Definition and Purpose**: User roles are used to simulate user input or questions. It is typically used to ask questions or request information directly from the model.
- **Impact**: The prompt words of the user role will be regarded by the model as input that requires direct response. For example, if the user role prompt is "Tell me about today's weather," the model will directly try to answer that question.
- **Usage Scenarios**: Suitable for scenarios where you need to obtain information directly or answer specific questions.
### Example comparison
**System role prompt words**:
```json
{
"role": "system",
"content": "You are a knowledgeable assistant who is good at answering technical questions."
} User role prompt words: {
"role": "user",
"content": "Please explain the basic principles of quantum computing."
} In this example, the system role cue words set the model's behavior and tone, making it appear knowledgeable and professional throughout the conversation. The user role prompt word is a specific question, and the model will directly try to answer this question. Difference in results
SummarizePutting the prompt words into a system role and putting them into a user role can have a significantly different impact on the results. System roles are used to set the overall tone of the conversation and the behavior of the model, while user roles are used to ask specific questions or request information. Choosing the right character to place your prompt words based on your specific needs gives you more control over the generated results.
|
这个就是最大的问题。比如 GPT 系列我之前自己测过, system Role 和 user message 的差异是挺大的。system role 对回答的影响能力会更大,那么我自然有动机做这个更新。 但是 Gemini 系列我目前并没有精力测试,所以只要你们给出一例用 system role 的效果比用 user message 好的,我自然愿意改。但如果你们日常在用 gemini 的情况下,都找不到设了 system role 比 user role 效果要好的 case 。为何我要在现在这个时间节点来做这件事呢? 或者如果有人愿意 PR 我举双手欢迎。 |
This is the biggest problem. For example, I have tested the GPT series myself before, and the difference between system Role and user message is quite big. The system role will have a greater impact on the answer, so I am naturally motivated to make this update. But I don’t have the energy to test the Gemini series at the moment, so as long as you give an example where using system role is better than using user message, I will naturally be willing to change it. But if you use gemini every day, you will not find a case where system role is better than user role. Why should I do this at this time? Or if anyone wants to PR I welcome it with both hands. |
gemini用的少,主要是用gpt4,看到这个issue就回复了一下,也许什么时候转用gemini时可以帮忙提pr,但目前没动力 |
Gemini is rarely used, mainly gpt4. I replied to this issue when I saw it. Maybe I can help with PR when I switch to gemini, but I have no motivation at the moment. |
@muamua33 我也一样,主力 claude + gpt4 。 claude 的 systemRole 我早做掉了。 Gemini 就是太拉了,完全没有动力给他去适配 🤷♂️ |
@muamua33 Me too, main claude + gpt4. I have already done away with claude's systemRole. Gemini is just too stretched, there is no motivation to adapt it 🤷♂️ |
✅ @m-guo This issue is closed, If you have any questions, you can comment and reply. |
🎉 This issue has been resolved in version 1.19.31 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🥰 Feature Description
现在官方SDK已经支持“System Instructions”设定 system role的prompt
🧐 Proposed Solution
希望可以添加该特性,Gemini 在中文某些方面的训练预料明显优于其他模型
📝 Additional Information
No response
The text was updated successfully, but these errors were encountered: