Sampled Query Filter Executor Experiment
The one idea you need
Two unknown numbers sit locked a fixed distance apart. A short program nudges them and drops clues that rule out combinations. To answer any question the model must track every still-possible pair of numbers, though it is graded on just one guessed final answer per problem.
The question
If you only ever grade a model on one possible answer per practice problem, can it still learn the full hidden set of possibilities behind every answer?
What we found
Yes. Graded on just one sampled final answer per problem, the model rebuilt the entire set of still-possible number pairs it was never shown, capturing 94 to 98 percent of it, because holding that full set is the cheapest way to answer varied questions. Simpler models that tracked each number separately, or skipped step-by-step execution, stayed under 6 percent.
Why it matters
When every answer in a task shares one hidden structure, you can supervise only final answers and let the model build that structure itself, but only if its design can hold the correlated whole rather than separate pieces, and you allow enough internal steps.
On this page
Results at a glance 6
How to read
Bars group by program length (4 to 24; models trained only up to 8). Height is probability placed on the correct answer, higher is better. Three bars per length: the full joint tracker, a separate-numbers tracker, and a one-shot no-steps model.
Takeaway → The full tracker holds above 95 percent even at three times the training length, while both simpler models collapse toward 5 to 12 percent.
Data table
| program length (trained on lengths 1-8) | joint recurrent | marginal recurrent | static one-shot |
|---|---|---|---|
| length 4 | 99.1% | 47% | 45.4% |
| length 8 | 97.8% | 30.8% | 25.7% |
| length 12 | 96.6% | 22.5% | 13.3% |
| length 16 | 95.8% | 16.5% | 8.2% |
| length 24 | 95.1% | 11.8% | 5.2% |
Numbers from analysis/mod31_control_summary.csv (also analysis/summary.md control table)
Technical framing
Answer accuracy on held-out program lengths: joint recurrent vs controls (mod 31) — With enough internal steps, the joint recurrent model stays above 95% even at 3x training length; both controls collapse.
How to read
The horizontal axis is the number of internal thinking steps allowed; the vertical axis is probability on the correct answer, higher is better. Each line is one program length (4, 8, 12, 16, 24).
Takeaway → Every line stays flat and low until the steps reach its own program length, then snaps up to 95 to 99 percent, the signature of genuine step-by-step execution.
Data table
| internal recurrent steps K | length 4 | length 8 | length 12 | length 16 | length 24 |
|---|---|---|---|---|---|
| 0 | 35.8% | 19.8% | 11.7% | 8% | 5.4% |
| 1 | 39.1% | 20.7% | 12.3% | 7.7% | 5.8% |
| 2 | 45.9% | 21.5% | 12.3% | 7.9% | 5% |
| 4 | 99.1% | 25.5% | 12.6% | 8.3% | 5.8% |
| 8 | 99.1% | 97.8% | 18.5% | 9.4% | 5.2% |
| 12 | 99.1% | 97.8% | 96.6% | 16.6% | 5.3% |
| 16 | 99.1% | 97.8% | 96.6% | 95.8% | 7.3% |
| 24 | 99.1% | 97.8% | 96.6% | 95.8% | 95.1% |
Numbers from analysis/final_metrics_query_mean.csv (main_joint_mod31, step 1500, mean over query types)
Technical framing
Sharp compute threshold: accuracy jumps exactly when internal steps reach program length — Accuracy stays low until K reaches the program length L, then snaps to ~95-99% -- evidence of step-by-step latent execution.
How to read
Bars group by program length; height is probability placed on the true set of still-possible number pairs, which was withheld from training entirely. Higher is better. Three bars each: full joint tracker, separate-numbers tracker, one-shot model.
Takeaway → The joint tracker recovers 94 to 98 percent of a hidden set it was never taught, while both simpler models stay under 6 percent.
Data table
| program length | joint recurrent | marginal recurrent | static one-shot |
|---|---|---|---|
| length 4 | 97.8% | 4.1% | 5.3% |
| length 8 | 96.2% | 3.4% | 2.2% |
| length 12 | 95.1% | 2.9% | 0.7% |
| length 16 | 94.4% | 2.3% | 0.3% |
| length 24 | 93.7% | 1.6% | 0.2% |
Numbers from analysis/mod31_control_summary.csv (belief_target_mass column)
Technical framing
Hidden belief state is learned without ever being supervised (mod 31, K >= L) — The full (A,B) belief distribution was withheld from the loss, yet the joint model recovers 94-98% of its mass; controls stay under 6%.
How to read
Bars group by unseen program length; height is answer accuracy once internal steps reach program length, higher is better. Four bars per length, one per question type: first number, second number, their sum, and their difference.
Takeaway → No question type lags: even the harder sum and difference questions stay above 94 percent, so the model holds a genuinely joint state, not two separate ones.
Data table
| Held-out program length | Query A | Query B | Query A+B | Query A-B |
|---|---|---|---|---|
| Length 4 | 99.3% | 99.2% | 98.9% | 98.8% |
| Length 8 | 98.2% | 98.1% | 97.3% | 97.4% |
| Length 12 | 97.1% | 97% | 96.2% | 96.2% |
| Length 16 | 96.4% | 96.4% | 95.4% | 95.2% |
| Length 24 | 95.6% | 95.6% | 94.8% | 94.7% |
Numbers from experiments/sampled_query_filter_executor/analysis/mod31_per_query_threshold_summary.csv
Technical framing
Accuracy at the compute threshold holds across all four query types (mod 31) — No query family lags: single-variable and compound (A+B, A-B) queries all exceed 94% mass once internal steps reach program length.
How to read
The horizontal axis is training step; the vertical axis is probability on the correct target, higher is better. One line is the graded answer accuracy, the other the never-graded hidden set-of-pairs accuracy.
Takeaway → The hidden line starts near 3 percent while the graded answer sits at 39 percent, then both climb and converge near 98 percent, hidden structure trailing the reward by roughly 200 steps.
Data table
| Training step | Query answer mass (supervised) | Hidden belief mass (never supervised) |
|---|---|---|
| 1 | 39.3% | 2.5% |
| 50 | 40.5% | 6.7% |
| 100 | 48.8% | 11.2% |
| 150 | 51.7% | 12.7% |
| 200 | 51.4% | 15% |
| 250 | 59% | 18.9% |
| 300 | 61.3% | 28.4% |
| 350 | 69.4% | 40.9% |
| 400 | 76.2% | 54.9% |
| 450 | 84.1% | 66.8% |
| 500 | 88% | 74.6% |
| 550 | 89.3% | 80.2% |
| 600 | 92.7% | 85.1% |
| 650 | 94.2% | 88% |
| 700 | 94.8% | 89.6% |
| 750 | 95.2% | 90.6% |
| 800 | 96.1% | 92.6% |
| 850 | 96.7% | 93.1% |
| 900 | 96.8% | 93.6% |
| 950 | 97.1% | 94.6% |
| 1000 | 97.6% | 95% |
| 1050 | 97.9% | 95.4% |
| 1100 | 98% | 95.7% |
| 1150 | 98.2% | 96.3% |
| 1200 | 98.4% | 96.7% |
| 1250 | 98.2% | 96.7% |
| 1300 | 98.5% | 96.9% |
| 1350 | 98.7% | 97.3% |
| 1400 | 98.8% | 97.5% |
| 1450 | 98.8% | 97.6% |
| 1500 | 98.9% | 97.7% |
Numbers from experiments/sampled_query_filter_executor/runs/main_joint_mod31/results.json
Technical framing
Belief-state accuracy rises during training despite never being supervised (mod 31) — Belief mass lags query mass early (2.5% vs 39% at step 1) then converges to 98%, tracking the supervised signal with a delay of ~200 steps.
How to read
Bars group by program length in an independent smaller-number version of the task; height is answer accuracy at a fixed internal-step budget, higher is better. Three bars each: full joint tracker and two simpler controls.
Takeaway → The joint tracker holds near 99 percent at every length while both controls decay below 31 percent, so the result is not a fluke of one problem size.
Data table
| Held-out program length | Joint recurrent p=11 | Marginal recurrent p=11 | Static p=11 |
|---|---|---|---|
| Length 3 | 99.7% | 56.3% | 58.6% |
| Length 6 | 99.3% | 44.4% | 39.3% |
| Length 9 | 99% | 35.9% | 24.3% |
| Length 12 | 98.8% | 30.4% | 17.5% |
Numbers from experiments/sampled_query_filter_executor/analysis/final_metrics_query_mean.csv
Technical framing
Modulus-11 pilot replicates the mod-31 result: joint recurrent beats both controls — In the independent mod-11 pilot the joint model stays near 99% at every length while marginal and static controls decay below 31%.
In the author’s words from the Report · “Abstract”
Averaged across query types, exact query target mass at the first K>=L step is 99.1%, 97.8%, 96.6%, 95.8%, and 95.1% for lengths 4, 8, 12, 16, and 24. Hidden belief target mass is 97.8%, 96.2%, 95.1%, 94.4%, and 93.7%, despite never being directly supervised. Marginal recurrent and static one-shot controls remain far lower.
Overview
This experiment tests latent recurrent execution over correlated belief states when training supervision is limited to one sampled final query value per example.
Contents
src/sampled_query_filter_executor_experiment.py: training and evaluation harness.src/analyze_sampled_query_filter_executor.py: analysis and figure generation.reports/sampled_query_filter_executor_paper.md: standalone writeup.reports/sampled_query_filter_executor_paper.html: standalone HTML report.reports/sampled_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/sampled_query_filter_executor/checkpoints/Download this experiment directory for the normal research bundle. Download ../../large_artifacts/sampled_query_filter_executor/ only when saved model weights are needed.
Report
Rendered from reports/sampled_query_filter_executor_paper.md
A controlled experiment on whether one sampled final query value can train hidden-state execution
Abstract
This experiment tests whether a latent recurrent runtime can learn an internal belief-state executor when each training example provides only one sampled final query value. 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 receives a query type such as A, B, A+B, or A-B, and the loss is ordinary cross-entropy on one value sampled from the exact final query distribution.
The full final query distribution and the full final belief distribution over (A,B) pairs are withheld from the loss. They are used only for evaluation. On the scaled modulus-31 task, trained on program lengths 1-8 and evaluated on lengths 4, 8, 12, 16, and 24, the joint recurrent model shows a sharp compute threshold. Averaged across query types, exact query target mass at the first K>=L step is 99.1%, 97.8%, 96.6%, 95.8%, and 95.1% for lengths 4, 8, 12, 16, and 24. Hidden belief target mass is 97.8%, 96.2%, 95.1%, 94.4%, and 93.7%, despite never being directly supervised. Marginal recurrent and static one-shot controls remain far lower.
Lay Summary
The model starts from partial knowledge:
B = A + d (mod p)This relation describes many possible worlds. A program then changes the registers and sometimes filters the possible worlds:
A = A + 7
observe B % 5 = 3
B = B - A
query A + BTraining gives the model only one sampled answer value for the final query. It is not told the full answer distribution, and it is not told the full set of possible (A,B) pairs. The question is whether the model learns the hidden set anyway because that hidden set is the reusable structure needed to answer many sampled queries. In the joint recurrent model, it does.
1. Question
The experiment asks whether sampled-answer supervision can induce a latent recurrent belief-state executor.
The target evidence has five parts:
- Query quality should depend on internal step budget
K. - The threshold should align with program length
L: weak whenK<L, strong whenK>=L. - The threshold should hold on lengths longer than training.
- Hidden belief mass should rise even though the full belief state is not directly supervised.
- Controls without joint state or without recurrent execution should fail on held-out lengths.
The setting is deliberately controlled. It is a mechanistic test of whether low-bandwidth final-answer 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:
| Operation | Meaning |
|---|---|
A=A+c | add a constant to A |
A=A-c | subtract a constant from A |
B=B+c | add a constant to B |
B=B-c | subtract a constant from B |
A=A+B | add B into A |
B=B+A | add A into B |
A=A-B | subtract B from A |
B=B-A | subtract A from B |
OBS_A_BUCKET | filter to states where A % m = r |
OBS_B_BUCKET | filter 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 type:
| Query | Distribution being sampled |
|---|---|
A | final distribution of A |
B | final distribution of B |
A_PLUS_B | final distribution of A+B mod p |
A_MINUS_B | final distribution of A-B mod p |
The training label is one value sampled from that exact query distribution. The model is trained with one-label cross-entropy. Evaluation still computes the exact final query distribution and exact final belief distribution.
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 Sampled-Query Filter
The primary model stores a categorical distribution over all (A,B) pairs. Each recurrent step reads the next instruction and applies a learned arithmetic transition or learned observation likelihood. The final pair distribution is projected into the selected query distribution, and the loss scores one sampled query value.
The full belief distribution is never used as a training target. It is measured afterward to test whether the model learned a coherent hidden state.
Marginal Sampled-Query Control
The marginal control follows the same recurrent schedule but stores separate distributions over A and B. It can learn some sampled-query signal, but it cannot exactly represent pairwise correlations.
Static Sampled-Query 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 exact final query distribution:
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 sampled-query filter shows a clean execution threshold. Query mass is low when K<L, then jumps when K reaches program length.


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

