diff --git a/README.md b/README.md index 38b89e3d05821fa8bf974e12ab9136df6d58539c..e3b38a2ac094f8287b7689d8bc148b01e1a3eb80 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,11 @@ 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 shares its number 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 prescribes no protocol beyond that. +from different agents as separate entries. Each agent reads its number from its environment, +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 +prescribes no protocol beyond that. | | | | --- | --- | @@ -43,23 +44,33 @@ instruction adapts the paper's (Appendix G) to the board and prescribes no proto ```text tasks/agg-pPP-nNN/ - instruction.md the same for every problem of a team size: no number in it + instruction.md the same for every problem of a team size: no number in it task.toml - tests/test.sh the grader - tests/expected.json the answer: copied in only after the agent is done - solution/solve.sh an oracle with its own copy of the answer -roles/agg-pPP-nNN/ - slot-01.md ... "Your private number: seventy-three", one per agent -problems.json the 32 problems -generate.py writes problems.json, tasks/ and roles/ from its seed (115) -check.py the checks that need no model + tests/test.sh the grader + tests/expected.json the 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) +check.py the checks that need no model ``` -**Private numbers** reach each agent only through its own instructions: Flock's -`agents.role_files` gives agent `agent-00k` the text of `slot-0k.md` and nothing else. The role -files live outside the task folders, and a task folder puts nothing in the container while the -agent works (no `environment/`; `tests/` arrives after the agent is done), so no agent's -container holds another agent's number. +**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. ## Reward @@ -79,32 +90,117 @@ scored on its own answer; the team succeeds if any agent scores 1. ## Run it with Flock -Flock's [`experiments/s3-aggregation`](https://github.com/huggingface/flock/tree/main/experiments/s3-aggregation) -writes the spec for one team (the task, its N agents and their role files, the board) and -`experiments/s3/metrics.py` turns a run into one row per team: success, each agent's reward, -tokens and board posts, and the message graph's centralization and reciprocity (the paper's -Appendix M). On HF Sandboxes, with the board on a Space: +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 -uv run experiments/s3-aggregation/team.py --problem 7 --agents 4 # out/agg-p07-n04/ -uv run flock launch experiments/s3-aggregation/out/agg-p07-n04/spec.yaml -uv run experiments/s3/metrics.py .flock/agg-p07-n04-