> For the complete documentation index, see [llms.txt](https://docs.valohai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.valohai.com/tasks/random-search.md).

# Random Search

Random Search samples parameter values randomly instead of testing every combination.

This is more efficient when you have many parameters or large ranges, you'll explore the space faster without exhaustive enumeration.

#### When to use Random Search

* **Large parameter spaces:** Testing all combinations would create too many executions
* **Budget constraints:** You have limited time or compute resources
* **Exploratory tuning:** You want a quick sense of promising regions before refining

#### Create a Random Search

Follow the same steps as Grid Search, but:

1. Select **Random Search** as the Task type
2. Open your project in Valohai
3. Go to the **Tasks** tab
4. Click **Create Task**
5. Select the step that contains your parameters
6. Scroll to **Parameters**
7. For each parameter, choose **Random** as the type
8. Specify:
   * **Min and max values** for the random range
   * **Count:** How many random samples to draw for this parameter

Valohai will generate random parameter combinations and queue the specified number of executions.

> 💡 **Tip:** Random Search often finds good hyperparameters faster than Grid Search when you have more than 3-4 parameters.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.valohai.com/tasks/random-search.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
