Home

Awesome

Flacuna: A Vicuna made of Flan

Paper | Model | Dataset

📣 We still have numerous experiments awaiting completion (details are here), requiring additional computing resources in our lab. If any industry professionals reading this are willing to provide assistance, please feel free to reach out to us at sporia@sutd.edu.sg.

<p align="center"> <img src="https://declare-lab.net/assets/images/logos/flacuna5.png" alt="Image" width="200" height="335"> </p>

Flacuna was developed by fine-tuning Vicuna on Flan-mini, a comprehensive instruction collection encompassing various tasks. Vicuna is already an excellent writing assistant, and the intention behind Flacuna was to enhance Vicuna's problem-solving capabilities. To achieve this, we curated a dedicated instruction dataset called Flan-mini.

Dataset NameSourceDataset Size
Flan2021Flan388K
Public Pool of PromptsFlan320K
Natural instructions v2Flan200K
CoTFlan100K
Code SearchHF/code_search_net100K
Code ContestHF/deepmind/code_contests50K
AppsHF/codeparrot/apps50K
GPT4-AlpacaGPT-452K
Code-AlpacaChatGPT20K
ShareGPTChatGPT60K
Total-1.34M

Quickstart Guide

from flacuna import FLACUNA
model = FLACUNA("declare-lab/flacuna-13b-v1.0")

prompt = (
  "A chat between a curious user and an artificial intelligence assistant. "
  "The assistant gives helpful, detailed, and polite answers to the user's questions. "
  "USER: You are tasked to demonstrate your writing skills in professional or work settings for the following question.\n"
  "Can you help me write a speech for a graduation ceremony, inspiring and motivating the graduates to pursue their dreams and make a positive impact on the world?\n"
  "Output: ASSISTANT: "
)
decoded = model.generate(prompt)
print (decoded)

The output is the following:

A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: You are tasked to demonstrate your writing skills in professional or work settings for the following question.
Can you help me write a speech for a graduation ceremony, inspiring and motivating the graduates to pursue their dreams and make a positive impact on the world?
Output: ASSISTANT: ​​Dear Graduates,

It is my honor to stand before you here today, to celebrate your achievements and to acknowledge your hard work and dedication that you have shown here at the University. I am proud of each one of you, for all that you have accomplished thus far, and for the potential that lies within each of you.

As you move on from this stage, I want to remind you that your journey has just begun. The real world awaits you, and with it, comes a myriad of opportunities and challenges. But I believe in each one of you, and I know that you are more than capable of facing whatever lies ahead.

You are the future of this world, and I have no doubt that you will make a positive impact on it, in whatever field you choose to pursue. Whether it is in science, technology, education, healthcare, or any other field, your contributions will be valuable and meaningful, and will make a difference in the lives of others.

So, as you move forward, I urge you to stay true to your passions, to pursue your dreams, and to never give up on what you believe in. Remember, it is not the obstacles that define us, but how we overcome them that truly matters.

You have the power to change the world, and I have no doubt that you will. So, go out there, and make the most of every opportunity that comes your way. Make a difference, and leave your mark on this world.

Congratulations once again, and best of luck in all that lies ahead.

Thank you.

Problem Solving Ability

As a result of this fine-tuning process, Flacuna exhibited notable performance improvements in problem-solving across multiple benchmark datasets, both in few-shot and zero-shot settings.

ModelSizeMMLU (5-shot)BBH (3-shot)DROP (3-shot)CRASS (3-shot)HumanEval (0-shot)Avg.
StableVicuna13B49.2 (+3.0)37.5 (+0.4)34.3 (-1.0)67.5 (+8.7)15.9 (+2.5)40.9 (+2.7)
Vicuna13B50.6 (+4.5)37.6 (+0.5)32.6 (-3.0)60.9 (+2.1)11.6 (-1.8)38.7 (+0.6)
Flacuna13B51.1 (+5.0)39.3 (+2.2)43.6 (+8.0)74.1 (+15.3)11.0 (-2.4)43.8 (+5.6)
ModelSizeMMLU (0-shot)BBH (0-shot)CRASS (0-shot)
StableVicuna13B47.518.564.2
Vicuna13B48.328.365.7
Flacuna13B49.432.567.9

During training, Flacuna is a 13B checkpoint of LLaMA and employed a maximum input sequence length of 1280. We utilized LoRA for parameter-efficient fine-tuning.

Chatbot / Writing Assistant

While Flacuna primarily excels in problem-solving tasks, we made efforts to maintain the impressive writing and chatting ability of Vicuna. To achieve this, we incorporated conversational datasets generated by GPT-4, such as GPT-4-Alpaca and ShareGPT, into the Flan-mini collection. To use Flacuna as a chatbot or writing assistant, we recommend you use the following template:

A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: {definition of the task}.\n\n
{question}\n
Output: ASSISTANT:

Please note that we still recommend using Vicuna as your preferred Chatbot or Writing Assistant, over Flacuna. Flacuna's primary strength lies in problem-solving tasks, making it ideal for such applications.

The following table presents the writing performance of Flacuna on the IMPACT dataset, which is a component of the InstructEval evaluation suite. The generated responses have been evaluated by ChatGPT, and their relevance and coherence have been scored on a scale of 1 to 5.

ModelSizeInformative Rel.Informative Coh.Professional Rel.Professional Coh.Argumentative Rel.Argumentative Coh.Creative Rel.Creative Coh.Avg. Rel.Avg. Coh.
ChatGPT-3.343.983.883.963.963.823.923.943.783.93
Flan-Alpaca11B3.563.463.543.703.223.283.703.403.513.46
Flan-T511B2.643.242.623.222.543.402.502.722.583.15
Dolly-V212B3.543.642.963.743.663.203.023.183.303.44
StableVicuna13B3.543.642.963.743.303.203.023.183.213.44
Vicuna13B3.603.963.743.823.823.563.823.923.753.82
Flacuna13B3.023.423.483.523.383.023.923.803.453.44

Training Flacuna

Navigate to the data directory and download the Flan-Mini dataset:

cd data
wget https://huggingface.co/datasets/declare-lab/flan-mini/resolve/main/flan_mini.json.zip
unzip flan_mini.json.zip
cd ..

You can then use the train.sh script for fine-tuning Vicuna on the Flan-Mini dataset:

bash train.sh

Citation

@misc{ghosal2023flacuna,
      title={Flacuna: Unleashing the Problem Solving Power of Vicuna using FLAN Fine-Tuning}, 
      author={Deepanway Ghosal and Yew Ken Chia and Navonil Majumder and Soujanya Poria},
      year={2023},
      eprint={2307.02053},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}