Rickesh commited on
Commit
2ecc4c8
·
verified ·
1 Parent(s): 301a114

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +63 -6
README.md CHANGED
@@ -12,16 +12,23 @@ task_categories:
12
  - question-answering
13
  ---
14
 
15
- # RLM × OOLONG: a negative reproduction
16
 
17
  A reproduction of [Recursive Language Models](https://alexzhang13.github.io/blog/2025/rlm/)
18
  (Zhang & Khattab, 2025) on [OOLONG-synth](https://huggingface.co/datasets/oolongbench/oolong-synth),
19
  run entirely through the Claude Code CLI with Claude Haiku 4.5 as both root and
20
  recursive model.
21
 
22
- **The method did not reproduce in this configuration.** Wrapping Haiku in an RLM
23
- made it *worse* than reading the same context straight through. That result, and
24
- the mechanism behind it, is the contribution here.
 
 
 
 
 
 
 
25
 
26
  ## Results
27
 
@@ -114,13 +121,63 @@ python rlm_ask.py --file huge.log --query "Which error appears most often?"
114
  `tool_use` blocks, and the RLM loop emits prose, so putting RLM behind the model
115
  endpoint would break tool calling outright.
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  ## What is *not* here
118
 
119
  - **No model weights.** Nothing was fine-tuned. This is a harness, a tool, and
120
  results. `rlm-ask` runs on whatever Ollama model you already have.
121
- - **No Terminal-Bench numbers.** `tbench/` (running Terminal-Bench against local
122
- Ollama models through Claude Code) is included but has **never produced a
123
  passing run**. Treat it as unvalidated code.
 
 
124
  - The 262k-token OOLONG slice was not run.
125
 
126
  ## Attribution
 
12
  - question-answering
13
  ---
14
 
15
+ # RLM × OOLONG a negative reproduction, and the fix that came out of it
16
 
17
  A reproduction of [Recursive Language Models](https://alexzhang13.github.io/blog/2025/rlm/)
18
  (Zhang & Khattab, 2025) on [OOLONG-synth](https://huggingface.co/datasets/oolongbench/oolong-synth),
19
  run entirely through the Claude Code CLI with Claude Haiku 4.5 as both root and
20
  recursive model.
21
 
22
+ Two results, and the second only exists because the first failed.
23
+
24
+ **1. The method did not reproduce.** Wrapping Haiku in an RLM made it *worse* than
25
+ reading the same context straight through: **0.269 vs 0.428** on OOLONG-131k.
26
+
27
+ **2. Chasing that failure produced something that works.** On a 957,493-char
28
+ corpus, a 4B model on a 6GB laptop GPU reached the correct answer where the
29
+ recursive harness failed four times and Claude Opus was 2/3 and self-inconsistent.
30
+ The fix was not a bigger model. It was removing the model from the steps it kept
31
+ getting wrong.
32
 
33
  ## Results
34
 
 
121
  `tool_use` blocks, and the RLM loop emits prose, so putting RLM behind the model
122
  endpoint would break tool calling outright.
123
 
124
+ ## The fix: stop asking the model to aggregate
125
+
126
+ Four attempts on the 957,493-char corpus, all with the same 4B:
127
+
128
+ | attempt | sub-calls | answer |
129
+ |---|---:|---|
130
+ | 1 | 7 | prose, having read about a third |
131
+ | 2 | 11 | `Spatial` — right arithmetic, truncated label |
132
+ | 3 | 65 | `Counterfactual` — swept everything, well-formed, wrong |
133
+ | 4 | 72 | `Status: beta, Status: delta, Status: gamma, Status: alpha` |
134
+
135
+ Attempt 4 is the diagnosis: asked to *select* a minimum, it *listed the candidates*.
136
+ A 4B can count rows in a fragment. It cannot reliably plan a traversal and then do
137
+ arithmetic across 65 partial results — and nothing about that arithmetic requires a
138
+ language model.
139
+
140
+ `ctxstream/` (C++17, zero third-party dependencies) treats the corpus like a video
141
+ stream: the segment plan is computed in code before any model call, N segments are
142
+ in flight at once, the model sees one fragment and emits `key<TAB>number` (never
143
+ prose), and aggregation is a loop.
144
+
145
+ 17 segments · failed=0 · records=611 · unparsed_lines=3 · keys=15 · 641s
146
+ Category: Spatial Relationship <- gold, correct
147
+
148
+ | | answer | correct | cost |
149
+ |---|---|:---:|---:|
150
+ | Claude Opus 4.8 [1m], one call, 439,742 tok | varies by run | 2/3 | $4.79 |
151
+ | 4B + ctxstream, RTX 3060 6GB | `Spatial Relationship` | yes | $0.00 |
152
+
153
+ A directory input builds a symbol/include graph first and segments along it, since
154
+ cutting code every N characters splits functions and separates calls from
155
+ definitions.
156
+
157
+ ```bash
158
+ cd ctxstream && cmake -S . -B build && cmake --build build -j
159
+ ./build/test_ctxstream # 61 checks, no GPU, no network, no tokens
160
+ ```
161
+
162
+ ## VRAM, measured on the 6GB card
163
+
164
+ | num_ctx | resident | fits 5.5GB usable |
165
+ |---:|---:|:---:|
166
+ | 32,768 | 3.3 GB | yes — the direct ceiling |
167
+ | 65,536 | 10.4 GB | no |
168
+
169
+ Streaming 261,226 tokens through that card peaks at **4.23–4.54 GB** across four
170
+ runs: an 8x context multiple at constant VRAM, because the corpus never enters the
171
+ KV cache. Switching KV to q4_0 changed nothing, so the cliff is not the KV cache.
172
+
173
  ## What is *not* here
174
 
175
  - **No model weights.** Nothing was fine-tuned. This is a harness, a tool, and
176
  results. `rlm-ask` runs on whatever Ollama model you already have.
177
+ - **No Terminal-Bench numbers.** `tbench/` is included but has **never produced a
 
178
  passing run**. Treat it as unvalidated code.
179
+ - **ctxstream has not been run at the full 262,144-token scale yet** — the correct
180
+ result above is on a 957,493-char corpus.
181
  - The 262k-token OOLONG slice was not run.
182
 
183
  ## Attribution