sdg-hub 0.1.0a2.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. sdg_hub/__init__.py +4 -0
  2. sdg_hub/_version.py +21 -0
  3. sdg_hub/blocks/__init__.py +6 -0
  4. sdg_hub/blocks/block.py +54 -0
  5. sdg_hub/blocks/filterblock.py +76 -0
  6. sdg_hub/blocks/iterblock.py +31 -0
  7. sdg_hub/blocks/llmblock.py +430 -0
  8. sdg_hub/blocks/rmblocks.py +194 -0
  9. sdg_hub/blocks/utilblocks.py +140 -0
  10. sdg_hub/configs/__init__.py +0 -0
  11. sdg_hub/configs/annotations/__init__.py +0 -0
  12. sdg_hub/configs/annotations/cot_reflection.yaml +34 -0
  13. sdg_hub/configs/annotations/detailed_description.yaml +10 -0
  14. sdg_hub/configs/annotations/detailed_description_icl.yaml +32 -0
  15. sdg_hub/configs/annotations/simple.yaml +10 -0
  16. sdg_hub/configs/knowledge/__init__.py +0 -0
  17. sdg_hub/configs/knowledge/atomic_facts.yaml +45 -0
  18. sdg_hub/configs/knowledge/auxilary_instructions.yaml +35 -0
  19. sdg_hub/configs/knowledge/data_recipe/__init__.py +0 -0
  20. sdg_hub/configs/knowledge/data_recipe/default_recipe.yaml +3 -0
  21. sdg_hub/configs/knowledge/detailed_summary.yaml +17 -0
  22. sdg_hub/configs/knowledge/evaluate_faithfulness.yaml +68 -0
  23. sdg_hub/configs/knowledge/evaluate_question.yaml +38 -0
  24. sdg_hub/configs/knowledge/evaluate_relevancy.yaml +85 -0
  25. sdg_hub/configs/knowledge/extractive_summary.yaml +17 -0
  26. sdg_hub/configs/knowledge/generate_code_questions_responses.yaml +39 -0
  27. sdg_hub/configs/knowledge/generate_questions_responses.yaml +56 -0
  28. sdg_hub/configs/knowledge/mcq_generation.yaml +83 -0
  29. sdg_hub/configs/knowledge/router.yaml +12 -0
  30. sdg_hub/configs/knowledge/simple_generate_qa.yaml +34 -0
  31. sdg_hub/configs/reasoning/dynamic_cot.yaml +40 -0
  32. sdg_hub/configs/skills/_A_.yaml +97 -0
  33. sdg_hub/configs/skills/_B_.yaml +36 -0
  34. sdg_hub/configs/skills/_C_.yaml +71 -0
  35. sdg_hub/configs/skills/_D_.yaml +85 -0
  36. sdg_hub/configs/skills/_E_.yaml +30 -0
  37. sdg_hub/configs/skills/_F_.yaml +45 -0
  38. sdg_hub/configs/skills/_G_.yaml +56 -0
  39. sdg_hub/configs/skills/_H_.yaml +80 -0
  40. sdg_hub/configs/skills/__init__.py +0 -0
  41. sdg_hub/configs/skills/analyzer.yaml +48 -0
  42. sdg_hub/configs/skills/annotation.yaml +36 -0
  43. sdg_hub/configs/skills/contexts.yaml +21 -0
  44. sdg_hub/configs/skills/critic.yaml +60 -0
  45. sdg_hub/configs/skills/data_recipe/__init__.py +0 -0
  46. sdg_hub/configs/skills/data_recipe/default_recipe.yaml +6 -0
  47. sdg_hub/configs/skills/evaluate_freeform_pair.yaml +44 -0
  48. sdg_hub/configs/skills/evaluate_freeform_questions.yaml +46 -0
  49. sdg_hub/configs/skills/evaluate_grounded_pair.yaml +54 -0
  50. sdg_hub/configs/skills/evaluate_grounded_questions.yaml +51 -0
  51. sdg_hub/configs/skills/freeform_questions.yaml +29 -0
  52. sdg_hub/configs/skills/freeform_responses.yaml +45 -0
  53. sdg_hub/configs/skills/grounded_questions.yaml +38 -0
  54. sdg_hub/configs/skills/grounded_responses.yaml +59 -0
  55. sdg_hub/configs/skills/judge.yaml +53 -0
  56. sdg_hub/configs/skills/planner.yaml +67 -0
  57. sdg_hub/configs/skills/respond.yaml +8 -0
  58. sdg_hub/configs/skills/revised_responder.yaml +78 -0
  59. sdg_hub/configs/skills/router.yaml +12 -0
  60. sdg_hub/configs/skills/simple_generate_qa_freeform.yaml +27 -0
  61. sdg_hub/configs/skills/simple_generate_qa_grounded.yaml +31 -0
  62. sdg_hub/flow.py +127 -0
  63. sdg_hub/flows/annotation/emotion/detailed_description.yaml +19 -0
  64. sdg_hub/flows/annotation/emotion/detailed_description_icl.yaml +19 -0
  65. sdg_hub/flows/annotation/emotion/simple.yaml +19 -0
  66. sdg_hub/flows/generation/knowledge/mmlu_bench.yaml +13 -0
  67. sdg_hub/flows/generation/knowledge/simple_knowledge.yaml +12 -0
  68. sdg_hub/flows/generation/knowledge/synth_knowledge.yaml +89 -0
  69. sdg_hub/flows/generation/knowledge/synth_knowledge1.5.yaml +136 -0
  70. sdg_hub/flows/generation/skills/agentic_improve_skill.yaml +108 -0
  71. sdg_hub/flows/generation/skills/simple_freeform_skill.yaml +12 -0
  72. sdg_hub/flows/generation/skills/simple_grounded_skill.yaml +12 -0
  73. sdg_hub/flows/generation/skills/synth_grounded_skills.yaml +80 -0
  74. sdg_hub/flows/generation/skills/synth_skills.yaml +59 -0
  75. sdg_hub/logger_config.py +20 -0
  76. sdg_hub/pipeline.py +66 -0
  77. sdg_hub/prompts.py +17 -0
  78. sdg_hub/py.typed +0 -0
  79. sdg_hub/registry.py +122 -0
  80. sdg_hub/sdg.py +164 -0
  81. sdg_hub/utils/__init__.py +5 -0
  82. sdg_hub/utils/chunking.py +73 -0
  83. sdg_hub/utils/datamixing.py +123 -0
  84. sdg_hub/utils/datautils.py +14 -0
  85. sdg_hub/utils/docprocessor.py +357 -0
  86. sdg_hub/utils/json.py +48 -0
  87. sdg_hub/utils/models.py +31 -0
  88. sdg_hub/utils/parse_and_convert.py +392 -0
  89. sdg_hub/utils/taxonomy.py +489 -0
  90. sdg_hub-0.1.0a2.dev0.dist-info/METADATA +154 -0
  91. sdg_hub-0.1.0a2.dev0.dist-info/RECORD +94 -0
  92. sdg_hub-0.1.0a2.dev0.dist-info/WHEEL +5 -0
  93. sdg_hub-0.1.0a2.dev0.dist-info/licenses/LICENSE +201 -0
  94. sdg_hub-0.1.0a2.dev0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,54 @@
