Research log Small Model Experimentation
GitHub

Query Filter Executor Experiment

Graded only on answers

The one idea you need

Two hidden numbers start tied by a fixed relationship, so many value-pairs stay possible. Like a detective narrowing a suspect board as each clue lands, the model crosses off pairs one instruction at a time, though it is graded only on the final answer.

The question

If you only ever grade a model on its final answer, will it still bother to build the full step-by-step reasoning the problem actually needs?

What we found

Yes, and that is the surprise. Trained only to name one final answer, the model taught itself to run each instruction in order and track every still-possible pair of the two hidden numbers. Given enough internal steps, it stayed about 96% accurate on programs three times longer than any it trained on, while simpler-memory and one-pass rivals collapsed to roughly 5 to 12%.

Why it matters

If a task needs an internal working state, cheap answer-only supervision can grow one, and you need not label every step. But only when the architecture can hold that state and you give it enough internal steps to match the task's depth.

Answer accuracy at three times the training length96% vs 5%step-by-step model versus one-pass rival on 24-operation programs, trained only up to 8 operations
Trained short, tested long8 → 24 operationstrained on programs up to 8 steps, still solved 24-step programs
Hidden internal state it was never trained on95% vs under 7%confidence on the exact correct set of hidden number-pairs: joint model versus both controls
Jump when internal steps reach program length26% → 98%answer accuracy on 8-step programs, before versus after enough internal steps
On this page
  1. Results at a glance
  2. Overview
  3. Report
    1. Abstract
    2. Lay Summary
    3. 1. Question
    4. 2. Task
    5. 3. Models
    6. 4. Metrics
    7. 5. Main Result
    8. 6. Query Types
    9. 7. Controls
    10. 8. Modulus-11 Diagnostic
    11. 9. Interpretation
    12. 10. Limits
    13. 11. Next Iterations
    14. 12. Reproducibility
    15. 13. Bottom Line
  4. Experiment log
  5. Figures
  6. Data files
  7. Reproduce
  8. Related

Results at a glance 7

Answer accuracy by program length: step-by-step model versus two simpler ones

How to read

Bars group by program length, 4 up to 24, with training only up to 8. Height is the share of confidence on the correct answer; taller is better. Three models: joint step-by-step, separate-memory, and one-pass.

0%25%50%75%100%99.3%48%46.9%length 498.2%32.3%27.2%length 897.3%22.4%13.1%length 1296.7%16.8%8.4%length 1696.2%12.1%5.1%length 24

Takeaway → The joint bars hold near 96% at every length while both others sink toward 5 to 12%, so only step-by-step execution survives past the training range.

Data table
program length (trained on lengths 1-8)joint recurrentmarginal recurrentstatic compiler
length 499.3%48%46.9%
length 898.2%32.3%27.2%
length 1297.3%22.4%13.1%
length 1696.7%16.8%8.4%
length 2496.2%12.1%5.1%

