Repository navigation
Release 0.3.5: budget cluster objective, dispatch mass, gate-only cluster gradient - #64
Merged
Merged
Conversation
…ster gradient The 0.3.4 cluster-locality term (attached mutual-information objective on the soft router mass) confined each stream to one cluster and trained the trunk toward document identity; on the 15M shape it cost +0.290 CE at step 600 with 3.89 distinct experts per token against 7.45 at lambda 0. - cluster_locality_objective: "budget" (default) or "mutual_info" - cluster_locality_budget: clusters per stream, 0 = half, rounded up - cluster_locality_mass: "dispatch" (default) or "soft" - cluster_input_detach: gate-only cluster gradient (default on), Torch and MLX, read inside the compiled and recomputed MLX step - pre-0.3.5 checkpoints load with the old objective - config schema, training CLIs, WebUI fields and 4-language help - docs/CLUSTER_LOCALITY.md section 9; doc line anchors remapped - reports/cluster_budget_20261127/summary.json: measured numbers - tests/test_cluster_budget.py: 15 tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The 0.3.4 cluster-locality term cost language-model loss. On the 15M shape it was +0.290 CE above λ=0 at step 600, and tokens used 3.89 distinct experts against 7.45. The mutual-information optimum confines each stream to one cluster, and the attached gradient also trained attention, embeddings and experts. This PR ports the fix measured in the cluster experiments and makes it the default.
Changes
cluster_locality_objective="budget"(default) or"mutual_info": a balance term plus the mass outside each stream's B heaviest clusters, with the ranking held fixed.cluster_locality_budget: B; 0 = half the clusters, rounded up.cluster_locality_mass="dispatch"(default) or"soft".cluster_input_detach=True(default): the cluster term reads the gate on a gradient-free input (Torchiteration_cluster_probs_grad, MLXiteration_cluster_probs), so it trains the gate weights only.config_dict_for_checkpointkeeps falsy trained values when a project config is present.docs/CLUSTER_LOCALITY.mdgains section 9 (root cause, definition, measurements). Line anchors in 8 docs are remapped to the edited files.reports/cluster_budget_20261127/summary.jsonholds every number cited.Results (MLX, one Apple M5, 3 seeds, cosine over 2,000 steps)
Tests
tests/test_cluster_budget.py: 15 tests covering defaults, the budget rule, schema, checkpoint backfill, budget = balance + spill, the free split inside resident clusters, Torch/MLX parity in window and segment mode, gate-only gradients on both backends, and compiled/recomputed MLX steps against eager.CHRONOS_BACKEND=cpu): 463 passed, 91 skipped, 2 failed.test_dt_clipMLX clip-boundary gradient,test_long_contextrope_scaling round-trip under the local transformers version, andtest_ui_event_contract.🤖 Generated with Claude Code