a1zhang's picture
Super-squash branch 'main' using huggingface_hub
a46f1f6
|
Raw History Blame Contribute Delete
3.68 kB
---
license: mit
task_categories:
- text-generation
language:
- en
tags:
- recursive-language-models
- tail-recursion
- synthetic
pretty_name: RLM Tail-Recursion SFT Data
---
# RLM Tail-Recursion SFT Data
![Gated chain: each RLM call solves one task, unlocks the next, and hands the rest of the chain to a fresh call](figures/gated_chain.png)
Synthetic SFT trajectories that teach a recursive language model (RLM) one skill: **answer the current task, check it with `unlock`, then tail-recurse with `handoff` on the next task.** All tasks are made up and share no text, data or templates with the evaluation tasks. Code: [alexzhang13/harness-cg](https://github.com/alexzhang13/harness-cg/).
`sft/gated_fake2.jsonl`: 7,705 samples (7,249 train / 456 validation). Each row is `{messages, pool_ids, depth, n, trunc}`: `messages` is a full chat in the `rlm.RLM` format (system prompt, task as user turn, then alternating assistant code and REPL output); `pool_ids` is the source chain, `depth` the 0-based position in the chain, `n` the chain length.
## Task setup
A *gated chain* is an ordered list of tasks; only the first is visible. Besides the REPL and `llm_query`, the model has:
- `unlock(answer)`: checks the answer against the hidden gold. On a pass it returns the next task, or `"DONE"` after the last; on a fail it returns `"LOCKED: ..."` (two attempts per task).
- `handoff(pkg)`: starts a fresh RLM call on the returned task and returns when that call and everything below it finish. A four-task chain is four nested RLM calls.
Each call stores its answer, calls `unlock`, then: hands off if it got a next task and submits; submits on `DONE`; revises and retries on `LOCKED` while an attempt remains.
## Tasks
Seven procedural families over made-up syllable-built names, each with a programmatic gold and a format-tolerant scorer (gate passes at score ≥ 0.999). About 60% of tasks carry a "catch". Chain length is 1–4 with weights 1:2:3:4; families are drawn independently per task.
| family (weight) | task | catch |
|---|---|---|
| ledger (3) | total value of one item's records at one site | `[VOID]` ignored, `RETURN` subtracts |
| readings (3) | sensor with the highest value | mixed grams and kg |
| timeline (1.5) | events strictly between two dates | invented 30-day-month calendar |
| chain (1) | topmost manager via manager links | only the latest statement per person counts |
| count (1) | records matching colour, size and status | inconsistent case and spacing |
| diff (1) | ids in list 1 but not list 2 | second list lower-cased |
| pick (1) | multiple choice from 3 facts hidden in filler | none |
`llm_query` is scripted, not a model: it returns the generated facts that appear verbatim in the prompt.
## Generation
- **Teacher:** [`a1zhang/RLM-27B`](https://huggingface.co/a1zhang/RLM-27B), temperature 0.3, no hint about the gate. On 59% of levels it also got a "write the solution as one program" note, stripped from saved prompts.
- **Forced turns:** the teacher's turns are kept until it tries to submit; that submission is rewritten into `result = unlock(<its answer>)`, followed by scripted `handoff`, submit or stop turns depending on the real gate reply. No wrong answer is injected.
- **Filtering:** 987 chains gave 2,809 calls; kept 2,279 that passed the gate and 202 that correctly stopped after two failures. Dropped calls that submitted before `unlock`, never submitted, used the literal fallback, or resubmitted the same answer.
- **Samples:** each kept call yields its full dialogue plus copies cut after the `unlock` turn and after the `handoff` turn (2,964 full, 3,147 ending at `unlock`, 1,594 ending at `handoff`).