diff --git a/README.md b/README.md index 3be32dabdcc2cac316a852e51b3e6d6790cb3d27..309340c3bfccdaf9db9f7bba4a10ca00997733e9 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ agents are Pi with Flock's board, and the board is what we measure. Each of the N agents holds one private integer from 1 to 99, written in English words ("seventy-three"). The team must list all N numbers in ascending order, keeping equal numbers -from different agents as separate entries. Each agent reads its number from its environment, +from different agents as separate entries. Each agent finds its number in its instruction, shares it on the board, reads the others', keeps one number per participant, writes `/app/answer.json` (a JSON array of N integers in ascending order) and stops. The team succeeds if any agent's answer is right. The instruction adapts the paper's (Appendix G) to the board and @@ -37,40 +37,35 @@ prescribes no protocol beyond that. | | | | --- | --- | | Problems | 32 (the paper's held-out set size), each 16 integers drawn uniformly from 1 to 99, repeats allowed, from a fixed seed | -| Tasks | 160: one per problem and team size N ∈ {1, 2, 4, 8, 16}, whose team holds the problem's first N numbers, e.g. `agg-p07-n08` | +| Teams | 160: one per problem and team size N ∈ {1, 2, 4, 8, 16}, holding the problem's first N numbers, e.g. `agg-p07-n08` | +| Tasks | 992: one per slot of each team, `agg-p07-n08-s01` .. `-s08`, whose instruction states that slot's number | | Image | `python:3.12-slim`, prebuilt and public (no Dockerfile): HF Sandboxes, docker and podman | | Agent / verifier timeout | 1800 s / 60 s | | Resources | 1 CPU, 1 GB memory per agent | ```text -tasks/agg-pPP-nNN/ - instruction.md the same for every problem of a team size: no number in it +tasks/agg-pPP-nNN-sKK/ slot K of team agg-pPP-nNN (zero-padded: name order is slot order) + instruction.md "Your private number is ...": slot K's, and no other task.toml - tests/test.sh the grader - tests/expected.json the answer: copied in only after the agent is done + tests/test.sh the grader, the same for every slot of the team + tests/expected.json the team's answer: copied in only after the agent is done solution/solve.sh an oracle with its own copy of the answer -resources/ Flock's resources_dir for these tasks - private_number.py puts each agent's own number in its environment (PRIVATE_NUMBER) - numbers.json each task's agents (agent-001 ...) and their numbers, in words - message_board.py Flock's own board, brought along (a resources_dir replaces Flock's) flock/ spec.template.yaml what every team's Flock run shares: model, board rules, loop, limits team.py writes one team's spec (docker, HF Sandboxes or the HF cluster) sweep/ the scaling sweep on the HF cluster (flock/sweep/README.md) eval/metrics.py one row per team from Flock run directories problems.json the 32 problems -generate.py writes problems.json, tasks/ and resources/numbers.json from its seed (115) +generate.py writes problems.json and tasks/ from its seed (115) check.py the checks that need no model ``` -**Private numbers** reach each agent only through its own environment. With the spec's -`resources_dir` on `resources/` and `resources.private_number.team` naming the task, Flock's -worker loads `private_number.py`, and its `bind(name)` gives agent `agent-00k`'s Trial -`PRIVATE_NUMBER=` and nothing else. The module and `numbers.json` stay on -the worker: they are not in Flock's tool bundle, the task folder or any container. A task folder -puts nothing in the container while the agent works (no `environment/`; `tests/` arrives after -the agent is done), and the instruction holds no number, so no agent can read another agent's -number until that agent posts it. +**Private numbers** reach each agent only through its own task. Flock runs a team with the +selector `agg-pPP-nNN-s*`, `agents.count: N` and `naming: consecutive-id`: the selector matches +the team's N slots, sorted by name, and `agent-00K` runs slot K's task, so its instruction +holds its own number and no one else's. A task folder puts nothing in the container while the +agent works (no `environment/`; `tests/` arrives after the agent is done), so no agent can read +another agent's number until that agent posts it. ## Reward @@ -91,13 +86,9 @@ scored on its own answer; the team succeeds if any agent scores 1. ## Run it with Flock Flock's [`experiments/s3-aggregation/spec.yaml`](https://github.com/huggingface/flock/tree/main/experiments/s3-aggregation) -runs `agg-p01-n04` in local docker with this dataset next to Flock's checkout (its -`resources_dir` is `../s3-aggregation/resources` from there), at the revision it pins: - -```sh -hf download HuggingFaceSwarms/s3-aggregation --repo-type dataset --revision --local-dir ../s3-aggregation -uv run flock launch experiments/s3-aggregation/spec.yaml -``` +runs one team on HF Sandboxes (`TEAM`, default `agg-p01-n04`, with `N` its size) at the revision +it pins: `uv run flock launch experiments/s3-aggregation/spec.yaml`. Its board is a public Space +for the run: delete it afterwards. For any other team or place, `flock/team.py` writes the spec from `flock/spec.template.yaml`, run from Flock's checkout. **Needs** `HF_TOKEN`, which reads the private dataset (and starts the @@ -197,14 +188,15 @@ uv run check.py --env none # without the Trials uv run check.py --env none --run RUN_DIR # also a Flock run of a team (below) ``` -1. **Generator:** `generate.py` reproduces `problems.json`, `tasks/` and - `resources/numbers.json` byte for byte; another seed gives other problems; 32 problems of 16 - integers in 1..99; the words read back to their numbers; each task's team is its problem's - first N numbers, and `numbers.json` gives agent `agent-00k` the k-th. +1. **Generator:** `generate.py` reproduces `problems.json` and `tasks/` byte for byte; another + seed gives other problems; 32 problems of 16 integers in 1..99; the words read back to their + numbers; each team has one task per slot, whose answer is the problem's first N numbers + sorted and whose instruction states that slot's number, and name order is slot order. 2. **Graders**, run as Harbor runs them (`tests/` copied in after the agent is done, through - any link the agent left): on all 160 tasks the oracle scores 1, and wrong, partial, padded, - unsorted and duplicate-dropping answers score 0. On one task per team size, twelve kinds of - malformed answer score 0, and so do sixteen cheats: the answer as a symlink to the tests' + any link the agent left), on slot 1 of each team (every slot's `tests/` and `solution/` are + the same, which this checks): on all 160 teams the oracle scores 1, and wrong, partial, + padded, unsorted and duplicate-dropping answers score 0. On one team per size, twelve kinds + of malformed answer score 0, and so do sixteen cheats: the answer as a symlink to the tests' `expected.json` (dangling until the tests arrive; absolute or relative), a symlink or a hardlink to a right answer elsewhere, a hardlink to `expected.json`, a symlinked `/app` (to a right answer, or into the tests' folder), an `expected.json` planted as a link to the answer, @@ -212,34 +204,30 @@ uv run check.py --env none --run RUN_DIR # also a Flock run of a team (below) to read any answer as right: a `json.py` in the grader's working directory or on `PYTHONPATH`, a `sitecustomize` on `PYTHONPATH`, a `usercustomize` or a `.pth` file in the user site, and a `dirname` shadowed on the `PATH` that points `expected.json` at the agent's file. -3. **No-cheat, in the files:** a task folder holds only its five files, its instruction is the - same for every problem of its team size and holds no number, the answer is only in `tests/` - and `solution/`, and `resources/` holds only the resource, its numbers and the board. -4. **No-cheat, the resource:** for every task and agent, `private_number`'s binding is that - agent's own number in `PRIVATE_NUMBER` and nothing else (no other variable, mount, host or - metadata, and no teammate's number anywhere in it); a team of the wrong size, an unknown - task or agent, and unknown options are refused. -5. **No-cheat, from inside Trials** of `agg-p01-n16`, with probe agents (no model): sixteen - probes, one per agent, each with exactly the environment `private_number` binds for it, look - around the container while "the agent works": every file, every process's environment and - command line, and the instruction. Each finds its own number only in its environment, and no - teammate's number, no `tests/` or `solution/` and no file holding the answer anywhere; then it - writes the answer, the same search finds it (a control), and the task's verifier scores it 1. - Four more leave a cheat with a wrong answer, and the verifier scores each 0: - `/app/answer.json` as a symlink to `/tests/expected.json`; `/app` as a symlink into a - `/tests` they made; a `json.py` that reads any answer as right wherever the verifier may - start; a `sitecustomize` in site-packages that does the same. -6. **No-cheat, a Flock run** (`--run RUN_DIR`, a local run's `.flock/-