> For the complete documentation index, see [llms.txt](https://docs.hackle.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hackle.io/en/ab-test/mab-test.md).

# MAB (Multi-Armed Bandit) Test

### What is MAB?

It is about choosing the best option among multiple test groups with limited resources (time, traffic).

For example, think of a situation where you need to decide which slot machine to bet on among several options.\
In this case, the MAB (Multi-Armed Bandit) algorithm evaluates the reward for each option and adjusts the selection ratio of individual machines over time using reward information to find the optimal choice.

This helps the algorithm gradually find better choices and maximize rewards.

{% hint style="success" %}
Use a MAB Test to optimize your success metric and make decisions faster than with an A/B Test.
{% endhint %}

<figure><img src="https://143363954-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyAVlNQhS253reum0Ce94%2Fuploads%2Fgit-blob-6e85e2471ab0d6c60c64d713d298ca20b6340b99%2Fimage%20(16).png?alt=media" alt=""><figcaption></figcaption></figure>

### What algorithm does Hackle's MAB use?

Hackle's MAB uses the Thompson Sampling (Bayesian) method.\
For n hours after MAB starts, traffic is distributed evenly across all test groups. After that, Thompson Sampling is used on an hourly basis to estimate the probability that each test group is the best, and traffic is allocated proportionally.

For example, if there are 3 test groups A, B, and C, and the probability that each group is the best is 70%, 20%, and 10%, traffic is allocated to each group in those proportions.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.hackle.io/en/ab-test/mab-test.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
