File size: 3,362 Bytes
c082dbb
 
 
 
 
 
 
 
 
 
 
 
4b63778
c082dbb
 
 
 
 
 
 
 
 
 
 
 
 
4f27bfe
4b63778
c082dbb
 
 
 
6f40eb8
4b63778
c082dbb
 
 
 
 
 
 
 
 
 
 
 
 
 
4b63778
4f27bfe
4b63778
c082dbb
 
 
4b63778
852f325
c082dbb
 
 
 
4b63778
7b79a19
4b63778
 
 
 
c082dbb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
eb6c7bd
77f1130
 
 
 
 
07cb3d0
77f1130
1dbcf9c
f2998fd
 
 
 
 
 
 
1dbcf9c
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
---
license: mit
tags:
- RLHF
- RLCD
- alignment
- rotation
---

# RLHF + RLCD Rotation

**First to combine RLHF + RLCD in rotation!**

## Idea

RLHF alone is expensive. RLCD alone is not enough.

My idea: **Rotate them!**

> **RLHF -> RLCD -> RLHF -> RLCD**

## How it works

1. **RLHF Step:** Learn from human taste, human preference.
2. **RLCD Step:** Learn from contrastive distillation, positive vs negative prompt.
3. **DEAD_ZONE = 0.05:** If the difference between RLHF and RLCD is small, keep both ON. Don't switch. This prevents mode collapse.
4. **Repeat:** Unknown number of steps.

## Note about Code Image

The image shared is only a part of the code.

![Code Part](./part_code.png)

## Why it works

- **RLHF** gives human intelligence.
- **RLCD** gives contrastive diversity.
- **Rotation** prevents repetition.
- **DEAD_ZONE** prevents collapse.

RLHF + RLCD = 0.7, 0.8, 0.9. Real thinking.

## Results

- No mode collapse.
- No repetition.
- Model stays smart, not dumber.
  
## Training

This training is not finished yet. It needs more resources to reach the target.

### Setup

- **Base Model:** There is no hope yet of reaching 100 million, but it is expandable without problem.
- **Method:** RLHF + RLCD Rotation
- **LoRA:** Yes, optimized LoRA
- **dtype:** float32
- **Optimizer:** AdamW (lr=2e-4)

## Why expandable?

Because it contains an idea like a person who reads a book once and forgets it 👋👀
But it stays stored in his mind, and he returns to read it many times to memorize it.
That is real training.
### Why it needs more resources?

With LoRA + float32, training is heavier.

- **float32** keeps weights precise, no loss.
- **LoRA** needs optimization.
- **group_params** is used for the adapter only, for optimization, nothing else.

This costs more RAM / VRAM, but it is necessary to get the correct result.

### group_params

I made an improvement for LoRA:

- `group_params` is only for the adapter.
- Only adapter weights are optimized.
- Base model is frozen.
- No conflict at all.

### Checked

- Full code checked.
- Adapter checked.
- Weights checked.
- **No conflict at all!**

### What is needed?

To finish training and get the required result, we need more resources:

- More VRAM / RAM
- Clean run, no interruption

### Status

**Code is clean. Code is complete. Code is checked.**
**Training is waiting for resources.**

## Code

No code shared. Idea only.

## Author

**Mouad Tarif**

## Contact

**email**:mouad.tarif@inbox.ru

**linkedin**:https://www.linkedin.com/in/mouad-tarif-297688340

```markdown
**Important note**
I thought about a training with a completely different code structure than that one 👋
And a small hint: those who used Fisher, which is a well-known function from 2017, I used the same method, but without following those who made it.
The important thing is, those who worked on the training made it so weights don't change because of a penalty, and that led to forgetting.
I hope for help and support for what I worked on. I don't think so at all, so I will find different ideas for training on the resources I have.
I opened a new communication channel, a new official account on LinkedIn, and I put the link to my personal account.
This idea I published about RLCD and RLHF is from my own thinking, officially, not from anyone else. And here are the different ideas I have.
```