Skip to content

Extend: MDL clustering stop, CKY chart parser, subword RePair exposure, more evals#2

Merged
Lulzx merged 1 commit into
mainfrom
extend-mdl-cky-evals-subword
Jun 4, 2026
Merged

Extend: MDL clustering stop, CKY chart parser, subword RePair exposure, more evals#2
Lulzx merged 1 commit into
mainfrom
extend-mdl-cky-evals-subword

Conversation

@Lulzx
Copy link
Copy Markdown
Owner

@Lulzx Lulzx commented Jun 4, 2026

Implements key items from the approved plan (post 'do all' + full ~4.16M scale run + cleanup PR #1).

  • MDL in induce_classes (mdl=True): merges only when proxy DL decreases. Addresses 'clustering threshold' limitation.
  • CKY in ConstructionGrammar (use_chart=True + parse_bits): min-cost MDL parses over class bigrams for grammaticality (better or equal to flat; fallback). Addresses 'class bigrams' + 'add a CKY parser' scaling goal.
  • RePair subword: seq now captured/reported; light support ready for NTs as atomic in classes/grammar.
  • More evals: generalized minimal_pairs(sents=...), grammar_ppl helper; ts now reports CG+chart acc + heldout grammar ppl.
  • Docs/README updated with usage + current status of limitations.
  • All defaults unchanged; pure stdlib; tests/CI/toy/ts pass; some evals improve (e.g. chart/CG now 5/5 where LM 4/5 on small data).

See plan.md (in session) and code comments for design/anchors/tradeoffs. Larger scale already run/validated separately (4.16M tokens).

Ready for review / further (variable slots, BabyLM, etc.).

…re, more evals + docs

Per approved plan (after 'do all', full ~4.16M scale run, and cleanup PR#1):

- MDL stopping in induce_classes(..., mdl=True, mdl_cost_weight=...): cheap online delta (class cost + fit via cosine proxy); merges only when shortens approx DL. Default=False preserves old. Wired in tinystories.
- ConstructionGrammar(..., use_chart=True) + .parse_bits: simple pure-stdlib CKY over class-bigram rules for min-cost MDL parse (fallback to flat bigram). bits() uses it when flag set. Toy + ts scoring updated (chart often gives equal/better margins).
- Subword: repair now captures 'repaired' seq (NTs); exposed in tinystories with note. Light tuple handling ready (hashable keys work in Counters/vecs/labels).
- More evals: minimal_pairs generalized (sents= for mining real text); grammar_ppl helper; ts [5] now reports LM/CG/chart accuracies + heldout grammar ppl; auto_pairs demo.
- Docs: README scaling/limitations updated with new flags + usage. ts banner dynamic + ext note. Comments.
- Tests: CI smoke + full toy + ts subsets pass (with/without flags); extensions improve some margins (e.g. chart/CG fix the dog-run case on small data).
- No breakage to defaults or stdlib/pure py contract. Larger scale already validated separately.

See plan.md for details/anchors/tradeoffs. Continues the 'learning == compression' baseline toward the README next rungs (CKY, MDL, subword).
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 4, 2026

Warning

Review limit reached

@Lulzx, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 47 minutes and 59 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 20b60a71-ad6d-418f-8c7e-8f8fef54ffe9

📥 Commits

Reviewing files that changed from the base of the PR and between 95656ff and aa17074.

📒 Files selected for processing (3)
  • README.md
  • solon.py
  • solon_tinystories.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch extend-mdl-cky-evals-subword

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Lulzx Lulzx merged commit 4152b77 into main Jun 4, 2026
6 checks passed
@Lulzx Lulzx deleted the extend-mdl-cky-evals-subword branch June 4, 2026 19:44
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa1707480f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread solon.py
for name, scorer in [("statistical back-off LM ", lm_score),
("construction grammar ", cg.bits)]:
("construction grammar ", cg.bits),
("construction grammar+chart", (lambda s: cg.parse_bits(s)) if cg.use_chart else cg.bits)]:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use the chart scorer for the chart row

In the self-contained solon.py demo, this row never exercises parse_bits: cg was constructed with the default use_chart=False, so the conditional selects cg.bits and the reported construction grammar+chart accuracy is just a duplicate of the flat construction-grammar scorer. This makes the chart evaluation in the demo misleading; construct/use a ConstructionGrammar(..., use_chart=True) instance for this row.

Useful? React with 👍 / 👎.

Comment thread solon_tinystories.py
score_cg = cg.bits
score_chart = cg_chart.bits # will use parse_bits internally
# demo generalized minimal_pairs on real heldout sents (more evals)
auto_pairs = minimal_pairs(random.Random(99), n=8, sents=test_sents[:300])
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Actually score the mined held-out pairs

auto_pairs is generated from held-out TinyStories sentences but then discarded, so the advertised generalized minimal-pair evaluation never runs; this section still reports accuracy only on the five hand-built examples. For experiment runs that rely on the new “more evals” output, the reported accuracy omits the held-out corruption test entirely.

Useful? React with 👍 / 👎.

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.

1 participant