Repository navigation
Conversation
…out codec overhead
…lesced gradient indices
…ntribution claims
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.
Summary
N-gram rows with identical complete bag-incidence/multiplicity signatures receive identical updates under the demonstrated sparse-SGD rules, although independent initialization can leave final vectors dissimilar. This adds an opt-in compact parameterization with a group-size gradient correction, certified native export/query plans, and rejection witnesses for unsupported bags. It preserves demonstrated updates and certified aggregates in real arithmetic; individual source vectors can change. The ordinary original-ID/byte-preserving packer remains a separate contract.
The public API works through
ngram_storeand historicalmeft_memory. Native export adds optional raw blocks, sequential reordered-ID writes, and release of dense initialization after grouped construction. Batched integer certification now speeds native-plan construction while producing identical plan arrays.The final evaluation compares actual trained rows against FAISS scalar quantization, PQ, OPQ, residual quantization, full-vector clustering and encoded-byte dedup. Within a declared quality budget, certified groups add complete-model capacity savings beyond the smallest qualifying direct codec. Full-domain fallback, precomputed known-word inference and unfavorable timing/quality results remain visible.
Evidence and limits
Independently gated Engram heads, arbitrary LLM memory fields, large grouped retraining, construction under a fixed RAM budget and independent corpora remain outside the demonstrated result. The current large Python builder peaks near 5.4 GiB RSS.
Evidence artifacts
Verification
e6d2870:python -m unittest discover -s tests— 165 tests, 17 skipped, successful, including FAISS CPU and PyTorch cases. Full log is published.git diff --checkpass.f9994ca: both PR and push workflows completed successfully, covering CPU PyTorch/FAISS, native/FastText sanitizers, legacy compatibility, Engram/TinyEngram integration and wheels.Benchmark context
Cached TinyShakespeare finite SGNS models and the separately scoped enwik8 updated-row export; no random performance vectors or corpus downloads. AMD EPYC 7742 shared CPU, Linux x86-64, Python 3.11.15, PyTorch 2.11.0+cu130, NumPy 2.2.6, FAISS CPU 1.15.0. Query threads one; base fits one, extended fits four. Warm OS pages and overlapping phases limit speed interpretation.
CUDA_VISIBLE_DEVICES=''; no GPU process inspected or stopped. Phase commits, exact commands, source hashes, failed/superseded attempts and full-cost controls are retained. No private text, vocabulary, weights, credentials or internal hostnames are included.Type of change