> 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 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.valohai.com/tasks/random-search.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.
