Kquant03 commited on
Commit
1a4ba90
1 Parent(s): 313d63d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +57 -0
README.md CHANGED
@@ -1,3 +1,60 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ language:
4
+ - en
5
+ tags:
6
+ - moe
7
+ - merge
8
  ---
9
+
10
+ ![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/6589d7e6586088fd2784a12c/SE60p6-LV2rI7qRsnm-nz.jpeg)
11
+
12
+ # "[We] are joined by the bonds of love. And you cannot track that, not with a thousand bloodhounds, and you cannot break it, not with a thousand swords."
13
+ [GGUF FILES HERE](https://huggingface.co/Kquant03/Buttercup-V2-GGUF)
14
+
15
+ [Join our Discord!](https://discord.gg/aEGuFph9)
16
+
17
+ Lasered all the models, then merged again. [original model](https://huggingface.co/Kquant03/Buttercup-4x7B-bf16).
18
+
19
+ The config looks like this...(detailed version is in the files and versions):
20
+ - [macadeliccc/WestLake-7B-v2-laser-truthy-dpo](https://huggingface.co/macadeliccc/WestLake-7B-v2-laser-truthy-dpo) - base
21
+ - [macadeliccc/WestLake-7B-v2-laser-truthy-dpo](https://huggingface.co/macadeliccc/WestLake-7B-v2-laser-truthy-dpo) - expert #1
22
+ - [cognitivecomputations/samantha-1.1-westlake-7b](https://huggingface.co/cognitivecomputations/samantha-1.1-westlake-7b) - expert #2
23
+ - [macadeliccc/WestLake-7B-v2-laser-truthy-dpo](https://huggingface.co/macadeliccc/WestLake-7B-v2-laser-truthy-dpo) - expert #3
24
+ - [Kukedlc/Triunvirato-7b](https://huggingface.co/Kukedlc/Triunvirato-7b) - expert #4
25
+
26
+ # Will upload to the huggingface leaderboard
27
+
28
+
29
+ # "[What is a Mixture of Experts (MoE)?](https://huggingface.co/blog/moe)"
30
+ ### (from the MistralAI papers...click the quoted question above to navigate to it directly.)
31
+
32
+ The scale of a model is one of the most important axes for better model quality. Given a fixed computing budget, training a larger model for fewer steps is better than training a smaller model for more steps.
33
+
34
+ Mixture of Experts enable models to be pretrained with far less compute, which means you can dramatically scale up the model or dataset size with the same compute budget as a dense model. In particular, a MoE model should achieve the same quality as its dense counterpart much faster during pretraining.
35
+
36
+ So, what exactly is a MoE? In the context of transformer models, a MoE consists of two main elements:
37
+
38
+ Sparse MoE layers are used instead of dense feed-forward network (FFN) layers. MoE layers have a certain number of “experts” (e.g. 32 in my "frankenMoE"), where each expert is a neural network. In practice, the experts are FFNs, but they can also be more complex networks or even a MoE itself, leading to hierarchical MoEs!
39
+
40
+ A gate network or router, that determines which tokens are sent to which expert. For example, in the image below, the token “More” is sent to the second expert, and the token "Parameters” is sent to the first network. As we’ll explore later, we can send a token to more than one expert. How to route a token to an expert is one of the big decisions when working with MoEs - the router is composed of learned parameters and is pretrained at the same time as the rest of the network.
41
+
42
+ At every layer, for every token, a router network chooses two of these groups (the “experts”) to process the token and combine their output additively.
43
+
44
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6589d7e6586088fd2784a12c/up_I0R2TQGjqTShZp_1Sz.png)
45
+
46
+ Switch Layer
47
+ MoE layer from the [Switch Transformers paper](https://arxiv.org/abs/2101.03961)
48
+
49
+ So, to recap, in MoEs we replace every FFN layer of the transformer model with an MoE layer, which is composed of a gate network and a certain number of experts.
50
+
51
+ Although MoEs provide benefits like efficient pretraining and faster inference compared to dense models, they also come with challenges:
52
+
53
+ Training: MoEs enable significantly more compute-efficient pretraining, but they’ve historically struggled to generalize during fine-tuning, leading to overfitting.
54
+ Inference: Although a MoE might have many parameters, only some of them are used during inference. This leads to much faster inference compared to a dense model with the same number of parameters. However, all parameters need to be loaded in RAM, so memory requirements are high. For example, [given a MoE like Mixtral 8x7B](https://huggingface.co/blog/moe), we’ll need to have enough VRAM to hold a dense 47B parameter model. Why 47B parameters and not 8 x 7B = 56B? That’s because in MoE models, only the FFN layers are treated as individual experts, and the rest of the model parameters are shared. At the same time, assuming just two experts are being used per token, the inference speed (FLOPs) is like using a 12B model (as opposed to a 14B model), because it computes 2x7B matrix multiplications, but with some layers shared (more on this soon).
55
+
56
+ If all our tokens are sent to just a few popular experts, that will make training inefficient. In a normal MoE training, the gating network converges to mostly activate the same few experts. This self-reinforces as favored experts are trained quicker and hence selected more. To mitigate this, an auxiliary loss is added to encourage giving all experts equal importance. This loss ensures that all experts receive a roughly equal number of training examples. The following sections will also explore the concept of expert capacity, which introduces a threshold of how many tokens can be processed by an expert. In transformers, the auxiliary loss is exposed via the aux_loss parameter.
57
+
58
+
59
+ ## "Wait...but you called this a frankenMoE?"
60
+ The difference between MoE and "frankenMoE" lies in the fact that the router layer in a model like the one on this repo is not trained simultaneously.