Skip to main content

Updated and improved implementation of the self-instruct system.

Project description

airoboros: using large language models to fine-tune large language models

This is my take on implementing the Self-Instruct paper. The approach is quite heavily modified, and does not use any human-generated seeds.

This updated implementation supports either the /v1/completions endpoint or /v1/chat/completions, which is particularly useful in that it supports gpt-4 and gpt-3.5-turbo (which is 1/10 the cost of text-davinci-003).

Key differences

  • support for either /v1/completions or /v1/chat/completions APIs (which allows gpt-3.5-turbo instead of text-davinci-003, as well as gpt-4 if you have access)
  • support for custom topics list, custom topic generation prompt, or completely random topics
  • in-memory vector db (Chroma) for similarity comparison, which is much faster than calculating rouge score for each generated instruction
  • (seemingly) better prompts, which includes injection of random topics to relate the instructions to, which creates much more diverse synthetic instructions
  • asyncio producers with configurable batch size
  • several "instructors", each targetting specific use-cases, such as Orca style reasoning/math, role playing, etc.
  • tries to ensure the context, if provided, is relevant to the topic and contains all the information that would be necessary to respond to the instruction, and nost just a link to article/etc.
  • generally speaking, this implementation tries to reduce some of the noise

Generating instructions

NEW - 2023-07-18

To better accomodate the plethora of options, the configuration has been moved to a YAML config file.

Please create a copy of example-config.yaml and configure as desired.

Once you have the desired configuration, run:

airoboros generate-instructions --config-path /path/to/config.yaml

Generating topics

NEW - 2023-07-18

Again, this is now all YAML configuration based! Please create a customized version of the YAML config file, then run:

airoboros generate-topics --config-path /path/to/config.yaml

You can override the topic_prompt string in the configuration to use a different topic generation prompt.

Support the work

https://bmc.link/jondurbin

Models (research use only):

gpt-4 versions

gpt-3.5-turbo versions

Datasets (subject to OpenAI license):

Coming soon

Scripts for fine-tuning various models using the self-instruct (and human-generated) prompts.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airoboros-2.0.13.tar.gz (40.1 kB view details)

Uploaded Source

Built Distribution

airoboros-2.0.13-py3-none-any.whl (57.0 kB view details)

Uploaded Python 3

File details

Details for the file airoboros-2.0.13.tar.gz.

File metadata

  • Download URL: airoboros-2.0.13.tar.gz
  • Upload date:
  • Size: 40.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for airoboros-2.0.13.tar.gz
Algorithm Hash digest
SHA256 1b86ad8af14a386a92b16c16ef92119787bf062cb5443863830860d31b901caf
MD5 7665add1a75d7eb7e9bb5f839936538c
BLAKE2b-256 cb18c5ae4a172f078d2c6a26f3b1f94b842ec429f5db640b103263d2b9470999

See more details on using hashes here.

File details

Details for the file airoboros-2.0.13-py3-none-any.whl.

File metadata

  • Download URL: airoboros-2.0.13-py3-none-any.whl
  • Upload date:
  • Size: 57.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for airoboros-2.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 b2861ed383fb5451349d6eb30d593a90a5ad18c2bf85f4c44f87ad58ab7e3c35
MD5 bdefd47fab2f65f2d6b5c5c1ad25dd64
BLAKE2b-256 4c058fc34f4cf707f15d341171ef48ac72f9fce3e455fd6d3366ea536bc52883

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page