File size: 6,733 Bytes
bf144d8
 
 
 
71c8f0d
 
 
97a57f9
27dda40
 
bf144d8
 
 
620862d
27dda40
 
 
 
 
 
 
ecfe0ec
27dda40
 
 
 
ac47d8a
71c8f0d
97a57f9
 
 
 
 
 
 
 
71c8f0d
 
 
 
97a57f9
 
 
 
 
 
 
 
 
71c8f0d
 
97a57f9
 
 
 
 
 
 
 
71c8f0d
 
97a57f9
 
 
 
 
 
 
 
 
71c8f0d
 
97a57f9
 
 
 
 
 
 
71c8f0d
8173c0d
 
 
 
bf144d8
 
 
ac47d8a
bf144d8
48cccc0
 
aca7a65
 
 
48cccc0
 
 
 
95739d7
 
8a04d92
cf45a1a
bf144d8
 
27dda40
 
 
 
 
bf144d8
 
 
48cccc0
bf144d8
f810050
db24444
bf144d8
 
ac47d8a
 
f810050
bf144d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71c8f0d
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
---
license: apache-2.0
tags:
- generated_from_trainer
- alpaca
- self-instruct
- instruction generation
- instructiongen
datasets:
- pszemraj/fleece2instructions
metrics:
- rouge
model-index:
- name: bart-base-instructiongen
  results:
  - task:
      name: Sequence-to-sequence Language Modeling
      type: text2text-generation
    dataset:
      name: pszemraj/fleece2instructions
      type: pszemraj/fleece2instructions
      split: validation
    metrics:
    - name: Rouge1
      type: rouge
      value: 61.7209
widget:
- text: >-
    You'll need to start by choosing the right venue. Consider the type of
    atmosphere and the size of the area that will be suitable for the number of
    guests you plan to invite. Choose the right decorations based on your
    brother's interests, such as balloons in his favorite colors, banners, and
    streamers. Next, decide on the food and drinks, making sure they are tasty
    and appropriate for the occasion. Then decide on the other games, music, and
    entertainment that will make the party memorable. Finally, involve your
    brother's friends and family to help create the perfect surprise.
  example_title: birthday party
- text: 1) cookies and cream 2) chocolate chip 3) mint chip 4) oreo
  example_title: ice cream
- text: >-
    Start by selecting a scale model of a building that fits the theme. Use a
    hobby knife and glue to cut and assemble the model into a ruined or
    abandoned version of itself, adding details like broken windows and
    graffiti. Create a base for the diorama using foam, plaster, or other
    materials, and paint it to resemble a ruined street or sidewalk. Add
    miniature vehicles, debris, and figures to complete the scene, and use
    weathering techniques like dry brushing and rust washes to add realism.
    Display the diorama in a shadow box or other protective case to showcase
    your work.
  example_title: Miniature diorama creation
- text: >-
    Start by selecting clothing that is futuristic and edgy, such as leather
    jackets, neon-colored accessories, and tech-inspired patterns. Add
    accessories like goggles, cybernetic implants, and LED lights to enhance the
    cyberpunk vibe. Use makeup and body paint to create a futuristic look, such
    as metallic skin or neon makeup. Consider adding functional elements to your
    costume, such as a built-in backpack or hidden pockets for your tech
    gadgets. Finally, practice your confident walk and embrace your inner
    cyberpunk for a memorable and immersive costume experience.
  example_title: Cyberpunk costume design
- text: >-
    Start by creating a base terrain with mountains, valleys, and other natural
    features. Use fractal noise and displacement mapping to add texture and
    detail to the terrain, and experiment with different materials like rock,
    grass, and water. Add surreal elements like floating islands, giant
    mushrooms, or impossible geometry to create a dreamlike atmosphere. Use
    lighting and color grading to enhance the mood and tone of the scene, and
    render the final image at a high resolution for maximum impact. Share your
    surreal landscape with the world and inspire others to explore the
    possibilities of 3D art.
  example_title: Surreal 3D landscape creation
- text: >-
    Start by setting a realistic goal and creating a training plan. Build up
    your mileage gradually over time, and incorporate cross-training and
    strength exercises to prevent injury and improve endurance. Be sure to stay
    hydrated and properly fuel your body with nutritious foods. Listen to your
    body and adjust your training as needed to avoid overexertion or burnout.
    Finally, taper your training in the weeks leading up to the race to give
    your body time to rest and recover before the big day.
  example_title: Marathon training
inference:
  parameters:
    max_length: 96
    num_beams: 4
---


# bart-base-instructiongen

Instead of generating questions from text, generate instructions for LLMs! 

- Check out a [basic demo on Spaces](https://huggingface.co/spaces/pszemraj/generate-instructions)
- An example of how to use instructiongen models in a CLI script can be found [here](https://gist.github.com/pszemraj/8b0213e700763106074d3ac15d041c14)
- You can find other models fine-tuned for instruction generation by [searching for the instructiongen tag](https://huggingface.co/models?other=instructiongen).


## About

**Hypothesis:** Apply text-to-text models to unlabeled domain-specific text to generate appropriate LLM instructions. Consequently, this may enable domain adaptation of instruction-tuned LLMs, making them more versatile for specific domains.

This model is a fine-tuned version of the [facebook/bart-base](https://huggingface.co/facebook/bart-base) model, fine-tuned using the `pszemraj/fleece2instructions` dataset. 

It achieves the following results on the evaluation set:
- Loss: 1.0034
- Rouge1: 61.7209
- Rouge2: 45.0116
- Rougel: 59.8188
- Rougelsum: 59.8931
- Gen Len: 14.3179

## Intended uses & limitations

This is just a base model/example. There is likely to be even better performance with larger models (click [here to see other checkpoints](https://huggingface.co/models?other=instructiongen))

Additionally, this was trained on a dataset of **only** instructions+outputs, with the `inputs` filtered out. This means that text of *1) cookies and cream 2) chocolate chip 3) mint chip 4) oreo* will **not** get you *"Rank the following ice cream flavors: oreo, mint chip, chocolate chip, cookies and cream"*.

## Training and evaluation data

See the linked dataset `pszemraj/fleece2instructions` - it is a filtered/formatted version of `tatsu-lab/alpaca` to generate instructions for arbitrary text.

- Some of the API examples are intentionally weird to demonstrate the generalizability of the model.

## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 8e-05
- train_batch_size: 8
- eval_batch_size: 1
- seed: 42
- distributed_type: multi-GPU
- gradient_accumulation_steps: 8
- total_train_batch_size: 64
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_ratio: 0.02
- num_epochs: 2.0

### Training results

| Training Loss | Epoch | Step | Validation Loss | Rouge1  | Rouge2  | Rougel  | Rougelsum | Gen Len |
|:-------------:|:-----:|:----:|:---------------:|:-------:|:-------:|:-------:|:---------:|:-------:|
| 1.2723        | 1.0   | 362  | 1.0325          | 61.6206 | 45.1199 | 59.6467 | 59.7534   | 14.0443 |
| 1.0157        | 2.0   | 724  | 1.0034          | 62.4433 | 46.0114 | 60.5355 | 60.6392   | 14.1807 |