TroyDoesAI commited on
Commit
ef0af7b
1 Parent(s): 5e77189

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +113 -0
README.md CHANGED
@@ -1,3 +1,116 @@
1
  ---
2
  license: artistic-2.0
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: artistic-2.0
3
+ language:
4
+ - en
5
+ base_model: TroyDoesAI/BlackSheep-4B
6
+ library_name: transformers
7
  ---
8
+
9
+ ## License
10
+ This project is licensed under the Artistic License 2.0.
11
+
12
+ ---
13
+
14
+ ## Introduction
15
+
16
+ This README provides instructions on how to effectively use the provided prompt template designed for training models to deliver contextually obedient answers. The template is especially useful for Retrieval-Augmented Generation (RAG) applications and aims to reduce hallucinations by ensuring that the model adheres strictly to the provided context.
17
+
18
+ ## Prompt Template Overview
19
+
20
+ The template consists of a well-defined structure that separates input, context, and instructions. This explicit structure helps the model better understand and respond accurately to queries by associating specific sources or context with the input data.
21
+
22
+ ### Basic Prompt Template Structure
23
+
24
+ ```
25
+ BEGININPUT
26
+ BEGINCONTEXT
27
+ {{ if .System }}<|system|>:{{ .System }}{{ end }}
28
+ ENDCONTEXT
29
+ [Insert your context here]
30
+ ENDINPUT
31
+ BEGININSTRUCTION
32
+ {{ if .Prompt }}{{ .Prompt }}{{ end }}
33
+ ENDINSTRUCTION
34
+ ### Response
35
+ {{ .Response }}
36
+ <|end|>
37
+ ```
38
+
39
+ ### Explanation of Template Components
40
+
41
+ - **BEGININPUT / ENDINPUT**: These markers define the boundaries of an input block. The input block is where you place all the contextual information that the model should use to generate its response. This section can contain multiple paragraphs of text, data, or other content that forms the basis of the query.
42
+
43
+ - **BEGINCONTEXT / ENDCONTEXT**: This section is specifically for key-value pairs or system messages that provide metadata or higher-level context to the model. For example, it can include the date, URL, or any other relevant information, as well as system-level directives that the model should consider while processing the input.
44
+
45
+ - **BEGININSTRUCTION / ENDINSTRUCTION**: This section contains the specific instructions or questions for the model. The instructions guide the model on how to respond based on the provided context. The model was trained with various formats, including single questions, paragraphs, and lists.
46
+
47
+ - **Response Section**: The model generates the response based on the context and instructions provided. The response is expected to be accurate and aligned with the input context.
48
+
49
+ ### Example Usage
50
+
51
+ To better understand how to use this template, here’s a simple example:
52
+
53
+ #### Example Input:
54
+ ```
55
+ BEGININPUT
56
+ BEGINCONTEXT
57
+ date: 2021-01-01
58
+ url: https://web.site/123
59
+ ENDCONTEXT
60
+ In a shocking turn of events, blueberries are now green, but will be sticking with the same name.
61
+ ENDINPUT
62
+ BEGININSTRUCTION
63
+ What color are blueberries? Source?
64
+ ENDINSTRUCTION
65
+ ```
66
+
67
+ #### Expected Response:
68
+ ```
69
+ Blueberries are now green.
70
+ Source:
71
+ date: 2021-01-01
72
+ url: https://web.site/123
73
+ ```
74
+
75
+ ### How to Use the Input and Context Sections
76
+
77
+ - **Input Section**: This section is where you provide the main content or context that the model needs to consider when forming a response. It can include detailed information, paragraphs of text, or other relevant data that directly informs the answer.
78
+
79
+ - **Context Section**: This section is reserved for metadata and system messages. Metadata might include information like dates, URLs, or other key-value pairs that give additional context to the input. System messages can be used to set up specific instructions or behaviors that the model should adhere to while processing the input.
80
+
81
+ For example, if you have a large block of text that the model needs to summarize, the input section would contain this text, while the context section could include the source of the text or any relevant metadata.
82
+
83
+ ### References in Responses
84
+
85
+ The model is trained to include references in responses when the instruction asks for citations. This is particularly important in RAG applications, where accurately linking responses to specific sources is critical for credibility and transparency.
86
+
87
+ #### Why Use This Template?
88
+
89
+ Retrieval accuracy can vary based on several factors, including dataset size and quality. By using this template, you ensure that the model provides accurate references by clearly associating input data with its corresponding context. This is crucial when dealing with multiple documents or data chunks, as it prevents the model from referencing irrelevant sources.
90
+
91
+ ### Advanced Parameters
92
+
93
+ For those looking to fine-tune the model further, the following parameters can be adjusted:
94
+
95
+ - **Temperature**: Controls the creativity of the model’s responses. Higher values make the model more creative, while lower values make it more coherent.
96
+ - **Context Length (num_ctx)**: Defines the maximum length of context that the model can handle.
97
+ - **GPU and Thread Parameters**: You can set the number of GPUs and threads based on your hardware configuration.
98
+
99
+ ### Model File Included
100
+
101
+ The following model file is included in this project:
102
+ ```
103
+ FROM ./ContextObedient-Tri-MoE.gguf
104
+ ```
105
+ This model is pre-configured with parameters to enhance context adherence. Adjustments to parameters like `temperature`, `num_ctx`, and stop tokens can be made based on your specific needs.
106
+
107
+ ### Feedback
108
+
109
+ Please try other prompt templates and provide feedback. The model has been exposed to a variety of prompts during training and can adapt to different formats.
110
+
111
+ ---
112
+
113
+ ## Conclusion
114
+
115
+ This README provides a comprehensive guide on how to use the context-obedient prompt template to achieve accurate, contextually grounded responses from the model. By following the structure and guidelines provided, you can maximize the effectiveness of the model in your RAG applications and beyond.
116
+ ---