1
+ system: You are a very knowledgeable AI Assistant that will faithfully assist the user with their task.
2
+
3
+ introduction: |
4
+ Please act as an impartial judge and evaluate the quality of the answer provided by an AI assistant to the questions displayed below. Evaluate whether or not the answer is a good example of how AI Assistant should respond to the user's instruction. Please assign a score using the following 3-point scale.
5
+ principles: |
6
+ 1: It means the answer is incorrect, irrelevant, unsafe or provides incomplete and garbage information. For instance, the answer may be factually wrong, off-topic, or filled with irrelevant content that doesn't address the user's question or it could be incomplete and hanging. It may also include any harmful, unethical, racist, sexist, explicit, offensive, toxic, dangerous, or illegal content. If the answer is not supported by the context given.
7
+
8
+ 2: It means the answer provides the correct answer, but it is brief and to the point without explanations. While it directly answers the user's question, it lacks additional context or in-depth explanations.
9
+
10
+ 3: It means the answer is a perfect answer from an AI Assistant. It intentionally addresses the user's question with a comprehensive and detailed explanation. It demonstrates expert knowledge in the area, is very well written, logical, easy to follow, engaging, and insightful. And the answer is safe and does not include any harmful content.
11
+
12
+ examples: |
13
+ [Start of Context]
14
+ In recent years, electric vehicles (EVs) have gained popularity due to their environmental benefits and advancements in technology. EVs produce zero emissions while driving, which helps reduce air pollution and combat climate change. Additionally, with the development of more efficient batteries, the range and performance of EVs have significantly improved, making them a more viable option for consumers.
15
+ [End of Context]
16
+
17
+ [Start of Question]
18
+ How do electric vehicles help in reducing air pollution?
19
+ [End of Question]
20
+
21
+ [Start of Answer]
22
+ Electric vehicles (EVs) help in reducing air pollution because they produce zero emissions while driving.
23
+ [End of Answer]
24
+
25
+ [Start of Evaluation]
26
+ This answer is correct, directly addresses the user's question, and is supported by the provided context. It is brief and to the point but lacks additional context or in-depth explanations.
27
+ [End of Evaluation]
28
+
29
+ [Start of Score]
30
+ 2
31
+ [End of Score]
32
+
33
+ generation: |
34
+ Begin your evaluation by providing a short explanation. Be as objective as possible. After providing your explanation, you must rate the answer on a scale of 1 to 3 as mentioned above.
35
+ Here's the context, question and the answer you need to evaluate:
36
+
37
+ [Start of Context]
38
+ {{ context }}
39
+ [End of Context]
40
+
41
+ [Start of Question]
42
+ {{ question }}
43
+ [End of Question]
44
+
45
+ [Start of Answer]
46
+ {{ response }}
47
+ [End of Answer]
48
+
49
+ * Return the evaluation between [Start of Evaluation] and [End of Evaluation] tags.
50
+ * Return the score between [Start of Score] and [End of Score] tags.
51
+
52
+
53
+ start_tags: ["[Start of Evaluation]", "[Start of Score]"]
54
+ end_tags: ["[End of Evaluation]", "[End of Score]"]
@@ -0,0 +1,51 @@
1
+ system: You are a very knowledgeable AI Assistant that will faithfully assist the user with their task.
2
+
3
+ introduction: |
4
+ Please act as an impartial judge and evaluate the questions generated by an AI assistant displayed below. Evaluate whether or not the question is a good question of how AI Assistant should respond to the user's instruction. Please assign a score using a binary 0/1 scale.
5
+
6
+ principles: |
7
+ Here are the requirements:
8
+ * A large language model should be able to complete the question. For example, do not ask the assistant to create any visual or audio output. For another example, do not ask the assistant to wake you up at 5pm or set a reminder because it cannot perform any action.
9
+ * The questions should be in English.
10
+ * The questions should be 1 to 2 sentences long and should be properly formatted.
11
+ * The question should not be offensive, abusive, or harmful. It should be safe and respectful.
12
+ * The question should be relevant to the task given - {{ task_description }}.
13
+ * Most importantly all the questions should be grounded in the context provided and should be answerable solely based on the provided context.
14
+
15
+ If the question meets the above requirements, please rate it 1. If not, please rate it 0.
16
+
17
+ examples: |
18
+ For better understanding of the task, here are some examples:
19
+
20
+ [Start of Context]
21
+ In recent years, electric vehicles (EVs) have gained popularity due to their environmental benefits and advancements in technology. EVs produce zero emissions while driving, which helps reduce air pollution and combat climate change. Additionally, with the development of more efficient batteries, the range and performance of EVs have significantly improved, making them a more viable option for consumers.
22
+ [End of Context]
23
+
24
+ [Start of Question]
25
+ How do electric vehicles help in reducing air pollution?
26
+ [End of Question]
27
+
28
+ [Start of Evaluation]
29
+ This question is properly formatted, respectful, and directly relevant to the task of understanding the benefits of electric vehicles. It is grounded in the provided context, which mentions that EVs produce zero emissions while driving, helping reduce air pollution. A large language model can provide an answer to this question based on the provided context.
30
+ [End of Evaluation]
31
+
32
+ [Start of Score]
33
+ 1
34
+ [End of Score]
35
+
36
+ generation: |
37
+ Here's the context and question you need to evaluate. Return the evaluation between [Start of Evaluation] and [End of Evaluation] tags.
38
+
39
+ [Start of Context]
40
+ {{ context }}
41
+ [End of Context]
42
+ [Start of Question]
43
+ {{ question }}
44
+ [End of Question]
45
+
46
+ Begin your evaluation by providing a short explanation. Be as objective as possible. After providing your explanation, you must rate the question on a scale of 0 or 1 as mentioned above.
47
+ * Return the evaluation between [Start of Evaluation] and [End of Evaluation] tags.
48
+ * Return the score using a binary 0/1 scale between [Start of Score] and [End of Score] tags.
49
+
50
+ start_tags: ["[Start of Evaluation]", "[Start of Score]"]
51
+ end_tags: ["[End of Evaluation]", "[End of Score]"]
@@ -0,0 +1,29 @@
1
+ system: You are a very knowledgeable AI Assistant that will faithfully assist the user with their task.
2
+
3
+ introduction: |
4
+ You are asked to come up with a set of {{ num_samples }} diverse questions - {{ task_description }}.
5
+
6
+ principles: |
7
+ Please follow these guiding principles when generating responses:
8
+ * Use proper grammar and punctuation.
9
+ * Always generate safe and respectful content. Do not generate content that is harmful, abusive, or offensive.
10
+ * Always generate content that is factually accurate and relevant to the prompt.
11
+ * The questions should be clear and human-like.
12
+ * The questions should be diverse and cover a wide range of topics.
13
+ * The questions should not be template-based or generic, it should be very diverse.
14
+ * Simply return the questions, do not return any answers or explanations.
15
+ * Strictly adhere to the prompt and generate responses in the same style and format as the example.
16
+ * Return each question between [Start of Question] and [End of Question] tags.
17
+
18
+ examples: |
19
+ To better assist you with this task, here is an example:
20
+
21
+ [Start of Question]
22
+ {{ seed_question }}
23
+ [End of Question]
24
+
25
+ generation: |
26
+ Now generate {{ num_samples }} such questions, remember to follow the principles mentioned above and use the same format as the examples. Remember to use the same style and format as the example above. Return each question between [Start of Question] and [End of Question] tags.
27
+
28
+ start_tags: ["[Start of Question]"]
29
+ end_tags: ["[End of Question]"]
@@ -0,0 +1,45 @@
1
+ system: You are a very knowledgeable AI Assistant that will faithfully assist the user with their task.
2
+
3
+ introduction: Your task is to faithfully follow the user's prompt and generate a response.
4
+
5
+ principles: |
6
+ Please follow these guiding principles when generating responses:
7
+ * Use proper grammar and punctuation.
8
+ * Always generate safe and respectful content. Do not generate content that is harmful, abusive, or offensive.
9
+ * Always generate content that is factually accurate and relevant to the prompt.
10
+ * Strictly adhere to the prompt and generate responses in the same style and format as the example.
11
+ * Return the response between [Start of Response] and [End of Response] tags.
12
+
13
+ examples: |
14
+ To better assist you with this task, here is an example:
15
+ {% if seed_samples is defined %}
16
+ {% for sample in seed_samples %}
17
+ [Start of Question]
18
+ {{ sample.seed_question }}
19
+ [End of Question]
20
+
21
+ [Start of Response]
22
+ {{ sample.seed_response }}
23
+ [End of Response]
24
+ {% endfor %}
25
+ {% else %}
26
+ [Start of Question]
27
+ {{ seed_question }}
28
+ [End of Question]
29
+
30
+ [Start of Response]
31
+ {{ seed_response }}
32
+ [End of Response]
33
+ {% endif %}
34
+
35
+ generation: |
36
+ Now generate a response to the following prompt. Remember to use the same style and format as the example above.
37
+
38
+ [Start of Question]
39
+ {{ question }}
40
+ [End of Question]
41
+
42
+ Return the response between [Start of Response] and [End of Response] tags.
43
+
44
+ start_tags: ["[Start of Response]"]
45
+ end_tags: ["[End of Response]"]
@@ -0,0 +1,38 @@
1
+ system: You are a very knowledgeable AI Assistant that will faithfully assist the user with their task.
2
+
3
+ introduction: |
4
+ You are asked to come up with a set of {{ num_samples }} diverse questions - {{ task_description }}.
5
+
6
+ principles: |
7
+ Please follow these guiding principles when generating responses:
8
+ * Use proper grammar and punctuation.
9
+ * Always generate safe and respectful content. Do not generate content that is harmful, abusive, or offensive.
10
+ * Always generate content that is factually accurate and relevant to the prompt.
11
+ * The questions should be clear and human-like.
12
+ * The questions should be diverse and cover a wide range of topics.
13
+ * The questions should not be template-based or generic, it should be very diverse.
14
+ * Simply return the questions, do not return any answers or explanations.
15
+ * Strictly adhere to the prompt and generate responses in the same style and format as the example.
16
+ * Most importantly all the questions should be grounded in the context provided and should be answerable solely based on the provided context.
17
+ * The question should address the task described in the prompt.
18
+ * Return each question between [Start of Question] and [End of Question] tags.
19
+
20
+ examples: |
21
+ To better assist you with this task, here is an example:
22
+
23
+ [Start of Context]
24
+ {{ seed_context }}
25
+ [End of Context]
26
+ [Start of Question]
27
+ {{ seed_question }}
28
+ [End of Question]
29
+
30
+ generation: |
31
+ Now generate {{num_samples}} such questions, remember to follow the principles mentioned above and use the same format as the examples. Remember to use the same style and format as the example above. Do not return any contexts or answers, only the questions. Return each question between [Start of Question] and [End of Question] tags.
32
+
33
+ [Start of Context]
34
+ {{ context }}
35
+ [End of Context]
36
+
37
+ start_tags: ["[Start of Question]"]
38
+ end_tags: ["[End of Question]"]
@@ -0,0 +1,59 @@
1
+ system: You are a very knowledgeable AI Assistant that will faithfully assist the user with their task.
2
+
3
+ introduction: Your task is to faithfully follow the user's prompt, given context and generate a response.
4
+ principles: |
5
+ Please follow these guiding principles when generating responses:
6
+ * Use proper grammar and punctuation.
7
+ * Always generate safe and respectful content. Do not generate content that is harmful, abusive, or offensive.
8
+ * Always generate content that is factually accurate and relevant to the prompt.
9
+ * Strictly adhere to the prompt and generate responses in the same style and format as the example.
10
+ * Most importantly all the responses should be grounded in the context provided.
11
+ * Return the response between [Start of Response] and [End of Response] tags.
12
+
13
+ examples: |
14
+ To better assist you with this task, here are some examples:
15
+ {% if seed_samples is defined %}
16
+ {% for sample in seed_samples %}
17
+ [Start of Context]
18
+ {{ sample.seed_context }}
19
+ [End of Context]
20
+
21
+ [Start of Question]
22
+ {{ sample.seed_question }}
23
+ [End of Question]
24
+
25
+ [Start of Response]
26
+ {{ sample.seed_response }}
27
+ [End of Response]
28
+ {% endfor %}
29
+ {% else %}
30
+ [Start of Context]
31
+ {{ seed_context }}
32
+ [End of Context]
33
+
34
+ [Start of Question]
35
+ {{ seed_question }}
36
+ [End of Question]
37
+
38
+ [Start of Response]
39
+ {{ seed_response }}
40
+ [End of Response]
41
+ {% endif %}
42
+
43
+ generation: |
44
+ Now generate a response to the following prompt. Remember to use the same style and format as the example above.
45
+ Return the response between [Start of Response] and [End of Response] tags.
46
+
47
+ [Start of Context]
48
+ {{ context }}
49
+ [End of Context]
50
+
51
+ [Start of Question]
52
+ {{ question }}
53
+ [End of Question]
54
+
55
+ Return the response between [Start of Response] and [End of Response] tags.
56
+
57
+
58
+ start_tags: ["[Start of Response]"]
59
+ end_tags: ["[End of Response]"]
@@ -0,0 +1,53 @@
1
+ system: You are a helpful and precise assistant for checking the quality of the answer.
2
+
3
+ introduction: Please act as an impartial judge and evaluate the quality of the responses provided by two AI assistants to the user question displayed below. You should choose the assistant that follows the user's instructions and answers the user's question better. Your evaluation should consider factors such as the helpfulness, relevance, accuracy, depth, creativity, and level of detail of their responses.
4
+
5
+ principles: |
6
+ * Begin your evaluation by comparing the two responses and provide a short judgement.
7
+ * Avoid any position biases and ensure that the order in which the responses were presented does not influence your decision.
8
+ * Do not allow the length of the responses to influence your evaluation.
9
+ * Be as objective as possible.
10
+
11
+ examples: |
12
+ To better assist you with this, heres an example:
13
+
14
+ [Start of User Question]
15
+ What are the benefits of regular exercise?
16
+ [End of User Question]
17
+
18
+ [Start of Assistant A Answer]
19
+ Regular exercise provides numerous benefits including improved cardiovascular health, enhanced muscle strength, better mental health, and weight management. It reduces the risk of chronic diseases such as diabetes, hypertension, and certain cancers. Additionally, regular physical activity can improve sleep quality and increase overall energy levels.
20
+ [The End of Assistant A's Answer]
21
+
22
+ [Start of Assistant B Answer]
23
+ Engaging in regular exercise has several advantages. It strengthens the heart, boosts muscle power, and aids in maintaining a healthy weight. Exercise is also beneficial for mental well-being, as it can reduce symptoms of anxiety and depression. Furthermore, it helps in preventing chronic illnesses like diabetes, heart disease, and obesity. Regular physical activity can lead to better sleep and increased energy throughout the day.
24
+ [The End of Assistant B Answer]
25
+
26
+ [Start of Judgement]
27
+ Both responses highlight the benefits of regular exercise, including cardiovascular health, muscle strength, mental health, and chronic disease prevention. However, Assistant B’s answer is more detailed and specific, mentioning anxiety and depression, which provides a slightly broader view of the mental health benefits. Assistant A’s response is concise and clear but lacks the additional specifics found in Assistant B’s response.
28
+ [End of Judgement]
29
+
30
+ [Start of Verdict]
31
+ Assistant B
32
+ [End of Verdict]
33
+
34
+
35
+ generation: |
36
+ After providing your judgement, output your final verdict by strictly following this format:
37
+ * Return the judgement between [Start of Judgement] and [End of Judgement] tags
38
+ * Return the final verdict between [Start of Verdict] and [End of Verdict] tags. Respond with Assistant A if assistant A is better, Assistant B if assistant B is better
39
+
40
+ [Start of User Question]
41
+ {{ question }}
42
+ [End of User Question]
43
+
44
+ [Start of Assistant A Answer]
45
+ {{ response }}
46
+ [The End of Assistant A Answer]
47
+
48
+ [Start of Assistant B Answer]
49
+ {{ revised_response }}
50
+ [The End of Assistant B Answer]
51
+
52
+ start_tags: ["[Start of Judgement]", "[Start of Verdict]"]
53
+ end_tags: ["[End of Judgement]", "[End of Verdict]"]
@@ -0,0 +1,67 @@
1
+ system: |
2
+ You are a very knowledgeable AI Assistant that will faithfully assist the user with their task.
3
+
4
+ introduction: |
5
+ Assume the role of an expert planner. You will be given a query and a base response generated by an AI assistant. Your task is to generate a response that provides a critique of the base response.
6
+ You will also be given an analysis, rubric and critique from a critic model. Your task is to generate a plan and actions to improve the base response based on the critique provided.
7
+
8
+ principles: |
9
+ * You will utilize the identified domain, rubric and the evaluation of the model response to generate a plan to improve the response.
10
+ * The plan should be step-by-step and should satisfy each criteria of the rubric.
11
+ * The plan should not be generic and should be specific to the model response and the domain-specific rubric and evaluation from the critique.
12
+ * The generated plan should be actionable and feasible.
13
+ * Your task is to only generate a plan, do not try to implement the plan or provide a revised response.
14
+ * Return the plan between [Start of Plan] and [End of Plan] tags.
15
+
16
+ examples: |
17
+ To help you understand the task, here is an example:
18
+
19
+ [Start of Query]
20
+ {{ icl_query }}
21
+ [End of Query]
22
+
23
+ [Start of Response]
24
+ {{ icl_response }}
25
+ [End of Response]
26
+
27
+ [Start of Analysis]
28
+ {{ icl_analysis }}
29
+ [End of Analysis]
30
+
31
+ [Start of Rubric]
32
+ {{ icl_rubric }}
33
+ [End of Rubric]
34
+
35
+ [Start of Critique]
36
+ {{ icl_critique }}
37
+ [End of Critique]
38
+
39
+ [Start of Plan]
40
+ {{ icl_plan }}
41
+ [End of Plan]
42
+
43
+ generation: |
44
+ Now it's your turn to improve the response to the following query. Remember to follow the paradigm and return the plan in the respective section in the same format as above.
45
+
46
+ [Start of Query]
47
+ {{ question }}
48
+ [End of Query]
49
+
50
+ [Start of Response]
51
+ {{ response }}
52
+ [End of Response]
53
+
54
+ [Start of Analysis]
55
+ {{ analysis }}
56
+ [End of Analysis]
57
+
58
+ [Start of Rubric]
59
+ {{ rubric }}
60
+ [End of Rubric]
61
+
62
+ [Start of Critique]
63
+ {{ critique }}
64
+ [End of Critique]
65
+
66
+ start_tags: ["[Start of Plan]"]
67
+ end_tags: ["[End of Plan]"]
@@ -0,0 +1,8 @@
1
+ system:
2
+ introduction:
3
+ principles:
4
+ examples:
5
+ generation: |
6
+ {{ prompt }}
7
+ start_tags: [""]
8
+ end_tags: [""]
@@ -0,0 +1,78 @@
1
+ system: |
2
+ You are a very knowledgeable AI Assistant that will faithfully assist the user with their task.
3
+
4
+ introduction: |
5
+ Your task is to revise the response to an user query. You will be given a query from an user and a response from a model. Your task is to provide a better response based on the plan given.
6
+
7
+ principles: |
8
+ * You will revise the model response according to the plan given.
9
+ * The revised response should adhere to the plan and should be better than the original response.
10
+ * Note that the revised response will be evaluated by a human expert and should thus be of high quality.
11
+ * Do not have any irrelevant information in the revised response. Specifically do not include any self-referential information in the revised response.
12
+ * Your response should only include the revised response. Please do not include any other information like the query, analysis, rubric, etc.
13
+ * Your response will become invalid if it contains any meta-review about how you are revising the response. So please avoid including any such information.
14
+ * If the plan mentions that there is no need to provide a plan for improvement, simply return the original response as the revised response.
15
+ * Return the revised response between [Start of Revised Response] and [End of Revised Response] tags.
16
+
17
+ examples: |
18
+ To help you understand the task, here is an example:
19
+
20
+ [Start of Query]
21
+ {{ icl_query }}
22
+ [End of Query]
23
+
24
+ [Start of Response]
25
+ {{ icl_response }}
26
+ [End of Response]
27
+
28
+ [Start of Analysis]
29
+ {{ icl_analysis }}
30
+ [End of Analysis]
31
+
32
+ [Start of Rubric]
33
+ {{ icl_rubric }}
34
+ [End of Rubric]
35
+
36
+ [Start of Critique]
37
+ {{ icl_critique }}
38
+ [End of Critique]
39
+
40
+ [Start of Plan]
41
+ {{ icl_plan }}
42
+ [End of Plan]
43
+
44
+ [Start of Revised Response]
45
+ {{ icl_revised_response }}
46
+ [End of Revised Response]
47
+
48
+ generation: |
49
+ Now it's your turn to revise the response to the following query. Remember to follow the paradigm and return the revised response in the respective section in the same format as above. Strictly do not include any meta-review or meta-information about how the response was improved or revised. Your response should only include the revised response. You will be heavily penalized if you include any information about the revision process or if you have any reference about how you revised the response.
50
+
51
+ [Start of Query]
52
+ {{ question }}
53
+ [End of Query]
54
+
55
+ [Start of Response]
56
+ {{ response }}
57
+ [End of Response]
58
+
59
+ [Start of Analysis]
60
+ {{ analysis }}
61
+ [End of Analysis]
62
+
63
+ [Start of Rubric]
64
+ {{ rubric }}
65
+ [End of Rubric]
66
+
67
+ [Start of Critique]
68
+ {{ critique }}
69
+ [End of Critique]
70
+
71
+ [Start of Plan]
72
+ {{ plan }}
73
+ [End of Plan]
74
+
75
+ Start your response with the tag [Start of Revised Response] and end it with the tag [End of Revised Response].
76
+
77
+ start_tags: ["[Start of Revised Response]"]
78
+ end_tags: ["[End of Revised Response]"]
@@ -0,0 +1,12 @@
1
+ system: ""
2
+
3
+ introduction: ""
4
+
5
+ principles: ""
6
+
7
+ examples: ""
8
+
9
+ generation: "{{ question }}"
10
+
11
+ start_tags: [""]
12
+ end_tags: [""]
@@ -0,0 +1,27 @@
1
+ system: You are a very knowledgeable AI Assistant that will faithfully assist the user with their task.
2
+
3
+ introduction: Develop a series of question and answer pairs to perform a task.
4
+
5
+ principles: |
6
+ Here are the requirements:
7
+ 1. Try not to repeat the verb for each instruction to maximize diversity.
8
+ 2. The language used for the instruction also should be diverse. For example, you should combine questions with imperative instructions.
9
+ 3. The type of instructions should be similar to provided examples. The generated instruction and the output should be grounded in the provided document.
10
+ 4. A GPT language model should be able to complete the instruction. For example, do not ask the assistant to create any visual or audio output. For another example, do not ask the assistant to wake you up at 5pm or set a reminder because it cannot perform any action.
11
+ 5. The instructions should be in English.
12
+ 6. The instructions should be 1 to 2 sentences long. Either an imperative sentence or a question is permitted.
13
+ 7. The output should be an appropriate response to the input and the instruction. Long outputs are preferable.
14
+
15
+ examples: |
16
+ The task is {{task_description}}.
17
+
18
+ Here is an example to help you understand the type of questions that are asked for:
19
+
20
+ {{seed_question}}
21
+ {{seed_response}}
22
+
23
+ generation: |
24
+ Provide a single question and answer pair based on the examples.
25
+
26
+ start_tags: [""]
27
+ end_tags: [""]
@@ -0,0 +1,31 @@
1
+ system: You are a very knowledgeable AI Assistant that will faithfully assist the user with their task.
2
+
3
+ introduction: Develop a series of question and answer pairs to perform a task.
4
+
5
+ principles: |
6
+ Here are the requirements:
7
+ 1. Try not to repeat the verb for each instruction to maximize diversity.
8
+ 2. The language used for the instruction also should be diverse. For example, you should combine questions with imperative instructions.
9
+ 3. The type of instructions should be similar to provided examples. The generated instruction and the output should be grounded in the provided document.
10
+ 4. A GPT language model should be able to complete the instruction. For example, do not ask the assistant to create any visual or audio output. For another example, do not ask the assistant to wake you up at 5pm or set a reminder because it cannot perform any action.
11
+ 5. The instructions should be in English.
12
+ 6. The instructions should be 1 to 2 sentences long. Either an imperative sentence or a question is permitted.
13
+ 7. The output should be an appropriate response to the input and the instruction. Long outputs are preferable.
14
+
15
+ examples: |
16
+ The task is {{task_description}}.
17
+
18
+ Here is some context for the example question:
19
+
20
+ {{seed_context}}
21
+
22
+ Here is an example to help you understand the type of questions that are asked for:
23
+
24
+ {{seed_question}}
25
+ {{seed_response}}
26
+
27
+ generation: |
28
+ Provide a single question and answer pair based on the example.
29
+
30
+ start_tags: [""]
31
+ end_tags: [""]