File size: 5,524 Bytes
84e2892
ede7d6e
84e2892
 
ede7d6e
84e2892
ede7d6e
84e2892
ede7d6e
1115d08
 
84e2892
 
 
ede7d6e
 
 
 
 
84e2892
 
 
 
 
 
ede7d6e
 
 
 
 
 
 
 
 
 
 
 
 
 
1115d08
ede7d6e
 
 
 
 
 
 
 
 
1115d08
ede7d6e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84e2892
 
 
ede7d6e
84e2892
 
 
ede7d6e
84e2892
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ede7d6e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
---
inference: false
tags:
- generated_from_trainer
- Yi
model-index:
- name: limarpv3-yi-llama-34b-lora
  results: []
license: apache-2.0
datasets:
- lemonilia/LimaRP
---

[<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)
# limarpv3-yi-llama-34b-lora

This model is an unofficial Yi-34B-Llama training on the LimaRP v3 dataset by [lemonilia](https://huggingface.co/lemonilia). It does not include the pretraining stage using stories.

The [Yi-34B-Llama](https://huggingface.co/chargoddard/Yi-34B-Llama) model is a modified [01-ai/Yi-34B](https://huggingface.co/01-ai/Yi-34B) with keys renamed to match those used in Llama models, eliminating the need for remote code and ensuring compatibility with existing training and inference repositories. Architecturally this is similar to a Llama 2 34B model with an expanded vocab size of 64000.

It achieves the following results on the evaluation set:
- Loss: 1.9729

## Model description

For more details about LimaRP, see the model page for the [previously released v2 version for Llama-2](https://huggingface.co/lemonilia/limarp-llama2-v2). Most details written there apply for this version as well. Generally speaking, LimaRP is a longform-oriented, novel-style roleplaying chat model intended to replicate the experience of 1-on-1 roleplay on Internet forums. Short-form, IRC/Discord-style RP (aka "Markdown format") is not supported yet. The model does not include instruction tuning, only manually picked and slightly edited RP conversations with persona and scenario data.

Prompt format is the [extended Alpaca format](https://github.com/tatsu-lab/stanford_alpaca):

```
### Instruction:
Character's Persona: {bot character description}
User's Persona: {user character description}
Scenario: {what happens in the story}
Play the role of Character. You must engage in a roleplaying chat with User below this line. Do not write dialogues and narration for User.
### Input:
User: {utterance}
### Response:
Character: {utterance}
### Input:
User: {utterance}
### Response:
Character: {utterance}
(etc.)
```

Inspired by the previously named "Roleplay" preset in SillyTavern, with this version of LimaRP it is possible to append a length modifier to the response instruction sequence, like this:

```
### Input:
User: {utterance}

### Response: (length = medium)
Character: {utterance}
```

This has an immediately noticeable effect on bot responses. The lengths using during training are:
`micro`, `tiny`, `short`, `medium`, `long`, `massive`, `huge`, `enormous`, `humongous`, `unlimited`.
**The recommended starting length is medium**. Keep in mind that the AI can ramble or impersonate
the user with very long messages.

The length control effect is reproducible, but the messages will not necessarily follow
lengths very precisely, rather follow certain ranges on average, as seen in this table
with data from tests made with one reply at the beginning of the conversation:

![lengths](https://i.imgur.com/2WXGgaV.png)

Response length control appears to work well also deep into the conversation. **By omitting
the modifier, the model will choose the most appropriate response length** (although it might
not necessarily be what the user desires).

## Intended uses & limitations

The model will show biases similar to those observed in niche roleplaying forums on the Internet, besides those exhibited by the base model.

## Training and evaluation data

For more details about LimaRP, see the model page for the [previously released v2 version for Llama-2](https://huggingface.co/lemonilia/limarp-llama2-v2).

## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 0.00015
- train_batch_size: 2
- eval_batch_size: 2
- seed: 42
- gradient_accumulation_steps: 4
- total_train_batch_size: 8
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 10
- num_epochs: 2

### Training results

| Training Loss | Epoch | Step | Validation Loss |
|:-------------:|:-----:|:----:|:---------------:|
| 2.1119        | 0.09  | 20   | 2.0727          |
| 1.9889        | 0.17  | 40   | 2.0104          |
| 1.878         | 0.26  | 60   | 1.9978          |
| 1.8531        | 0.34  | 80   | 1.9886          |
| 1.9504        | 0.43  | 100  | 1.9837          |
| 1.9216        | 0.51  | 120  | 1.9826          |
| 1.8483        | 0.6   | 140  | 1.9794          |
| 1.9668        | 0.68  | 160  | 1.9780          |
| 1.9776        | 0.77  | 180  | 1.9778          |
| 1.9312        | 0.85  | 200  | 1.9772          |
| 1.9003        | 0.94  | 220  | 1.9738          |
| 1.8748        | 1.02  | 240  | 1.9729          |
| 1.8896        | 1.11  | 260  | 1.9745          |
| 1.8702        | 1.19  | 280  | 1.9760          |
| 1.9038        | 1.28  | 300  | 1.9770          |
| 1.9083        | 1.36  | 320  | 1.9758          |
| 1.8143        | 1.45  | 340  | 1.9756          |
| 1.852         | 1.53  | 360  | 1.9742          |
| 1.8608        | 1.62  | 380  | 1.9735          |
| 1.8959        | 1.7   | 400  | 1.9735          |
| 1.7912        | 1.79  | 420  | 1.9731          |
| 1.8908        | 1.87  | 440  | 1.9727          |
| 1.8079        | 1.96  | 460  | 1.9729          |


### Framework versions

- Transformers 4.34.1
- Pytorch 2.0.1+cu118
- Datasets 2.14.6
- Tokenizers 0.14.1