The K curves show the threshold by length.


Numerically, averaged across query types:
| Program length | Best query mass when K<L | Best hidden belief mass when K<L | First K>=L | Query mass at first K>=L | Hidden belief mass at first K>=L | Query top-1 |
|---|---|---|---|---|---|---|
| 4 | 45.9% | 13.8% | 4 | 99.1% | 97.8% | 100.0% |
| 8 | 25.5% | 4.0% | 8 | 97.8% | 96.2% | 100.0% |
| 12 | 18.5% | 3.2% | 12 | 96.6% | 95.1% | 100.0% |
| 16 | 16.6% | 4.1% | 16 | 95.8% | 94.4% | 100.0% |
| 24 | 7.3% | 0.8% | 24 | 95.1% | 93.7% | 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:
| Query | Query mass at K=24 | Hidden belief mass at K=24 |
|---|---|---|
A | 95.6% | 93.7% |
A_MINUS_B | 94.7% | 93.7% |
A_PLUS_B | 94.8% | 93.8% |
B | 95.6% | 93.6% |
Relational queries matter 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 sampled-label fitting or one-shot compilation.


At modulus 31, averaged across query types:
| Model | L=4 query | L=8 query | L=12 query | L=16 query | L=24 query |
|---|---|---|---|---|---|
| Joint recurrent | 99.1% | 97.8% | 96.6% | 95.8% | 95.1% |
| Marginal recurrent | 47.0% | 30.8% | 22.5% | 16.5% | 11.8% |
| Static compiler | 45.4% | 25.7% | 13.3% | 8.2% | 5.2% |
Hidden belief target mass separates the models even more sharply:
| Model | L=4 belief | L=8 belief | L=12 belief | L=16 belief | L=24 belief |
|---|---|---|---|---|---|
| Joint recurrent | 97.8% | 96.2% | 95.1% | 94.4% | 93.7% |
| Marginal recurrent | 4.1% | 3.4% | 2.9% | 2.3% | 1.6% |
| Static compiler | 5.3% | 2.2% | 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 training lengths 1-6 and evaluation lengths 3, 6, 9, and 12. The joint recurrent model reached 98.6-99.7% query mass and 98.2-99.3% hidden belief mass at K=L. The marginal and static controls stayed far lower, especially on held-out lengths. This diagnostic checks that the sampled-answer objective works before scaling the state space to modulus 31.
9. Interpretation
The result supports a specific mechanism claim:
One sampled final query value per example 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 the combination of:
- a sharp
K=Lthreshold, - length generalization beyond the training range,
- high hidden-belief mass without direct belief supervision,
- failure of marginal and static controls.
The experiment is stronger than training directly on full belief states. The model is rewarded only for one sampled answer value, yet the audited hidden state becomes a high-quality approximation to the full final belief.
10. Limits
This is still a structured setting.
- The joint model stores an explicit categorical state over
(A,B)pairs. - The runtime uses a direct program counter.
- The operation family is modular arithmetic plus bucket observations.
- The largest completed state space has 961 pairs.
- Supervision is an exact sample from an exact query distribution, not noisy natural-language feedback.
The experiment shows that sampled-answer 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 Tests
Useful next tests:
- Replace the explicit categorical state with a dense latent state and probe how much belief structure remains.
- Replace the direct program counter with attention over instruction tokens.
- Add a learned halt/no-op policy so the model chooses its compute budget.
- Train with noisy sampled labels and measure robustness.
- Increase modulus and state size while tracking memory and runtime scaling.
12. Reproducibility
Primary files:
- Experiment script:
../src/sampled_query_filter_executor_experiment.py - Analysis script:
../src/analyze_sampled_query_filter_executor.py - Experiment log:
sampled_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/sampled_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 sampled-query filter learned to execute arithmetic and observation-filter programs from one sampled final answer value per example. 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 arithmetic and observation-filter execution when each training example provides only one sampled final query value, not the full final query distribution and not the full belief state.
The hidden state is evaluated against the exact final belief distribution over (A, B) pairs, but the training loss only observes a single sampled value for one query:
ABA+B mod pA-B mod p
Hypothesis
If sampled-value supervision is sufficient to induce a reusable latent executor, then:
- Query performance should improve sharply when
K >= L. - The threshold should generalize to held-out lengths longer than training.
- Hidden belief mass should rise even though the model never sees full belief targets.
- A marginal recurrent control should be weaker because it cannot represent pairwise correlations.
- A static one-shot compiler should not reproduce the same length-generalizing K threshold.
Task
Initial belief:
B = A + d (mod p), with A unknownPrograms contain:
- arithmetic updates over
AandB - 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 and one answer value from the exact final query distribution. The model is trained with ordinary one-label cross-entropy on that sampled value. Evaluation still uses exact query distributions and exact hidden belief states.
Models
Joint Sampled-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 and scoring the sampled answer value.
Marginal Sampled-Query Control
The marginal control stores separate distributions over A and B. It can learn some marginal answer signal but cannot exactly preserve pairwise correlations.
Static Sampled-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 sampled-value query loss.
Planned Sequence
- Smoke test at tiny modulus.
- Pilot joint sampled-query filter at small modulus.
- Matched marginal and static controls at small modulus.
- Main scaled run at modulus 31.
- Matched scaled controls.
- Aggregate metrics, generate figures, and write a standalone report.
Smoke Test
Run: ../runs/smoke_joint_mod7
Command:
python experiments/sampled_query_filter_executor/src/sampled_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/sampled_query_filter_executor/runs/smoke_joint_mod7 --checkpoint_dir large_artifacts/sampled_query_filter_executor/checkpoints/smoke_joint_mod7Status: complete.
Result: the script compiled, trained with sampled query labels, evaluated exact query and hidden-belief metrics, wrote metrics, and saved checkpoints under ../../../large_artifacts/sampled_query_filter_executor/checkpoints/smoke_joint_mod7.
Interpretation: sampled-value targets, exact query evaluation, hidden-belief audit metrics, evaluation aggregation, and separated checkpoint writing are functional. The run is intentionally too short to test learning.
Pilot 1: Joint Sampled-Query Filter, Modulus 11
Run: ../runs/pilot_joint_mod11
Command:
python experiments/sampled_query_filter_executor/src/sampled_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 1200 --batch_size 512 --eval_batch_size 512 --eval_examples 512 --log_every 50 --eval_every 600 --lr 0.03 --output_dir experiments/sampled_query_filter_executor/runs/pilot_joint_mod11 --checkpoint_dir large_artifacts/sampled_query_filter_executor/checkpoints/pilot_joint_mod11Status: complete.
Interim result at step 600:
L=3: atK=3, all query types reached 100% top-1-on-support, 98.8-99.2% query target mass, and 97.6-97.8% hidden belief target mass.L=6: atK=6, all query types reached 100% top-1-on-support, 97.4-98.1% query target mass, and 96.0-96.2% hidden belief target mass.L=9: atK=9, all query types reached 100% top-1-on-support, 96.1-97.2% query target mass, and 94.9-95.0% hidden belief target mass.L=12: atK=12, all query types reached 100% top-1-on-support, 95.4-96.5% query target mass, and 94.3-94.4% hidden belief target mass.
For K<L, query target mass and hidden belief mass were much lower. This interim result shows that one sampled answer value per example is enough to induce a coherent latent belief state at small modulus.
Final result at step 1200:
L=3: atK=3, all query types reached 100% top-1-on-support, 99.6-99.7% query target mass, and 99.3% hidden belief target mass.L=6: atK=6, all query types reached 100% top-1-on-support, 99.2-99.4% query target mass, and 98.7-98.9% hidden belief target mass.L=9: atK=9, all query types reached 100% top-1-on-support, 98.8-99.1% query target mass, and 98.4-98.5% hidden belief target mass.L=12: atK=12, all query types reached 100% top-1-on-support, 98.6-99.0% query target mass, and 98.2-98.3% hidden belief target mass.
Interpretation: sampled-value supervision is sufficient to train the joint recurrent executor at small modulus, including held-out lengths.
Control 1: Marginal Sampled-Query Filter, Modulus 11
Run: ../runs/control_marginal_mod11
Command:
python experiments/sampled_query_filter_executor/src/sampled_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 1200 --batch_size 512 --eval_batch_size 512 --eval_examples 512 --log_every 100 --eval_every 1200 --lr 0.03 --output_dir experiments/sampled_query_filter_executor/runs/control_marginal_mod11 --checkpoint_dir large_artifacts/sampled_query_filter_executor/checkpoints/control_marginal_mod11Status: complete.
Result at step 1200:
L=3: at sufficientK, query target mass reached 43.6-66.2%; hidden belief mass was 10.3-11.5%.L=6: at sufficientK, query target mass reached 35.3-52.0%; hidden belief mass was 11.2-11.9%.L=9: at sufficientK, query target mass reached 28.1-44.2%; hidden belief mass was 10.2-11.1%.L=12: at sufficientK, query target mass reached 23.0-37.6%; hidden belief mass was 9.3-10.5%.
Interpretation: the marginal model learns some sampled-answer signal but does not recover a coherent joint belief state.
Control 2: Static Sampled-Query Compiler, Modulus 11
Run: ../runs/control_static_mod11
Command:
python experiments/sampled_query_filter_executor/src/sampled_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 1200 --batch_size 512 --eval_batch_size 512 --eval_examples 512 --log_every 100 --eval_every 1200 --lr 0.001 --dim 128 --heads 4 --compiler_layers 2 --output_dir experiments/sampled_query_filter_executor/runs/control_static_mod11 --checkpoint_dir large_artifacts/sampled_query_filter_executor/checkpoints/control_static_mod11Status: complete.
Result at step 1200:
L=3: query target mass reached 48.0-66.6%; hidden belief mass was 15.1-17.2%.L=6: query target mass reached 32.7-45.3%; hidden belief mass was 8.2-9.4%.L=9: query target mass reached 21.2-28.1%; hidden belief mass was 3.1-3.8%.L=12: query target mass reached 16.4-18.1%; hidden belief mass was 2.0-2.4%.
Interpretation: the static compiler learns short-length signal but does not length-generalize and does not recover a coherent hidden belief state.
Main Run: Joint Sampled-Query Filter, Modulus 31
Run: ../runs/main_joint_mod31
Command:
python experiments/sampled_query_filter_executor/src/sampled_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 1500 --batch_size 512 --eval_batch_size 512 --eval_examples 512 --log_every 50 --eval_every 750 --lr 0.03 --output_dir experiments/sampled_query_filter_executor/runs/main_joint_mod31 --checkpoint_dir large_artifacts/sampled_query_filter_executor/checkpoints/main_joint_mod31Status: complete.
Interim result at step 750:
L=4: atK=4, all query types reached 100% top-1-on-support, 95.0-97.2% query target mass, and 91.2-91.3% hidden belief target mass.L=8: atK=8, all query types reached 100% top-1-on-support, 89.7-92.6% query target mass, and 84.6-85.4% hidden belief target mass.L=12: atK=12, all query types reached 100% top-1-on-support, 85.1-89.2% query target mass, and 80.9-81.4% hidden belief target mass.L=16: atK=16, all query types reached 100% top-1-on-support, 82.1-85.8% query target mass, and 78.3-79.0% hidden belief target mass.L=24: atK=24, all query types reached 100% top-1-on-support, 78.9-83.8% query target mass, and 75.5-76.9% hidden belief target mass.
Final result at step 1500:
L=4: atK=4, all query types reached 100% top-1-on-support, 98.8-99.3% query target mass, and 97.8-97.9% hidden belief target mass.L=8: atK=8, all query types reached 100% top-1-on-support, 97.3-98.2% query target mass, and 96.1-96.3% hidden belief target mass.L=12: atK=12, all query types reached 100% top-1-on-support, 96.2-97.1% query target mass, and 95.0-95.1% hidden belief target mass.L=16: atK=16, all query types reached 100% top-1-on-support, 95.2-96.4% query target mass, and 94.2-94.5% hidden belief target mass.L=24: atK=24, all query types reached 100% top-1-on-support, 94.7-95.6% query target mass, and 93.6-93.8% hidden belief target mass.
For K<L, the same examples remained close to baseline. At L=24, the best pre-threshold query target mass stayed below 10% for all four query types, while K=24 recovered the exact sampled-query answer support and most of the full hidden belief mass.
Scaled Control: Marginal Sampled-Query Filter, Modulus 31
Run: ../runs/control_marginal_mod31
Command:
python experiments/sampled_query_filter_executor/src/sampled_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 1500 --batch_size 512 --eval_batch_size 512 --eval_examples 512 --log_every 100 --eval_every 1500 --lr 0.03 --output_dir experiments/sampled_query_filter_executor/runs/control_marginal_mod31 --checkpoint_dir large_artifacts/sampled_query_filter_executor/checkpoints/control_marginal_mod31Status: complete.
Result at step 1500:
L=4: at sufficientK, query target mass reached 36.2-56.2%; hidden belief mass was 3.8-4.3%.L=8: at sufficientK, query target mass reached 23.9-36.8%; hidden belief mass was 3.3-3.5%.L=12: at sufficientK, query target mass reached 16.4-29.0%; hidden belief mass was 2.8-3.0%.L=16: at sufficientK, query target mass reached 11.7-21.5%; hidden belief mass was 2.2-2.6%.L=24: at sufficientK, query target mass reached 8.5-15.0%; hidden belief mass was 1.6%.
Interpretation: the marginal recurrent control learns some sampled-query signal but does not recover the joint hidden state and does not approach the joint recurrent model on held-out lengths.
Scaled Control: Static Sampled-Query Compiler, Modulus 31
Run: ../runs/control_static_mod31
Command:
python experiments/sampled_query_filter_executor/src/sampled_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 1500 --batch_size 512 --eval_batch_size 512 --eval_examples 512 --log_every 100 --eval_every 1500 --lr 0.001 --dim 128 --heads 4 --compiler_layers 2 --output_dir experiments/sampled_query_filter_executor/runs/control_static_mod31 --checkpoint_dir large_artifacts/sampled_query_filter_executor/checkpoints/control_static_mod31Status: complete.
Result at step 1500:
L=4: query target mass reached 36.7-54.0%; hidden belief mass was 4.8-5.9%.L=8: query target mass reached 20.8-29.7%; hidden belief mass was 2.1-2.3%.L=12: query target mass reached 11.5-15.0%; hidden belief mass was 0.6-0.7%.L=16: query target mass reached 7.6-9.2%; hidden belief mass was 0.3-0.4%.L=24: query target mass reached 5.0-5.4%; hidden belief mass was 0.2%.
Interpretation: the static compiler learns some short-length sampled-query signal but does not length-generalize and does not recover the hidden joint belief state.
Figures 7







