sphiratrioth666 commited on
Commit
2a010e9
·
verified ·
1 Parent(s): 237df69

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +14 -13
README.md CHANGED
@@ -1,7 +1,7 @@
1
  ---
2
  license: cc-by-nc-4.0
3
  ---
4
- I was experimenting with Silly Tavern lorebooks and I found a great way of implementing pre-defined random events or actions when particular circumstances occur. It allows steering the scenario automatically, simulating a TTRPG experience (rolling dice with random roleplaying results) or steering a {{char}} behavior very precisely the way we want.
5
  ![image/png](https://img.goodfon.com/original/1920x1080/9/8d/the-lord-of-the-rings-sauron-dark-lord-metal-helm.jpg)|
6
  |:--:|
7
  |Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License (https://www.goodfon.com/fantasy/wallpaper-the-lord-of-the-rings-sauron-dark-lord-metal-helm.html)|<br>
@@ -9,31 +9,32 @@ I was experimenting with Silly Tavern lorebooks and I found a great way of imple
9
 
10
  <b>How to do it:</b>
11
 
12
- <b>1. Create a lorebook in Silly Tavern (I will not teach you that, you need to understand how it's done and how it's used on your own this time - super simple (read this: https://rentry.co/world-info-encyclopedia). In short, it is usually used for storing and triggering actual lore information when a particular trigger word appears in our message or LLM response, but we'll be using the lorebooks much more creatively! They can be used to give LLM orders/instructions in instruct mode in a very useful way. Lorebooks go into: (...)\SillyTavern\data\default-user\worlds).</b>
13
 
14
- <b>2. Create the entries group in your lorebook - add multiple entries, each representing random events you want to happen in a given situation (like table of results of dice rolls in TTRPG).</b>
15
 
16
- Each entry must have: a) the same trigger words, b) position = at Depth (System), c) depth = 1, d) order = 100, e) trigger = 100, f) Prevent further recursion option on (entry will not activate other entries), g) group weight = 100 (or lower it if you want something to trigger less frequently, it's just a probability modifier, does not have to sum up to 100 in a group, as it seems), h) sticky = 10 or 20 (it makes the instruction for LLM remain active for a given number of the following messages - so it actually triggers logically within the scene, LLMs seem to understand it and do things under logical circumstances in the scene".</b>
17
 
18
  ![image/png](https://cdn-uploads.huggingface.co/production/uploads/66a2a6820c4cd36ffbc95623/kT6VO8BADs3vNPGRuucs9.png)
19
 
20
  ![image/png](https://cdn-uploads.huggingface.co/production/uploads/66a2a6820c4cd36ffbc95623/a3ZVY-APXxozDZLE2lTVq.png)
21
 
22
- <i>You can theoretically change the weights to trigger different events with different probabilities. For simplicity, you can also match all separate "dice results" with a given fiction result or a TTRPG system DC (something like: we roll 1d6, we fail at 1-3 so: 1 = {{user}} will fail in {{user}}'s' action, 2 = {{user}} will fail in {{user}}'s' action, 3 = {{user}} will fail in {{user}}'s action', 4 = {{user}} will succeed in {{user}}'s action etc.'). I rather prefer having equal weights and repeated entries rather than messing with the weights. We never know, which actual RNG simulator a given software will use so this way - we take control of that forcing the real, equal distribution. It's also why Excell RNG for dice rolling is more realistic than dice rolling apps, just if you're curious (I'm working in game dev).</i>
23
 
24
- <b>3. Write instructions inside of the entries. They must be short, clear and include a specific word: "WILL". It seems to be very, very important. Otherwise, it might not work - at least with Mistral models and their fine-tunes.</b>
25
 
26
- Template: {{char}} will [ACTION YOU WANT] or [EVENT] will [HAPPEN}.
27
- Something like: "enemies will attack {{user}}" or "road ahead will be blocked".
28
 
29
- Again, it seems that a word "will" is the best working trigger. Here, maybe "OOC" instructions would also be a good idea but since keys at depth = system are inserted already as instructions inside of a prompt itself (I checked, they're [INST] (...) [/INSTR] for Mistral), I'm not sure if it makes any sense.
30
 
31
  ![image/png](https://cdn-uploads.huggingface.co/production/uploads/66a2a6820c4cd36ffbc95623/QXwxJsNx1CNMyJwVLe8FJ.png)
32
 
33
  ![image/png](https://cdn-uploads.huggingface.co/production/uploads/66a2a6820c4cd36ffbc95623/Y3Qil3XhVBJGN2_3LzlT7.png)
34
 
35
  <b>TRICKS:</b>
36
- 1. it may be good using one, specific word to trigger the entry group so it does not trigger again and again with different results as you or LLM repeats the trigger word - such as - attack or defend or whatever. You can use something like... roll 1d20 even - if you're into TTRPG. However, in different situations, recursive triggering may prove beneficial - then you may want to lower a "sticky" value but 5 seems balanced (LLM counts both {{user}} and {{char}} messages, if you're interested to know).
37
- 2. depending on the use-case, you will need a couple of such entry groups (like different "dice rolls" for social encounters, different for random events in the world and different for dungeons exploring). IT WORKS VERY WELL.
38
- 3. you can also steer {{char}}'s behavior precisely using this method to stick to the personality better or make character consistently do given things in given situations (it seems to work better than pure card definitions).
39
- 4. In NSFW, like actions during combat, reacting to monsters (your {{char}} should be really terrified when seeing a Sauron or a Nazgul, not jump at them with an axe happily) - you can add variety and logic to your roleplays - this way, {{char}}'s behavior is influenced better than while using normal, random lorebooks in a classical manner. BTW, you can combat a positive bias of LLMs like that (a bias of cooperating with {{user}} when {{user}} does something - for instance, your sword swing will fail to connect with the enemy if you set it up to trigger like that. It works VERY WELL.
 
 
1
  ---
2
  license: cc-by-nc-4.0
3
  ---
4
+ Hey all. I was experimenting with Silly Tavern lorebooks and I found a great, non-obvious implementation for lorebooks. It turns out that we are able to precisely guide our LLM during roleplay by triggering instructions from a lorebook. It works like OOC but on steroids. With a properly prepared lorebook, we can automatically roll a positive/negative results of our actions, to combat a positive bias but not only that. It's possible giving all kinds of instructions like that. Want a character to always do something in a particular situation? No problem. Want to add flavor or diversity to your roleplays? It all becomes possible.
5
  ![image/png](https://img.goodfon.com/original/1920x1080/9/8d/the-lord-of-the-rings-sauron-dark-lord-metal-helm.jpg)|
6
  |:--:|
7
  |Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License (https://www.goodfon.com/fantasy/wallpaper-the-lord-of-the-rings-sauron-dark-lord-metal-helm.html)|<br>
 
9
 
10
  <b>How to do it:</b>
11
 
12
+ <b>1. Create a lorebook in Silly Tavern (I will not teach you in detail how to do that, my appologies - you need to find a guide online, there are many of them and it is actually super simple (for instance - read this: https://rentry.co/world-info-encyclopedia).
13
 
14
+ <b>2. Create the entries with your lorebook and put them in the same group - add multiple entries first, each representing a given instruction or anything you want to happen in a given situation (like table of results of dice rolls in TTRPG). So for instance: entry1: {{char}} is currently busy, entry2: {{char}} is currently free, entry3: {{char}} will not answer a phone because something happened, do not reveal the {{char}} circumstances yet.</b>
15
 
16
+ Each entry must have: a) the same trigger words, b) position = at Depth (System) (entries at depth = system are inserted into context right with a message you type but automatically and they do not appear in a chat - so they work even if models do not understand OOC and if a model does - it is still a more elegant, immersive and smooth experience), c) depth = 0, d) order = 100, e) trigger = 100, f) Prevent further recursion option: ON (entry will not activate other entries), g) group weight = 100/number of entries within your group (100 divided per total number of entries in a group) (it is super important since weight determines the probability of a given entry being randomly rolled, you can adjust probabilites for each entry but always keep the whole weights sum within the same group = 100), h) sticky = 4 or more/less (it makes the instruction for LLM remain active for a given number of the following messages - so it actually triggers logically within the scene, LLMs seem to understand it and do things under logical circumstances in the scene".</b>
17
 
18
  ![image/png](https://cdn-uploads.huggingface.co/production/uploads/66a2a6820c4cd36ffbc95623/kT6VO8BADs3vNPGRuucs9.png)
19
 
20
  ![image/png](https://cdn-uploads.huggingface.co/production/uploads/66a2a6820c4cd36ffbc95623/a3ZVY-APXxozDZLE2lTVq.png)
21
 
22
+ <i>Remember, you can change the weights to trigger different events with different probabilities but do not leave them at 100 even if you want to roll from 2 entries in a group. Use 100 when you do not want to roll but trigger the entry through a trigger word, use 100/number of entries in a group (100 divided per total number of entries in a group) if you want to roll randomly which entry will be inserted.</i>
23
 
24
+ <b>3. Write instructions inside of the entries. They must be short, clear and include a specific phrase if you want something to happen now: "WILL INSTANTLY". Do not ask me why but otherwise different LLMs more often fail in following the instruction. I've tried Mistral, LLAMAs, Qwen, Gemma and other tunes - all behave in a very similar manner.</b>
25
 
26
+ Template: {{char}} will instantly [ACTION YOU WANT CHARACTER TO PERFORM] or [EVENT YOU WANT] will instantly [HAPPEN}.
27
+ Something like: "enemies will instantly attack {{user}}" or "road ahead will instantly turn out to be blocked".
28
 
29
+ Again, it seems that a phrase "will instantly" is the best working trigger.
30
 
31
  ![image/png](https://cdn-uploads.huggingface.co/production/uploads/66a2a6820c4cd36ffbc95623/QXwxJsNx1CNMyJwVLe8FJ.png)
32
 
33
  ![image/png](https://cdn-uploads.huggingface.co/production/uploads/66a2a6820c4cd36ffbc95623/Y3Qil3XhVBJGN2_3LzlT7.png)
34
 
35
  <b>TRICKS:</b>
36
+ 1. It may be good using one, specific word to trigger the entry group so it does not trigger again and again with different results as you or LLM repeats the trigger word. You can use something like... "DC"/"AP" (difficulty challenge/action-perform; or you can come up with good trigger words so it triggers without you even doing anything! (like: attack - will roll the attack result from a lorebook with entries "successful attack/failer attack" being activated randomly within a group with the same trigger word.
37
+ 2. Depending on the use-case, you will need a couple of such entry groups (like different "dice rolls" for social encounters, different for random events in the world and different for dungeons exploring). IT WORKS VERY WELL.
38
+ 3. You can also steer {{char}}'s behavior precisely using this method to stick to the personality better or to make character consistently do given things in given situations (it seems to work better than pure card definitions).
39
+ 4. Use it in NSFW to add variety and logic to your roleplays - this way, {{char}}'s behavior is influenced better than while using normal, random lorebooks in a classical manner.
40
+ 5. Use it to counter a positive bias of the LLMs (a bias of cooperating with {{user}} when {{user}} does something - for instance, your sword swing will fail to connect with the enemy if you set it up to trigger like that. It works VERY WELL.