# Autoresearch and weight-space programming

bsln version: `0.0.1b40`

SDK source: `baseline-robotics/engineering@c8db8d9fbc8ce8e0524c5ee45cebdfcec34fc666:robotics/bsln`

Page source: `baseline-robotics/engineering@c8db8d9fbc8ce8e0524c5ee45cebdfcec34fc666:robotics/bsln/docs/customer/RECIPES-AUTORESEARCH.md`

[Read on the web](https://docs.baseline-robotics.com/recipes/autoresearch/) | [Markdown](https://docs.baseline-robotics.com/recipes/autoresearch.md) | [Documentation index](https://docs.baseline-robotics.com/llms.txt)

## Autoresearch

Start with a reproducible task, fixed scoring and a trial budget. Record baseline policy inputs, versions and results. Allow the agent to change one part of the policy at a time. Keep the task and scoring fixed, log each attempt, and compare the best candidate with the original on setups held back from the search. See [autoresearch](https://github.com/karpathy/autoresearch).

### CLI example

For two [approved SDK sessions](https://docs.baseline-robotics.com/index.md#3-run-a-session), run the same policy loop with each version. A one-session pilot needs a separate grant for each run. When both sessions end, enter their IDs at the prompts:

```bash
bash -c '
read -r -p "Baseline session ID: " baseline_id || exit 1
read -r -p "Candidate session ID: " candidate_id || exit 1
[[ $baseline_id == ses_* && $candidate_id == ses_* ]] || exit 1
bsln get session-report "$baseline_id" --json > baseline-report.json &&
bsln get session-report "$candidate_id" --json > candidate-report.json
'
```

Use your task criterion to score both trials. Practice with the [offline recording](https://docs.baseline-robotics.com/recipes/explore-recording.md) while setting up access.

## Weight-space programming

Use [recordings](https://docs.baseline-robotics.com/recordings.md) to isolate one reproducible failure. Save the original checkpoint and make a small, documented weight edit in a copy. Compare both checkpoints offline on observations from failed and successful episodes. Confirm the change under the same task conditions and on fresh cases.

When you have [approved SDK sessions](https://docs.baseline-robotics.com/index.md#3-run-a-session) for both versions, use the same policy loop. Use the [recording download command](https://docs.baseline-robotics.com/cli/reports-and-data.md#get-the-report-and-recording) once for each ended session. Compare the target failure and behavior that already worked. Use [trial denominators](https://docs.baseline-robotics.com/results.md#compare-trials-offline) when reporting results.
