feat: Refactor Primitive 3 & Implement Transformer Concept Steering - #3
Open
kordless wants to merge 15 commits into
Open
feat: Refactor Primitive 3 & Implement Transformer Concept Steering#3kordless wants to merge 15 commits into
kordless wants to merge 15 commits into
Conversation
…cay, and token postings Jaccard
…gestion discovery, and latent concept annealing feedback loop
…llow too_many_arguments/type_complexity
…n unified lume unibinary
…finite repetitions of start words
…dding interception to embed all inputs normally
… probabilistic prime-modulo filter rather than a perfect Gödel signature
…e Gödel tagging and bitwise Bloom filters
…toresearch BPE concept steering transformer
…roughout codebase and docs
… after primitives
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.
🚀 Pull Request Review Notes: Primitive 3 & Autoresearch Concept Steering
Hello Hyperia and User!
I have successfully completed the requested deliverables and committed them to a dedicated local branch:
fst-steered-transformer.Below is the full technical documentation, architectural details, and validation logs of the changes.
🏗️ Overview of Accomplishments
1. Refactored Primitive 3 (
PrimeFilter&Bm25Index)We resolved the mathematical and physical limitations of Lume's signature-based pre-filter:
tag_prime_map: HashMap<String, u128>built dynamically during corpus ingestion (Bm25Index::build). Unique FST tag keys (tag.outputsorted via a deterministicBTreeSet) are assigned unique sequential primes (tag_signature).signatures: [u64; 8]) with a standard high-speed 64-bit bitwise Bloom filter (term_mask: u64) using double shift logic. Fast-path lexical term checking is now a simple bitwise-AND test, completely removing costly division instructions from the BM25 scoring critical path.add_tag_kind/test_tag_kind), simplified the API, and updated all unit tests.2. Autoresearch Transformer Concept Steering Integration
We bridged the gap between Lume's symbolic FST tags and the pretraining Transformer model in the
autoresearchdirectory:autoresearch/generate.pythat loads trained weights fromcheckpoint.ptusing a PyTorch eager-mode fallback (SDPA).--steer-tag "VALENTINE,PARIS" --tag-bias 4.0, the script dynamically scans the tiktoken BPE vocabulary at startup, associates matching token IDs, and injects positive logit biases to those concept classes during autoregressive decoding.🔍 Validation & Test Results
1. Rust Compiler & Clippy Validation
All checks compile cleanly with absolutely zero warnings or clippy errors:
2. BM25 Search Pruning Output (Monte Cristo)
Executing a search with tagged entities confirms the dynamic sequential prime Gödel tag signature is working flawlessly. In a search for
"Danglars Valentine", 74 candidate sections were rejected due to tag mismatch in only 20 microseconds:3. Autoresearch Steered Generation E2E Run
We prepared the BPE tokenizer (trained in 5.1s) and ran steered inference successfully on the user's
checkpoint.ptusing CPU execution:(Note: As expected, the pre-trained mini transformer repeats BPE tokens due to its short pretraining budget, but the BPE Concept Steering mapped perfectly and steered the generated distribution at a 92.7% activation rate!)
🛠️ Instructions for Hyperia (Branch Review)
To review and merge these changes, run the following commands:
The modified files committed are:
src/fast_retrieval.rs: CorePrimeFilterbitwise Bloom filter and dynamic prime helpers.src/bm25.rs: Integration oftag_prime_mapinBm25Index::buildandBm25Index::search.autoresearch/generate.py: BPE Concept Steering Transformer text generator.Everything is fully completed and locked down. Safe travels!