license:apache-2.0 region:us
---
license: apache-2.0
---

## Overview

This dataset is a continuation of the airoboros datasets, with two main new contributions:
* MathJSON - math questions, prefixed with __"Create a MathJSON solution to the following:"__, which then outputs a JSON between __`<mathjson>`__ and __`</mathjson>`__ tags, which can be parsed and passed to a deterministic library to perform calculations.
* Anon-contributed RP dataset to enhance multi-turn coherency.

Some of the MathJSON data was adapted from https://huggingface.co/datasets/meta-math/MetaMathQA

## Format

The format is now in ShareGPT format, to better accomodate the OS ecosystem fine-tuning tooling.

## MathJSON

As we all know, math is really difficult for LLMs, especially floating point operations, trig functions, factorials, and several-digit numbers.

Instead of sending millions and millions of examples to the LLM for fine-tuning, I've created a new category `mathjson` which simply presents the solution to the problem as a JSON string that can be evaluated by traditional computation.

The dataset has roughly 4k samples, as a proof of concept.  This can be expanded fairly easily, now that the fine-tuned models have a basic understanding of how to represent the problems.

For example:

```
Create a MathJSON solution to the following: Calculate the area of a circle with radius of 17.2456cm.  Include your reasoning. [/INST]
```

```
The area (A) of a circle is given by the formula A = πr², where r is the radius of the circle. Since the radius is given in centimeters, we need to convert it to meters first. We know that 1 meter equals 100 centimeters. Therefore, we can represent the radius as: r = 17.2456 cm * 100/1.

Once we have the radius in meters, we can calculate the area of the circle using the formula A = πr².

Solution as MathJSON:
<mathjson>
[
  "Multiply",
  "Pi",
  [
    "Power",
    17.2456,
    2
  ]
]
</mathjson>
```

Simply extract the JSON string between the mathjson tags, and evaluate it with https://cortexjs.io/compute-engine/ or my ultra-hacky limited-functionality python version of it https://github.com/jondurbin/airoboros/blob/mathjson/airoboros/mathjson.py