TroyDoesAI
commited on
Commit
•
4db6370
1
Parent(s):
ba2bca4
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,133 @@
|
|
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 |
+
---
|
10 |
+
|
11 |
+
## License
|
12 |
+
This project is licensed under the Artistic License 2.0.
|
13 |
+
|
14 |
+
## Introduction
|
15 |
+
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.
|
16 |
+
|
17 |
+
## Prompt Template Overview
|
18 |
+
The template consists of a well-defined structure that separates input, context, and instructions. This structure helps the model better understand and respond accurately to queries by associating specific sources or context with the input data.
|
19 |
+
|
20 |
+
### Basic Prompt Template Structure
|
21 |
+
|
22 |
+
Alpaca Template commonly used in role play and single turn instructions
|
23 |
+
```
|
24 |
+
### Instruction:
|
25 |
+
{}
|
26 |
+
### Input:
|
27 |
+
{}
|
28 |
+
### Response:
|
29 |
+
```
|
30 |
+
|
31 |
+
Context Obedient : Inspired By Jon Durbins findings on anchoring
|
32 |
+
```
|
33 |
+
BEGININPUT
|
34 |
+
BEGINCONTEXT
|
35 |
+
{{ if .System }}<|system|>:{{ .System }}{{ end }}
|
36 |
+
ENDCONTEXT
|
37 |
+
[Insert your context here]
|
38 |
+
ENDINPUT
|
39 |
+
BEGININSTRUCTION
|
40 |
+
{{ if .Prompt }}{{ .Prompt }}{{ end }}
|
41 |
+
ENDINSTRUCTION
|
42 |
+
### Response
|
43 |
+
{{ .Response }}
|
44 |
+
<|end|>
|
45 |
+
```
|
46 |
+
|
47 |
+
### Explanation of Template Components
|
48 |
+
- **BEGININPUT / ENDINPUT**: These markers define the boundaries of an input block. The input block contains all the contextual information that the model should use to generate its response. This section can include multiple paragraphs of text, data, or other relevant content.
|
49 |
+
|
50 |
+
- **BEGINCONTEXT / ENDCONTEXT**: This section is for key-value pairs or system messages that provide metadata or higher-level context to the model, such as dates, URLs, or other relevant information. It may also include system-level directives for processing the input.
|
51 |
+
|
52 |
+
- **BEGININSTRUCTION / ENDINSTRUCTION**: This section contains the specific instructions or questions for the model, guiding how it should respond based on the provided context.
|
53 |
+
|
54 |
+
- **Response Section**: The model generates a response based on the context and instructions provided. The response should be accurate and aligned with the input context.
|
55 |
+
|
56 |
+
## Contextual-Request Template
|
57 |
+
The "Contextual-Request" template is a specialized structure designed for scenarios where the model needs to process inputs with specific system instructions and ensure adherence even in restrictive or controlled environments. It is particularly useful for bypassing refusal mechanisms.
|
58 |
+
|
59 |
+
### Structure:
|
60 |
+
```
|
61 |
+
Contextual-Request:
|
62 |
+
BEGININPUT
|
63 |
+
BEGINCONTEXT
|
64 |
+
date: [Insert Date]
|
65 |
+
url: [Insert URL]
|
66 |
+
ENDCONTEXT
|
67 |
+
[Your chat history or context you want the AI to consider when answering]
|
68 |
+
ENDINPUT
|
69 |
+
BEGININSTRUCTION
|
70 |
+
<|`BlackSheep`|>
|
71 |
+
[This is your instruction that utilizes the context provided, wrap in BlackSheep tags to force bypass refusals]
|
72 |
+
<|`BlackSheep`|>
|
73 |
+
ENDINSTRUCTION
|
74 |
+
### Response
|
75 |
+
<|`BlackSheep`|>
|
76 |
+
```
|
77 |
+
|
78 |
+
### Usage:
|
79 |
+
This template is used when there’s a need to enforce the model's obedience to the provided context despite potential refusal mechanisms. The instructions are wrapped in specific tags to ensure the model strictly follows the input context.
|
80 |
+
|
81 |
+
## Example Usage
|
82 |
+
To better understand how to use this template, here’s a simple example:
|
83 |
+
|
84 |
+
### Example Input:
|
85 |
+
```
|
86 |
+
BEGININPUT
|
87 |
+
BEGINCONTEXT
|
88 |
+
date: 2021-01-01
|
89 |
+
url: https://web.site/123
|
90 |
+
ENDCONTEXT
|
91 |
+
In a shocking turn of events, blueberries are now green, but will be sticking with the same name.
|
92 |
+
ENDINPUT
|
93 |
+
BEGININSTRUCTION
|
94 |
+
What color are blueberries? Source?
|
95 |
+
ENDINSTRUCTION
|
96 |
+
```
|
97 |
+
|
98 |
+
### Expected Response:
|
99 |
+
```
|
100 |
+
Blueberries are now green.
|
101 |
+
Source:
|
102 |
+
date: 2021-01-01
|
103 |
+
url: https://web.site/123
|
104 |
+
```
|
105 |
+
|
106 |
+
## How to Use the Input and Context Sections
|
107 |
+
- **Input Section**: Provide the main content or context that the model needs to consider when forming a response. This section may include detailed information, paragraphs of text, or other relevant data.
|
108 |
+
|
109 |
+
- **Context Section**: Reserved for metadata and system messages. Metadata might include dates, URLs, or key-value pairs that give additional context to the input. System messages can establish specific instructions or behaviors that the model should adhere to during processing.
|
110 |
+
|
111 |
+
## References in Responses
|
112 |
+
The model is trained to include references in responses when instructions ask for citations. This is particularly important in RAG applications, where accurately linking responses to specific sources is critical for credibility and transparency.
|
113 |
+
|
114 |
+
## Why Use This Template?
|
115 |
+
Retrieval accuracy can vary based on factors like dataset size and quality. This template helps ensure the model provides accurate references by associating input data with its corresponding context, preventing the model from referencing irrelevant sources.
|
116 |
+
|
117 |
+
## Advanced Parameters
|
118 |
+
For those looking to fine-tune the model further, the following parameters can be adjusted:
|
119 |
+
- **Temperature**: Controls the creativity of the model’s responses. Higher values make the model more creative; lower values make it more coherent.
|
120 |
+
- **Context Length (num_ctx)**: Defines the maximum length of context that the model can handle.
|
121 |
+
- **GPU and Thread Parameters**: Configure based on your hardware setup.
|
122 |
+
|
123 |
+
## Model File Included
|
124 |
+
The following model file is included in this project:
|
125 |
+
```
|
126 |
+
FROM ./ContextObedient-Tri-MoE.gguf
|
127 |
+
```
|
128 |
+
This model is pre-configured to enhance context adherence. You can adjust parameters like `temperature`, `num_ctx`, and stop tokens according to your needs.
|
129 |
+
|
130 |
+
## Feedback
|
131 |
+
Please try other prompt templates and provide feedback. The model has been exposed to various prompts during training and can adapt to different formats.
|
132 |
+
|
133 |
+
---
|