Numbers from analysis/summary.md (Modulus-31 Control Summary table; runs/*_mod31/results.json)

Technical framing

Query accuracy on held-out program lengths: joint belief state vs controls — Only the joint recurrent model keeps ~96%+ query accuracy out to length 24, three times its training length; both controls collapse.

Answer accuracy jumps when internal steps reach the program length

How to read

The horizontal axis is the number of internal steps allowed; the vertical axis is confidence on the correct answer, higher better. Each line is one program length, from 4 to 24.

0%50%100%150%01020

Takeaway → Every line stays near the floor, then leaps above 96% exactly when the step count reaches its own program length, the fingerprint of true step-by-step execution.

Data table
internal recurrent steps KL=4L=8L=12L=16L=24
034.4%18.9%11.3%7.6%5.5%
142.1%20.2%11.2%7%5.3%
251.4%22.9%11.7%7.6%4.7%
499.4%28.6%13.9%7.1%6.5%
899.4%98.5%25.4%11.1%5.8%
1299.4%98.5%97.8%21.6%6.3%
1699.4%98.5%97.8%97.1%10%
2499.4%98.5%97.8%97.1%96.5%

Numbers from analysis/summary.md (Final Metrics By Run, Joint recurrent p=31, query A; runs/main_joint_mod31/metrics_step01000.csv)

Technical framing

Execution threshold: query accuracy jumps exactly when step budget K reaches program length L — Accuracy stays near chance until K reaches program length L, then jumps above 96% — the signature of step-by-step latent execution.

The hidden internal state becomes accurate although nobody trained it

How to read

Bars group by program length, 4 to 24. Height is the confidence placed on the exact correct set of hidden number-pairs, an audit never used in training; higher is better. Three models compared.

0%25%50%75%100%98.3%4.2%6.3%length 497%3.9%2.6%length 896.1%3.1%0.7%length 1295.5%2.4%0.3%length 1695%1.8%0.2%length 24

Takeaway → The joint model holds around 95% on this untrained internal state while both others sit under 7%, proving it discovered the hidden pairs unprompted.

Data table
program lengthjoint recurrentmarginal recurrentstatic compiler
length 498.3%4.2%6.3%
length 897%3.9%2.6%
length 1296.1%3.1%0.7%
length 1695.5%2.4%0.3%
length 2495%1.8%0.2%

Numbers from analysis/summary.md (Modulus-31 Control Summary table; runs/*_mod31/results.json)

Technical framing

Hidden belief state becomes accurate without ever being supervised — Trained only on final query answers, the joint model still builds a near-exact (A,B) belief state; controls put under 7% mass on it.

All four question types work at the hardest length

How to read

Bars for four question types: each hidden number alone, their sum, and their difference, at the longest program with a full step budget. Two measures each, answer accuracy and hidden-state accuracy; higher is better.

0%25%50%75%100%96.5%94.9%A96.6%94.9%B95.7%94.9%A+B95.8%95.1%A-B

Takeaway → The sum and difference questions, which separate-memory models cannot answer, match the single-number questions near 96%, confirming genuine paired reasoning.

Data table
query typequery masshidden belief mass
A96.5%94.9%
B96.6%94.9%
A+B95.7%94.9%
A-B95.8%95.1%

Numbers from analysis/summary.md (Main Modulus-31 Per-Query Threshold Summary, length 24)

Technical framing

All four query types work at the execution threshold (length 24, K=24) — Relational queries A+B and A-B, which marginals cannot answer, match the direct register queries at the hardest held-out length.

The same step threshold appears in a separate smaller run

How to read

The horizontal axis is internal step count; the vertical axis is confidence on the correct answer, higher is better. One line per program length, 3 to 12, using a smaller number system.

0%25%50%75%100%125%0510Length 3Length 6Length 9Length 12

Takeaway → Each line jumps above 98% right when steps reach its own length, confirming the threshold is not a quirk of one setup.

Data table
Step budget KLength 3Length 6Length 9Length 12
046.7%29.2%21.8%17.4%
155.7%31.8%22.9%17.8%
270.1%36%24.2%18.2%
399.7%42.6%25.1%18.7%
699.7%99.4%36.7%22.3%
999.7%99.4%99.1%34.8%
1299.7%99.4%99.1%98.8%

Numbers from experiments/query_filter_executor/analysis/summary.md (Final Metrics By Run table, Joint recurrent p=11, query type A)

Technical framing

Threshold effect replicates at modulus 11 (pilot run) — The same K-equals-L jump appears in an independent pilot with a smaller modulus (11), so the threshold is not specific to modulus 31.

With too few steps, compound questions are hardest to guess

How to read

Bars group by program length, 4 to 24. Height is the best answer accuracy reachable while internal steps stay below the program length. Four question types: each number, their sum, their difference; taller means easier to fake.

0%20%40%60%48121624

Takeaway → Sum and difference bars sit below the single-number bars, and all collapse as programs lengthen, so compound questions cannot be faked without real execution.

Data table
Program lengthABA plus BA minus B
451.4%51.9%43.9%42.3%
828.6%29.9%22.1%23.4%
1225.4%23.9%13.3%14.3%
1621.6%20.5%11.1%10%
2410%9.8%6.2%5.7%

Numbers from experiments/query_filter_executor/analysis/summary.md (Main Modulus-31 Per-Query Threshold Summary table)

Technical framing

Below the threshold, compound queries are hardest to guess — With too few steps, single-variable queries stay easier to guess than compound ones, and all guessing collapses as programs get longer.

The later half of training mainly sharpens long programs

How to read

Bars group by program length, 4 to 24. Height is answer accuracy when internal steps equal the program length. Two snapshots: halfway through training and at the end; higher is better.

0%25%50%75%100%97.5%99.4%494.3%98.5%891.4%97.8%1289.2%97.1%1686.9%96.5%24

Takeaway → By the halfway mark short programs already peak; the second half almost entirely lifts the longest programs, from about 87% to 96%.

Data table
Program lengthMid-training (step 500)Final (step 1000)
497.5%99.4%
894.3%98.5%
1291.4%97.8%
1689.2%97.1%
2486.9%96.5%

Numbers from experiments/query_filter_executor/runs/main_joint_mod31/metrics_step00500.csv and metrics_step01000.csv (query type A rows with k equal to length)

Technical framing

The second half of training mainly sharpens long-program answers — By step 500 the model already answers at the execution threshold; steps 500 to 1000 mostly close the remaining gap on the longest programs.

In the author’s words from the Report · “Abstract”

Averaged across query types, query target mass at the first K>=L step is 99.3%, 98.2%, 97.3%, 96.7%, and 96.2% for lengths 4, 8, 12, 16, and 24. Hidden belief target mass, despite not being directly supervised, is 98.3%, 97.0%, 96.1%, 95.5%, and 95.0%. Marginal recurrent and static one-shot controls remain far lower on held-out lengths.

Overview

This experiment tests latent recurrent execution over correlated belief states when training supervision is limited to final query answers.

Contents

  • src/query_filter_executor_experiment.py: training and evaluation harness.
  • src/analyze_query_filter_executor.py: analysis and figure generation.
  • reports/query_filter_executor_paper.md: standalone writeup.
  • reports/query_filter_executor_paper.html: standalone HTML report.
  • reports/query_filter_executor_experiment_log.md: chronological experiment log.
  • runs/: JSON and CSV run outputs.
  • analysis/: generated summaries and figures.
  • checkpoint_manifest.csv: paths and sizes for saved checkpoints.

Checkpoints are written outside the experiment directory under:

../../large_artifacts/query_filter_executor/checkpoints/

Download this experiment directory for the normal research bundle. Download ../../large_artifacts/query_filter_executor/ only when saved model weights are needed.

Report

Rendered from reports/query_filter_executor_paper.md

A controlled experiment on recurrent hidden-state execution from final-answer supervision

Abstract

This experiment tests whether a latent recurrent runtime can learn an internal belief-state executor when training supervision is limited to final query answers. Each example starts with an unknown pair of modular registers constrained by B=A+d (mod p). A program applies arithmetic updates and observation filters. The model is trained only to answer a sampled final query: A, B, A+B, or A-B. The exact final belief distribution over (A,B) pairs is held out from the loss and used only as an audit.

The primary joint recurrent model stores a categorical distribution over register pairs and applies one learned update per internal step. On the scaled modulus-31 task, trained on program lengths 1-8 and evaluated on lengths 4, 8, 12, 16, and 24, it shows a sharp execution threshold. Averaged across query types, query target mass at the first K>=L step is 99.3%, 98.2%, 97.3%, 96.7%, and 96.2% for lengths 4, 8, 12, 16, and 24. Hidden belief target mass, despite not being directly supervised, is 98.3%, 97.0%, 96.1%, 95.5%, and 95.0%. Marginal recurrent and static one-shot controls remain far lower on held-out lengths.

Lay Summary

The model starts with a relation, not exact values:

B = A + d (mod p)

That relation describes many possible worlds. The program changes the registers and sometimes adds observations:

A = A + 7
observe B % 5 = 3
B = B - A
query A + B

Training only tells the model the final answer distribution for the query. It does not tell the model the full set of possible (A,B) pairs. The question is whether the model learns the hidden set anyway because doing so is the reusable way to answer many queries. In the joint recurrent model, it does.

1. Question

The experiment asks whether final-answer supervision can induce a latent recurrent belief-state executor.

The desired evidence has four parts:

  1. Query accuracy should depend on internal step budget K.
  2. The threshold should align with program length L: weak when K<L, strong when K>=L.
  3. Hidden belief mass should also rise, even though the full belief state is not directly supervised.
  4. Controls without joint state or without recurrent execution should fail on held-out lengths.

The setting is deliberately controlled. The target is not broad natural-language reasoning; it is a mechanistic test of whether query supervision can train reusable latent execution.

2. Task

Programs operate over two registers modulo p.

Initial belief:

{(A, B): B = A + d mod p}

For p=31, the full state space has 961 register pairs. The initial support contains 31 pairs.

Operations:

OperationMeaning
A=A+cadd a constant to A
A=A-csubtract a constant from A
B=B+cadd a constant to B
B=B-csubtract a constant from B
A=A+Badd B into A
B=B+Aadd A into B
A=A-Bsubtract B from A
B=B-Asubtract A from B
OBS_A_BUCKETfilter to states where A % m = r
OBS_B_BUCKETfilter to states where B % m = r

Observation residues are sampled from the live support, so every target support is non-empty. For the scaled run, p=31, observation modulus is 5, and each instruction is an observation with probability 0.3.

Each example samples one final query:

QueryTarget
Afinal distribution of A
Bfinal distribution of B
A_PLUS_Bfinal distribution of A+B mod p
A_MINUS_Bfinal distribution of A-B mod p

Training used lengths 1-8. Evaluation used lengths 4, 8, 12, 16, and 24. Lengths 12, 16, and 24 test length generalization.

3. Models

Joint Recurrent Query Filter

The primary model stores a categorical distribution over all (A,B) pairs. Each recurrent step reads the next instruction and applies the corresponding learned update. The final pair distribution is projected into the sampled query distribution, and the loss is cross-entropy on that query distribution only.

The full belief distribution is never used as a training target. It is measured afterward to see whether the model learned a coherent hidden state.

Marginal Recurrent Control

The marginal control follows the same recurrent schedule but stores separate distributions over A and B. It can learn some marginal query signal, but it cannot exactly represent pairwise correlations.

Static Compiler Control

The static control receives the initial relation and whole program, then predicts a final pair distribution in one pass with a small Transformer encoder. It has no recurrent execution axis.

4. Metrics

The primary metrics evaluate the sampled final query:

  • query_target_mass: total probability assigned to the exact query support.
  • query_top1_on_support: whether the most likely queried value is inside the exact query support.
  • query_target_nll: cross-entropy against the exact query distribution.

The audit metrics evaluate the full hidden belief state:

  • belief_target_mass: total pair probability assigned to the exact final (A,B) support.
  • belief_top1_on_support: whether the most likely pair is inside the exact support.
  • belief_target_nll: cross-entropy against the exact final pair distribution.

The hidden-belief metrics are not training objectives.

5. Main Result

The scaled modulus-31 joint recurrent query filter shows a clean execution threshold. Query mass is low when K<L, then jumps when K reaches program length.

Query top-1 heatmap

Query mass heatmap

The hidden belief audit shows the same threshold, even though the full belief state was not directly supervised.

Hidden belief mass heatmap

The K curves show the threshold by length.

Query mass K curves

Hidden belief mass K curves

Numerically, averaged across query types:

Program lengthBest query mass when K<LBest hidden belief mass when K<LFirst K>=LQuery mass at first K>=LHidden belief mass at first K>=LQuery top-1
447.4%14.1%499.3%98.3%100.0%
826.0%4.1%898.2%97.0%100.0%
1219.2%3.5%1297.3%96.1%100.0%
1615.8%3.1%1696.7%95.5%100.0%
247.6%0.4%2496.2%95.0%100.0%

The held-out lengths are the critical evidence. The model was trained only on lengths up to 8, but it executes lengths 12, 16, and 24 when given enough recurrent steps.

6. Query Types

All four query types work at the execution threshold. At length 24:

QueryQuery mass at K=24Hidden belief mass at K=24
A96.5%94.9%
A_MINUS_B95.8%95.1%
A_PLUS_B95.7%94.9%
B96.6%94.9%

Relational queries are important because they are harder to answer from independent marginals. The joint model solves them along with the direct A and B queries.

7. Controls

The scaled controls show that the result is not explained by shallow query fitting or one-shot compilation.

Control query mass

Control hidden belief mass

At modulus 31, averaged across query types:

ModelL=4 queryL=8 queryL=12 queryL=16 queryL=24 query
Joint recurrent99.3%98.2%97.3%96.7%96.2%
Marginal recurrent48.0%32.3%22.4%16.8%12.1%
Static compiler46.9%27.2%13.1%8.4%5.1%

Hidden belief target mass separates the models even more sharply:

ModelL=4 beliefL=8 beliefL=12 beliefL=16 beliefL=24 belief
Joint recurrent98.3%97.0%96.1%95.5%95.0%
Marginal recurrent4.2%3.9%3.1%2.4%1.8%
Static compiler6.3%2.6%0.7%0.3%0.2%

The marginal control has recurrence but lacks joint state. The static compiler sees the whole program but lacks recurrent execution. Neither recovers the executor signature.

8. Modulus-11 Diagnostic

A smaller modulus-11 diagnostic used the same query-supervised task with training lengths 1-6 and evaluation lengths 3, 6, 9, and 12. The joint recurrent model reached 98.5-99.7% query mass and 98.0-99.2% hidden belief mass at K=L. The marginal and static controls stayed far lower, especially on held-out lengths. This diagnostic confirmed the training objective before the scaled run.

9. Interpretation

The result supports a specific mechanism claim:

Final query supervision can train a latent recurrent runtime to form and execute a coherent joint belief state when that state is the reusable structure needed to answer varied queries.

The strongest evidence is not just high final accuracy. It is the combination of:

  1. a sharp K=L threshold,
  2. length generalization beyond the training range,
  3. high hidden-belief mass without direct belief supervision,
  4. failure of marginal and static controls.

This is a stronger test than training directly on full belief states. The hidden state is useful enough that the model discovers it under a lower-bandwidth objective.

10. Limits

This is still a structured setting.

  • The joint model stores an explicit categorical distribution over (A,B).
  • The runtime uses a direct program counter.
  • The operation family is modular arithmetic plus bucket observations.
  • The largest completed state space has 961 pairs.
  • Query supervision is exact; it is not noisy natural-language feedback.

The experiment shows that query-only supervision can induce the intended latent state when the architecture can represent it. It does not show that an unstructured hidden vector would discover the same state without architectural support.

11. Next Iterations

Useful next tests:

  1. Replace the explicit categorical state with a dense latent state and probe how much belief structure remains.
  2. Replace the direct program counter with attention over instruction tokens.
  3. Add a learned halt/no-op policy so the model chooses its compute budget.
  4. Train on sparse scalar rewards or sampled query values instead of exact query distributions.
  5. Increase modulus and state size while tracking memory and runtime scaling.

12. Reproducibility

Primary files:

  • Experiment script: ../src/query_filter_executor_experiment.py
  • Analysis script: ../src/analyze_query_filter_executor.py
  • Experiment log: query_filter_executor_experiment_log.md
  • Results directory: ../runs/
  • Analysis directory: ../analysis/
  • Checkpoint manifest: ../checkpoint_manifest.csv

Key run directories:

  • ../runs/main_joint_mod31
  • ../runs/control_marginal_mod31
  • ../runs/control_static_mod31
  • ../runs/pilot_joint_mod11
  • ../runs/control_marginal_mod11
  • ../runs/control_static_mod11

Large checkpoint files are stored outside the experiment bundle under:

../../../large_artifacts/query_filter_executor/checkpoints/

Environment:

  • Python 3.12.3
  • PyTorch 2.8.0+cu128
  • GPU: NVIDIA RTX 6000 Ada Generation

13. Bottom Line

The joint recurrent query filter learned to execute arithmetic and observation-filter programs from final-query supervision alone. It generalized from training lengths 1-8 to lengths 12, 16, and 24, with a sharp improvement when K reached L. The hidden belief state became accurate even though it was not directly supervised. The marginal and static controls failed on the scaled task.

Experiment log 15

Show the running log (15 entries)

Objective

Test whether a latent recurrent runtime can learn to execute arithmetic and observation-filter programs when it is trained only from final query distributions, not from dense belief-state supervision.

The hidden state is still evaluated as a full belief distribution over (A, B) pairs, but the training loss only asks the model to answer one query about the final state:

  • A
  • B
  • A+B mod p
  • A-B mod p

Hypothesis

If final-query supervision is sufficient to induce a reusable latent executor, then:

  1. Query accuracy and query target mass should be low when K < L and high when K >= L.
  2. The threshold should generalize to held-out lengths longer than training.
  3. The latent belief state should become coherent even though it is not directly supervised.
  4. A marginal recurrent control should be weaker, especially on relational queries.
  5. A static one-shot compiler should not reproduce the same length-generalizing K threshold.

Task

Initial belief:

B = A + d (mod p), with A unknown

Programs contain:

  • arithmetic updates over A and B
  • observation filters of the form A % m = r
  • observation filters of the form B % m = r

Observation residues are sampled from the current support, so the target support is never empty.

Each example samples one final query type. The query target is the exact distribution of the queried value under the final belief state.

Models

Joint Query Filter

The primary model stores a categorical distribution over all (A,B) pairs. At each recurrent step, it applies the next learned arithmetic transition or learned observation likelihood, then normalizes the belief state. Training loss is computed only after projecting the final pair distribution into the sampled query distribution.

Marginal Query Filter Control

The marginal control stores separate distributions over A and B. It can answer some marginal queries but cannot exactly preserve pairwise correlations.

Static Query Compiler Control

The static control receives the initial relation and whole program, then predicts a final pair distribution in one pass. It is trained through the same final query loss.

Planned Sequence

  1. Smoke test at tiny modulus.
  2. Pilot joint query filter at small modulus.
  3. Matched marginal and static controls at small modulus.
  4. Main scaled run at modulus 31.
  5. Matched scaled controls.
  6. Aggregate metrics, generate figures, and write a standalone report.

Smoke Test

Run: ../runs/smoke_joint_mod7

Command:

python experiments/query_filter_executor/src/query_filter_executor_experiment.py --mode joint --modulus 7 --observe_mod 3 --observe_prob 0.4 --train_max_len 3 --eval_lengths 2,3 --eval_k 0,1,2,3 --eval_query_types all --train_steps 2 --batch_size 16 --eval_batch_size 16 --eval_examples 32 --log_every 1 --eval_every 1 --lr 0.01 --output_dir experiments/query_filter_executor/runs/smoke_joint_mod7 --checkpoint_dir large_artifacts/query_filter_executor/checkpoints/smoke_joint_mod7

Result: the script compiled, trained, evaluated all query types, wrote metrics, and saved checkpoints under ../../../large_artifacts/query_filter_executor/checkpoints/smoke_joint_mod7.

Interpretation: query targets, query projection, hidden-belief audit metrics, evaluation aggregation, and separated checkpoint writing are functional. The run is intentionally too short to test learning.

Pilot 1: Joint Query Filter, Modulus 11

Run: ../runs/pilot_joint_mod11

Command:

python experiments/query_filter_executor/src/query_filter_executor_experiment.py --mode joint --modulus 11 --observe_mod 4 --observe_prob 0.3 --train_max_len 6 --eval_lengths 3,6,9,12 --eval_k 0,1,2,3,6,9,12 --eval_query_types all --train_steps 800 --batch_size 512 --eval_batch_size 512 --eval_examples 512 --log_every 50 --eval_every 400 --lr 0.03 --output_dir experiments/query_filter_executor/runs/pilot_joint_mod11 --checkpoint_dir large_artifacts/query_filter_executor/checkpoints/pilot_joint_mod11

Result at step 800:

  • L=3: at K=3, all query types reached 100% top-1-on-support, 99.6-99.7% query target mass, and 99.2% hidden belief target mass.
  • L=6: at K=6, all query types reached 100% top-1-on-support, 99.1-99.4% query target mass, and 98.6-98.7% hidden belief target mass.
  • L=9: at K=9, all query types reached 100% top-1-on-support, 98.7-99.1% query target mass, and 98.3% hidden belief target mass.
  • L=12: at K=12, all query types reached 100% top-1-on-support, 98.5-98.9% query target mass, and 98.0-98.1% hidden belief target mass.

For K<L, query target mass stayed far lower and hidden belief mass stayed low. This is a positive result: final-query supervision induced a coherent latent belief state.

Control 1: Marginal Query Filter, Modulus 11

Run: ../runs/control_marginal_mod11

Command:

python experiments/query_filter_executor/src/query_filter_executor_experiment.py --mode marginal --modulus 11 --observe_mod 4 --observe_prob 0.3 --train_max_len 6 --eval_lengths 3,6,9,12 --eval_k 0,1,2,3,6,9,12 --eval_query_types all --train_steps 800 --batch_size 512 --eval_batch_size 512 --eval_examples 512 --log_every 100 --eval_every 800 --lr 0.03 --output_dir experiments/query_filter_executor/runs/control_marginal_mod11 --checkpoint_dir large_artifacts/query_filter_executor/checkpoints/control_marginal_mod11

Result at step 800:

  • L=3: at K=3, query target mass reached 47.3-66.0%; hidden belief mass was 10.5-11.3%.
  • L=6: at K=6, query target mass reached 35.6-52.0%; hidden belief mass was 11.2-11.5%.
  • L=9: at K=9, query target mass reached 28.2-43.3%; hidden belief mass was 10.1-11.3%.
  • L=12: at K=12, query target mass reached 23.6-38.3%; hidden belief mass was 9.3-10.7%.

Interpretation: the marginal model learns some query signal but does not recover a coherent joint belief state.

Control 2: Static Query Compiler, Modulus 11

Run: ../runs/control_static_mod11

Command:

python experiments/query_filter_executor/src/query_filter_executor_experiment.py --mode static --modulus 11 --observe_mod 4 --observe_prob 0.3 --train_max_len 6 --eval_lengths 3,6,9,12 --eval_k 0,1,2,3,6,9,12 --eval_query_types all --train_steps 800 --batch_size 512 --eval_batch_size 512 --eval_examples 512 --log_every 100 --eval_every 800 --lr 0.001 --dim 128 --heads 4 --compiler_layers 2 --output_dir experiments/query_filter_executor/runs/control_static_mod11 --checkpoint_dir large_artifacts/query_filter_executor/checkpoints/control_static_mod11

Result at step 800:

  • L=3: query target mass reached 52.6-65.9%; hidden belief mass was 16.0-18.5%.
  • L=6: query target mass reached 33.3-45.5%; hidden belief mass was 8.5-9.3%.
  • L=9: query target mass reached 22.0-28.6%; hidden belief mass was 3.5-3.7%.
  • L=12: query target mass reached 17.2-19.1%; hidden belief mass was 2.1-2.5%.

Interpretation: the static compiler learns short-length signal but does not length-generalize and does not recover a coherent final belief state.

Main Run: Joint Query Filter, Modulus 31

Run: ../runs/main_joint_mod31

Command:

python experiments/query_filter_executor/src/query_filter_executor_experiment.py --mode joint --modulus 31 --observe_mod 5 --observe_prob 0.3 --train_max_len 8 --eval_lengths 4,8,12,16,24 --eval_k 0,1,2,4,8,12,16,24 --eval_query_types all --train_steps 1000 --batch_size 512 --eval_batch_size 512 --eval_examples 512 --log_every 50 --eval_every 500 --lr 0.03 --output_dir experiments/query_filter_executor/runs/main_joint_mod31 --checkpoint_dir large_artifacts/query_filter_executor/checkpoints/main_joint_mod31

Status: complete.

Interim result at step 500:

  • L=4: at K=4, all query types reached 100% top-1-on-support, 96.4-97.9% query target mass, and 93.5-93.6% hidden belief target mass.
  • L=8: at K=8, all query types reached 100% top-1-on-support, 92.3-94.6% query target mass, and 88.8-89.0% hidden belief target mass.
  • L=12: at K=12, all query types reached 100% top-1-on-support, 88.7-91.4% query target mass, and 85.1-85.9% hidden belief target mass.
  • L=16: at K=16, all query types reached 100% top-1-on-support, 86.5-89.2% query target mass, and 83.2-83.9% hidden belief target mass.
  • L=24: at K=24, all query types reached 100% top-1-on-support, 83.8-86.9% query target mass, and 81.1-81.8% hidden belief target mass.

For K<L, query and hidden-belief mass stayed much lower. This interim result already shows length-generalizing recurrent execution under query-only supervision.

Final result at step 1000:

  • L=4: at K=4, all query types reached 100% top-1-on-support, 99.1-99.4% query target mass, and 98.3% hidden belief target mass.
  • L=8: at K=8, all query types reached 100% top-1-on-support, 97.9-98.5% query target mass, and 97.0% hidden belief target mass.
  • L=12: at K=12, all query types reached 100% top-1-on-support, 96.8-97.8% query target mass, and 96.0-96.2% hidden belief target mass.
  • L=16: at K=16, all query types reached 100% top-1-on-support, 96.4-97.1% query target mass, and 95.4-95.6% hidden belief target mass.
  • L=24: at K=24, all query types reached 100% top-1-on-support, 95.7-96.6% query target mass, and 94.9-95.1% hidden belief target mass.

For K<L, the final run preserved the sharp threshold: long programs remained near baseline until the recurrent budget reached the program length.

Scaled Control: Marginal Query Filter, Modulus 31

Run: ../runs/control_marginal_mod31

Command:

python experiments/query_filter_executor/src/query_filter_executor_experiment.py --mode marginal --modulus 31 --observe_mod 5 --observe_prob 0.3 --train_max_len 8 --eval_lengths 4,8,12,16,24 --eval_k 0,1,2,4,8,12,16,24 --eval_query_types all --train_steps 1000 --batch_size 512 --eval_batch_size 512 --eval_examples 512 --log_every 100 --eval_every 1000 --lr 0.03 --output_dir experiments/query_filter_executor/runs/control_marginal_mod31 --checkpoint_dir large_artifacts/query_filter_executor/checkpoints/control_marginal_mod31

Status: complete.

Result at step 1000:

  • L=4: at K=4, query target mass reached 37.0-57.7%; hidden belief mass was 4.0-4.5%.
  • L=8: at K=8, query target mass reached 26.2-39.4%; hidden belief mass was 3.7-4.1%.
  • L=12: at K=12, query target mass reached 17.0-27.9%; hidden belief mass was 2.9-3.2%.
  • L=16: at K=16, query target mass reached 12.5-21.1%; hidden belief mass was 2.3-2.5%.
  • L=24: at K=24, query target mass reached 8.5-15.7%; hidden belief mass was 1.6-2.1%.

Interpretation: the marginal control answers some easy marginal signal but does not recover the joint state and does not approach the joint recurrent model on held-out lengths.

Scaled Control: Static Query Compiler, Modulus 31

Run: ../runs/control_static_mod31

Command:

python experiments/query_filter_executor/src/query_filter_executor_experiment.py --mode static --modulus 31 --observe_mod 5 --observe_prob 0.3 --train_max_len 8 --eval_lengths 4,8,12,16,24 --eval_k 0,1,2,4,8,12,16,24 --eval_query_types all --train_steps 1000 --batch_size 512 --eval_batch_size 512 --eval_examples 512 --log_every 100 --eval_every 1000 --lr 0.001 --dim 128 --heads 4 --compiler_layers 2 --output_dir experiments/query_filter_executor/runs/control_static_mod31 --checkpoint_dir large_artifacts/query_filter_executor/checkpoints/control_static_mod31

Status: complete.

Result at step 1000:

  • L=4: query target mass reached 38.1-53.9%; hidden belief mass was 6.0-6.7%.
  • L=8: query target mass reached 23.2-32.9%; hidden belief mass was 2.4-2.9%.
  • L=12: query target mass reached 11.7-14.7%; hidden belief mass was 0.7-0.8%.
  • L=16: query target mass reached 8.1-9.1%; hidden belief mass was 0.3-0.4%.
  • L=24: query target mass reached 4.9-5.4%; hidden belief mass was 0.2%.

Interpretation: the static compiler learns some short-length signal but collapses on longer programs and does not recover the latent belief state.

Figures 7

mod31 belief mass heatmap
mod31 belief mass heatmap · analysis/figures/
mod31 belief mass k curves
mod31 belief mass k curves · analysis/figures/
mod31 controls belief mass
mod31 controls belief mass · analysis/figures/
mod31 controls query mass
mod31 controls query mass · analysis/figures/
mod31 query mass heatmap
mod31 query mass heatmap · analysis/figures/
mod31 query mass k curves
mod31 query mass k curves · analysis/figures/
mod31 query top1 heatmap
mod31 query top1 heatmap · analysis/figures/

Data files 23

Result tables and metrics copied from the experiment folder — preview inline or open the raw file.

Reproduce

The run commands are documented inside the experiment folder (see the README).

Browse the experiment folder on GitHub ↗