LittleInstructionMaker-4B-v0.1
A small model to create prompts the Magpie way.
The secret sauce turned out to be also training on the prompts. I did that last with SystemChat-1.1 in order to be able to steer the prompt generation. It does not work without a system message.
Now imagine, if you will, having this bad boy generate a bunch of different prompts right, and having another model like, I mean.. LittleInstructionJudge Any mode with some proper prompt engineering right, judge all of the instructions right, and then slam a serverfarm with the cream of the crop right.
In other words, giving it a system prompt like "You are a creative writing partner", "You are an advanced coding assistant", "You are a damn good psychologist", etc, you can can quickly generate prompts for a niche dataset that can then be answered by large model.
In a different language: Ved hjælp af Husskades indsigt, hvor man udnytter sprogmodellers natur til at skabe tilpasningsdata, kan man med fordel bruge denne sprogmodel til at skrive instruktioner, og endda styre indholdet ved hjælp af system beskeden.
Training
All the datasets were used seperately and merged together using Model Stock, except for SystemChat-1.1 where I fine-tuned it using LoRA+ with train_on_prompt
set to True.
Datasets
- Airoboros-3.2 (CC BY 4.0) by jondurbin
- SystemChat-1.1 by abacusai
- orpo-dpo-mix-40k by mlabonne
- SlimOrcaDedupCleaned by cgato
- openhermes_200k_unfiltered by Crystalcareai
Using this model to make instructions
<|im_start|>system
{{system_message}}<|im_end|>
<|im_start|>user
It actually generates an EOS token at the end of a "user" prompt. Lawdy that has been a pain when trying to use large models for this purpose. Good luck; have fun.
Response preview
Giving the model this text at a temperature of 0.9:
<|im_start|>system
You are an AI coding assistant.<|im_end|>
<|im_start|>user
Will return this:
Hey, can you help me write a simple program that generates a Fibonacci sequence until a certain number of terms? Like this: Fib(5) should give me the first five numbers in the series.
Code example to use it
import torch
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
"trollek/LittleInstructionMaker-4B-v0.1",
dtype=torch.bfloat16,
load_in_4bit=True,
max_seq_length=8192
)
FastLanguageModel.for_inference(model)
def instruction_generator(system_message: str, num_instructions: int):
if system_message is None or "":
raise ValueError
if num_instructions < 1:
raise ValueError
magpie_template = f"<|im_start|>system\n{system_message}<|im_end|>\n<|im_start|>user\n"
input_ids = tokenizer(magpie_template, return_tensors="pt").input_ids.to("cuda")
for idx in range(num_instructions):
generated_ids = model.generate(input_ids, max_new_tokens=512, temperature=0.9, repetition_penalty=1.1, do_sample=True, eos_token_id=tokenizer.eos_token_id)
response = tokenizer.decode(generated_ids[0][input_ids.shape[-1]:], skip_special_tokens=True, clean_up_tokenization_space=True)
yield response
for instruct in instruction_generator("You are an AI coding assistant.", 2):
print(instruct)
# Can you help me write a simple programming language syntax?
# I want to create a Python program for a social media app that allows users to post and comment on stories. The message I want to convey is that staying connected with others is essential in life. Can you suggest a way to design the program?
Quants
- Downloads last month
- 3