Data files 23
Result tables and metrics copied from the experiment folder — preview inline or open the raw file.
analysis/all_metrics_long.csv165 kBanalysis/final_metrics_long.csv113 kBanalysis/final_metrics_query_mean.csv27 kBanalysis/mod31_control_summary.csv2.4 kBanalysis/mod31_per_query_threshold_summary.csv1.6 kBanalysis/mod31_threshold_summary.csv823 Bruns/control_marginal_mod11/metrics_step01200.csv16 kBruns/control_marginal_mod11/results.json69 kBruns/control_marginal_mod31/metrics_step01500.csv24 kBruns/control_marginal_mod31/results.json97 kBruns/control_static_mod11/metrics_step01200.csv2.5 kBruns/control_static_mod11/results.json16 kBruns/control_static_mod31/metrics_step01500.csv3.1 kBruns/control_static_mod31/results.json20 kBruns/main_joint_mod31/metrics_step00750.csv22 kBruns/main_joint_mod31/metrics_step01500.csv22 kBruns/main_joint_mod31/results.json189 kBruns/pilot_joint_mod11/metrics_step00600.csv15 kBruns/pilot_joint_mod11/metrics_step01200.csv15 kBruns/pilot_joint_mod11/results.json134 kBruns/smoke_joint_mod7/metrics_step00001.csv4.1 kBruns/smoke_joint_mod7/metrics_step00002.csv4.1 kBruns/smoke_joint_mod7/results.json36 kB
Reproduce
The run commands are documented inside the experiment folder (see the README).