Research monorepo for the "Activation-as-View: LeWM x Qwen3" roadmap.
The current experimental teacher is Qwen/Qwen3-32B. The strongest Phase 0 representation so far is token_similarity_v1, which encodes token-token relational fields from selected transformer layers as image-like observations.
Current status: Phase 0 and the first real LeWM training pass are positive on Qwen/Qwen3-32B with token_similarity_v1. The result is not yet a SWE-bench or GLM generalization claim; it is a strong falsification pass showing that the activation-view dataset is learnable by the vendored LeWM pipeline and produces a large VoE signal.
Published Hugging Face artifacts:
Artvv/qwen3-32b-token-similarity-activation-tripletsArtvv/lewm-qwen3-32b-token-similarityMain run:
Qwen/Qwen3-32Btoken_similarity_v1[10, 20, 30]50K triplets, observations [3, 64, 64], actions [256]artifacts/lewm_qwen3_token_similarity/latest.pt, mirrored on Hugging Face as checkpoints/latest.ptPhase 0 visual/probe result:
~0.996-1.000 across successful 500-prompt runstoken_similarity_v1Real LeWM 50K result:
6.1250.999471.43x59.90xThere are two different training paths in this repo. They are intentionally named differently:
artifacts/world_model_qwen32_token_similarity/ is the early proxy world-model baseline. It is useful only as a sanity check and is not the main LeWM result.artifacts/lewm_qwen3_token_similarity/ is the real vendored LeWM training run on the 50K Qwen3-32B activation triplets.Do not treat root-level latest.pt files as canonical. The canonical trained LeWM checkpoint is artifacts/lewm_qwen3_token_similarity/latest.pt, mirrored on Hugging Face as checkpoints/latest.pt.
src/activation_views/: core contracts, encoding, validation, HDF5 IOjobs/: launchers for Modal, RunPod, Hugging Face Endpointconfigs/: versioned configs for models, datasets, runs, train, evalthird_party/le-wm/: vendored LeWM fork plus Qwen activation adaptersevals/: standalone evaluation entrypointspaper/: figures, tables, notes, compiled reportsLarge generated datasets, checkpoints, and experiment artifacts are intentionally excluded from git. Keep them under artifacts/ or external storage.
This repo uses local-first experiment logging:
TensorBoard event files for training curves and scalar metricsartifacts/*.json for run summaries, ablations, kill/go decisions, and eval outputspaper/figures/*.png and paper/results_manifest.json for paper-facing exportspython -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest
python -m activation_views.cli phase0 --config configs/runs/phase0_debug.yaml
python -m activation_views.cli phase0-live --config configs/runs/phase0_modal_qwen32.yaml
python -m activation_views.cli validate-hdf5 --path artifacts/qwen3_reasoning_triplets.h5
PYTHONPATH=src python scripts/validate_dataset.py artifacts/qwen3_32b_train_token_similarity.h5
PYTHONPATH=src python scripts/dynamics_baselines.py artifacts/qwen3_32b_train_token_similarity.h5
PYTHONPATH=src python scripts/train_world_model.py --config configs/train/world_model_qwen32_token_similarity.yaml
python third_party/le-wm/train_qwen3_reasoning.py --config third_party/le-wm/config/train/qwen3_reasoning.yaml
python third_party/le-wm/eval_qwen3_voe.py --config third_party/le-wm/config/train/qwen3_reasoning.yaml --checkpoint artifacts/lewm_qwen3_token_similarity/latest.pt --output artifacts/lewm_qwen3_token_similarity/voe.json
python evals/generate_swebench_candidates.py --dataset-name princeton-nlp/SWE-bench_Verified --split test --model Qwen/Qwen3-32B --num-candidates 8 --output artifacts/swebench/qwen_candidates_n8.jsonl
python evals/generate_swebench_candidates_vllm.py --dataset-name princeton-nlp/SWE-bench_Verified --split test --model Qwen/Qwen3-32B --num-candidates 8 --request-batch-size 64 --output artifacts/swebench/qwen_candidates_n8.jsonl
python evals/together_batch_swebench.py preflight --model Qwen/Qwen3-32B
python evals/together_batch_swebench.py prepare --model Qwen/Qwen3-32B --existing-candidates artifacts/swebench/qwen_candidates_n8.jsonl --batch-input artifacts/swebench/together_batch_input.jsonl --manifest artifacts/swebench/together_batch_manifest.jsonl
python evals/together_batch_swebench.py submit --batch-input artifacts/swebench/together_batch_input.jsonl --state-output artifacts/swebench/together_batch_state.json
python evals/together_batch_swebench.py wait --batch-id <batch-id> --poll-seconds 60 --state-output artifacts/swebench/together_batch_state.json
python evals/together_batch_swebench.py download --batch-id <batch-id> --output artifacts/swebench/together_batch_output.jsonl --error-output artifacts/swebench/together_batch_errors.jsonl
python evals/together_batch_swebench.py convert --batch-output artifacts/swebench/together_batch_output.jsonl --manifest artifacts/swebench/together_batch_manifest.jsonl --output artifacts/swebench/qwen_candidates_n8.jsonl
python evals/swebench_rerank.py --candidates artifacts/swebench/qwen_candidates_n8.jsonl --checkpoint artifacts/lewm_qwen3_token_similarity/latest.pt --config third_party/le-wm/config/train/qwen3_reasoning.yaml --output artifacts/evals/swebench_reranked_predictions.jsonl
python -m swebench.harness.run_evaluation --dataset_name princeton-nlp/SWE-bench_Verified --split test --predictions_path artifacts/evals/swebench_reranked_predictions.jsonl --max_workers 8 --run_id code_jepa_lewm_qwen32_rerank
python evals/cross_arch_glm.py --model zai-org/GLM-5.1-FP8 --checkpoint artifacts/lewm_qwen3_token_similarity/latest.pt --config third_party/le-wm/config/train/qwen3_reasoning.yaml --layers 16,39,58 --n-per-category 100 --output artifacts/evals/cross_arch_glm_5_1_fp8.json --embeddings-output artifacts/evals/cross_arch_glm_5_1_fp8_embeddings.npz
python evals/compile_results.py --runs-dir artifacts --output paper/results_manifest.json
# then inspect local training logs with:
# tensorboard --logdir artifacts/tensorboard
For Modal Phase 0 runs:
modal run jobs/modal/extract_phase0.py
Research monorepo for the "Activation-as-View: LeWM x Qwen3" roadmap.
The current experimental teacher is Qwen/Qwen3-32B. The strongest Phase 0 representation so far is token_similarity_v1, which encodes token-token relational fields from selected transformer layers as image-like observations.
Current status: Phase 0 and the first real LeWM training pass are positive on Qwen/Qwen3-32B with token_similarity_v1. The result is not yet a SWE-bench or GLM generalization claim; it is a strong falsification pass showing that the activation-view dataset is learnable by the vendored LeWM pipeline and produces a large VoE signal.
Published Hugging Face artifacts:
Artvv/qwen3-32b-token-similarity-activation-tripletsArtvv/lewm-qwen3-32b-token-similarityMain run:
Qwen/Qwen3-32Btoken_similarity_v1[10, 20, 30]50K triplets, observations [3, 64, 64], actions [256]artifacts/lewm_qwen3_token_similarity/latest.pt, mirrored on Hugging Face as checkpoints/latest.ptPhase 0 visual/probe result:
~0.996-1.000 across successful 500-prompt runstoken_similarity_v1Real LeWM 50K result:
6.1250.999471.43x59.90xThere are two different training paths in this repo. They are intentionally named differently:
artifacts/world_model_qwen32_token_similarity/ is the early proxy world-model baseline. It is useful only as a sanity check and is not the main LeWM result.artifacts/lewm_qwen3_token_similarity/ is the real vendored LeWM training run on the 50K Qwen3-32B activation triplets.Do not treat root-level latest.pt files as canonical. The canonical trained LeWM checkpoint is artifacts/lewm_qwen3_token_similarity/latest.pt, mirrored on Hugging Face as checkpoints/latest.pt.
src/activation_views/: core contracts, encoding, validation, HDF5 IOjobs/: launchers for Modal, RunPod, Hugging Face Endpointconfigs/: versioned configs for models, datasets, runs, train, evalthird_party/le-wm/: vendored LeWM fork plus Qwen activation adaptersevals/: standalone evaluation entrypointspaper/: figures, tables, notes, compiled reportsLarge generated datasets, checkpoints, and experiment artifacts are intentionally excluded from git. Keep them under artifacts/ or external storage.
This repo uses local-first experiment logging:
TensorBoard event files for training curves and scalar metricsartifacts/*.json for run summaries, ablations, kill/go decisions, and eval outputspaper/figures/*.png and paper/results_manifest.json for paper-facing exportspython -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest
python -m activation_views.cli phase0 --config configs/runs/phase0_debug.yaml
python -m activation_views.cli phase0-live --config configs/runs/phase0_modal_qwen32.yaml
python -m activation_views.cli validate-hdf5 --path artifacts/qwen3_reasoning_triplets.h5
PYTHONPATH=src python scripts/validate_dataset.py artifacts/qwen3_32b_train_token_similarity.h5
PYTHONPATH=src python scripts/dynamics_baselines.py artifacts/qwen3_32b_train_token_similarity.h5
PYTHONPATH=src python scripts/train_world_model.py --config configs/train/world_model_qwen32_token_similarity.yaml
python third_party/le-wm/train_qwen3_reasoning.py --config third_party/le-wm/config/train/qwen3_reasoning.yaml
python third_party/le-wm/eval_qwen3_voe.py --config third_party/le-wm/config/train/qwen3_reasoning.yaml --checkpoint artifacts/lewm_qwen3_token_similarity/latest.pt --output artifacts/lewm_qwen3_token_similarity/voe.json
python evals/generate_swebench_candidates.py --dataset-name princeton-nlp/SWE-bench_Verified --split test --model Qwen/Qwen3-32B --num-candidates 8 --output artifacts/swebench/qwen_candidates_n8.jsonl
python evals/generate_swebench_candidates_vllm.py --dataset-name princeton-nlp/SWE-bench_Verified --split test --model Qwen/Qwen3-32B --num-candidates 8 --request-batch-size 64 --output artifacts/swebench/qwen_candidates_n8.jsonl
python evals/together_batch_swebench.py preflight --model Qwen/Qwen3-32B
python evals/together_batch_swebench.py prepare --model Qwen/Qwen3-32B --existing-candidates artifacts/swebench/qwen_candidates_n8.jsonl --batch-input artifacts/swebench/together_batch_input.jsonl --manifest artifacts/swebench/together_batch_manifest.jsonl
python evals/together_batch_swebench.py submit --batch-input artifacts/swebench/together_batch_input.jsonl --state-output artifacts/swebench/together_batch_state.json
python evals/together_batch_swebench.py wait --batch-id <batch-id> --poll-seconds 60 --state-output artifacts/swebench/together_batch_state.json
python evals/together_batch_swebench.py download --batch-id <batch-id> --output artifacts/swebench/together_batch_output.jsonl --error-output artifacts/swebench/together_batch_errors.jsonl
python evals/together_batch_swebench.py convert --batch-output artifacts/swebench/together_batch_output.jsonl --manifest artifacts/swebench/together_batch_manifest.jsonl --output artifacts/swebench/qwen_candidates_n8.jsonl
python evals/swebench_rerank.py --candidates artifacts/swebench/qwen_candidates_n8.jsonl --checkpoint artifacts/lewm_qwen3_token_similarity/latest.pt --config third_party/le-wm/config/train/qwen3_reasoning.yaml --output artifacts/evals/swebench_reranked_predictions.jsonl
python -m swebench.harness.run_evaluation --dataset_name princeton-nlp/SWE-bench_Verified --split test --predictions_path artifacts/evals/swebench_reranked_predictions.jsonl --max_workers 8 --run_id code_jepa_lewm_qwen32_rerank
python evals/cross_arch_glm.py --model zai-org/GLM-5.1-FP8 --checkpoint artifacts/lewm_qwen3_token_similarity/latest.pt --config third_party/le-wm/config/train/qwen3_reasoning.yaml --layers 16,39,58 --n-per-category 100 --output artifacts/evals/cross_arch_glm_5_1_fp8.json --embeddings-output artifacts/evals/cross_arch_glm_5_1_fp8_embeddings.npz
python evals/compile_results.py --runs-dir artifacts --output paper/results_manifest.json
# then inspect local training logs with:
# tensorboard --logdir artifacts/tensorboard
For Modal Phase 0 runs:
modal run jobs/modal/extract_phase0.py