Skip to content

Remove legacy FSQ emission path - #21

Merged
trashhalo merged 4 commits into
mainfrom
codex/remove-fsq-reopened
Jul 30, 2026
Merged

trashhalo merged 4 commits into
mainfrom
codex/remove-fsq-reopened

Conversation

@trashhalo

Copy link
Copy Markdown
Contributor

Summary

  • remove the legacy FSQ and multi-latent emission path
  • remove obsolete FSQ dimensions, embedding slots, and chess-specific loss terms
  • keep concepts as the supported geometry-control mechanism
  • retain the lossless code-emission and open-ended single-vector strategies
  • update examples, documentation, and tests for the supported state-training model

Context

This recreates PR #20 after its merge was reverted from main so the change can go through review and CI again before anyone merges it.

Validation

No additional local checks were run while recreating the branch. GitHub CI should validate the reapplied change set.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Not ready to approve

There is a confirmed CodeSoftmaxObjective dimension mismatch risk with res_dim>0 (codebook spans state_dim, not full latent_dim) that can cause runtime failures unless constrained or handled.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

This PR removes the legacy FSQ-based multi-latent emission path and its associated configuration/loss surface, and standardizes multi-vector training around explicit emission strategies (concept/codebook named-state objectives or QueryBridge for continuous unordered sets). It updates the core model/trainer APIs, tests, documentation, and examples accordingly, including failing fast on legacy FSQ checkpoints.

Changes:

  • Remove FSQObjective and FSQ-era knobs/aux terms; require an explicit TrainingArguments.emission for multi_latent=True.
  • Replace FSQ “codebook” training/rollout plumbing with named-state code_emit + rollout_train_state, and add a legacy-checkpoint migration error.
  • Update/replace tests and docs; remove legacy FSQ-based examples/demos.
File summaries
File Description
tests/test_trainer_multi_characterization.py Removed FSQ golden characterization coverage.
tests/test_superposition.py Removed superposition regression tests tied to old harness.
tests/test_state_residual.py Updated to rollout_train_state and refreshed module docs.
tests/test_sigreg_smoke.py Switched to new multi-vector helpers harness.
tests/test_replay.py Updated imports/harness and removed obsolete FSQ-era args.
tests/test_random_init.py Updated harness; builds random-init model using code_emit codebook.
tests/test_kv_cache.py Updated KV-cache tests to named-state codebook emission.
tests/test_gradcache_multi.py Updated GradCache multi tests; now injects CodeSoftmaxObjective.
tests/test_cot_emit.py Updated harness and removed FSQ-only loss-term fields in test setup.
tests/test_code_softmax.py Updated to rollout_train_state and refreshed codebook-emission docs.
tests/test_bridge_emission_smoke.py Updated hard-neg behavior notes after HardNegTerm removal.
tests/test_aux_heads.py Updated model construction to code_emit and sets emission strategy.
tests/multi_state_helpers.py Added shared deterministic fixtures for named-state multi-vector tests.
src/langset/training_args.py Removed FSQ/label/slot args; emission now optional but required for multi-latent.
src/langset/trainer.py Enforces explicit emission strategy; removes FSQ label/slot/hard-neg term plumbing.
src/langset/strategies.py Removes FSQObjective and FSQ-only aux terms; updates emission contracts for codebook/concepts/bridge.
src/langset/sigreg.py Updates SIGReg docs to be objective-agnostic via z_for_reg.
src/langset/probes.py Updates probe docs to reference concept entropy rather than FSQ entropy.
src/langset/modeling.py Reworks EmitHead + rollout/teacher-forcing to named-state codebook emission; blocks legacy FSQ checkpoints.
src/langset/heads.py Updates docs to reflect new emitter geometry (no FSQ-specific language).
src/langset/bridge_emission.py Updates docs/contracts for hard negatives (bridge-owned) after HardNegTerm removal.
README.md Reframes project docs around explicit emission families (concept/codebook/query bridge).
examples/ner-multi-latent/train.py Removed legacy FSQ NER multi-latent demo.
examples/ner-multi-latent/train_modal.py Removed legacy FSQ modal runner.
examples/ner-multi-latent/README.md Removed legacy FSQ demo docs.
examples/ner-multi-latent/prepare.py Removed legacy FSQ demo data prep.
examples/ner-multi-latent/play_cpu.py Removed legacy FSQ demo playback script.
examples/maze-superposition/train.py Updated maze example to concept objective only; removes FSQ/state-residual flags.
examples/maze-superposition/README.md Updated maze docs to concept entropy framing and new CLI.
examples/maze-superposition/gen_maze.py Removes FSQ-subspace-specific labeling notes.
examples/maze-superposition/eval.py Updates eval docs to concept entropy framing.
examples/ecosystem-cascade/train.py Removed legacy FSQ ecosystem example.
examples/ecosystem-cascade/train_modal.py Removed legacy FSQ ecosystem modal runner.
examples/ecosystem-cascade/gen_eco.py Removed legacy FSQ ecosystem data generator.
examples/ecosystem-cascade/eco_eval.py Removed legacy FSQ ecosystem eval script.
examples/danger-corridor/train.py Removed legacy FSQ danger-corridor example.
examples/danger-corridor/train_modal.py Removed legacy FSQ danger-corridor modal runner.
examples/danger-corridor/gen_danger.py Removed legacy FSQ danger-corridor data generator.
examples/danger-corridor/danger_eval.py Removed legacy FSQ danger-corridor eval script.
Review details

Comments suppressed due to low confidence (1)

tests/test_superposition.py:1

  • Removing this test drops regression coverage for two still-supported trainer behaviors: (1) selectors flagged needs_final_epoch (e.g. last_epoch_selector) must evaluate the final epoch even when it’s off the eval_every cadence, and (2) snapshot_every should remain 1-based. Consider reintroducing equivalent tests using the new multi_state_helpers harness so these behaviors don’t regress.
  • Files reviewed: 39/39 changed files
  • Comments generated: 3
  • Review effort level: Low

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread src/langset/strategies.py
Comment thread src/langset/modeling.py
Comment thread src/langset/trainer.py Outdated
@trashhalo
trashhalo merged commit 9c3d3b7 into main Jul 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants